Rik

That won't work. I can't guarantee when my data will arrive, so I will
likely miss it if I open the port, wait and then relinquish it (it's a
keyboard driver). I could try opening the port once and setting a global
variable. But when do I close it? No one could do a hotsync if I hogged the
port. Actually I think having just written that I'm sure I tried that,
opening the port using SrmOpenBackground(). I didn't seem to get anywhere
there either. Perhaps I didn't try hard enough! Still leaves the question as
to when to relinquish hold of the port (perhaps not so much a problem if
opened as Background only).

Gary

-----Original Message-----
From: Richard Anderson [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 25, 2000 9:33 AM
To: Palm Developer Forum
Subject: RE: quick serOpen /Close


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/

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to