This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Reading data from ttyS fails
- From: "thunderboy42" <thunderboy42 at cooltoad dot com>
- To: cygwin at cygwin dot com
- Date: Thu, 24 May 2012 14:25:27 +0200
- Subject: Reading data from ttyS fails
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?
--
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