This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]