Updated on Nov 21, 2010.
We released the ZigBee Operator. The ZigBee Operator can create Digi’s ZigBee XBee and 802.15.4’s API package directly. Please check out ZigBee Operator.
Comm Operator 4.3 added a new quick send data panel, which is customized data panel. Customized quick send panel is designed for creating structured data. It supports both text data and binary data.
Structured data is also called as formatted data. It is widely used to store and transfer information. Most of the applications use structured data to transfer information through network and serial port. Most of structured data are in binary data, like data transferred through network. A lot of applications also use structured data in text format, like data from GPS module, and http protocol.
ZigBee module has two ways of communication, AT mode and API mode. AT mode is transparent mode, send data from one module to another just like two serial port connected directly. The remote end will received exactly what the local sends. API mode is different, it transfers data in formatted frame. The data will be formatted according the type. There are several advantage to use API mode, one most important advantage is that there is no need to enter command mode to change the destination address. That makes possible to switch destination quickly, as address of destination is included in the formatted data frame. The disadvantage is that extra work has to be done to create formatted data. In fact, although API mode is more powerful, most of zigbee application use AT mode as AT mode compile the traditional serial port application better.
With customized quick send panel, create formatted data for ZigBee API mode is much easier. It is almost just same as create data in AT mode. Let’s start with sending AT command in API mode.
Here is the API data frame of zigbee AT command
Each data frame is made of start delimiter, length, frame data and check sum.
The start delimiter is always 0x7E.
The length part has two bytes. The first byte is MSB(most significant byte) followed with LSB(least significant byte).
Then comes with Frame data. The length of frame data is variable, depends on command and parameters. It has two parts, command ID which is API identifier and cmdData which is identifier-specific data. The cmdData is made of Frame ID, AT Command and Parameter Value.
The last byte is check sum.
To send structured data in Comm Operator is create a template of customized data.
Here are steps.
Select [View]->[Customized Data] in Comm Operator to open Customzied Data quick send panel.
Click button[Edit] to open customized data editor.
Click [Delete All] to remove items.
Click [New] Add a new data field like below.
Click [New Var] to Add a field for length. We just create a variable field and will work on this later when all other fields are added.
Click [New] to add field for cmdID
Click [New] to add field for Frame ID
Click [New] to add field for AT Command
Click [New] to add field for parameter value
Click [New] to add field for checksum.
Select var “Length” in list and Click button [Edit"]. Select field cmdID and “Frame ID”, “AT Command”, and “Parameter Value” in fields list.
So far, we have created a templated for AT command API data frame.
For example, we want to get high bytes of zigbee modem address, the AT command is “SH”. To send command “SH”, we just input “SH” in “AT Command” Field. Then click “Send “ button.
Here is the API data been sent.
Send:(17:52:48) 7E 00 04 08 01 53 48 5B
The Start Delimiter is “7E”
The length is “00 4E”
The cmd ID is “08”
The Frame ID is “01”
The AT Command is “53 48”, which is ascii code of “SH” in hex
The Checksum is “5B”
To send other AT command, just change the content of field “AT Command” and Parameter Value, the data frame will be created by quick send panel and all variable will be calculated automatically. That make test with ZigBee API mode so easy!