This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Problem in writing to the modem
- From: "Bhanu AN Kurpad" <bhanuk at mindtree dot com>
- To: <cygwin at cygwin dot com>
- Date: Sun, 3 Feb 2002 16:32:33 +0530
- Subject: Problem in writing to the modem
Hi,
1.Our application has a problem writing to the serial port connected to the
modem.
The same application works fine on Linux.
2.The following is the open call for the serial port connected to the modem:
fd = open( device_name, O_RDWR | O_NONBLOCK );
3.The serial port has the following settings:
struct termios newtio;
tcgetattr(fd,&newtio);
memset(&newtio,0,sizeof(struct termios));
newtio.c_cflag = CS8 | B115200 | CREAD | CLOCAL | CRTSCTS;
newtio.c_oflag = 0;
newtio.c_iflag = IGNPAR | IXON | IXOFF ;
newtio.c_lflag = 0;
newtio.c_cc[VTIME] = 0;
newtio.c_cc[VMIN] = 1;
tcflush(fd,TCIFLUSH);
/* Set Terminal settings for the Line Device */
newtio.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
newtio.c_oflag &= ~OPOST;
newtio.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
newtio.c_cflag &= ~(CSIZE|PARENB);
newtio.c_cflag |= CS8;
tcsetattr(fd, TCSANOW, &newtio);
4.The write call to the serial port is failing. The error returned is EACESS
or EAGAIN.
Please let me know if there is any problem in the settings of the port.
Thanking you in advance
Bhanu Kurpad