Your case 0 looks pretty dubious. Normally, if SerReceiveWait does not
return an error, you do something like:
SerReceiveCheck( serRefNum, &numBytes ); // find out how many
characters in receive queue
if (numBytes) // Receive
the bytes into our buffer
SerReceive( serRefNum, respBufP, numBytes, 0, &err );
It is important to remember that, at this point, they are individual bytes,
not null terminated strings. Also, you may not get a whole message/string
at one go. The string is asynchronously received via interrupts.
Good Luck,
-jjf
-----Original Message-----
From: Patrick Ouellet [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 05, 2000 12:50 PM
To: Palm Developer Forum
Subject: Serial Weirdness
Ok Im doing this to receive a couple of string via Serial Modem
connection
do
{
RecepErr = SerReceiveWait(NumRef, 1, -1);
switch(RecepErr)
{
case 0:
{
StrCopy(strRBuff, InBuff);
ScanComm(InBuff);
break;
}
case serErrTimeOut:
{
return false;
break;
}
case serErrLineErr:
{
return false;
break;
}
}
}
while(TransmissionEnd == false);
But what I receive is far from what I send...
Does someone see a problem with the code above ?
What I send:
"UserName:Patrick Ouellet"<CR><LF>
What I receive ( when I display it using FrmCopyLabel )
�R�R�R�R�R�R�R�r
Till I get a Fatal exception (assuming that I hit the capacity limit of
my string... Be cause I
loop until I find a <CR><LF> in the receiving buffer)
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Patrick Ouellet - Programmeur
[EMAIL PROTECTED]
Recherche & Devloppement
Les Entreprise Microtec inc.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/