delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/12/14:35:22

From: dhensley AT my-dejanews DOT com
Newsgroups: comp.os.msdos.djgpp
Subject: Re: How to open COM port in DJGPP?
Date: Tue, 12 Jan 1999 19:16:03 GMT
Organization: Deja News - The Leader in Internet Discussion
Lines: 45
Message-ID: <77g71i$d34$1@nnrp2.dejanews.com>
References: <369A9A22 DOT 9AF7AB2A AT juno DOT com> <Pine DOT SUN DOT 3 DOT 91 DOT 990112110417 DOT 15876S-100000 AT is>
NNTP-Posting-Host: 128.138.130.135
X-Article-Creation-Date: Tue Jan 12 19:05:14 1999 GMT
X-Http-User-Agent: Mozilla/4.08 [en] (X11; I; Linux 2.0.36 i686)
X-Http-Proxy: 1.0 x11.dejanews.com:80 (Squid/1.1.22) for client 128.138.130.135
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

> > I need to use the open() function, and I've tried
> > COM1, /dev/com1/, /dev/tty00, /dev/ttyS0, and /dev/cua0--none of them
> > work.
>
> The first two, COM1 and /dev/com1, should have worked.  What exactly
> do you mean by ``none of them work''?  Did the call to `open' fail?
> If so, how exactly did you call `open' (a code fragment would be nice)
> and what was the failure code (errno value) ?

Actually, I should have been more specific: open() seemed to open a
file/device, but tcgetattr() failed. That's why I thought it didn't work. But
your explanation (and old posts I eventually found in the archives) cleared
up why.

> >     I need to use open() because my code uses tcgetattr(), tcsetattr(),
> > and select().
>
> `select' will work, once you open the port, but `tcgetattr' and
> `tcsetattr' won't.  The DJGPP implementation of termios is minimal and
> currently only works for terminal devices.

I think I tried stdaux, but I don't think it worked. One question I have is,
if I set the COM port attributes through the Control Panel, does DOS (and
DJGPP) inherit those properties, or does DJGPP set some (other) arbitrary
attributes?

To solve my problem, I've been looking at 3 packages. I first looked at
CYGWIN, but its serial support is buggy at best. I got something to kind of
work, but it was a real kludge. I also looked at UWIN. My test program
compiled and worked flawlessly, but as far as I know it doesn't have a
FORTRAN compiler (which I ultimately need). I'm also looking at DJGPP
(obviously).

> The filesystem extensions feature is described in the library
> reference; type "info libc alpha 'File System'" from the DOS prompt
> (the quotes around File System are important!).

Will this work under NT?

Thanks for the response,
Dan

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    

- Raw text -


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