Re: Non-polling serial I/O



Sorry. You can set the timeout to infinite if you never want the call to
come back until it has some bytes for you...

Paul T.

"J.Spraul" <JSpraul@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B5209E7E-794C-4ACF-A673-3BA6E0A2B14E@xxxxxxxxxxxxxxxx
I didn't say asking for 0 bytes, I said returning 0 bytes (eg. after a
timeout).

But thanks for your input!

"Paul G. Tobey [eMVP]" wrote:

Call ReadFile() with a non-zero number of bytes. Call WaitCommEvent().
There are several ways to attack it. I'm finding it troubling that
everything you've read said to call ReadFile() and ask for zero bytes.
That's a really stupid way to do things. Serial I/O is essentially
copied
directly from the desktop, so any sample code found for that platform
should
work, possibly with a few modifications, on CE.

Paul T.

"J.Spraul" <J.Spraul@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:74FAF28C-D3AE-407A-A485-65411361D13B@xxxxxxxxxxxxxxxx
Is there a standard method of performing non-polling serial I/O under
Windows
CE? Everything I've seen works out to a ReadFile() returning 0 bytes
until
there's something to read.

1) Is there any way to get WaitForSingleObject() to block on a serial
port
"file" handle until something can be read?

2) Is there any way to modify (or monitor) the default Windows CE
serial
driver to set a named event which can take the place of the file handle
above?

Thanks for any insight into how we can cut down CPU time spent waiting
for
serial input.





.



Relevant Pages

  • Re: strange problem with serial communication
    ... Each time I send a string, ... > Your code is written to stop reading whenever ReadFile gets a timeout, ... > but you have set the timeout to zero. ... > only one byte for each ReadFile call. ...
    (microsoft.public.vc.mfc)
  • Re: strange problem with serial communication
    ... Each time I send a string, ... > Your code is written to stop reading whenever ReadFile gets a timeout, ... > but you have set the timeout to zero. ... > only one byte for each ReadFile call. ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: question on win32 api readfile on serial port
    ... I was hoping to capture an error through a return value of Readfile. ... > Since you want things to timeout, why even use WaitCommEvent? ... >>I am attempting to use non overlapping mode on reading data from a serial ...
    (microsoft.public.vc.language)
  • Re: synchronize_qrcu_timeout()
    ... On 06/26, Paul E. McKenney wrote: ... it should survive after the timeout. ... Except the code re-use, which is always good. ...
    (Linux-Kernel)
  • Re: Windows CE 5.0
    ... If there is a parity error, perhaps the driver has changed slightly to ... Is ReadFile returning false, for example? ... >> Paul T. ...
    (microsoft.public.dotnet.framework.compactframework)

Quantcast