注明1:
[1]到[6]需测试XBEE PRO模块验证其结果。
[1]发送选项0x08不被支持。
[2]发送API帧,最大RF数据负载不是72字节,由AT指令中NP命令查看。
[3]64bit目标地址可以设为0,作为协调器地址。
[4]最大广播半径是32。
[5]在节点识别指示器(0x95)中,AT指令中NO命令可以被用包含DD参数。
[6]14)节点识别指示器帧的结构需确定。
注明2:
nBytes代表字段的大小是可变的。
注明3:
API帧中的转义字符(Escape Characters),AT指令中AP命令参数等于2时。
UART帧的收发就需要注意以下方面:
当发出或者到一个串口的数据帧时,特殊数据值必须进行转义,这样的帧就不会与数据帧序列干扰。
为了转义干扰数据字节,插入0x7D,其后的字节与0x20异或。
需要转义的数据字节有:0x7E,0x7D,0x11,0x13。
转义字符不参于检验和运算。
DIGI XBEE RPO模块API不同类型帧的详细说明:
API Frame Names Values
Modem Status 0x8A
AT Command 0x08
AT Command - Queue Parameter Value 0x09
AT Command Response 0x88
Explicit Addressing ZigBee Command Frame 0x11
ZigBee Receive Packet (AO=0) 0x90
ZigBee Explicit Rx Indicator (AO=1) 0x91
ZigBee IO Da
XBee Sensor Read Indicator (AO=0) 0x94
Node Identification Indicator (AO=0) 0x95
1)MODEM状态帧(RF模块状态信息从模块发出)(什么条件产生此帧)
API标志符:0x8A
API帧的结构:
Start identifier |
Frame Da |
Frame Da |
Checksum |
API帧中字段说明:
Start Identifier:0x7E(1Byte)
Frame Da
Frame Da
Frame Da
API Identifier---0x8A(1Byte)
Identifier specific Da
0=Hardware reset
1=Watchdog timer reset
2=Associated
3=Disassociated
4=Synchronization lost(Beacon-enabled on
5=Coordinator realignment
6=coordinator started
Checksum:0xFF-( Frame Da
2)AT命令帧(使用API帧允许对所有模块参数寄存器进行查询或者设定)
API标志符:0x08
API帧的结构:
Start identifier |
Frame Da |
Frame Da |
Checksum |
API帧中字段说明:
Start Identifier:0x7E(1Byte)
Frame Da
Frame Da
Frame Da
API Identifier---0x08(1Byte)
Identifier specific Da
[Frame ID]:1Byte, Identifies the UART da
ACK(acknowledgement).If set to ‘0’, no response is sent.
[AT command]:2 Bytes, Command Name - Two ASCII characters that identify the AT Command.
[Parameter Value]:n Bytes, If present, indicates the requested parametevalue to set the
Given register.If no characters present, register is queried.
Checksum:0xFF-( Frame Da
3)AT命令-队列参数值帧(使用API帧允许模块参数可以被排列或者设定)(相对“AT命令”类型,新的参数被排队而不被应用,直到“AT命令”类型,或者AC命令发出).
API标志符:0x09
API帧的结构:
Start identifier |
Frame Da |
Frame Da |
Checksum |
API帧中字段说明:
Start Identifier:0x7E(1Byte)
Frame Da
Frame Da
Frame Da
API Identifier---0x09(1Byte)
Identifier specific Da
[Frame ID]:1Byte, Identifies the UART da
ACK(acknowledgement).If set to ‘0’, no response is sent.
[AT command]:2Bytes, Command Name - Two ASCII characters that identify the AT Command.
[Parameter Value]:n Bytes, If present, indicates the requested parametevalue to set the given
register.If no characters present, register is queried.
4)AT命令反馈帧(对AT命令的反馈,一些命令将会反馈多个帧)
API标志符:0x88
API帧的结构:
Start identifier |
Frame Da |
Frame Da |
Checksum |
API帧中字段说明:
Start Identifier:0x7E(1Byte)
Frame Da
Frame Da
Frame Da
API Identifier---0x88(1Byte)
Identifier specific Da
[Frame ID]: 1Byte,Identifies the UART da
AT Command Mode, no AT Command Response will be given.
[ATCommand]:2Bytes,Command Name -Two ASCII characters that identify the AT Command.
[Status]:1Byte
0 = OK
1 = ERROR
2 = Invalid Command
3 = Invalid Parameter
[Value]: nByte,The HEX (non-ASCII) value of the requested register.
5)远程AT命令请求帧(允许远程对模块参数寄存器进行查询或者设定)
API标志符:0x17
API帧的结构:
Start identifier |
Frame Da |
Frame Da |
Checksum |
API帧中字段说明:
Start Identifier:0x7E(1Byte)
Frame Da
Frame Da
Frame Da
API Identifier---0x17(1Byte)
Identifier specific Da
DestinationNetwork Address] + [Command Options] + [Command Name]+[Command Da
[FrameID]: 1Byte,Identifies the UART da
ACK(acknowledgement).If set to ‘0’, no AT Command Response will be given.
[64-bit-Destination-Address]:8Bytes,Set to match the 64-bit address of the destination, MSB
first,LSB last. Broadcast =0x000000000000FFFF.
[16-bit-Destination-Network-Address]:2Bytes,Set to match the 16-bit network address of the
destination, MSBfirst, LSB last. Set to 0xFFFE for broadcast TX, or if the network
address is unknown.
[Command Options]: 1Byte,0x02 - Apply changes on remote. (If not set, AC command must be
Sent before changes will take effect.)All other bits must be set to 0.
[Command Name]:2Bytes, Name of the command
[Command Da
register. If no characters present,the register is queried.
6)远程命令反馈(相对于远程AT命令请求)
API标志符:0x97
API帧的结构:
Start identifier |
Frame Da |
Frame Da |
Checksum |
API帧中字段说明:
Start Identifier:0x7E(1Byte)
Frame Da
Frame Da
Frame Da
API Identifier---0x97(1Byte)
Identifier specific Da
Responder Network Address] + [AT Command]+[Status] + [Value]
[Frame ID]: 1Byte, Identifies the UART da
[64-bit Responder Address]: 8Bytes,Indicates the 64-bit address of the remote module that is
responding to the Remote AT Command request
[16-bit Responder Network Address]: 2Bytes,Set to the 16-bit network address of the remote.
Set to 0xFFFE if unknown.
[AT Command]:2Bytes,Command Name -Two ASCII characters that identify the AT Command.
[Status]:1Byte
0 = OK
1 = ERROR
2 = Invalid Command
3 = Invalid Parameter
[Value]: n Bytes,The HEX (non-ASCII) value of the requested register.
7)Zigbee发送请求帧(TX请求消息将使模块发出RF包)TX包帧
API标志符:0x10
API帧的结构:
Start identifier |
Frame Da |
Frame Da |
Checksum |
API帧中字段说明:
Start Identifier:0x7E(1Byte)
Frame Da
Frame Da
Frame Da
API Identifier---0x10(1Byte)
Identifier specific Da
DestinationNetwork Address] + [Broadcast Radius] + [Options] + [ RF Da
[FrameID]: 1Byte,Identifies the UART da
ACK(acknowledgement).If set to ‘0’, no AT Command Response will be given.
[64-bit-Destination-Address]:8Bytes,Set to match the 64-bit address of the destination, MSB
first,LSB last. Broadcast =0x000000000000FFFF.
[16-bit-Destination-Network-Address]:2Bytes,Set to match the 16-bit network address of the
destination, MSBfirst, LSB last. Set to 0xFFFE for broadcast TX, or if the network
address is unknown.
[Broadcast Radius]: 1Byte, Sets maximum number of hops a braodcast transmission can
traverse. If set to 0, the TX raidus will be set to the maximum hop value (10).
[Options]:1Bytes, 0x08 =Send multicast transmission. (Unicast set if not sent.) All other bits
Must be set to 0.
[RF Da
8) Explicit Addressing ZigBee命令帧(帧中允许应用层区域“终端和簇ID”被指定)
API标志符:0x11
API帧的结构:
Start identifier |
Frame Da |
Frame Da |
Checksum |
API帧中字段说明:
Start Identifier:0x7E(1Byte)
Frame Da
Frame Da
Frame Da
API Identifier---0x11(1Byte)
Identifier specific Da
DestinationNetwork Address] + [Source endpoint] + [Destination endpoint] + [Cluster ID] +
[Pro
[FrameID]: 1Byte,Identifies the UART da
ACK(acknowledgement).If set to ‘0’, no AT Command Response will be given.
[64-bit-Destination-Address]:8Bytes,Set to match the 64-bit address of the destination, MSB
first,LSB last. Broadcast =0x000000000000FFFF.
[16-bit-Destination-Network-Address]:2Bytes,Set to match the 16-bit network address of the
destination, MSBfirst, LSB last. Set to 0xFFFE for broadcast TX, or if the network
address is unknown.
[Source endpoint]: 1Byte,Source endpoint for the transmission.
[Destination endpoint]: 1Byte, Destination endpoint for the transmission.
[Cluster ID]:2 Bytes,Cluster ID used in the transmission
[Pro
[Broadcast Radius]: 1Byte, Sets the maximum number of hops a broadcast transmission
can traverse. If set to 0, the transmission radius will be set tothe network maximum hops value.
[Options]:1Bytes, Set to 0
[RF Da
RF da
9)ZigBee发送状态帧(TX状态帧,TX请求完成时,模块会发出状态信息,这个信息将给出数据包是否被成功发送,或者发送失败)
API标志符:0x8B
API帧的结构:
Start identifier |
Frame Da |
Frame Da |
Checksum |
API帧中字段说明:
Start Identifier:0x7E(1Byte)
Frame Da
Frame Da
Frame Da
API Identifier---0x8B(1Byte)
Identifier specific Da
Count] + [Delivery Status] + [Discovery Status]
[FrameID]:1Byte, Identifies UART da
[Remote Network Address]: 2Byte, 16-bit Network Address the packet was delivered to
(if success). If not success, this address matches the Destination Network Address that was provided in the Transmit Request Frame.
[Transmit Retry Count]: 1Byte, The number of applicationtransmission retries that took place.
[Delivery Status]: 1Byte,
0x00 = Success
0x02 = CCA Failure?
0x15 = Invalid destination endpoint
0x21 = Network ACK Failure
0x22 = Not Joined to Network
0x23 = Self-addressed
0x24 = Address Not Found
0x25 = Route Not Found
[Discovery Status]: 1Byte,
0x00 = No Discovery Overhead
0x01 = Address Discovery
0x02 = Route Discovery
0x03 = Address and Route Discovery
10)ZigBee接收帧(RX包帧,模块收到RF包时,将把RF信息发出到UART)
API标志符:0x90
API帧的结构:
Start identifier |
Frame Da |
Frame Da |
Checksum |
API帧中字段说明:
Start Identifier:0x7E(1Byte)
Frame Da
Frame Da
Frame Da
API Identifier---0x90(1Byte)
Identifier specific Da
[64-bit Address]:8Bytes
[16-bit Network Address]:2 Bytes
[Options]:1Byte,
0x01 - Packet Acknowledged
0x02 - Packet was a broadcast packet
[RF Da
11) ZigBee Explicit RX指示器帧(模块收到RF包时,将把RF信息发到UART,AO=1)
API标志符:0x91
API帧的结构:
Start identifier |
Frame Da |
Frame Da |
Checksum |
API帧中字段说明:
Start Identifier:0x7E(1Byte)
Frame Da
Frame Da
Frame Da
API Identifier---0x91(1Byte)
Identifier specific Da
+ [Source endpoint] + [Destination endpoint] + [Cluster ID] + [Pro
Radius] + [Options] + [RF Da
[64-bit Source Address]:8Bytes,
[16-bit Source Network Address]:2Bytes,
[Source endpoint]: 1Byte,Source endpoint for the transmission.
[Destination endpoint]: 1Byte, Destination endpoint for the transmission.
[Cluster ID]:2 Bytes, Cluster ID the packet was addressed to.
[Pro
not yet supported.)
[Broadcast Radius]: 1Byte, Sets the maximum number of hops a broadcast transmission
can traverse. If set to 0, the transmission radius will be set tothe network maximum hops value.
[Options]:1Bytes,
0x01 – Packet Acknowledged
0x02 – Packet was a broadcast packet
[RF Da
RF da
12) ZigBee IO数据采样Rx 指示器帧(模块从远程设备收到I/O采样帧时,会将数据帧发出到串口)
API标志符:0x92
API帧的结构:
Start identifier |
Frame Da |
Frame Da |
Checksum |
API帧中字段说明:
Start Identifier:0x7E(1Byte)
Frame Da
Frame Da
Frame Da
API Identifier---0x92(1Byte)
Identifier specific Da
Options] + [Num Samples] + [Digital Channel Mask] + [Analog Channel Mask] + [Digital
Samples] + [Analog Samples]
[64-bit Address]:8Bytes,
[16-bit Network Address]:2Bytes,
[Receive Options]:1Byte,
0x01 - Packet Acknowledged
0x02 - Packet was a broadcast packet
[Num Samples]:1Byte,Number of sample sets included in the payload. (Always set to 1)
[Digital Channel Mask]:2Bytes,Bitmask field that indicates which digital IO lines on the
remote have sampling enabled (if any)
[Analog Channel Mask]:1Byte, Bitmask field that indicates which Analog IO lines on the
remote have sampling enabled (if any).
[Digital Samples]:2Bytes, If the sample set includes any digital IO lines (Digital Channel Mask > 0), these two bytes contain samples for all enabled digital inputs. DIO lines that do not have sampling enabled return 0. Bits in these 2 bytes map the same as they do in the Digital Channels Mask field.
[Analog Samples]: 2 bytes each sample, If the sample set includes any analog input lines
(Analog Channel Mask > 0), each enabled analog input returns a 2-byte value indicating the A/D measurement of that input. Analog samples are ordered sequentially from AD0/DIO0 to AD3/DIO3, to the supply voltage.
13)XBee传感器读取指示器帧(暂不)
14)节点识别指示器帧(当模块发送节点信息给协调器以标志它自己时,协调将收到这个帧.“AO=0”.这个帧的数据部分与节点发现反馈帧相似.“AT指令中的ND命令”)
(帧的结构需通过模块验证)
余锡钱,09-08-28整理
DIGI XBEE RPO模块重要的AT命令说明(调试过程中验证):