[comp.sys.atari.st] Serial Port I/O

dave@motto.UUCP (dave brown) (07/18/89)

I am writing a small program which does input and output through (and
sometimes to) a modem connected to the ST's the serial port.

I do not want the program to wait indefinitely if there is no response
at the port (i.e. nothing connected to the port, other end does not
reply, etc.).

Currently I use BIOS BCONSTAT (TRAP #13 function 1) to test whether
there is a character waiting for input.  If so, I read it using
BIOS CONIN (TRAP #13 function 2).  If not, I keep looping on the
BCONSTAT until a character arrives, or a certain amount of time
passes.  If the time limit expires with no character, I give up
and report an error.

Is this the best way to do this kind of thing?  If I had to wait
for input from the serial port and the keyboard, and process either
one, would I just keep polling each one with BCONSTAT until one
or the other had a character ready for input?

Thanks for your help,

	Dave

 -----------------------------------------------------------------------------
|  David C. Brown		|  uunet!mnetor!motto!dave		      |
|  Motorola Canada, Ltd.	|  416-499-1441 ext 3708		      |
|  Communications Division	|  Disclaimer: Motorola is a very big company |
 -----------------------------------------------------------------------------