API operation API frames
XBee/XBee-PRO ZigBee RF Modules User Guide 130
Suppose an IO sample is received with analog and digital IO, from a remote with a 64-bit address of 0x0013A200
40522BAA and a 16-bit address of 0x7D84. If pin AD1/DIO1 is enabled as an analog input, AD2/DIO2 and DIO4 are
enabled as a digital inputs (currently high), and AD3/DIO3 is enabled as a digital output (low) the IO sample is
shown in the API example in the table above.
Frame-specific
Data
16-bit Source
Network Address
MSB 12 0x7D
16-bit address of sender
LSB 13 0x84
Receive Options
14 0x01
0x01 - Packet Acknowledged
0x02 - Packet was a broadcast packet
Number of Samples
15 0x01
Number of sample sets included in the payload
(Always set to 1)
Digital Channel
Mask*
16 0x00
Bitmask field that indicates which digital IO lines on the
remote have sampling enabled (if any)
17 0x1C
Analog Channel
Mask**
18 0x02
Bitmask field that indicates which analog IO lines on the
remote have sampling enabled (if any)
Digital Samples (if
included)
19 0x00
If the sample set includes any digital IO lines (Digital Channel
Mask > 0), these two bytes contain samples for all enabled
digital IO lines
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
20 0x14
Analog Sample
21 0x02
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
22 0x25
Checksum
23 0xF5
0xFF - the 8 bit sum of bytes from offset 3 to this byte
* N/A N/A N/A CD/DIC12 PWM/DI011 RSSI/DIO10 N/A N/A
CTS/DI07 RTS/DI06 ASSOC/DI05 DI04 AD3/DI03 AD2/DI02 AD1/DIO1 AD0/DIO0
** Supply Voltage N/A N/A N/A AD3 AD2 AD1 AD0
Frame Fields Offset Example Description