Page 1 of 1

PostPosted: Fri Jan 26, 2001 3:17 pm
by Moonlite
I tried using the Serial Chat on two Visors, but it didn't seem to work. I though that was how you sent stuff through the IR port. Does anyone know how to send data over the IR port? I'd like to not use the any extra libraries if possible.

PostPosted: Fri Jan 26, 2001 3:37 pm
by Farmer Al
On the smae vein, will the port recieve at the same time??


PostPosted: Fri Jan 26, 2001 7:56 pm
by Moonlite
BTW, I was trying the serial I/O stuff, with the setting at 8N1C (whatever's in the Serial Chat sample).

PostPosted: Fri Jan 26, 2001 8:34 pm
by jstadolnik
The reason the code is not working is because the UART (serial controller) in the dragonball processor on your palm has to be kicked into IR mode.

Currently, the only way of doing this is with the serIR() function in the PToolbox library.

And, yes you can send and receive data at the same time. The receive data is buffered, but the buffer is of a fixed size. So you should do reads frequently.


PostPosted: Sat Jan 27, 2001 1:57 am
by Moonlite
What are the correct settings for serIR() if I want to send/recieve? I've modified Serial Chat to test it, but 3 and 11 don't seem to work.

PostPosted: Sat Jan 27, 2001 2:24 am
by jstadolnik
Try using serial mode "8N1N". That should do it.


PostPosted: Sat Jan 27, 2001 6:16 pm
by Moonlite
Thanks! It now works with Serial Chat... but does anyone know how how to send/recieve strings? I want to send/recieve both 5 and 299 char strings over the IR Port. I kind of guessed, but it's not really working.

Also, do you have to use serIR(0) after using the IR port? Or does it turn if off automaticly? Just wondering...

To sum it up: Does anyone know who to send/reccieve strings over the IR port? (Hopefully without pointers)

Edited by - Moonlite on 01/28/2001 11:19:02

PostPosted: Sun Jan 28, 2001 8:29 pm
by SyPDA
Could you please post the modified serial chat routine here? I'm trying to do the same thing but had no luck so far.

Did you test it with two Palm units? Has anyone tried to send IR commands (e.g. 'atz') to a IR mobile phone?

PostPosted: Sun Jan 28, 2001 9:06 pm
by Moonlite
I used my Visor Deluxe and my friend's Visor. Here is the modified version:

//Serial Chat
library "PToolboxLib"
int ret;
puts("Serial Chat\n");
ret = seropen(57600, "8N1N", 50);

That is the only part I changed. And once again, does anyone know an easy way (or a way that works) to send and recieve strings over the IR port? Please?

PostPosted: Mon Jan 29, 2001 1:09 am
by jstadolnik
You will have to convert your strings to/from arrays of chars to do it.

Check out the following PocketC built-in functions: strtoc, ctostr, sersenda, and serrecva.

You should use the serIR(0) call when you are done. This disengages serial IR mode (though the OS may do this automatically, but you shouldn't count on that).


Edited by - jstadolnik on 01/28/2001 19:14:02