Digi XTend User Manual page 58

Rf module
Table of Contents

Advertisement

Any data received prior to the start delimiter is silently discarded. If the frame is not received correctly 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:
Start Delimiter
(Byte 1)
0x7E
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::
Start Delimiter
(Byte 1)
0x7E
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.
Data bytes that need to be escaped:
0x7E – Frame Delimiter
0x7D – Escape
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
XTend RF Module User Guide
Length
(Bytes 2-3)
MSB
LSB
Length
(Bytes 2-3)
MSB
LSB
API-specific Structure
Characters Escaped If Needed
Frame Data
(Bytes 4-n)
API-specific Structure
Frame Data
(Bytes 4-n)
API operation
Checksum
(Byte n + 1)
1 Byte
Checksum
(Byte n + 1)
1 Byte
58

Advertisement

Table of Contents
loading

Table of Contents