This is the mail archive of the cygwin@cygwin.com 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]

Problems setting baud rate


Hi,

I'm using Cygwin GCC 3.2, and have the following code:

tty_fd = open(modem_device[Port-1], O_RDWR | O_NOCTTY );
tcgetattr(tty_fd,&oldtio); /* save current serial port settings */

newtio.c_cflag = bd | CS8 | CLOCAL | CREAD;
<and some other settings>

tcsetattr(tty_fd,TCSANOW,&newtio);

This doesn't change the baudrate, even though I thought I specified it in c_cflag. If the baudrate happens to be correct, everything works. If the baudrate happens to be incorrect, well, I get garbage or nothing.

How do I do to change the baudrate? Would above suffice for Unix, but not when compiling for Win32?

By the way, I got this email address from Mingw list. Is this a mailinglist? If so, how can I join?

Regards
Mats


-- 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]