delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/04/19/13:30:32

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
Reply-To: Cygwin List <cygwin AT cygwin DOT com>
Message-Id: <6.1.0.6.0.20040419132328.02fc8820@127.0.0.1>
X-Sender:
Date: Mon, 19 Apr 2004 13:25:58 -0400
To: Lutz =?iso-8859-1?Q?H=F6rl?= <lhoerl AT thorlabs DOT com>, <cygwin AT cygwin DOT com>
From: Larry Hall <cygwin-lh AT cygwin DOT com>
Subject: Re: 1.57 on Win2k or WinXP. Not more than 16 com ports. Differences between //./comX and /dev/comX
In-Reply-To: <C2F0FC2A5C4B3E44ADF4327E699486A509F528@mail2.de.thorlabs.l ocal>
References: <C2F0FC2A5C4B3E44ADF4327E699486A509F528 AT mail2 DOT de DOT thorlabs DOT local>
Mime-Version: 1.0

At 12:29 PM 4/19/2004, you wrote:
>Hello,
>
>I want to use (Windows-) COM port numbers greater
>than 16, but when I use open() to get a file
>descriptor for the devices I get the behaviour:
>
>---1.case-----------------------------------------
>
>errno = 0;
>fd = open("/dev/com8", O_RDWR | O_NONBLOCK);
>-> fd = 3, errno = 0
>-> everything is OK,
>   I can use the opened COM port
>
>---2.case-----------------------------------------
>
>errno = 0;
>fd = open("\\.\com8", O_RDWR | O_NONBLOCK);

            ^^^^^^^^^
You didn't escape the backslashes.  "//./com8" should work too.


>-> fd = 3, errno = 20 = ERROR_BAD_UNIT
>   = "The system cannot find the device specified"
>-> I can not use the opened COM port. The port
>   number 1...16 versus 17...255 does NOT matter.
>
>---3.case-----------------------------------------
>
>errno = 0;
>fd = open("/dev/com23", O_RDWR | O_NONBLOCK);
>
>-> fd = -1, errno = 2 = ERROR_FILE_NOT_FOUND
>   = "The system cannot find the file specified"
>-> I can not use the opened COM port. The port
>   number 1...16 (OK) 17...255 (not OK) DOES matter.


Right.  Cygwin only maps the first 16 com ports to this
POSIX syntax.  The Win32 syntax as amended above should
work for you though.




--
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
838 Washington Street                   (508) 893-9889 - FAX
Holliston, MA 01746                     


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