Using the Java serial library RXTX (
http://rxtx.qbang.org/) I have managed to send a message from my Eclipse IDE on my Mac to the HP50g and received a message back.
I do not have a terminal program on the HP50g yet so I just talked to the built in XModem server.
Here is a log:
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7
log: |found the following ports:|
log: | /dev/ttyUSB0|
the following serial ports have been detected:
1: /dev/ttyUSB0
enter the id (1,2,...) of the connection to connect to:
1
log: |connection on /dev/ttyUSB0 established|
do you want this tool to send back all the received messages?
'y' for yes or 'n' for no:
n
type 'q' to end the example
enter a string to be sent ('q' to exit):
help
sent 104 over the serial port as [I@6ca1c
sent 101 over the serial port as [I@1bf216a
sent 108 over the serial port as [I@12ac982
sent 112 over the serial port as [I@1389e4
received the following message: 1, , , X, , &,
received the following message: 32, ý, , , M, B, , *, ¡, , , ;, Z, , d, t, e, r, m, �, -, �, , p, y,
received the following message: 5, I, O, P, A, R, t, *, 8
received the following message: 128, 8, Ó, , P, Y, T, H, A, G, , *,
received the following message: 79, , , B, 3, ),
received the following message: 240, ¢, }, , C, 3, ),
received the following message: 240, c, Ë, , E, Q, ¸, *, 2
received the following message: 190, W
received the following message: 4, T, P, A, R, t, *, @
received the following message: 163, ð, , Z, P, A, R, t, *, ö
received the following message: 16, Ý, ¸, , Y, 1, �, -, u
received the following message: 64, ~, -, , P, P, A, R, t, *,
received the following message: 112, Ü, , , P, T, p, a, r, , +, N
received the following message: 32, ù, Ï, , C, A, S, D, I, R, , *, , , `, D, , , P, R, I, M, I, T, ¸, *, Ë
received the following message: 241, e, , C, A, S, I, N, F, O, , +, ¶,
received the following message: 7, Ä, , M, O, D, U, L, O, , &,
received the following message: 48, ç, ,
, R, E, A, L, A, S, S, U, M, E, t, *, 7
received the following message: 176, , ±, , P, E, R, I, O, D, ¸, *,
received the following message: 48, S, &, , V, X, H, .,
received the following message: 158, >, , E, P, S, 3, ),
received the following message: 240, Ò, Ì
enter a string to be sent ('q' to exit):
received the following message: 238, , , , X, , &,
received the following message: 32, ý, , , M, B, , *, ¡, , , ;, Z, , d, t, e, r, m, �, -, �, , p, y,
received the following message: 5, I, O, P, A, R, t, *, 8
received the following message: 128, 8, Ó, , P, Y, T, H, A, G, , *,
received the following message: 79, , , B, 3, ),
received the following message: 240, ¢, }, , C, 3, ),
received the following message: 240, c, Ë, , E, Q, ¸, *, 2
received the following message: 190, W
received the following message: 4, T, P, A, R, t, *, @
received the following message: 163, ð, , Z, P, A, R, t, *, ö
received the following message: 16, Ý, ¸, , Y, 1, �, -, u
received the following message: 64, ~, -, , P, P, A, R, t, *,
received the following message: 112, Ü, , , P, T, p, a, r, , +, N
received the following message: 32, ù, Ï, , C, A, S, D, I, R, , *, , , `, D, , , P, R, I, M, I, T, ¸, *, Ë
received the following message: 241, e, , C, A, S, I, N, F, O, , +, ¶,
received the following message: 7, Ä, , M, O, D, U, L, O, , &,
received the following message: 48, ç, ,
, R, E, A, L, A, S, S, U, M, E, t, *, 7
received the following message: 176, , ±, , P, E, R, I, O, D, ¸, *,
received the following message: 48, S, &, , V, X, H, .,
received the following message: 158, >, , E, P, S, 3, ),
received the following message: 240, Ò, Ì
received the following message: 238, , , , X, , &,
received the following message: 32, ý, , , M, B, , *, ¡, , , ;, Z, , d, t, e, r, m, �, -, �, , p, y,
received the following message: 5, I, O, P, A, R, t, *, 8
received the following message: 128, 8, Ó, , P, Y, T, H, A, G, , *,
received the following message: 79, , , B, 3, ),
received the following message: 240, ¢, }, , C, 3, ),
received the following message: 240, c, Ë, , E, Q, ¸, *, 2
received the following message: 190, W
received the following message: 4, T, P, A, R, t, *, @
received the following message: 163, ð, , Z, P, A, R, t, *, ö
received the following message: 16, Ý, ¸, , Y, 1, �, -, u
received the following message: 64, ~, -, , P, P, A, R, t, *,
received the following message: 112, Ü, , , P, T, p, a, r, , +, N
received the following message: 32, ù, Ï, , C, A, S, D, I, R, , *, , , `, D, , , P, R, I, M, I, T, ¸, *, Ë
received the following message: 241, e, , C, A, S, I, N, F, O, , +, ¶,
received the following message: 7, Ä, , M, O, D, U, L, O, , &,
received the following message: 48, ç, ,
, R, E, A, L, A, S, S, U, M, E, t, *, 7
received the following message: 176, , ±, , P, E, R, I, O, D, ¸, *,
received the following message: 48, S, &, , V, X, H, .,
received the following message: 158, >, , E, P, S, 3, ),
received the following message: 240, Ò, Ì
received the following message: 238, , , , X, , &,
received the following message: 32, ý, , , M, B, , *, ¡, , , ;, Z, , d, t, e, r, m, �, -, �, , p, y,
received the following message: 5, I, O, P, A, R, t, *, 8
received the following message: 128, 8, Ó, , P, Y, T, H, A, G, , *,
received the following message: 79, , , B, 3, ),
received the following message: 240, ¢, }, , C, 3, ),
received the following message: 240, c, Ë, , E, Q, ¸, *, 2
received the following message: 190, W
received the following message: 4, T, P, A, R, t, *, @
received the following message: 163, ð, , Z, P, A, R, t, *, ö
received the following message: 16, Ý, ¸, , Y, 1, �, -, u
received the following message: 64, ~, -, , P, P, A, R, t, *,
received the following message: 112, Ü, , , P, T, p, a, r, , +, N
received the following message: 32, ù, Ï, , C, A, S, D, I, R, , *, , , `, D, , , P, R, I, M, I, T, ¸, *, Ë
received the following message: 241, e, , C, A, S, I, N, F, O, , +, ¶,
received the following message: 7, Ä, , M, O, D, U, L, O, , &,
received the following message: 48, ç, ,
, R, E, A, L, A, S, S, U, M, E, t, *, 7
received the following message: 176, , ±, , P, E, R, I, O, D, ¸, *,
received the following message: 48, S, &, , V, X, H, .,
received the following message: 158, >, , E, P, S, 3, ),
received the following message: 240, Ò, Ì
received the following message: 238, , , , X, , &,
received the following message: 32, ý, , , M, B, , *, ¡, , , ;, Z, , d, t, e, r, m, �, -, �, , p, y,
received the following message: 5, I, O, P, A, R, t, *, 8
received the following message: 128, 8, Ó, , P, Y, T, H, A, G, , *,
received the following message: 79, , , B, 3, ),
received the following message: 240, ¢, }, , C, 3, ),
received the following message: 240, c, Ë, , E, Q, ¸, *, 2
received the following message: 190, W
received the following message: 4, T, P, A, R, t, *, @
received the following message: 163, ð, , Z, P, A, R, t, *, ö
received the following message: 16, Ý, ¸, , Y, 1, �, -, u
received the following message: 64, ~, -, , P, P, A, R, t, *,
received the following message: 112, Ü, , , P, T, p, a, r, , +, N
received the following message: 32, ù, Ï, , C, A, S, D, I, R, , *, , , `, D, , , P, R, I, M, I, T, ¸, *, Ë
received the following message: 241, e, , C, A, S, I, N, F, O, , +, ¶,
received the following message: 7, Ä, , M, O, D, U, L, O, , &,
received the following message: 48, ç, ,
, R, E, A, L, A, S, S, U, M, E, t, *, 7
received the following message: 176, , ±, , P, E, R, I, O, D, ¸, *,
received the following message: 48, S, &, , V, X, H, .,
received the following message: 158, >, , E, P, S, 3, ),
received the following message: 240, Ò, Ì
received the following message: 238, , , , X, , &,
received the following message: 32, ý, , , M, B, , *, ¡, , , ;, Z, , d, t, e, r, m, �, -, �, , p, y,
received the following message: 5, I, O, P, A, R, t, *, 8
received the following message: 128, 8, Ó, , P, Y, T, H, A, G, , *,
received the following message: 79, , , B, 3, ),
received the following message: 240, ¢, }, , C, 3, ),
received the following message: 240, c, Ë, , E, Q, ¸, *, 2
received the following message: 190, W
received the following message: 4, T, P, A, R, t, *, @
received the following message: 163, ð, , Z, P, A, R, t, *, ö
received the following message: 16, Ý, ¸, , Y, 1, �, -, u
received the following message: 64, ~, -, , P, P, A, R, t, *,
received the following message: 112, Ü, , , P, T, p, a, r, , +, N
received the following message: 32, ù, Ï, , C, A, S, D, I, R, , *, , , `, D, , , P, R, I, M, I, T, ¸, *, Ë
received the following message: 241, e, , C, A, S, I, N, F, O, , +, ¶,
received the following message: 7, Ä, , M, O, D, U, L, O, , &,
received the following message: 48, ç, ,
, R, E, A, L, A, S, S, U, M, E, t, *, 7
received the following message: 176, , ±, , P, E, R, I, O, D, ¸, *,
received the following message: 48, S, &, , V, X, H, .,
received the following message: 158, >, , E, P, S, 3, ),
received the following message: 240, Ò, Ì
received the following message: 238, , , , X, , &,
received the following message: 32, ý, , , M, B, , *, ¡, , , ;, Z, , d, t, e, r, m, �, -, �, , p, y,
received the following message: 5, I, O, P, A, R, t, *, 8
received the following message: 128, 8, Ó, , P, Y, T, H, A, G, , *,
received the following message: 79, , , B, 3, ),
received the following message: 240, ¢, }, , C, 3, ),
received the following message: 240, c, Ë, , E, Q, ¸, *, 2
received the following message: 190, W
received the following message: 4, T, P, A, R, t, *, @
received the following message: 163, ð, , Z, P, A, R, t, *, ö
received the following message: 16, Ý, ¸, , Y, 1, �, -, u
received the following message: 64, ~, -, , P, P, A, R, t, *,
received the following message: 112, Ü, , , P, T, p, a, r, , +, N
received the following message: 32, ù, Ï, , C, A, S, D, I, R, , *, , , `, D, , , P, R, I, M, I, T, ¸, *, Ë
received the following message: 241, e, , C, A, S, I, N, F, O, , +, ¶,
received the following message: 7, Ä, , M, O, D, U, L, O, , &,
received the following message: 48, ç, ,
, R, E, A, L, A, S, S, U, M, E, t, *, 7
received the following message: 176, , ±, , P, E, R, I, O, D, ¸, *,
received the following message: 48, S, &, , V, X, H, .,
received the following message: 158, >, , E, P, S, 3, ),
received the following message: 240, Ò, Ì
received the following message: 238, , , , X, , &,
received the following message: 32, ý, , , M, B, , *, ¡, , , ;, Z, , d, t, e, r, m, �, -, �, , p, y,
received the following message: 5, I, O, P, A, R, t, *, 8
received the following message: 128, 8, Ó, , P, Y, T, H, A, G, , *,
received the following message: 79, , , B, 3, ),
received the following message: 240, ¢, }, , C, 3, ),
received the following message: 240, c, Ë, , E, Q, ¸, *, 2
received the following message: 190, W
received the following message: 4, T, P, A, R, t, *, @
received the following message: 163, ð, , Z, P, A, R, t, *, ö
received the following message: 16, Ý, ¸, , Y, 1, �, -, u
received the following message: 64, ~, -, , P, P, A, R, t, *,
received the following message: 112, Ü, , , P, T, p, a, r, , +, N
received the following message: 32, ù, Ï, , C, A, S, D, I, R, , *, , , `, D, , , P, R, I, M, I, T, ¸, *, Ë
received the following message: 241, e, , C, A, S, I, N, F, O, , +, ¶,
received the following message: 7, Ä, , M, O, D, U, L, O, , &,
received the following message: 48, ç, ,
, R, E, A, L, A, S, S, U, M, E, t, *, 7
received the following message: 176, , ±, , P, E, R, I, O, D, ¸, *,
received the following message: 48, S, &, , V, X, H, .,
received the following message: 158, >, , E, P, S, 3, ),
received the following message: 240, Ò, Ì
received the following message: 238, , , , X, , &,
received the following message: 32, ý, , , M, B, , *, ¡, , , ;, Z, , d, t, e, r, m, �, -, �, , p, y,
received the following message: 5, I, O, P, A, R, t, *, 8
received the following message: 128, 8, Ó, , P, Y, T, H, A, G, , *,
received the following message: 79, , , B, 3, ),
received the following message: 240, ¢, }, , C, 3, ),
received the following message: 240, c, Ë, , E, Q, ¸, *, 2
received the following message: 190, W
received the following message: 4, T, P, A, R, t, *, @
received the following message: 163, ð, , Z, P, A, R, t, *, ö
received the following message: 16, Ý, ¸, , Y, 1, �, -, u
received the following message: 64, ~, -, , P, P, A, R, t, *,
received the following message: 112, Ü, , , P, T, p, a, r, , +, N
received the following message: 32, ù, Ï, , C, A, S, D, I, R, , *, , , `, D, , , P, R, I, M, I, T, ¸, *, Ë
received the following message: 241, e, , C, A, S, I, N, F, O, , +, ¶,
received the following message: 7, Ä, , M, O, D, U, L, O, , &,
received the following message: 48, ç, ,
, R, E, A, L, A, S, S, U, M, E, t, *, 7
received the following message: 176, , ±, , P, E, R, I, O, D, ¸, *,
received the following message: 48, S, &, , V, X, H, .,
received the following message: 158, >, , E, P, S, 3, ),
received the following message: 240, Ò, Ì
received the following message: 238, , , , X, , &,
received the following message: 32, ý, , , M, B, , *, ¡, , , ;, Z, , d, t, e, r, m, �, -, �, , p, y,
received the following message: 5, I, O, P, A, R, t, *, 8
received the following message: 128, 8, Ó, , P, Y, T, H, A, G, , *,
received the following message: 79, , , B, 3, ),
received the following message: 240, ¢, }, , C, 3, ),
received the following message: 240, c, Ë, , E, Q, ¸, *, 2
received the following message: 190, W
received the following message: 4, T, P, A, R, t, *, @
received the following message: 163, ð, , Z, P, A, R, t, *, ö
received the following message: 16, Ý, ¸, , Y, 1, �, -, u
received the following message: 64, ~, -, , P, P, A, R, t, *,
received the following message: 112, Ü, , , P, T, p, a, r, , +, N
received the following message: 32, ù, Ï, , C, A, S, D, I, R, , *, , , `, D, , , P, R, I, M, I, T, ¸, *, Ë
received the following message: 241, e, , C, A, S, I, N, F, O, , +, ¶,
received the following message: 7, Ä, , M, O, D, U, L, O, , &,
received the following message: 48, ç, ,
, R, E, A, L, A, S, S, U, M, E, t, *, 7
received the following message: 176, , ±, , P, E, R, I, O, D, ¸, *,
received the following message: 48, S, &, , V, X, H, .,
received the following message: 158, >, , E, P, S, 3, ),
received the following message: 240, Ò, Ì
q
example terminated
Experimental: JNI_OnLoad called.
It is actually a listing of the directory contents of the device but that is unimportant. The fact that they are talking is the thing.
I think I will do all my dev on an Ubuntu VM as the serial port access is much simpler than on a Mac.
Credit: I have used as a starting point code written by a Raphael Blatter (
[email protected]) Thanks !