Envoy Application Programming Manual

Table Of Contents
BISYNC Point-To-Point Protocol
Envoy Application Programming Manual427159-001
3-28
WRITEREAD Procedure (Limited Conversational
Exchange)
If an ID ACK0 sequence is returned, the remote station has accepted the ID (and the line
bid) and the line state is WRITE. At this point, the caller should verify the ID that was
returned. If the ID is not valid, the caller disconnects the line (or performs some
corresponding action). If the ID is valid, text can be sent in subsequent calls to WRITE
or WRITEREAD (which are continuation operations) or the caller can send an EOT
sequence.
If an ID NAK sequence is returned, the remote station has rejected the ID. The line state
then is CONTROL.
If a message is returned, the ID exchange sequence is not being performed by the remote
and the line state is READ. In this case, the caller disconnects the line.
WRITEREAD Procedure (ID Exchange by Called Station)
The WRITEREAD procedure is used by the called station, following a READ and the
acceptance of the caller’s ID, to send its ID back to the caller and to read the first
message. The called station’s ID, followed by an ACK0, must be formatted in the buffer
of the application process. The call to WRITEREAD procedure (Example 3-11
)
completes when the remote station sends a message, when it sends an EOT sequence, or
when the operation times out.
If a message is returned, the caller has accepted the called station’s ID and the line state
is READ. A returned EOT sequence also indicates that the ID has been accepted by the
caller. In this case, the line state is CONTROL.
Example 3-10. WRITEREAD Procedure (ID Exchange by Caller)
Local Remote
line state = CONTROL
CALL WRITEREAD(...)
| (bid) ID ENQ -->
| <-- ID ACK0 or
| ID NAK or
| message
|
(WRITEREAD completes)
error = 0
line state = WRITE
if ID ACK0 received
or
line state = CONTROL
if ID NAK received
or
line state = READ
if message received