Api Operation; Api Frame Specifications - Digi XBee-PRO 900 Instruction Manual

Oem rf modules
Table of Contents

Advertisement

5.  API Operation
Downloaded from
Elcodis.com
electronic components distributor
As an alternative to Transparent Operation, API (Application Programming Interface) Operations
are available. API operation requires that communication with the module be done through a
structured interface (data is communicated in frames in a defined order). The API specifies how
commands, command responses and module status messages are sent and received from the
module using a UART Data Frame.

API Frame Specifications

Two API modes are supported and both can be enabled using the AP (API Enable) command. Use
the following AP parameter values to configure the module to operate in a particular mode:
• AP = 1: API Operation
• AP = 2: API Operation (with escaped characters)
API Operation (AP parameter = 1)
When this API mode is enabled (AP = 1), the UART data frame structure is defined as follows:
UART Data Frame Structure:
Start Delimiter
Length
(Byte 1)
(Bytes 2-3)
0x7E
MSB
MSB = Most Significant Byte, LSB = Least Significant Byte
Any data received prior to the start delimiter is silently discarded. If the frame is not received
correctly or if the checksum fails, the module will reply with a module status frame indicating the
nature of the failure.
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:
Start Delimiter
Length
(Byte 1)
(Bytes 2-3)
0x7E
MSB
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.
© 2008 Digi International, Inc.
Frame Data
(Bytes 4-n)
LSB
API-specific Structure
Frame Data
(Bytes 4-n)
LSB
API-specific Structure
Characters Escaped If Needed
Checksum
(Byte n + 1)
1 Byte
Checksum
(Byte n + 1)
1 Byte
     25

Advertisement

Table of Contents
loading

This manual is also suitable for:

Digimesh 900

Table of Contents