Serial programming - Writing bytes in a blocking mode - Problem with tcdrain() ?

Christopher Faylor cgf-no-personal-reply-please@cygwin.com
Wed May 18 15:35:00 GMT 2005


On Wed, May 18, 2005 at 10:10:28AM +0200, pbenito@cemitec.com wrote:
>>I wonder if you're just seeing the effects of a buffer on the comm
>>device itself not draining even though Windows has flushed everything
>>from its own memory.
>
>I'm not reading any buffer, the idea of my program is the following: Put
>the RTS signal low, write some bytes, wait until everything is transmitted
>and then raise again the RTS signal...

I didn't say you were reading any buffer.  Most modern serial devices
contain buffers so when you send a byte to a com device it may be stored
in a buffer.  Cygwin (and Window?) won't know about this buffer.
tcdrain() will only report that the byte has left the OS buffer.  It
won't know if the byte is still sitting in the device's buffer.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list