Can't set CREAD flag on serial port?

mbarilli@midsouth.rr.com mbarilli@midsouth.rr.com
Wed Feb 25 12:27:00 GMT 2004


>>>>> "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/


More information about the Cygwin mailing list

AltStyle によって変換されたページ (->オリジナル) /