www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/11/19/16:15:42

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 19 Nov 2004 13:15:23 -0800
From: Roger Pryor <rpryor AT pryor-and-pryor DOT com>
To: Cygwin Mailing List <cygwin AT cygwin DOT com>
Subject: Newbie question regarding tcsetattr
Message-Id: <20041119131523.58dd206d.rpryor@pryor-and-pryor.com>
Organization: Pryor and Pryor Inc.
Mime-Version: 1.0
X-Declude-Sender: rpryor AT pryor-and-pryor DOT com [64.114.151.101]
X-Declude-Spoolname: D641f003b023a1cd9.SMD
X-IsSubscribed: yes

Hi:

I'm a new cygwin user, attepting to port a Linux package that uses the COM
ports to drive a remote device.  I'm finding that calls to tcsetattr don't
seem to work.  What is happening is that although the speed is being
setup correctly, the values that I want for c_iflag and c_cflag are not
being set, but left as they were before.  Is this a known bug (there were
conversations about this last year in the archives) and if so is there any
idea when it will be fixed?, or am I confused (equally likely!)

Usage is:

...
	int     port;
        struct termios p;
...
        port = open("/dev/ttyS1", O_RDWR|O_NOCTTY|O_NDELAY);
...
        memset(&p, 0, sizeof(struct termios));
        p.c_iflag = IGNBRK|IGNPAR;
        p.c_cflag = CS8|CREAD|CLOCAL|B9600;
        cfsetispeed(&p, B9600);
        cfsetospeed(&p, B9600);
        if(tcsetattr(port, TCSANOW, &p) < 0)
		grumble

Thanks

--------------------------------------------------------------------------
Roger Pryor
Vancouver, B.C., V6E 1K7, Canada

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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