Asynchronous Terminals and Printer Processes Programming Manual

TERMINAL PROGRAMMING CONSIDERATIONS
Modem Connections
Switched (Dial-Up) Line Connections
If your application is being executed through the command
interpreter over a switched line, the command interpreter, not
your application, takes care of answering incoming calls and
disconnecting the line. In this case, your application interacts
with the remote terminal by way of file-system procedure calls
such as OPEN, CLOSE, READ, and WRITE.
If, on the other hand, your application is directly controlling
the line, you must use CONTROL procedure calls to answer incoming
calls and to disconnect the line. In between those functions,
your application interacts with the remote terminal through file-
system procedure calls such as OPEN, CLOSE, READ, and WRITE.
Example
Assume that you want your application process to be able to
accept an incoming call from a modem designated "$LINE1" while
continuing with other processing functions. You could use the
following code:
LITERAL NO^WAIT = 1, ! data declarations
WAIT^ON^CALL = 11, !
TIMEOUT = 40; !
.
.
INT .LINE1 [0:11] := [ "$LINE1", 9 * [ " " ] ];
INT LINE1^FNUM,
CALL^RECEIVED := 0;
! open the modem, allowing one concurrent I/O operation
CALL OPEN ( LINE1, LINE1^FNUM, NOWAIT );
The file system enables the modem for an incoming call, and your
application process continues executing. Call CONTROL to wait
for a modem connection.
CALL CONTROL ( LINE1^FNUM, WAIT^ON^CALL );
Periodically, call the AWAITIO procedure to see if a call has
been received:
4-26