delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/12/05:24:30

Date: Thu, 12 Feb 1998 12:24:08 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Nigel Megitt <nigel DOT megitt AT rd DOT bbc DOT co DOT uk>
cc: djgpp AT delorie DOT com
Subject: Re: Serial ports?
In-Reply-To: <2.2.16.19980212100841.25774aea@sunf0>
Message-ID: <Pine.SUN.3.91.980212121912.19556O-100000@is>
MIME-Version: 1.0

On Thu, 12 Feb 1998, Nigel Megitt wrote:

> I had indeed read that section of the info file, but, perhaps because there
> are other things I don't know, I didn't find it very helpful. It does not
> say how to use the extensions, for instance to open up COM1 with 8 stop
> bits, at 9600 baud etc., with a 256 byte buffer size, returning a handle
> which could be used with fgetc or some other i/o function.

You asked about using file I/O for COMx ports.  That is where Filesystem 
Extensions are useful: they can disguise an interrupt-driven COM package 
as a file.

But to initialize the port to a specific setting, you will need to write 
your own code.  The bios support is in my experience not enough (but if 
it is good enough for you, you can use the functions in the DJGPP 
library).  The relevant info about setting the port is documented in any 
good book about serial communications.  There are also a few packages in 
v2tk directory where you get DJGPP.

If DOS I/O is good enough for your needs, you can use the built-in stream 
stdaux to read and write to COM1.  But be warned that this will not 
support high baudreates.

- Raw text -


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