www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/05/02:49:34

Date: Wed, 5 May 1999 09:46:00 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: solderer AT my-dejanews DOT com
cc: djgpp AT delorie DOT com
Subject: Re: Need Help with Com/RS232
In-Reply-To: <7gnrb6$1mv$1@nnrp1.dejanews.com>
Message-ID: <Pine.SUN.3.91.990505094543.23088K-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Tue, 4 May 1999 solderer AT my-dejanews DOT com wrote:

> I want to use a com port to get some data from a
> measurment thing into the PC. I have had a look around, but I didn't find any
> good information about it. The settings for the Com-Port are 4800 Baud 8
> Databits 1 Stopbit 1 Startbit and no Paretybit. The thing always sends his
> data automatikal and countiniosly in ASCII code and I need it in an arry to
> use it. It would be very helpfull if you could say how to do it or where I
> can find informations.

The simplest way to do this would be to read from the standard stream
stdaux using buffered input functions like fread.

If buffering gets in your way, you might open the device "COM1" or
"AUX" (as if it were a file) and read the characters using functions
like `read' or `_read'.

The above assumes your program doesn't have anything else to do while
it waits for the input to arrive.  If this assumption is false, you
will be better off using some library for asynchronous
communications.  A couple of these are available from the DJGPP sites
in the v2tk directory; the DJGPP FAQ lists the URLs in section 22.3.

- Raw text -


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