[Tutor] how to check if serial port is open

Vicki Stanfield vicki at thepenguin.org
Mon Aug 18 10:47:02 EDT 2003


I have a program which reads from and writes to a device via an infrared
dongle attached to my computer's serial port. I can read and write fine
when the device is in communication mode, but I don't know how to test
whether or not the device is available. The device itself is proprietary,
but I was hoping that there is something similar out there to use as an
example. Basically, I send a command in hex format to the device and the
device responds with a hex response. If the device has timed out and is no
longer in com mode, I get nothing back. Is there a standard way to test
for this condition so that I can send an appropriate error code to the
user?

--vicki



More information about the Tutor mailing list