The code I am using:
// gP is pointer to globals. This is a shared library
err = SrmOpen(0x8001,9600,&gP->portId);
if(!err) {
err = SrmControl (gP->portId, srmCtlIrDAEnable,&flags,&flagsize);
} else {
SrmClose(gP->portId);
return 0x909;
}
SrmControl (gP->portId, srmCtlRxDisable,&flags,&flagsize);
SrmSend (gP->portId,cmd,1,&err); // cmd = 'U'
SrmControl (gP->portId, srmCtlRxEnable,&flags,&flagsize);
TimOut = TimGetSeconds() + 10;
do { // wait for 2122 to start
sending data
SrmReceiveCheck (gP->portId,&bytecount);
}while((TimOut > TimGetSeconds ()) && (bytecount == 0));
// time out error handling removed
SrmReceive (gP->portId,gP->buf,1,5 * SysTicksPerSecond(), &err);
if(gP->buf[0] != ACK) { // the 2122 sends 0x06 but I see
a garbage char
I also wrote a HB++ program that simply watches the IR port and displays
everything in hex that it sees. On the Treo 650 and Zire 72 this program
verifies that the first char in any grouping of characters is garbaged up.
This same program running on a Palm 515 shows every character flawlessly.
I really cannot change the baud rate as we have tens of thousands of the
devices with the 2122 set at 9600 baud in the field.
Thanks for your interest,
Jesse
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/