Envoy Application Programming Manual

Table Of Contents
BISYNC Centralized Multipoint Supervisor Protocol
Envoy Application Programming Manual427159-001
4-48
Programming Examples
Example 4-19 shows the sequence when polling is resumed (and no station has data to
send).
The following program Example 4-20
consists of two procedures (poll and select) that
control line operations and two procedures (check^term and write^term) that
control terminal operations. The main execution loop is the doit procedure.
The poll procedure handles the line polling function. If no station responds to the poll,
the poll procedure returns a 0; if a station responds, then the poll procedure returns a 1.
The message is located in the application's line buffer (linebuf).
The select procedure handles message-routing. If the message destination is a tributary
station, the message is formatted and the destination station's select-list entry number is
placed in the message control word. The message is then written to the tributary station.
The doit procedure issues a WRITEREAD to the home terminal and polls the
communications line. A positive response to the poll takes precedence over a READ
completing on the home terminal. Consequently, if a poll responds and the destination of
the message is the home terminal, the READ completion on the home terminal is
remembered and any data read from the terminal is saved. The select procedure is then
called to send the message to the home terminal. If there is no response to a poll and the
READ on the home terminal completes, the select procedure is again called to send the
message.
Example 4-19. Polling Resumed
Supervisor (Local) Tributary (Remote)
line state = WRITE
CALL READ
| EOT -->
|
| (poll) EOT SYN SYN PD ENQ -->
| <-- EOT (station 3)
| (poll) EOT SYN SYN PA ENQ -->
| <-- EOT (station 0)
| (poll) EOT SYN SYN PB ENQ -->
| <-- EOT (station 1)
| (poll) EOT SYN SYN PC ENQ -->
(READ completes) <-- EOT (station 2)
error = 176
line state = CONTROL
MCW.<8:15> = 2