Mail Archives: djgpp/1998/02/12/05:24:30
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 -