Hardware Reference
In-Depth Information
Sending Commands
There are two frame types that affect the local module:
AT
command frame (
0x08
), which will immediately change values.
•
The
AT
command queue (
0x09
), which holds changes until the apply-changes (
AC
) command
has been issued or a subsequent
AT
command (
0x08
) is sent.
The ability to send
AT
commands to a remote module is a unique function that is not available in AT command
mode. Sending remote
AT
commands uses a frame type of
0x17
and is constructed in a similar fashion as the local
AT
frame (
0x08
). There is extra data contained in the frame data section after the frame ID byte:
•
The
•
First is the 64-bit destination address followed by the 16-bit network address. For the example
following, (
0x00 00 00 00 00 00 FF FF
) will be used for the 64-bit and (
0xFF FE
) for 16-bit.
0x00
as the
AT
command
queue and needs the
AC
command to finalize the changes. The other options for the command
option byte are
0x02
to apply the changes immediately,
0x20
to use encryption if globally set
in the
EE
register, and
0x40
to use a longer transmission timeout. Settings
0x00
and
0x02
are
the only two of interest for this example.
•
The next byte is a command option; it has the same effect if set to
AT
command is after the command option byte; the node-discovery command will be
used for this packet to see what the ROUTER module can transmit to.
•
The
The example packet is the following:
0x7E 0x00 0x0F 0x17 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0xFF 0xFF 0xFF 0xFE 0x00 0x4E 0x44 0x5A
The example packet sends a request to all devices on the network, asking for those modules to perform a node
discovery and send back their findings to the originating device. The return packet follows the same structure as any
other packet, with the header, frame data, and checksum being in the same order. The returned packet's frame data
has the 64- and 16-bit network address of the remote module added between the frame ID and the command bytes.
The frame data is identical in structure to the local command, excluding the added address bytes. The value for this
frame type is
0x97
.
The example remote
AT
command packet will execute on all the modules that can hear the coordinator. On
large networks this can cause talk-over communication packet corruptions and is not advisable. In some situations
broadcasting a change-setting packet is needed, as when changing the pan ID of the whole network or changing
encryption settings. When changing settings across an entire network, change and apply the settings to the remote
modules before changing the local module.
Sending Data
Up to this point, configuration packets have been constructed and sent, but no data has been sent through to the
Arduino that is connected to the serial program. The packets for sending data are constructed in the same order as the
AT
command packets, with the frame IDs being
0x10
and
0x11
.
0x10
data packets are general-purpose data containers that leave the network routing up
to the modules.
•
The
0x11
packets have more options on how the packet should reach its destination.
•
In contrast,