delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/07/23/10:27:53

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
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <3F1E9B4F.7060607@enea.se>
Date: Wed, 23 Jul 2003 16:27:27 +0200
From: Mats Liljegren <mlil AT enea DOT se>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312
X-Accept-Language: en-us, en, ko
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Problems setting baud rate

Hi,

I'm using Cygwin GCC 3.2, and have the following code:

tty_fd = open(modem_device[Port-1], O_RDWR | O_NOCTTY );
tcgetattr(tty_fd,&oldtio); /* save current serial port settings */

newtio.c_cflag = bd | CS8 | CLOCAL | CREAD;
<and some other settings>

tcsetattr(tty_fd,TCSANOW,&newtio);

This doesn't change the baudrate, even though I thought I specified it 
in c_cflag. If the baudrate happens to be correct, everything works. If 
the baudrate happens to be incorrect, well, I get garbage or nothing.

How do I do to change the baudrate? Would above suffice for Unix, but 
not when compiling for Win32?

By the way, I got this email address from Mingw list. Is this a 
mailinglist? If so, how can I join?

Regards
 Mats


--
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