FreakLabs FreakZ Simulator and Hardware
Command- Line Interface
User Guide
1.
INTRO ..................................................................................................................................... 4
2. FILE STRUCTURE.................................................................................................................... 5
3. SIMULATOR SPECIFIC COMMANDS ......................................................................................... 7
3.1 Add Node ......................................................................................................................... 7
3.2 List Nodes ....................................................................................................................... 7
3.3 Send command to Node .................................................................................................. 7
4. STARTING AND JOINING NODES ............................................................................................. 9
5. COMMAND LINE COMMANDS................................................................................................ 10
5.1 General App Commands............................................................................................... 10
5.1.1 Hello ......................................................................................................................................10
5.1.2 Zigbee Start...........................................................................................................................10
5.1.3 Dump NIB............................................................................................................................. 11
5.1.4 Dump PIB ............................................................................................................................. 11
5.1.5 Show Used Buffers ............................................................................................................... 11
5.1.6 Dump Neighbor Table ..........................................................................................................12
5.1.7 Dump Routing Table.............................................................................................................12
5.1.8 Dump Binding Table.............................................................................................................12
5.1.9 Dump Group Table ...............................................................................................................13
5.1.10 Add Binding Entry..............................................................................................................13
5.1.11 Remove Binding Entry .......................................................................................................13
5.1.12 Add Group Entry ................................................................................................................14
5.1.13 Remove Group Entry..........................................................................................................14
5.2 ZCL Commands ............................................................................................................ 15
5.2.1 Read Attribute ......................................................................................................................15
5.2.2 Write Attribute......................................................................................................................15
5.2.3 Discover Attributes...............................................................................................................16
5.2.4 Configure Report ..................................................................................................................17
5.2.5 Identify..................................................................................................................................17
5.2.6 On/Off....................................................................................................................................18
5.2.7 Move to Level........................................................................................................................18
5.2.8 Level Move ............................................................................................................................19
5.2.9 Level Step .............................................................................................................................19
5.2.10 Level Stop ...........................................................................................................................20
5.3 ZDO Commands............................................................................................................ 20
5.3.1 Network Address Request ....................................................................................................20
5.3.2 IEEE Address Request .........................................................................................................21
5.3.3 End Device Bind ...................................................................................................................21
5.3.4 LQI Request ..........................................................................................................................22
5.3.5 Network Leave Request .......................................................................................................23
5.3.6 ZDO Leave Request ..............................................................................................................23
5.3.7 Network Discovery Request .................................................................................................23
5.3.8 Permit Join Request .............................................................................................................24
5.4 Raw Data Commands................................................................................................... 24
5.4.1 Unicast Data Request...........................................................................................................24
5.4.2 Reliable Unicast Data Request ............................................................................................24
5.4.3 Indirect Data Request ..........................................................................................................25
5.4.4 Group Data Request .............................................................................................................25
1. Intro
The FreakZ simulator and raven-usb hardware build both have identical command line interfaces
that can be used to access many of the Zigbee application level functions. This document is a
guide on how to use the commands in the command line interface as well as hardware setup,
simulator setup, and command line file hierarchy.
2. File Structure
The files that govern the command line application interface are located in the <root
dir>/test/test_sim and <root dir>/test/test_avr_ravenusb directories. They follow this basic
hierarchy:
toplevel
controller
test_zdo.c test_zcl.c test_data.c
test_app.c
toplevel controller – This file is named test_sim.c for the simulator and test_avr_ravenusb.c for
the raven usb sticks. It contains the main communication routines for communicating with the
node. In the case of the simulator, it has the OSes pipe communication initialization routines
which allows it to talk to the command shell, sim.exe. In the USB sticks, test_avr_ravenusb.c
contains the USB/serial rx handler which parses the received data and sends it to the command
line located in test_app.
test_app.c – This is the main application code for the command line and contains the command
table, menu, and command line parsing. New commands would need to be added to the
command table before they could be used by the command line. This file also contains basic
functions that are not part of the ZCL or ZDO and are used mainly for debugging and testing.
test_zdo.c – This file specifies the ZDO endpoint and contains all ZDO specific functions. These
commands act directly on the ZDO endpoint of the FreakZ Zigbee stack.
test_zcl.c – This file specifies the TEST_ZCL endpoint and contains all ZCL specific functions.
The commands in this file act directly on the ZCL endpoint of the FreakZ Zigbee stack.
test_data.c – This file contains a manufacturer specific (to FreakLabs, hehe) endpoint and
contains generic data transfer functions. This endpoint exists so that the user can transmit and
receive raw data without worrying about going through the ZDO or ZCL. This is useful if they add