Start Delimiter; Length; Frame Data - Digi XBee Cellular LTE Cat 1 User Manual

Embedded modem
Hide thumbs Also See for XBee Cellular LTE Cat 1:
Table of Contents

Advertisement

Operate in API mode
Frame fields
Byte Description

Start delimiter 1

Length

2 - 3

Frame data

4 - n API-specific structure
Checksum
n + 1 1 byte
Escape characters
When sending or receiving a UART data frame, you must escape (flag) specific data values so they do
not interfere with the data frame sequencing. To escape an interfering data byte, insert 0x7D and
follow it with the byte to be escaped XOR'd with 0x20. If not escaped, 0x11 and 0x13 are sent as is.
Data bytes that need to be escaped:
0x7E – Frame delimiter
n
0x7D – Escape
n
0x11 – XON
n
0x13 – XOFF
n
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 previous 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.
Start delimiter
This field indicates the beginning of a frame. It is always 0x7E. This allows the device to easily detect a
new incoming frame.
Length
The length field specifies the total number of bytes included in the frame's data field. Its two-byte
value excludes the start delimiter, the length, and the checksum.
Frame data
This field contains the information that a device receives or will transmit. The structure of frame data
depends on the purpose of the API frame:
Start
delimiter
1
0x7E
MSB
Digi XBee Cellular LTE Cat 1 Embedded Modem User Guide
0x7E
Most Significant Byte, Least Significant Byte
Frame
Length
type
2
3
4
API frame type
LSB
Characters escaped if needed
Frame data
Data
5
6
7
8
9
...
Data
API frame specifications
Checksum
n
n+1
Single byte
71

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents