Hello all
I'd ;ike anyone/everyone input on the palm serial managment. I've
writen an applaction thats supposed to use the palms serial port to talk
to another device(not a pc). I think i've writen the code correctly, but
when I load it into pose to test it First when I try to open the port I
get the port allready open error Ok fine I tried to recive data, because
if the ports open I should be able to recive data, I get the BadPort
error. POSE is set to COM2 on the computer the other device is pluged in
and on, Al devices are set to the correct baud rate but nothing seems to
want to talk :(. In the PalmOS Doc's it talks about the code being outside
the event loop, I think mine is because I only need to qurrey the port
when a button is pushed so I have my button handler with when the button
is pressed jumps into another function that's supposed to open the port,
recive data, and close the port all in one. I don't think thats the
problem but..... Below is the code I'm using to do this Please any help
would be appricated.
if (!serPortOpen)
{
//err = SerOpen(refNum,0,9600);
err = SrmOpen(serPortCradlePort, 9600, &portID);
if (err) {
if (err == serErrAlreadyOpen) {
FrmCustomAlert(TestAlert,"", "Port Already
Open","");
}else{
FrmCustomAlert(TestAlert,"Port not
Availble", "Failed to Open","");}
}else{
FrmCustomAlert(TestAlert,"Port Open", "","");
serPortOpen = true;
SrmReceive(portID, &buf, 10, 100, &err);
switch (err){
case serErrBadPort:
FrmCustomAlert(TestAlert,"Bad
Port", "","");
break;
case serErrNotOpen:
FrmCustomAlert(TestAlert,"Not
Open", "","");
break;
case serErrConfigurationFailed:
FrmCustomAlert(TestAlert,"Configuration Failed", "","");
break;
case serErrNotSupported:
FrmCustomAlert(TestAlert,"Not
Supported", "","");
break;
default:
FrmCustomAlert(TestAlert, "Other
Error", "","");
break;
}
FrmCustomAlert(TestAlert, &buf, "","");
err = SrmClose(portID);
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/