Length; Frame Data - Digi XBee ZNet 2.5 Product Manual

Oem rf modules
Table of Contents

Advertisement

Figure 33: UART data frame structure with escape control characters.
Escape characters
When sending or receiving a UART data frame, specific data values must be escaped (flagged) 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.
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.

Length

The length field has two-byte value that specifies the number of bytes that will be contained in the
frame data field. It does not include the checksum field.

Frame data

Frame data of the UART data frame forms an API-specific structure as follows:
XBee ZNet 2.5 / XBee PRO Znet 2.5 OEM RF Modules Product Manual
Start Delimiter
Length
(Byte 1)
(Bytes 2-3)
0x7E
MSB
MSB = Most Significant Byte, LSB = Least Significant Byte
Frame Data
(Bytes 4-n)
LSB
API-specific Structure
Characters Escaped If Needed
API frame specifications
Checksum
(Byte n + 1)
1 Byte
60

Advertisement

Table of Contents
loading

This manual is also suitable for:

Xbee pro znet 2.5

Table of Contents