Hey Martin,
As Lawson said, some programs use WaitForComm event to wait for data, then GetCommError to check how many bytes arrived, then ReadFile to read it. They then expect ReadFile to return TRUE.
One such program is VBTerm, the visual basic terminal program, or at least the VBX in it.
Testing applications that use serial ports is difficult, and debugging often must be done remotely. (eg. send me a trace like this, apply this patch and send me another trace, etc.)
After making a change, i usually get a terminal program (such as KoalaTerm) and send a couple of "AT" commands to it... :-)
Mike
Original message from: lawson_whitney@juno.com
On Wed, 9 Jan 2002, Martin Wilck wrote: ....
How do you check if data is ready in Windows? I didn't find a
select()
equivalent, nor is it possible to wait on file handles.
GetCommError and some other functions, I think, returns
lpStat->cbInQue,
which is in effect the number of characters immediately available to
be
read.
Martin
Lawson
------------------------------------------ mailto:Mike_McCormack@start.com.au ph +82 16 430 0425
__________________________________________________________________ Get your free Australian email account at http://www.Looksmart.com.au
Mike McCormack wrote:
As Lawson said, some programs use WaitForComm event to wait for data, then GetCommError to check how many bytes arrived, then ReadFile to read it. They then expect ReadFile to return TRUE.
One such program is VBTerm, the visual basic terminal program, or at least the VBX in it.
Testing applications that use serial ports is difficult, and debugging often must be done remotely. (eg. send me a trace like this, apply this patch and send me another trace, etc.)
For what it's worth, I documented some overlapped serial I/O quirks some time ago at http://www.alumni.caltech.edu/~dank/overlap.htm I also have a little running sample code there.
- Dan