Envoy Application Programming Manual

Table Of Contents
Software Concepts
Envoy Application Programming Manual427159-001
2-9
Message Formats
Messages must be formatted according to rules determined by the line protocol.
Message formatting involves the embedding of specific control characters in messages.
The purpose of the control characters is to indicate the type of message (such as a start-
of-header [SOH] message versus a text message) and whether the message consists of
transparent text or normal text (DLE STX versus STX).
Prior to transmitting a message, the specific control characters for a particular message
type must be placed in the data by the application process. When a message is received,
the control characters are returned in the data to indicate the type of message received.
Here is an example of message formatting. An application for the BISYNC protocol
inserts control characters in the message as follows:
Normal BISYNC text is indicated by messages of the form:
message = STX—text—ETB
message = STX—text—ETX
(message length = 2 + text length)
Transparent BISYNC text is indicated by messages of the form:
message = DLE STX—text—ETB
message = DLE STX—text—ETX
(message length = 3 + text length)
Note that the format of the message indicates when transparent text is to be transmitted
(DLE STX appears at the start of the text portion of the message). Likewise, the receipt
of transparent text is indicated by the format of the message. Note also that any DLE
control characters generated by the transmitting controller are not included in the
message format (they are automatically deleted by the receiving controller).
For transmitting headings (optionally followed by text):
message = SOH—heading—STX—text—ETB|ETX
message = SOH—heading—ETB
message = SOH—heading—DLE STX—text—ETB|ETX
An application process indicates a transparent text block by including the DLE STX at
the start of the text portion of the message. The sending controller automatically inserts
a DLE ahead of the final ETB or ETX character in the message block. Transparent mode
does not carry over from one WRITE operation to the next. You must explicitly reinitiate
transparent mode (by using DLE STX) for each message block.