Envoy Application Programming Manual

Table Of Contents
ADM-2 Multipoint Supervisor Protocol
Envoy Application Programming Manual427159-001
7-42
Select and Send Operation
Select and Send Operation
Example 7-20 demonstrates the line-control sequence and program coding to select a
terminal and send a normal message to it. In this example, a message is sent to
terminal 2.
Example 7-20. Select and Send Operation
Application Process Terminal 2
line state = READ
MCW.<6> = 0 (message type = normal)
MCW.<8:15> = 4 (address list entry 4, terminal 2 select)
CALL WRITE(..);
| ACK ->
| <- EOT
| (sel) EOT 22q ENQ ->
| <- ACK
| message ->
| <- ACK
(WRITE completes)
error = 0
line state = CONTROL
The program coding for the above operation is:
PROC send (message, length, entry);
STRING .message; ! message to be sent.
INT length, ! message length.
entry; ! address-list entry number.
BEGIN
STRING .s;
! set entry of terminal to be selected in MCW.
mcw := entry;
! format message.
sline^buf ’:=’ [ STX ] & message FOR length &
[ ETX ] - @s;
! compute length of message.
line^write^count := @s ’-’ @sline^buf[-2];
! send the message.
CALL WRITE (linefnum, linebuf[-1], line^write^count);
IF THEN ... ! bad news.
END; ! send.