EasyManuals Logo

Digi XBEE2 User Manual

Digi XBEE2
195 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #110 background imageLoading...
Page #110 background image
API operation API frame specifications
XBee/XBee-PRO ZigBee RF Modules User Guide 110
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:
UART data frame structure - with escape control characters:
Note 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 data frame sequencing. To escape an interfering data byte, insert 0x7D
and follow it with the byte to be escaped XOR’d with 0x20. Note that, if not escaped, 0x11 and 0x13 is sent as is.
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 a 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:
UART data frame and API-specific structure:
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
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

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Digi XBEE2 and is the answer not in the manual?

Digi XBEE2 Specifications

General IconGeneral
BrandDigi
ModelXBEE2
CategoryControl Unit
LanguageEnglish

Related product manuals