This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Serial programming - Writing bytes in a blocking mode - Problem with tcdrain() ?
- From: Christopher Faylor <cgf-no-personal-reply-please at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 18 May 2005 10:28:22 -0400
- Subject: Re: Serial programming - Writing bytes in a blocking mode - Problem with tcdrain() ?
- References: <OFD5CBE7A0.8D91228D-ONC1257005.002999DA@cetenasa.es>
- Reply-to: cygwin at cygwin dot com
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/