At 15:10 27.08.2001 +0200, you wrote:
>What is the correct way of opening a serial connection to the serial
>device specified in the serial perferences. I've written an
>application that works fine with IrComm (SysFileCVirtIrComm), but also
>want it to work when serial is configured via the cradle.
>
>Is it a special port id to use, or do I have to check the preferences
>and test on this? How do I get and test that preference setting?
here is a sample code :
Word refSer = 0;
SerSettingsType serset;
if (SysLibFind("Serial Library", &refSer) == 0)
{
SerOpen(refSer, 0, 9600);//refSer is a reference to the serial
port, 0 is the port no, 9600 is the speed
SerGetSettings(refSer, &serset);
serset.flags = serSettingsFlagBitsPerCharM |
serSettingsFlagStopBits1 | SerSettingsFlagBitsPerChar8; // 8 bits, no
parity, 1 stop bits.
SerSetSettings(refSer, &serset);
SerSend10(refSer, (char *) data, StrLen(data));
SerClose(refSer);
}
you should use the SDK Reference for details. See pp.949-965 The Serial Manager
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/