GDSX (Extended General Device Support) Manual

Design and Development
Extended General Device Support (GDSX) Manual529931-001
2-104
The DEVICE^HANDLER Procedure
As a final step, CONTINUATION^READ deallocates the IOCB associated with the
Envoy READ operation and returns:
When a WRITE or WRITEREAD operation is initiated on a line, the subprocedure
WRITE^ACTION is called. Before this call, the subprocedure LOOK has set adcb to
point to the DCB for the subdevice targeted for the write.
WRITE^ACTION verifies that adcb has a current WRITE or WRITEREAD request. If
this is not the case, a trap occurs. Otherwise, the appropriate control characters are
added to the DEVICE^HANDLER-supplied text and the WRITE or WRITEREAD
operation is initiated.
When the I/O completes, the subprocedure WRITE^COMPLETE is called. The
DEVICE^HANDLER task request is completed with any error that occurred, and the
IOCB associated with the Envoy WRITE operation is returned.
The DEVICE^HANDLER Procedure
The DEVICE^HANDLER procedure included in USAMPLE is usable either with the
LINE^HANDLER or in environments that are not Envoy environments. The procedure
body is a state machine having the same basic design as the machine employed in the
LINE^HANDLER. Seventeen device states are defined, as follows:
0 Error occurred
1EOT received
2 Text received
Device State Description
0 - d^null Task has no I/O operations outstanding.
1 - d^idle READUPDATE posted on $RECEIVE; waiting on request from
requester process.
2 - d^request A new request has been received from the external opener. No I/O
operations outstanding.
3 - d^write WRITE operation in process to terminal.
4 - d^read READUPDATE posted on $RECEIVE.
5 - d^read1 READ operation in process on terminal; READUPDATE posted on
$RECEIVE.
6 - d^setmode SETMODENOWAIT in process to terminal.
7 - d^control CONTROL in process to terminal.
8 - d^writeread READUPDATE posted on $RECEIVE.
9 - d^writeread1 WRITEREAD operation in process on terminal; READUPDATE posted
on $RECEIVE.
10 - d^preread READUPDATE posted on $RECEIVE.
11 - d^preread1 CONTROL 22 posted on terminal; READUPDATE posted on
$RECEIVE.