When you open the serial port in IR mode, you get a raw IR connection with
no error checking. If you're an old guy like me, it's like using a 300pbs
acoustic couple modem -- you get garbage characters from time to time due to
noise. For old modems, noise was the various clicks MaBell tossed into the
line. For raw IR, it's stray light from halogen, florecent, and other bright
light, and whatever else happens to land on the IR leds.
The answer back then is the answer now -- error correction, retries, etc.
Your software will need to figure out if the data it gets/sends is accurate
or corrupted. That's what the low-level IRDA stuff does for you. Every
packet sent over IR includes a lot of information describing the packet
itself -- a start and stop char, and a 16 bit CRC value -- the low-level IR
protocol checks the packet to make sure the propper framing bits are there,
that the CRC matches, etc. If not, the receiver requests the packet be
retransmitted.
If you have control over both sides of the transmission, I'd suggest using a
simple packet format -- frame each chunk of data with a start & stop char,
and tack on a 16 bit CRC. You can use the same LMP packet format as used by
irda (see www.irda.org for a description of it) or something simpler. As
part of our Cooltown project at HP Labs (cooltown.hp.com) I implemented the
Ultra irda protocol for PalmOS using this technique.
If you don't have control over the sender, you can add some sanity checks to
your receiver end, if the data you're expecting is only ascii text, you
could toss any chars that where not.
- John Schettino
-----Original Message-----
From: Charles Rezsonya [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 16, 2000 2:48 PM
To: Palm Developer Forum
Subject: Re: Serial Communication via IR
ok, originally i thought i wasn't doing something right, now i got it to
send data back and forth. but i get the occasional single char or couple
(seems like intermitten bytes back and forth?), how do i mask these? or
how do i understand what these are?
tia,
Charles
-----Original Message-----
From: Alan Burgess <[EMAIL PROTECTED]>
To: Palm Developer Forum <[EMAIL PROTECTED]>
Date: Friday, October 13, 2000 12:25 PM
Subject: RE: Serial Communication via IR
>Just open the serial port as normal - then redirect as shown below
>
>static void CommsEnableInfrared()
>{
> SerControl(SerialRef, serCtlIrDAEnable, 0, 0);
>}
>
>static void CommsDisableInfrared()
>{
> SerControl(SerialRef, serCtlIrDADisable, 0, 0);
>}
>
>Alan Burgess
>Grosvenor Technology Ltd
>[EMAIL PROTECTED]
>
> -----Original Message-----
>From: James [mailto:[EMAIL PROTECTED]]
>Sent: 10 October 2000 06:43
>To: Palm Developer Forum
>Subject: Serial Communication via IR
>
>Has anyone ever tried this, without going the IrDA route/or using the
>Exchange manager? I'm trying to develop an application and all the
>overhead of the IrDA stack is not really needed. I'm trying to get a
>Palm to communicate to a non-Palm. I will be writing software for the
>other platform(a PC) and will be using some Serial libraries to send and
>receive data from the PC.
>
>I'll just be sending some coordinate information back and forth between
>the Palm and the non-Palm.
>
>What is the best approach for doing this kind of communication between a
>Palm and a non-Palm device...(IrDA, Serial over IR, etc.)?
>
>Thanks in advance.
>
>-James
>
>--
>For information on using the Palm Developer Forums, or to unsubscribe,
>please see http://www.palmos.com/dev/tech/support/forums/
>
>--
>For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
>
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/