Envoy Application Programming Manual

Table Of Contents
ADM-2 Multipoint Supervisor Protocol
Envoy Application Programming Manual427159-001
7-44
Sending a Broadcast-Select Message
Example 7-22 shows the program coding for the broadcast-select operation shown in
Example 7-21.
Example 7-22. Program Code for a Broadcast-Select Message
PROC broadcast (message, length);
STRING .message; ! message to be sent.
INT length; ! message length.
BEGIN
INT count;
STRING .s;
! clear message control word.
mcw := 0;
! set message type = special.
mcw.<6> := 1;
! format message.
sline^buf := [ EOT ];
@s := @sline^buf[1];
! insert terminal address list entry numbers in
! message.
count := -1;
WHILE (count := count + 1) < poll^count DO
BEGIN
s := "t"; ! broadcast select
! function code.
s[1] := count + poll^count; ! address-list entry
! number.
s[2] := 0; ! place holder.
@s := @s[3];
end;
! insert text to be broadcast.
s ’:=’ [ 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; ! broadcast.