9XTend
‐
NEMA™
RS
‐
232/485
RF
Modem
–
Product
Manual
v2.x4x
[2007.01.04]
©
2007
MaxStream,
Inc.,
Confidential
&
Proprietary
‐
All
Rights
Reserved
47
4.5. API Operation
By default, XTend RF Modems act as a serial line replacement (Transparent Operation) - all UART
data received through the DI pin is queued up for RF transmission. When the modem receives an
RF packet, the data is sent out the DO pin with no additional information.
Inherent to Transparent Operation are the following behaviors:
• If modem parameter registers are to be set or queried, a special operation is required for
transitioning the modem into Command Mode [refer to p22].
• In point-to-multipoint systems, the application must send extra information so that the
receiving modem(s) can distinguish between data coming from different remotes.
As an alternative to the default Transparent Operation, API (Application Programming Interface)
Operations are available. API operation requires that communication with the modem be done
through a structured interface (data is communicated in frames in a defined order). The API spec-
ifies how commands, command responses and modem status messages are sent and received
from the modem using a UART Data Frame.
4.5.1. API Frame Specifications
Two API modes are supported and both can be enabled using the AP (API Enable) command. Use
the following AP parameter values to configure the modem to operate in a particular mode:
• AP = 0 (default): Transparent Operation (UART Serial line replacement)
API modes are disabled.
• AP = 1: API Operation
• AP = 2: API Operation (with escaped characters)
Any data received prior to the start delimiter is silently discarded. If the frame is not received cor-
rectly or if the checksum fails, the data is silently discarded.
API Operation (AP parameter = 1)
When this API mode is enabled (AP = 1), the UART data frame structure is defined as follows:
Figure
4
‐
03. UART
Data
Frame
Structure:
MSB
=
Most
Significant
Byte,
LSB
=
Least
Significant
Byte
API Operation - with Escape Characters (AP parameter = 2)
When this API mode is enabled (AP = 2), the UART data frame structure is defined as follows:
Figure
4
‐
04. UART
Data
Frame
Structure
‐
with
escape
control
characters:
MSB
=
Most
Significant
Byte,
LSB
=
Least
Significant
Byte
Escape characters. When sending or receiving a UART data frame, specific data values must be
escaped (flagged) so they do not interfere with the UART or UART data frame operation. To escape
an interfering data byte, insert 0x7D and follow it with the byte to be escaped XOR’d with 0x20.
Start Delimiter
(Byte 1)
Length
(Bytes 2-3)
Frame Data
(Bytes 4-n)
Checksum
(Byte n + 1)
0x7E
MSB
LSB
API-specific Structure
1 Byte
Start Delimiter
(Byte 1)
Length
(Bytes 2-3)
Frame Data
(Bytes 4-n)
Checksum
(Byte n + 1)
0x7E
MSB
LSB
API-specific Structure
1 Byte
Characters Escaped If Needed