I would guess that you open the port (which will/should be empty, as I
believe the rx buffer is only allocated on port opening, or at least
flushed), you then see if there are chars a few microseconds later, you
could use some of the Ser wait commands to ensure you get your bytes.
Rik
> -----Original Message-----
> From: Metalle Gary-GMETALL1 [SMTP:[EMAIL PROTECTED]]
> Sent: 25 September 2000 09:18
> To: Palm Developer Forum
> Subject: quick serOpen /Close
>
> Hi
>
> I've recently written a Hackmaster hack to perform background tasks and I
> now want to read some data from the serial port in the short period of
> time
> that I do my background processing.
> I thought that I could just do a :
>
> SerOpen();
> SerCheckReceive();
> if (data) {
> bla bla
> }
> SerClose();
>
> For some reason I never read in any data although my code works (tested it
> in a normal 'application'). I always receive 0 (zero) bytes from the
> SerCheckReceive function. Is the same by the way even if you use the New
> Serial Manager functions. Does SerOpen() flush out the receive port? Is
> there a better way to quickly nip in, read data from the serial port and
> nip
> out again? I emphasize that this is a background task, so I can't just
> open
> the serial port when the application starts and then close it when it
> shuts
> down. I have to do any initialisation every time my trap handler gets
> called.
>
> Any thoughts on this appreciated. No more late nights please swearing at
> the
> computer!
>
> Gary
>
> --
> 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/