www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/04/15:42:42

Date: Thu, 4 Feb 1999 18:16:47 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: David Allsopp <daa AT tqbase DOT demon DOT co DOT uk>
cc: djgpp AT delorie DOT com
Subject: Re: Help needed: reading COM1
In-Reply-To: <tu8XHPAHAbu2Ewmz@tqbase.demon.co.uk>
Message-ID: <Pine.SUN.3.91.990204181314.26702I-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Thu, 4 Feb 1999, David Allsopp wrote:

> So, after some research, I've got the latest DJGPP compiler,
> and I've started in on the FAQ, which is, of course, huge.

If you are looking for a specific topic, use the indices at the end of 
the FAQ to quickly find out if the topic you are after is at all in the 
FAQ.

Anyway, the FAQ is NOT the place to look for functions you need to use 
for your program.  You need to search the library reference, libc.info.

> Could anyone help me short-circuit the process of finding what I want,
> please?  The program I need to write must:
> 
>         Open COM1 (or possibly another COM) and send a character.

You can use the preconnected stream called `stdaux'.  It is already 
connected to COM1.

>         Read a short (~30 char) string from the port.

Use `fread'.

>         Write the string out to a file.

Any write function, but pay attention to the binary/text issue.  
(`stdaux' is in binary mode.)

>         Time out after 5 seconds if the port (a weighbridge, actually)
>         doesn't reply.

Use `select'.

- Raw text -


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