Mail Archives: djgpp/2003/02/18/15:59:49
Well, spent quite some time digging through the Usenet archives
regarding djgpp and serial I/O. Most of it completely frustrating,
finding librarys that required me to specify stuff that it should
already know (the IRQ and hardware port addresses for COM1 for
instance) and seemed to want to talk directly to the hardware, an
undesirable characteristic when you may be running under Windows
2000/XP.
So, I gave up on dzcomm, bcserio,pmcom, etc.. I then thought for a
moment, that under a DOS window you can do something as simple as
"echo 'hello' >COM1" so why not just trying to do an open on COM1:.
Well, it worked pretty good. The only gotcha seems to be that read
appears to always be NONBLOCKING-- which if I had to choose is at
least the workable choice, as I can loop until I get non-zero back
from the read, but this seems less than optimal. Better than messing
with the overlycomplex libraries that don't really seem to buy me
anything, but if I could get it to do a blocking read that would be a
worthwhile improvement.
I tried using fcntl, ioctl, and tcgetattr, but none of these seemed to
do anything useful (though for fcntl and tcgetattr, I just tried to
GET the current info, rather than set anything, but because it always
seemed to return 0 for everything, I figured this stuff isn't
connected...).
Anyone know how to make this last minor adjustment to real "basic"
COM1: port I/O?
--
Keith Doyle
- Raw text -