delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/02/03/06:05:24

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MimeOLE: Produced By Microsoft Exchange V6.0.4712.0
content-class: urn:content-classes:message
MIME-Version: 1.0
Subject: Problem in writing to the modem
Date: Sun, 3 Feb 2002 16:32:33 +0530
Message-ID: <E125980C421DFD4DA0B80D55DB1EDA5807D0E6@mtv01ex01.mindtree.com>
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Thread-Topic: Problem in writing to the modem
Thread-Index: AcGsokfoLoPcsIG8TdOJxqyPfoyChA==
From: "Bhanu AN Kurpad" <bhanuk AT mindtree DOT com>
To: <cygwin AT cygwin DOT com>
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id g13B5NY19769

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

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019