Mail Archives: cygwin/2006/09/27/18:36:38
On Wed, 27 Sep 2006, ahnkle wrote:
> hi
>
> I wrote a small program to test some serial stuff. I was puzzled because
> I recall that I was able to set baud rate on a serial port before, but
> now I cannot.
>
> I call tcgetattr() after I open the serial port, but it fails (the
> tcsetattr() also fails which first got my attention).
>
> I enclose a short example, and cygwin details, too. Any ideas?
Hmm... Either you've asked this before, or I saw an almost exactly the
same program posted within the past month or two. Quoting the first few
lines of your program:
#define PORT "com1"
...
fd = open(PORT, O_RDWR | O_NOCTTY );
There's your problem. When you open a port as "com1", it looks like a
file to Cygwin, since it doesn't recognize it as a valid device name.
Thus any attempt to manipulate that fd as a device will fail.
Use the Cygwin device (e.g., "/dev/ttyS0").
HTH,
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com
ZZZzz /,`.-'`' -. ;-;;,_ Igor Peshansky, Ph.D. (name changed!)
|,4- ) )-,_. ,\ ( `'-' old name: Igor Pechtchanski
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"
--
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/
- Raw text -