> Hi,
> I am working on sending data to another device ( power
> scanner) right now,
> and data is sent by serial communication. However, I don't
> understand serial
> communication at all. Anyone can give me some help, I will highly
> appreciated.
>
the serial communication with the palm pilot is documented in the sdk pdf's.
you can do a search for:
SerReceive
SerSend
SerOpen
first you have to init the serial port (i do this after a
sysAppLaunchCmdNormalLaunch):
err = SysLibFind("Serial Library", &gSerialRefNum);
ErrNonFatalDisplayIf(err != 0, "Can't find serial library");
err = SerOpen(gSerialRefNum, 0, 19200);
if (err != 0) {
if (err == serErrAlreadyOpen) {
FrmAlert(SerialInUseAlertAlert);
SerClose(gSerialRefNum);
} else
FrmAlert(CantopenserialAlertAlert);
return true;
}
the last parameter passed to seropen is the baud rate
then you can send:
SerSend(gSerialRefNum, &b, 13, &err);
where b = bufferpointer and 13 is the length
or receive:
rec = SerReceive(gSerialRefNum, &read, 1, 100, &err);
hth, roland
(if you need more info i can send you some source off list)