Hi
I am attempting to read the RS-232 serial output from a
external device from(digital converted Loadcell output) my palm to store.The
device will send the output to the 9 pin serial connector once it receives
the call from the palm(ie character "A").I tried so many times but i could
not read the output.
I set the same baud rate at both ends. Here is my code.
Boolean doSend()
{
Err errP;
UInt16 i;
UInt16 newPortIdP;
Char pBuf[10];
Char pBuf2[10];
UInt32 bytes = 10;
Int32 timeout = 1000;
FormPtr activeForm;
//FrmGetObjectIndex(activeForm, MainList);
FieldType* fldP;
UInt32 actualRead = 0;
UInt32 actualSent = 0;
UInt32 cnt=0;
UInt16 refNumP;
StrNCopy(pBuf, "AA", 2);
SysLibFind("Serial Library", &refNumP);
SerOpen(refNumP, 0, 1200);
actualSent = SerSend(refNumP, pBuf, 1, &errP);
actualRead = SerReceive(refNumP, pBuf2, 5, 1000, &errP);
SerClose(refNumP);
/*SrmOpen(serPortCradlePort , 1200, &newPortIdP);
actualSent = SrmSend(newPortIdP, pBuf, 1, &errP);
actualRead = SrmReceive(newPortIdP, pBuf2, 5, 1000, &errP);
SrmClose(newPortIdP);*/
activeForm = FrmGetActiveForm();
fldP = FrmGetObjectPtr(activeForm, FrmGetObjectIndex(activeForm,
EDT_DISPLAY));
FldInsert(fldP, pBuf2, StrLen(pBuf2));
activeForm = FrmGetActiveForm();
fldP = FrmGetObjectPtr(activeForm, FrmGetObjectIndex(activeForm,
EDT_DISPLAY));
FldInsert(fldP, "Ok", 2);
}
Thanks in advance
Sureshbabu
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/