
API operation
9XTend-PKG-R RS-232/485 RF Modem User Guide
68
•
0x11 – XON
•
0x13 – XOFF
Example - Raw UART Data Frame (before escaping interfering bytes):
0x7E 0x00 0x02 0x23 0x11 0xCB
0x11 needs to be escaped which results in the following frame:
0x7E 0x00 0x02 0x23 0x7D 0x31 0xCB
Note
In the above example, the length of the raw data (excluding the checksum) is 0x0002 and the checksum of the
non-escaped data (excluding frame delimiter and length) is calculated as:
0xFF - (0x23 + 0x11) = (0xFF - 0x34) = 0xCB.
Checksum
To test data integrity, a checksum is calculated and verified on non-escaped data.
To calculate
: Not including frame delimiters and length, add all bytes keeping only the lowest 8 bits of the result and
subtract from 0xFF.
To verify
: Add all bytes (include checksum, but not the delimiter and length). If the checksum is correct, the sum will
equal 0xFF.
API Types
Frame data of the UART data frame forms an API-specific structure as follows:
The cmdID frame (API-identifier) indicates which API messages will be contained in the cmdData frame (Identifier-
specific data). Refer to the sections that follow for more information regarding the supported API types. Note that
multi-byte values are sent big endian.
RF Modem Status
API Identifier: 0x8A
RF modem status messages are sent from the modem in response to specific conditions.
Length
(Bytes 2-3)
Checksum
(Byte n + 1)
MSB
LSB
1 Byte
Start Delimiter
(Byte 1)
0x7E
Frame Data
(Bytes 4-
n
)
API-specific Structure
Identifier-specific Data
cmdData
API Identifier
cmdID