Envoy Application Programming Manual

Table Of Contents
BISYNC Point-To-Point Protocol
Envoy Application Programming Manual427159-001
3-27
WRITEREAD Procedure (Limited Conversational
Exchange)
The file-system errors for a continuation WRITEREAD are the same as for a
continuation WRITE.
Initial WRITEREAD (Line in READ State, Last state was
CONTROL or WRITE)
A WRITEREAD while the line is in the READ state is used to acknowledge a message
from the remote station by returning a message. The action of an initial WRITEREAD
while the line is in the READ state is the same as that for a call to WRITEREAD while
the line is in the WRITE state.
Continuation WRITEREAD (Line in READ State, Last State was
READ)
A continuation WRITEREAD while the line is in READ state is not permitted for
limited conversational mode according to the BISYNC protocol. A second call to
WRITEREAD while the line is in the READ state would be an attempt to acknowledge
two consecutive messages with messages.
In this case, the call completes with a condition code of CCL and a file-system error 160
(request is invalid for device state; protocol error).
WRITEREAD Procedure (ID Exchange by Caller)
If an ID exchange is to take place, the line must first be configured for ID exchange
when issuing the ADD DEVICE command or with a call to the SETMODE procedure.
The WRITEREAD procedure is used by the caller to send its ID to the remote station
and to bid for the line at the same time (Example 3-10
). This WRITEREAD call also
allows the caller to read the ID from the remote station. The ID followed by an ENQ
must be formatted by the application process in the buffer of the application process.
The call to the WRITEREAD procedure completes when the remote station either
returns its ID followed by either ACK0 or NAK (either of which is returned to the buffer
of the application process) or returns a message.
Example 3-9. Continuation WRITEREAD (Line in WRITE State)
Local Remote
line state = WRITE
CALL WRITEREAD(...)
| message n -->
| <-- ACKn or message 1
|
(WRITE completes)
error = 0
line state = WRITE
if ACKn received
or
line state = READ
if message received