I/O support
On-demand sampling
Digi XBee® 3 802.15.4 RF Module User Guide
97
Example: Local AT command in API mode
The
IS
command sent to a local device in API mode would use a
or
Command - Queue Parameter Value frame - 0x09
frame:
7E 00 04 08 53 49 53 08
The device responds with a
AT Command Response frame - 0x88
that contains the
:
7E 00 0F 88 53 49 53 00 01 0C 0C 03 04 08 03 D0 01 24 68
This example uses the
, if you use the legacy format (
AO
=
2
or data is
received from an S1 or S2C device) then see the
for information on how this data
is structured.
Output Field
Description
7E
Start
Delimiter
Indicates the beginning of an API frame
00 0F
Length
Length of the packet
88
Frame type
AT Command response frame
53
Frame ID
This ID corresponds to the Frame ID of the 0x08 request
49 53
AT Command
Indicates the AT command that this response corresponds to
0x49 0x53 =
IS
00
Status
Indicates success or failure of the AT command
00
= OK
if no I/O lines are enabled, this will return 01 (ERROR)
01
One sample set
0C 0C
Digital channel mask, indicates which digital lines are sampled
(0x0C0C = 0000
11
00 0000
11
00b = DIO2, 3, 10, 11)
03
Analog channel mask, indicates which analog lines are sampled
(0x03 = 0000 00
11
b = AD0, 1)
04 08
Digital sample data that corresponds with the digital channel mask
0x0408 = 0000
01
00 0000
10
00b = DIO3 and DIO10 are high, DIO2 and
DIO11 are low
03 D0
Analog sample data for AD0
01 24
Analog sample data for AD1
68
Checksum
Can safely be discarded on received frames
Example: Remote AT command in API mode
The
IS
command sent to a remote device with an address of 0013A200 12345678 uses a
7E 00 0F 17 87 00 13 A2 00 12 34 56 78 FF FE 00 49 53 FF
The
from the device is returned in a
Remote Command Response frame - 0x97
frame
with the sample data as the parameter value:
7E 00 19 97 87 00 13 A2 00 12 34 56 78 00 00 49 53 00 01 0C 0C 03 04 08 03 FF 03 FF 50