This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Can't set CREAD flag on serial port?
- From: mbarilli at midsouth dot rr dot com
- To: cygwin at cygwin dot com
- Date: Tue, 24 Feb 2004 20:30:12 -0600
- Subject: Re: Can't set CREAD flag on serial port?
- References: <873c908a8q.fsf@shadizar.dyndns.org>
>>>>> "me" == mbarilli <mbarilli@midsouth.rr.com> writes:
me> I'm trying to write an application to access a serial port on
me> a Windows 2000 box, but the CREAD flag doesn't stay set when I
me> do `tcsetattr' and check the values with `tcgetattr'. Trying
me> to read from the port returns a ``Resource temporarily
me> unavailable'' error (as generated from perror).
me> ...
me> tty_fd = open("/dev/com2",O_RDWR|O_NDELAY|O_BINARY);
Doh. Guess that's what I get for cargo-cult programming and not
reading the flags I'm passing to `open'. Of course I'll get an error
of EAGAIN if I open the port in non-blocking mode (O_NDELAY) and
there's nothing available on the wire. The CREAD flag issue was a red
herring, apparently.
Sorry 'bout that ...
--
Michael J. Barillier | ``Those who make peaceful
email: mbarilli(at)midsouth.rr.com | revolution impossible will make
web: <http://shadizar.dyndns.org/> | violent revolution inevitable.''
Public key available on request. | -- John F. Kennedy
--
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/