delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/02/03/04:23:17

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: Thu, 3 Feb 2005 10:19:55 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Help about serial programming: manipulating DTR
Message-ID: <20050203091955.GD14580@cygbert.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <6 DOT 0 DOT 1 DOT 1 DOT 0 DOT 20050202171834 DOT 01fcf4f8 AT 192 DOT 168 DOT 2 DOT 1> <20050202180929 DOT GQ31117 AT cygbert DOT vinschen DOT de> <6 DOT 0 DOT 1 DOT 1 DOT 0 DOT 20050203091915 DOT 02128f78 AT 192 DOT 168 DOT 2 DOT 1>
Mime-Version: 1.0
In-Reply-To: <6.0.1.1.0.20050203091915.02128f78@192.168.2.1>
User-Agent: Mutt/1.4.2i

On Feb  3 09:52, llandre wrote:
> 
> >> I'm trying to manipulate the DTR signal of the serial port.
> >> As an example I used this code snippet:
> >> http://lists.exploits.org/upsdev/Feb2004/00013.html.
> >> I can open the com1, I can send and receive data but the ioctl I use
> >> to read the status of the signals returns -1:
> >>
> >>     int status;
> >>     ioctl(upsfd, TIOCMGET, &status);
> >>
> >> Anybody can help me? I have no idea about what's wrong with this code.
> >
> >strace would give a hint.  TIOCMGET should only fail because a call to
> >GetCommModemStatus fails.  If so, the strace would contain a line which
> >talks about setting errno in fhandler_serial::ioctl.
> 
> Corinna,
> 
> thanks a lot for your advice.
> I tried to use strace. Here is what I see:

That's not enough information, so I try an educated guess.  It looks
like the file you opened is not recognized as serial interface.  What
did you use as device name?  FYI, it should be either "/dev/com1"
or /dev/ttyS0" for the first serial.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

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