Reading data from ttyS fails
Corinna Vinschen
corinna-cygwin@cygwin.com
Thu May 24 12:52:00 GMT 2012
On May 24 14:25, thunderboy42 wrote:
> I have an embedded system connectet with my PC which sends debug data over the
> rs232. A simple terminal program unter cygwin is used to analyze this data.
> before cygwin 1.7.10 evertything went fine, but now it seems, most transmitted
> characters get lost. even this simple example from wikibooks does not work
> anymore:
>
> ...
> memset(&tio,0,sizeof(tio));
> tio.c_iflag=0;
> tio.c_oflag=0;
> tio.c_cflag=CS8|CREAD|CLOCAL;
> tio.c_lflag=0;
> tio.c_cc[VMIN]=1;
> tio.c_cc[VTIME]=5;
>
> tty_fd=open("/dev/ttyS0", O_RDWR | O_NONBLOCK);
> cfsetospeed(&tio,B115200); // 115200 baud
> cfsetispeed(&tio,B115200); // 115200 baud
>
> tcsetattr(tty_fd,TCSANOW,&tio);
> while (c!='q')
> {
> if (read(tty_fd,&c,1)>0) write(STDOUT_FILENO,&c,1);
> }
> ...
>
> So what can I do?
Can you please create a simple testcase for reading from ttyS0
which can be compiled out of the box?
Thanks,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list