Problem in writing to the modem

Bhanu AN Kurpad bhanuk@mindtree.com
Sun Feb 3 12:07:00 GMT 2002


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



More information about the Cygwin mailing list