Hi,
I've written a small apps which allow me to read GPS information from Holux
mouse connected to a Tungsten W.
Unfortunately the same won't work on my Treo 600. No errors returned but
TimeOut. Is there something special to do to make it works on Treo 600 ?
thank you very much in advance.
Sample of my code:
UInt16 OpenSerialPort ( UInt32 aSpeed )
{
UInt16 lSerialID;
Err lError;
UInt16 lParamSize;
UInt32 lFlags = srmSettingsFlagBitsPerChar8 | srmSettingsFlagStopBits1;
Int32 lCTSTimeOut = 1;
lSerialID = 0;
// check for ROM version
FtrGet ( sysFtrCreator, sysFtrNumROMVersion, &gROMVersion );
lError = SrmOpen ( serPortCradlePort, aSpeed, &lSerialID );
if ( lError ) FrmAlert ( SerialOpenErrorAlert );
else
{
printf ( "Serial Port opened\n" );
// pas d'error
lParamSize = sizeof (aSpeed);
lError = SrmControl ( lSerialID, srmCtlSetBaudRate, &aSpeed,
&lParamSize );
printf ( "srmCtlSetBaudRate : %d\n", lError );
lParamSize = sizeof (lFlags);
lError = SrmControl ( lSerialID, srmCtlSetFlags, &lFlags, &lParamSize );
printf ( "srmCtlSetFlags : %d\n", lError );
lParamSize = sizeof (lCTSTimeOut);
lError = SrmControl ( lSerialID, srmCtlSetCtsTimeout, &lCTSTimeOut,
&lParamSize );
printf ( "srmCtlSetCtsTimeout : %d\n", lError );
}
SysTaskDelay (50);
return lSerialID;
}
//***** Main program
UInt16 aSerialPortID;
UInt32 lNbCar, lErrorCode;
char lBuffer[250];
aSerialPortID = OpenSerialPort ( 4800L );
SerialReceiveCheck ( aSerialPortID, &lNbCar );
printf ( "SerialReceiveCheck : %d\n", lNbCar );
if ( lNbCar > 0 )
{
SrmReceive ( aSerialPortID, lBuffer, lNbCar, 10, &lErrorCode );
printf ( "buffer : %s\n", lBuffer );
}
SrmReceiveFlush ( aSerialPortID );
//***** End of main program
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/