initial check in
authorTony Cave <t-cave@ti.com>
Thu, 18 Dec 2014 00:05:00 +0000 (00:05 +0000)
committerTony Cave <t-cave@ti.com>
Thu, 18 Dec 2014 00:05:00 +0000 (00:05 +0000)
221 files changed:
Manifest.html [new file with mode: 0755]
README.MD [new file with mode: 0755]
README.html [new file with mode: 0755]
docs/ZNP Host User's Guide.pdf [new file with mode: 0755]
examples/ZNP Host Users Guide.pdf [new file with mode: 0644]
examples/cmdLine/build/gnu/Makefile [new file with mode: 0644]
examples/cmdLine/build/gnu/main.c [new file with mode: 0755]
examples/cmdLine/build/tirtos/ccs/.ccsproject [new file with mode: 0644]
examples/cmdLine/build/tirtos/ccs/.cproject [new file with mode: 0644]
examples/cmdLine/build/tirtos/ccs/.project [new file with mode: 0644]
examples/cmdLine/build/tirtos/ccs/EK_TM4C1294XL.cmd [new file with mode: 0644]
examples/cmdLine/build/tirtos/ccs/macros.ini_initial [new file with mode: 0644]
examples/cmdLine/build/tirtos/ccs/src/.exclude [new file with mode: 0755]
examples/cmdLine/build/tirtos/ccs/src/makefile.libs [new file with mode: 0755]
examples/cmdLine/build/tirtos/ccs/src/sysbios/BIOS.obj [new file with mode: 0755]
examples/cmdLine/build/tirtos/ccs/src/sysbios/dmtimer_Timer_asm.obj [new file with mode: 0755]
examples/cmdLine/build/tirtos/ccs/src/sysbios/ducati_CTM_asm.obj [new file with mode: 0755]
examples/cmdLine/build/tirtos/ccs/src/sysbios/ducati_Core_asm.obj [new file with mode: 0755]
examples/cmdLine/build/tirtos/ccs/src/sysbios/m3_Clobber_asm.obj [new file with mode: 0755]
examples/cmdLine/build/tirtos/ccs/src/sysbios/m3_Hwi_asm.obj [new file with mode: 0755]
examples/cmdLine/build/tirtos/ccs/src/sysbios/m3_Hwi_asm_switch.obj [new file with mode: 0755]
examples/cmdLine/build/tirtos/ccs/src/sysbios/m3_IntrinsicsSupport_asm.obj [new file with mode: 0755]
examples/cmdLine/build/tirtos/ccs/src/sysbios/m3_TaskSupport_asm.obj [new file with mode: 0755]
examples/cmdLine/build/tirtos/ccs/src/sysbios/makefile [new file with mode: 0755]
examples/cmdLine/build/tirtos/ccs/src/sysbios/omap4430_Power_resumeCpu.obj [new file with mode: 0755]
examples/cmdLine/build/tirtos/ccs/src/sysbios/omap4430_Power_saveCpu.obj [new file with mode: 0755]
examples/cmdLine/build/tirtos/ccs/src/sysbios/smp_Power_resumeCpu.obj [new file with mode: 0755]
examples/cmdLine/build/tirtos/ccs/src/sysbios/smp_Power_saveCpu.obj [new file with mode: 0755]
examples/cmdLine/build/tirtos/ccs/src/sysbios/sysbios.aem4f [new file with mode: 0755]
examples/cmdLine/build/tirtos/ccs/target_config.ccxml [new file with mode: 0644]
examples/cmdLine/build/tirtos/ccs/ti_rtos.cfg [new file with mode: 0644]
examples/cmdLine/build/tirtos/main.c [new file with mode: 0755]
examples/cmdLine/build/windows/Makefile [new file with mode: 0644]
examples/cmdLine/build/windows/cmdLineBuild/cmdLineBuild.cbp [new file with mode: 0644]
examples/cmdLine/build/windows/cmdLineBuild/cmdLineBuild.layout [new file with mode: 0644]
examples/cmdLine/build/windows/main.c [new file with mode: 0644]
examples/cmdLine/cmdLine.c [new file with mode: 0644]
examples/cmdLine/cmdLine.h [new file with mode: 0755]
examples/dataSendRcv/build/gnu/Makefile [new file with mode: 0644]
examples/dataSendRcv/build/gnu/main.c [new file with mode: 0644]
examples/dataSendRcv/build/tirtos/ccs/.ccsproject [new file with mode: 0644]
examples/dataSendRcv/build/tirtos/ccs/.cproject [new file with mode: 0644]
examples/dataSendRcv/build/tirtos/ccs/.project [new file with mode: 0644]
examples/dataSendRcv/build/tirtos/ccs/EK_TM4C1294XL.cmd [new file with mode: 0644]
examples/dataSendRcv/build/tirtos/ccs/macros.ini_initial [new file with mode: 0644]
examples/dataSendRcv/build/tirtos/ccs/src/.exclude [new file with mode: 0755]
examples/dataSendRcv/build/tirtos/ccs/src/makefile.libs [new file with mode: 0755]
examples/dataSendRcv/build/tirtos/ccs/src/sysbios/BIOS.obj [new file with mode: 0755]
examples/dataSendRcv/build/tirtos/ccs/src/sysbios/dmtimer_Timer_asm.obj [new file with mode: 0755]
examples/dataSendRcv/build/tirtos/ccs/src/sysbios/ducati_CTM_asm.obj [new file with mode: 0755]
examples/dataSendRcv/build/tirtos/ccs/src/sysbios/ducati_Core_asm.obj [new file with mode: 0755]
examples/dataSendRcv/build/tirtos/ccs/src/sysbios/m3_Clobber_asm.obj [new file with mode: 0755]
examples/dataSendRcv/build/tirtos/ccs/src/sysbios/m3_Hwi_asm.obj [new file with mode: 0755]
examples/dataSendRcv/build/tirtos/ccs/src/sysbios/m3_Hwi_asm_switch.obj [new file with mode: 0755]
examples/dataSendRcv/build/tirtos/ccs/src/sysbios/m3_IntrinsicsSupport_asm.obj [new file with mode: 0755]
examples/dataSendRcv/build/tirtos/ccs/src/sysbios/m3_TaskSupport_asm.obj [new file with mode: 0755]
examples/dataSendRcv/build/tirtos/ccs/src/sysbios/makefile [new file with mode: 0755]
examples/dataSendRcv/build/tirtos/ccs/src/sysbios/omap4430_Power_resumeCpu.obj [new file with mode: 0755]
examples/dataSendRcv/build/tirtos/ccs/src/sysbios/omap4430_Power_saveCpu.obj [new file with mode: 0755]
examples/dataSendRcv/build/tirtos/ccs/src/sysbios/smp_Power_resumeCpu.obj [new file with mode: 0755]
examples/dataSendRcv/build/tirtos/ccs/src/sysbios/smp_Power_saveCpu.obj [new file with mode: 0755]
examples/dataSendRcv/build/tirtos/ccs/src/sysbios/sysbios.aem4f [new file with mode: 0755]
examples/dataSendRcv/build/tirtos/ccs/target_config.ccxml [new file with mode: 0755]
examples/dataSendRcv/build/tirtos/ccs/ti_rtos.cfg [new file with mode: 0644]
examples/dataSendRcv/build/tirtos/main.c [new file with mode: 0755]
examples/dataSendRcv/build/windows/Makefile [new file with mode: 0644]
examples/dataSendRcv/build/windows/dataSendRcvBuild/dataSendRcvBuild.cbp [new file with mode: 0644]
examples/dataSendRcv/build/windows/dataSendRcvBuild/dataSendRcvBuild.layout [new file with mode: 0644]
examples/dataSendRcv/build/windows/main.c [new file with mode: 0644]
examples/dataSendRcv/dataSendRcv.c [new file with mode: 0644]
examples/dataSendRcv/dataSendRcv.h [new file with mode: 0755]
examples/nwkTopology/build/gnu/Makefile [new file with mode: 0644]
examples/nwkTopology/build/gnu/main.c [new file with mode: 0755]
examples/nwkTopology/build/tirtos/ccs/.ccsproject [new file with mode: 0644]
examples/nwkTopology/build/tirtos/ccs/.cproject [new file with mode: 0644]
examples/nwkTopology/build/tirtos/ccs/.project [new file with mode: 0644]
examples/nwkTopology/build/tirtos/ccs/EK_TM4C1294XL.cmd [new file with mode: 0644]
examples/nwkTopology/build/tirtos/ccs/macros.ini_initial [new file with mode: 0644]
examples/nwkTopology/build/tirtos/ccs/src/.exclude [new file with mode: 0755]
examples/nwkTopology/build/tirtos/ccs/src/makefile.libs [new file with mode: 0755]
examples/nwkTopology/build/tirtos/ccs/src/sysbios/BIOS.obj [new file with mode: 0755]
examples/nwkTopology/build/tirtos/ccs/src/sysbios/dmtimer_Timer_asm.obj [new file with mode: 0755]
examples/nwkTopology/build/tirtos/ccs/src/sysbios/ducati_CTM_asm.obj [new file with mode: 0755]
examples/nwkTopology/build/tirtos/ccs/src/sysbios/ducati_Core_asm.obj [new file with mode: 0755]
examples/nwkTopology/build/tirtos/ccs/src/sysbios/m3_Clobber_asm.obj [new file with mode: 0755]
examples/nwkTopology/build/tirtos/ccs/src/sysbios/m3_Hwi_asm.obj [new file with mode: 0755]
examples/nwkTopology/build/tirtos/ccs/src/sysbios/m3_Hwi_asm_switch.obj [new file with mode: 0755]
examples/nwkTopology/build/tirtos/ccs/src/sysbios/m3_IntrinsicsSupport_asm.obj [new file with mode: 0755]
examples/nwkTopology/build/tirtos/ccs/src/sysbios/m3_TaskSupport_asm.obj [new file with mode: 0755]
examples/nwkTopology/build/tirtos/ccs/src/sysbios/makefile [new file with mode: 0755]
examples/nwkTopology/build/tirtos/ccs/src/sysbios/omap4430_Power_resumeCpu.obj [new file with mode: 0755]
examples/nwkTopology/build/tirtos/ccs/src/sysbios/omap4430_Power_saveCpu.obj [new file with mode: 0755]
examples/nwkTopology/build/tirtos/ccs/src/sysbios/smp_Power_resumeCpu.obj [new file with mode: 0755]
examples/nwkTopology/build/tirtos/ccs/src/sysbios/smp_Power_saveCpu.obj [new file with mode: 0755]
examples/nwkTopology/build/tirtos/ccs/src/sysbios/sysbios.aem4f [new file with mode: 0755]
examples/nwkTopology/build/tirtos/ccs/target_config.ccxml [new file with mode: 0644]
examples/nwkTopology/build/tirtos/ccs/ti_rtos.cfg [new file with mode: 0644]
examples/nwkTopology/build/tirtos/main.c [new file with mode: 0755]
examples/nwkTopology/build/windows/Makefile [new file with mode: 0644]
examples/nwkTopology/build/windows/main.c [new file with mode: 0644]
examples/nwkTopology/build/windows/nwkTopologyBuild/nwkTopologyBuild.cbp [new file with mode: 0644]
examples/nwkTopology/build/windows/nwkTopologyBuild/nwkTopologyBuild.layout [new file with mode: 0644]
examples/nwkTopology/nwkTopology.c [new file with mode: 0644]
examples/nwkTopology/nwkTopology.h [new file with mode: 0755]
examples/servDisc/build/gnu/Makefile [new file with mode: 0644]
examples/servDisc/build/gnu/main.c [new file with mode: 0644]
examples/servDisc/build/tirtos/ccs/.ccsproject [new file with mode: 0644]
examples/servDisc/build/tirtos/ccs/.cproject [new file with mode: 0644]
examples/servDisc/build/tirtos/ccs/.project [new file with mode: 0644]
examples/servDisc/build/tirtos/ccs/EK_TM4C1294XL.cmd [new file with mode: 0644]
examples/servDisc/build/tirtos/ccs/macros.ini_initial [new file with mode: 0644]
examples/servDisc/build/tirtos/ccs/src/.exclude [new file with mode: 0755]
examples/servDisc/build/tirtos/ccs/src/makefile.libs [new file with mode: 0755]
examples/servDisc/build/tirtos/ccs/src/sysbios/BIOS.obj [new file with mode: 0755]
examples/servDisc/build/tirtos/ccs/src/sysbios/dmtimer_Timer_asm.obj [new file with mode: 0755]
examples/servDisc/build/tirtos/ccs/src/sysbios/ducati_CTM_asm.obj [new file with mode: 0755]
examples/servDisc/build/tirtos/ccs/src/sysbios/ducati_Core_asm.obj [new file with mode: 0755]
examples/servDisc/build/tirtos/ccs/src/sysbios/m3_Clobber_asm.obj [new file with mode: 0755]
examples/servDisc/build/tirtos/ccs/src/sysbios/m3_Hwi_asm.obj [new file with mode: 0755]
examples/servDisc/build/tirtos/ccs/src/sysbios/m3_Hwi_asm_switch.obj [new file with mode: 0755]
examples/servDisc/build/tirtos/ccs/src/sysbios/m3_IntrinsicsSupport_asm.obj [new file with mode: 0755]
examples/servDisc/build/tirtos/ccs/src/sysbios/m3_TaskSupport_asm.obj [new file with mode: 0755]
examples/servDisc/build/tirtos/ccs/src/sysbios/makefile [new file with mode: 0755]
examples/servDisc/build/tirtos/ccs/src/sysbios/omap4430_Power_resumeCpu.obj [new file with mode: 0755]
examples/servDisc/build/tirtos/ccs/src/sysbios/omap4430_Power_saveCpu.obj [new file with mode: 0755]
examples/servDisc/build/tirtos/ccs/src/sysbios/smp_Power_resumeCpu.obj [new file with mode: 0755]
examples/servDisc/build/tirtos/ccs/src/sysbios/smp_Power_saveCpu.obj [new file with mode: 0755]
examples/servDisc/build/tirtos/ccs/src/sysbios/sysbios.aem4f [new file with mode: 0755]
examples/servDisc/build/tirtos/ccs/target_config.ccxml [new file with mode: 0644]
examples/servDisc/build/tirtos/ccs/ti_rtos.cfg [new file with mode: 0644]
examples/servDisc/build/tirtos/main.c [new file with mode: 0755]
examples/servDisc/build/windows/Makefile [new file with mode: 0644]
examples/servDisc/build/windows/main.c [new file with mode: 0644]
examples/servDisc/build/windows/servDiscBuild/servDiscBuild.cbp [new file with mode: 0644]
examples/servDisc/build/windows/servDiscBuild/servDiscBuild.layout [new file with mode: 0644]
examples/servDisc/servDisc.c [new file with mode: 0644]
examples/servDisc/servDisc.h [new file with mode: 0755]
examples/stressTest/build/gnu/Makefile [new file with mode: 0755]
examples/stressTest/build/gnu/main.c [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/.ccsproject [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/.cproject [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/.gitignore [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/.project [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/EK_TM4C1294XL.cmd [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/macros.ini_initial [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/src/.exclude [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/src/makefile.libs [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/src/sysbios/BIOS.obj [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/src/sysbios/dmtimer_Timer_asm.obj [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/src/sysbios/ducati_CTM_asm.obj [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/src/sysbios/ducati_Core_asm.obj [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/src/sysbios/m3_Clobber_asm.obj [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/src/sysbios/m3_Hwi_asm.obj [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/src/sysbios/m3_Hwi_asm_switch.obj [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/src/sysbios/m3_IntrinsicsSupport_asm.obj [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/src/sysbios/m3_TaskSupport_asm.obj [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/src/sysbios/makefile [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/src/sysbios/omap4430_Power_resumeCpu.obj [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/src/sysbios/omap4430_Power_saveCpu.obj [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/src/sysbios/smp_Power_resumeCpu.obj [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/src/sysbios/smp_Power_saveCpu.obj [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/src/sysbios/sysbios.aem4f [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/target_config.ccxml [new file with mode: 0755]
examples/stressTest/build/tirtos/ccs/ti_rtos.cfg [new file with mode: 0755]
examples/stressTest/build/tirtos/main.c [new file with mode: 0755]
examples/stressTest/stressTest.c [new file with mode: 0755]
examples/stressTest/stressTest.h [new file with mode: 0755]
framework/mt/Af/mtAf.c [new file with mode: 0644]
framework/mt/Af/mtAf.h [new file with mode: 0755]
framework/mt/Sapi/mtSapi.c [new file with mode: 0644]
framework/mt/Sapi/mtSapi.h [new file with mode: 0644]
framework/mt/Sys/mtSys.c [new file with mode: 0644]
framework/mt/Sys/mtSys.h [new file with mode: 0755]
framework/mt/Zdo/mtZdo.c [new file with mode: 0644]
framework/mt/Zdo/mtZdo.h [new file with mode: 0644]
framework/mt/mtParser.c [new file with mode: 0644]
framework/mt/mtParser.h [new file with mode: 0755]
framework/platform/gnu/dbgPrint.c [new file with mode: 0644]
framework/platform/gnu/dbgPrint.h [new file with mode: 0644]
framework/platform/gnu/hostConsole.c [new file with mode: 0644]
framework/platform/gnu/hostConsole.h [new file with mode: 0644]
framework/platform/gnu/rpcTransport.c [new file with mode: 0644]
framework/platform/gnu/rpcTransport.h [new file with mode: 0644]
framework/platform/gnu/rpcTransportUart.c [new file with mode: 0644]
framework/platform/tirtos/Board/Board.h [new file with mode: 0644]
framework/platform/tirtos/Board/EK_TM4C1294XL.c [new file with mode: 0644]
framework/platform/tirtos/Board/EK_TM4C1294XL.h [new file with mode: 0644]
framework/platform/tirtos/UARTConsole.c [new file with mode: 0644]
framework/platform/tirtos/UARTConsole.h [new file with mode: 0644]
framework/platform/tirtos/dbgPrint.h [new file with mode: 0644]
framework/platform/tirtos/fcntl.h [new file with mode: 0644]
framework/platform/tirtos/hostConsole.c [new file with mode: 0755]
framework/platform/tirtos/hostConsole.h [new file with mode: 0755]
framework/platform/tirtos/rpcTransport.c [new file with mode: 0755]
framework/platform/tirtos/rpcTransport.h [new file with mode: 0755]
framework/platform/tirtos/rpcTransportUart.c [new file with mode: 0755]
framework/platform/tirtos/semaphore.c [new file with mode: 0755]
framework/platform/tirtos/semaphore.h [new file with mode: 0755]
framework/platform/tirtos/sys/ioctl.h [new file with mode: 0644]
framework/platform/tirtos/sys/types.h [new file with mode: 0644]
framework/platform/tirtos/termios.h [new file with mode: 0644]
framework/platform/tirtos/time.c [new file with mode: 0644]
framework/platform/tirtos/time.h [new file with mode: 0755]
framework/platform/tirtos/unistd.c [new file with mode: 0644]
framework/platform/tirtos/unistd.h [new file with mode: 0644]
framework/platform/windows/dbgPrint.c [new file with mode: 0644]
framework/platform/windows/dbgPrint.h [new file with mode: 0644]
framework/platform/windows/hostConsole.c [new file with mode: 0644]
framework/platform/windows/hostConsole.h [new file with mode: 0644]
framework/platform/windows/queue.c [new file with mode: 0644]
framework/platform/windows/queue.h [new file with mode: 0644]
framework/platform/windows/rpcTransport.c [new file with mode: 0644]
framework/platform/windows/rpcTransport.h [new file with mode: 0644]
framework/platform/windows/semaphore.c [new file with mode: 0644]
framework/platform/windows/semaphore.h [new file with mode: 0644]
framework/rpc/queue.c [new file with mode: 0644]
framework/rpc/queue.h [new file with mode: 0644]
framework/rpc/rpc.c [new file with mode: 0644]
framework/rpc/rpc.h [new file with mode: 0755]
framework/rpcWindows/rpc.c [new file with mode: 0644]
framework/rpcWindows/rpc.h [new file with mode: 0644]

diff --git a/Manifest.html b/Manifest.html
new file mode 100755 (executable)
index 0000000..e69de29
diff --git a/README.MD b/README.MD
new file mode 100755 (executable)
index 0000000..a4ecbe8
--- /dev/null
+++ b/README.MD
@@ -0,0 +1,83 @@
+#ZNP Host Framework\r
+\r
+##Introduction\r
+\r
+This git repository contains the source code for the ZNP POSIX Host Framework and Examples. The project is intended to help developer to develop ZigBee application on a host MCU/MPU connected to the Texas Instruments ZigBee Network Processor (CC253x). The framework offers a C callable / callback API to access the ZigBee Network Processor functionality available as a Binary Remote Procedure Call format over the UART/SPI interface.\r
+\r
+The Framework and Examples utilize a subset of POSIX functions to access OS functionality (Semaphores etc) making it easily portable between OS’s (High Level or Real Time) and HW platforms.\r
+\r
+The Examples currently implemented are:\r
+\r
+-      CmdLine: A command line example that exposes the ZNP API on the command line, auto complete and help on the available commands is at hand by pressing TAB. This example allows the user to intuitively learn the ZNP interface API as well as ZigBee commands. \r
+-      DataSendRecv: A Simple example to send / receive data between nodes in the network.\r
+-      NwkTopology: A Simple example to discover the topology of a network that the node is a part of.\r
+-      servDesc: A Simple example to discover services of nodes on the network.\r
+-      stressTest: A test example used for testing the robustness of the framework.\r
+\r
+The Platforms currently supported are:\r
+\r
+The framework and examples are described in more detail in the UserGuide in the /docs directory of this git.\r
+\r
+##Quick Start Guide\r
+\r
+###Required HW\r
+For the Linux platform only the [CC2538DK]( https://store.ti.com/CC2538DK-CC2538-Development-Kit-P4532.aspx) is required.\r
+\r
+For the TIRTOS Tiva platform you will need in addition to the [CC2538DK]( https://store.ti.com/CC2538DK-CC2538-Development-Kit-P4532.aspx) ; a [TIVA-C Launchpad](https://store.ti.com/Tiva-C-LaunchPad.aspx) and an [EM Booster pack](https://store.ti.com/boost-ccemadapter.aspx ) (modified as indicated in the Users Guide).\r
+\r
+###Programming the CC2538EM's with ZNP FW \r
+Use the [SmartRF Programmer 2]( http://processors.wiki.ti.com/index.php/Download_CCS) to program the FW contain in the bin dir of the git repository.\r
+\r
+For the Linux Platform use /bin/cc2538-znp-120-usb-tclk.hex FW. For the TIRTOS/TIVA Platform use the cc2538-znp-120-uart-tclk.hex\r
+\r
+Remember to set the P5 header correctly on the CC2538EM:\r
+\r
+* For use with the Linux platform set P5 to VDD -> USB so the CC2538Em is powered from the USB connector.\r
+* For programming and use with the TIRTOS/TIVA Platform set P5 to  VDD -> EM, so it is powered from the RM headers.\r
+\r
+Connect the CC2538EM to the Host:\r
+\r
+* For the Linux platform connect the CC2538EM to the Linux machine.\r
+* For the TIRTOS/TIVA platform connect the CC2538EM to the EM Booster Pack and then to the TIRTOS/TIVA Launchpad.\r
+\r
+### Building and running the examples\r
+\r
+The following describe how the build environment is setup and how one of the examples can be run. For a complete description consult the Users Guide.\r
+\r
+Clone the git \r
+\r
+    git clone git://git.ti.com/znp-host-framework/znp-host-framework.git\r
+\r
+####Linux\r
+\r
+Change dir to the build directory for one of the examples and build it\r
+\r
+    cd znp-posix-framework/examples/cmdLine/build/gnu/\r
+    make\r
+    \r
+Then run the example:\r
+\r
+    ./cmdLine.bin /dev/ttyACM0\r
+    \r
+\r
+####TI RTOS\r
+\r
+Download CCS v6 from here:\r
+[CCS v6]( http://processors.wiki.ti.com/index.php/Download_CCS)\r
+\r
+Download TIRTOS for TIVA-C version 2.00.02.36 from here:\r
+[TIRTOS for TIVA-C version 2.00.02.36 (for Windows)]( http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/tirtos/2_00_02_36/exports/tirtos_tivac_setupwin32_2_00_02_36.exe)\r
+\r
+Other versions of TIRTOS are available [here]( http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/tirtos/index.html) however these are not yet tested so we recommend that you use the version suggested above.\r
+\r
+Open CCSv6, Import the project through Project->Import->Code Composer Studio->CCS Project. Browse to <base dir>/znp-posix-framework\examples\cmdLine\build\tirtos\ccs\r
+\r
+To build and download the example Right click on the example in the Project Explorer and select Debug As->Code Composer Debug Session\r
+\r
+##Known Issues and Limitations\r
+\r
+* When built from ZStack-Home-1.2.1 ZNP for CC2538 USB the host framework intermittently receives corrupted RPC messages. For this reason hex files from ZStack-Home-1.2.0 are included. The root cause of this issue is currently being investigated.\r
+\r
+* API documentation is not yet released.\r
+\r
+* stressTest Example with ED's results in high level of lost packets. This is because the Ed device sleeps and polls it parent at a default rate, its parent is responsible for buffering any messages until it polls. In this test the Coordinator will send a test message every 200ms, this can cause the parents buffer to overflow and messages to get lost. A possible resolution would be to configure the EndDevice a Always On for this test, but this has not yet been implemented. 
\ No newline at end of file
diff --git a/README.html b/README.html
new file mode 100755 (executable)
index 0000000..7d9e343
--- /dev/null
@@ -0,0 +1,364 @@
+<!DOCTYPE html>\r
+<html>\r
+<head>\r
+<title>README</title>\r
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r
+<style type="text/css">\r
+/* GitHub stylesheet for MarkdownPad (http://markdownpad.com) */
+/* Author: Nicolas Hery - http://nicolashery.com */
+/* Version: b13fe65ca28d2e568c6ed5d7f06581183df8f2ff */
+/* Source: https://github.com/nicolahery/markdownpad-github */
+
+/* RESET
+=============================================================================*/
+
+html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
+  margin: 0;
+  padding: 0;
+  border: 0;
+}
+
+/* BODY
+=============================================================================*/
+
+body {
+  font-family: Helvetica, arial, freesans, clean, sans-serif;
+  font-size: 14px;
+  line-height: 1.6;
+  color: #333;
+  background-color: #fff;
+  padding: 20px;
+  max-width: 960px;
+  margin: 0 auto;
+}
+
+body>*:first-child {
+  margin-top: 0 !important;
+}
+
+body>*:last-child {
+  margin-bottom: 0 !important;
+}
+
+/* BLOCKS
+=============================================================================*/
+
+p, blockquote, ul, ol, dl, table, pre {
+  margin: 15px 0;
+}
+
+/* HEADERS
+=============================================================================*/
+
+h1, h2, h3, h4, h5, h6 {
+  margin: 20px 0 10px;
+  padding: 0;
+  font-weight: bold;
+  -webkit-font-smoothing: antialiased;
+}
+
+h1 tt, h1 code, h2 tt, h2 code, h3 tt, h3 code, h4 tt, h4 code, h5 tt, h5 code, h6 tt, h6 code {
+  font-size: inherit;
+}
+
+h1 {
+  font-size: 28px;
+  color: #000;
+}
+
+h2 {
+  font-size: 24px;
+  border-bottom: 1px solid #ccc;
+  color: #000;
+}
+
+h3 {
+  font-size: 18px;
+}
+
+h4 {
+  font-size: 16px;
+}
+
+h5 {
+  font-size: 14px;
+}
+
+h6 {
+  color: #777;
+  font-size: 14px;
+}
+
+body>h2:first-child, body>h1:first-child, body>h1:first-child+h2, body>h3:first-child, body>h4:first-child, body>h5:first-child, body>h6:first-child {
+  margin-top: 0;
+  padding-top: 0;
+}
+
+a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 {
+  margin-top: 0;
+  padding-top: 0;
+}
+
+h1+p, h2+p, h3+p, h4+p, h5+p, h6+p {
+  margin-top: 10px;
+}
+
+/* LINKS
+=============================================================================*/
+
+a {
+  color: #4183C4;
+  text-decoration: none;
+}
+
+a:hover {
+  text-decoration: underline;
+}
+
+/* LISTS
+=============================================================================*/
+
+ul, ol {
+  padding-left: 30px;
+}
+
+ul li > :first-child, 
+ol li > :first-child, 
+ul li ul:first-of-type, 
+ol li ol:first-of-type, 
+ul li ol:first-of-type, 
+ol li ul:first-of-type {
+  margin-top: 0px;
+}
+
+ul ul, ul ol, ol ol, ol ul {
+  margin-bottom: 0;
+}
+
+dl {
+  padding: 0;
+}
+
+dl dt {
+  font-size: 14px;
+  font-weight: bold;
+  font-style: italic;
+  padding: 0;
+  margin: 15px 0 5px;
+}
+
+dl dt:first-child {
+  padding: 0;
+}
+
+dl dt>:first-child {
+  margin-top: 0px;
+}
+
+dl dt>:last-child {
+  margin-bottom: 0px;
+}
+
+dl dd {
+  margin: 0 0 15px;
+  padding: 0 15px;
+}
+
+dl dd>:first-child {
+  margin-top: 0px;
+}
+
+dl dd>:last-child {
+  margin-bottom: 0px;
+}
+
+/* CODE
+=============================================================================*/
+
+pre, code, tt {
+  font-size: 12px;
+  font-family: Consolas, "Liberation Mono", Courier, monospace;
+}
+
+code, tt {
+  margin: 0 0px;
+  padding: 0px 0px;
+  white-space: nowrap;
+  border: 1px solid #eaeaea;
+  background-color: #f8f8f8;
+  border-radius: 3px;
+}
+
+pre>code {
+  margin: 0;
+  padding: 0;
+  white-space: pre;
+  border: none;
+  background: transparent;
+}
+
+pre {
+  background-color: #f8f8f8;
+  border: 1px solid #ccc;
+  font-size: 13px;
+  line-height: 19px;
+  overflow: auto;
+  padding: 6px 10px;
+  border-radius: 3px;
+}
+
+pre code, pre tt {
+  background-color: transparent;
+  border: none;
+}
+
+kbd {
+    -moz-border-bottom-colors: none;
+    -moz-border-left-colors: none;
+    -moz-border-right-colors: none;
+    -moz-border-top-colors: none;
+    background-color: #DDDDDD;
+    background-image: linear-gradient(#F1F1F1, #DDDDDD);
+    background-repeat: repeat-x;
+    border-color: #DDDDDD #CCCCCC #CCCCCC #DDDDDD;
+    border-image: none;
+    border-radius: 2px 2px 2px 2px;
+    border-style: solid;
+    border-width: 1px;
+    font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
+    line-height: 10px;
+    padding: 1px 4px;
+}
+
+/* QUOTES
+=============================================================================*/
+
+blockquote {
+  border-left: 4px solid #DDD;
+  padding: 0 15px;
+  color: #777;
+}
+
+blockquote>:first-child {
+  margin-top: 0px;
+}
+
+blockquote>:last-child {
+  margin-bottom: 0px;
+}
+
+/* HORIZONTAL RULES
+=============================================================================*/
+
+hr {
+  clear: both;
+  margin: 15px 0;
+  height: 0px;
+  overflow: hidden;
+  border: none;
+  background: transparent;
+  border-bottom: 4px solid #ddd;
+  padding: 0;
+}
+
+/* TABLES
+=============================================================================*/
+
+table th {
+  font-weight: bold;
+}
+
+table th, table td {
+  border: 1px solid #ccc;
+  padding: 6px 13px;
+}
+
+table tr {
+  border-top: 1px solid #ccc;
+  background-color: #fff;
+}
+
+table tr:nth-child(2n) {
+  background-color: #f8f8f8;
+}
+
+/* IMAGES
+=============================================================================*/
+
+img {
+  max-width: 100%
+}\r
+</style>\r
+</head>\r
+<body>\r
+<h1>ZNP Host Framework</h1>
+<h2>Introduction</h2>
+<p>This git repository contains the source code for the ZNP POSIX Host Framework and Examples. The project is intended to help developer to develop ZigBee application on a host MCU/MPU connected to the Texas Instruments ZigBee Network Processor (CC253x). The framework offers a C callable / callback API to access the ZigBee Network Processor functionality available as a Binary Remote Procedure Call format over the UART/SPI interface.</p>
+<p>The Framework and Examples utilize a subset of POSIX functions to access OS functionality (Semaphores etc) making it easily portable between OS’s (High Level or Real Time) and HW platforms.</p>
+<p>The Examples currently implemented are:</p>
+<ul>
+<li>CmdLine: A command line example that exposes the ZNP API on the command line, auto complete and help on the available commands is at hand by pressing TAB. This example allows the user to intuitively learn the ZNP interface API as well as ZigBee commands. </li>
+<li>DataSendRecv: A Simple example to send / receive data between nodes in the network.</li>
+<li>NwkTopology: A Simple example to discover the topology of a network that the node is a part of.</li>
+<li>servDesc: A Simple example to discover services of nodes on the network.</li>
+<li>stressTest: A test example used for testing the robustness of the framework.</li>
+</ul>
+<p>The Platforms currently supported are:</p>
+<p>The framework and examples are described in more detail in the UserGuide in the /docs directory of this git.</p>
+<h2>Quick Start Guide</h2>
+<h3>Required HW</h3>
+<p>For the Linux platform only the <a href="https://store.ti.com/CC2538DK-CC2538-Development-Kit-P4532.aspx">CC2538DK</a> is required.</p>
+<p>For the TIRTOS Tiva platform you will need in addition to the <a href="https://store.ti.com/CC2538DK-CC2538-Development-Kit-P4532.aspx">CC2538DK</a> ; a <a href="https://store.ti.com/Tiva-C-LaunchPad.aspx">TIVA-C Launchpad</a> and an <a href="https://store.ti.com/boost-ccemadapter.aspx">EM Booster pack</a> (modified as indicated in the Users Guide).</p>
+<h3>Programming the CC2538EM's with ZNP FW</h3>
+<p>Use the <a href="http://processors.wiki.ti.com/index.php/Download_CCS">SmartRF Programmer 2</a> to program the FW contain in the bin dir of the git repository.</p>
+<p>For the Linux Platform use /bin/cc2538-znp-120-usb-tclk.hex FW. For the TIRTOS/TIVA Platform use the cc2538-znp-120-uart-tclk.hex</p>
+<p>Remember to set the P5 header correctly on the CC2538EM:</p>
+<ul>
+<li>For use with the Linux platform set P5 to VDD -&gt; USB so the CC2538Em is powered from the USB connector.</li>
+<li>For programming and use with the TIRTOS/TIVA Platform set P5 to  VDD -&gt; EM, so it is powered from the RM headers.</li>
+</ul>
+<p>Connect the CC2538EM to the Host:</p>
+<ul>
+<li>For the Linux platform connect the CC2538EM to the Linux machine.</li>
+<li>For the TIRTOS/TIVA platform connect the CC2538EM to the EM Booster Pack and then to the TIRTOS/TIVA Launchpad.</li>
+</ul>
+<h3>Building and running the examples</h3>
+<p>The following describe how the build environment is setup and how one of the examples can be run. For a complete description consult the Users Guide.</p>
+<p>Clone the git </p>
+<pre><code>git clone git://git.ti.com/znp-host-framework/znp-host-framework.git
+</code></pre>
+
+<h4>Linux</h4>
+<p>Change dir to the build directory for one of the examples and build it</p>
+<pre><code>cd znp-posix-framework/examples/cmdLine/build/gnu/
+make
+</code></pre>
+
+<p>Then run the example:</p>
+<pre><code>./cmdLine.bin /dev/ttyACM0
+</code></pre>
+
+<h4>TI RTOS</h4>
+<p>Download CCS v6 from here:\r
+<a href="http://processors.wiki.ti.com/index.php/Download_CCS">CCS v6</a></p>
+<p>Download TIRTOS for TIVA-C version 2.00.02.36 from here:\r
+<a href="http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/tirtos/2_00_02_36/exports/tirtos_tivac_setupwin32_2_00_02_36.exe">TIRTOS for TIVA-C version 2.00.02.36 (for Windows)</a></p>
+<p>Other versions of TIRTOS are available <a href="http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/tirtos/index.html">here</a> however these are not yet tested so we recommend that you use the version suggested above.</p>
+<p>Open CCSv6, Import the project through Project-&gt;Import-&gt;Code Composer Studio-&gt;CCS Project. Browse to <base dir>/znp-posix-framework\examples\cmdLine\build\tirtos\ccs</p>
+<p>To build and download the example Right click on the example in the Project Explorer and select Debug As-&gt;Code Composer Debug Session</p>
+<h2>Known Issues and Limitations</h2>
+<ul>
+<li>
+<p>When built from ZStack-Home-1.2.1 ZNP for CC2538 USB the host framework intermittently receives corrupted RPC messages. For this reason hex files from ZStack-Home-1.2.0 are included. The root cause of this issue is currently being investigated.</p>
+</li>
+<li>
+<p>API documentation is not yet released.</p>
+</li>
+<li>
+<p>stressTest Example with ED's results in high level of lost packets. This is because the Ed device sleeps and polls it parent at a default rate, its parent is responsible for buffering any messages until it polls. In this test the Coordinator will send a test message every 200ms, this can cause the parents buffer to overflow and messages to get lost. A possible resolution would be to configure the EndDevice a Always On for this test, but this has not yet been implemented. </p>
+</li>
+</ul>
+\r
+</body>\r
+</html>\r
+<!-- This document was created with MarkdownPad, the Markdown editor for Windows (http://markdownpad.com) -->\r
diff --git a/docs/ZNP Host User's Guide.pdf b/docs/ZNP Host User's Guide.pdf
new file mode 100755 (executable)
index 0000000..34717c2
Binary files /dev/null and b/docs/ZNP Host User's Guide.pdf differ
diff --git a/examples/ZNP Host Users Guide.pdf b/examples/ZNP Host Users Guide.pdf
new file mode 100644 (file)
index 0000000..695a41c
Binary files /dev/null and b/examples/ZNP Host Users Guide.pdf differ
diff --git a/examples/cmdLine/build/gnu/Makefile b/examples/cmdLine/build/gnu/Makefile
new file mode 100644 (file)
index 0000000..8693d62
--- /dev/null
@@ -0,0 +1,71 @@
+
+SBU_REV= "0.1"
+
+
+INCLUDE = -I$(PROJ_DIR)../../ -I$(PROJ_DIR)../../../../framework/platform/gnu -I$(PROJ_DIR)../../../../framework/rpc/ -I$(PROJ_DIR)../../../../framework/mt/ -I$(PROJ_DIR)../../../../framework/mt/Af -I$(PROJ_DIR)../../../../framework/mt/Zdo -I$(PROJ_DIR)../../../../framework/mt/Sys -I$(PROJ_DIR)../../../../framework/mt/Sapi
+
+CC= gcc
+#CC=/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc
+
+CFLAGS= -c -Wall -g -std=gnu99
+LIBS = -lrt -lpthread
+PROJ_DIR=
+
+all: cmdLine.bin
+
+cmdLine.bin: main.o cmdLine.o rpc.o mtParser.o mtZdo.o mtSys.o mtAf.o mtSapi.o dbgPrint.o hostConsole.o rpcTransport.o queue.o
+       $(CC) main.o cmdLine.o rpc.o mtParser.o mtZdo.o mtSys.o mtAf.o mtSapi.o dbgPrint.o hostConsole.o rpcTransport.o queue.o $(LIBS) -o cmdLine.bin
+
+# rule for file "main.o".
+main.o: main.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)main.c
+
+# rule for file "cmdLine.o".
+cmdLine.o: ../../cmdLine.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)../../cmdLine.c
+
+# rule for file "rpc.o".
+rpc.o: $(PROJ_DIR)../../../../framework/rpc/rpc.h $(PROJ_DIR)../../../../framework/rpc/rpc.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)../../../../framework/rpc/rpc.c
+
+# rule for file "mtParser.o".
+mtParser.o: $(PROJ_DIR)../../../../framework/mt/mtParser.h $(PROJ_DIR)../../../../framework/mt/mtParser.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)../../../../framework/mt/mtParser.c
+
+# rule for file "mtZdo.o".
+mtZdo.o: $(PROJ_DIR)../../../../framework/mt/Zdo/mtZdo.h $(PROJ_DIR)../../../../framework/mt/Zdo/mtZdo.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)../../../../framework/mt/Zdo/mtZdo.c
+
+# rule for file "mtSys.o".
+mtSys.o: $(PROJ_DIR)../../../../framework/mt/Sys/mtSys.h $(PROJ_DIR)../../../../framework/mt/Sys/mtSys.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)../../../../framework/mt/Sys/mtSys.c
+
+# rule for file "mtAf.o".
+mtAf.o: $(PROJ_DIR)../../../../framework/mt/Af/mtAf.h $(PROJ_DIR)../../../../framework/mt/Af/mtAf.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)../../../../framework/mt/Af/mtAf.c
+
+# rule for file "mtSapi.o".
+mtSapi.o: $(PROJ_DIR)../../../../framework/mt/Sapi/mtSapi.h $(PROJ_DIR)../../../../framework/mt/Sapi/mtSapi.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)../../../../framework/mt/Sapi/mtSapi.c
+
+# rule for file "dbgPrint.o".
+dbgPrint.o: $(PROJ_DIR)../../../../framework/platform/gnu/dbgPrint.h $(PROJ_DIR)../../../../framework/platform/gnu/dbgPrint.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)../../../../framework/platform/gnu/dbgPrint.c
+
+# rule for file "hostConsole.o".
+hostConsole.o: $(PROJ_DIR)../../../../framework/platform/gnu/hostConsole.h $(PROJ_DIR)../../../../framework/platform/gnu/hostConsole.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)../../../../framework/platform/gnu/hostConsole.c
+
+# rule for file "rpcTransport.o".
+rpcTransport.o: $(PROJ_DIR)../../../../framework/platform/gnu/rpcTransport.h $(PROJ_DIR)../../../../framework/platform/gnu/rpcTransport.c $(PROJ_DIR)../../../../framework/platform/gnu/rpcTransportUart.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)../../../../framework/platform/gnu/rpcTransport.c
+
+
+# rule for file "queue.o".
+queue.o: $(PROJ_DIR)../../../../framework/rpc/queue.h $(PROJ_DIR)../../../../framework/rpc/queue.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)../../../../framework/rpc/queue.c
+
+
+# rule for cleaning files generated during compilations.
+clean:
+       /bin/rm -f cmdLine.bin *.o
diff --git a/examples/cmdLine/build/gnu/main.c b/examples/cmdLine/build/gnu/main.c
new file mode 100755 (executable)
index 0000000..e14b36d
--- /dev/null
@@ -0,0 +1,108 @@
+/**************************************************************************************************\r
+ * Filename:       main.c\r
+ * Description:    This file contains the main for the gnu platform.\r
+ *\r
+ *\r
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/\r
+ *\r
+ *\r
+ *  Redistribution and use in source and binary forms, with or without\r
+ *  modification, are permitted provided that the following conditions\r
+ *  are met:\r
+ *\r
+ *    Redistributions of source code must retain the above copyright\r
+ *    notice, this list of conditions and the following disclaimer.\r
+ *\r
+ *    Redistributions in binary form must reproduce the above copyright\r
+ *    notice, this list of conditions and the following disclaimer in the\r
+ *    documentation and/or other materials provided with the\r
+ *    distribution.\r
+ *\r
+ *    Neither the name of Texas Instruments Incorporated nor the names of\r
+ *    its contributors may be used to endorse or promote products derived\r
+ *    from this software without specific prior written permission.\r
+ *\r
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ *\r
+ */\r
+#include <pthread.h>\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+\r
+#include "rpc.h"\r
+#include "cmdLine.h"\r
+\r
+#include "dbgPrint.h"\r
+\r
+void *rpcTask(void *argument)\r
+{\r
+       while (1)\r
+       {\r
+               rpcProcess();\r
+       }\r
+\r
+       dbg_print(PRINT_LEVEL_WARNING, "rpcTask exited!\n");\r
+}\r
+\r
+void *appTask(void *argument)\r
+{\r
+       while (1)\r
+       {\r
+               appProcess(NULL);\r
+       }\r
+}\r
+\r
+int main(int argc, char* argv[])\r
+{\r
+       char * selectedSerialPort;\r
+       pthread_t rpcThread, appThread;\r
+\r
+       dbg_print(PRINT_LEVEL_INFO, "%s -- %s %s\n", argv[0], __DATE__, __TIME__);\r
+\r
+       // accept only 1\r
+       if (argc < 2)\r
+       {\r
+               //usage(argv[0]);\r
+               dbg_print(PRINT_LEVEL_INFO, "attempting to use /dev/ttyACM0\n\n");\r
+               selectedSerialPort = "/dev/ttyACM0";\r
+       }\r
+       else\r
+       {\r
+               selectedSerialPort = argv[1];\r
+       }\r
+\r
+       int serialPortFd = rpcOpen(selectedSerialPort, 0);\r
+       if (serialPortFd == -1)\r
+       {\r
+               dbg_print(PRINT_LEVEL_ERROR, "could not open serial port\n");\r
+               exit(-1);\r
+       }\r
+\r
+       //init the rpc que client\r
+       rpcInitMq();\r
+\r
+       //init the application thread to register the callbacks\r
+       appInit();\r
+\r
+       //Start the Rx thread\r
+       dbg_print(PRINT_LEVEL_INFO, "creating RPC thread\n");\r
+       pthread_create(&rpcThread, NULL, rpcTask, (void *) &serialPortFd);\r
+\r
+       //Start the example thread\r
+       dbg_print(PRINT_LEVEL_INFO, "creating example thread\n");\r
+       pthread_create(&appThread, NULL, appTask, NULL);\r
+\r
+       while (1)\r
+               ;\r
+\r
+}\r
diff --git a/examples/cmdLine/build/tirtos/ccs/.ccsproject b/examples/cmdLine/build/tirtos/ccs/.ccsproject
new file mode 100644 (file)
index 0000000..230dfe2
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<?ccsproject version="1.0"?>
+<projectOptions>
+       <deviceVariant value="Cortex M.TM4C1294NCPDT"/>
+       <deviceFamily value="TMS470"/>
+       <deviceEndianness value="little"/>
+       <codegenToolVersion value="5.1.7"/>
+       <isElfFormat value="true"/>
+       <rts value="libc.a"/>
+       <createSlaveProjects value=""/>
+       <templateProperties value="id=com.ti.rtsc.TIRTOStivac.example_6,type=rtsc,products=com.ti.rtsc.TIRTOStivac,xdcToolsVersion=3.30.01.25_core,platform=ti.platforms.tiva:TM4C1294NCPDT,buildProfile=release,isHybrid=true,"/>
+       <isTargetManual value="true"/>
+</projectOptions>
diff --git a/examples/cmdLine/build/tirtos/ccs/.cproject b/examples/cmdLine/build/tirtos/ccs/.cproject
new file mode 100644 (file)
index 0000000..b973c12
--- /dev/null
@@ -0,0 +1,234 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
+<?fileVersion 4.0.0?>\r
+\r
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">\r
+       <storageModule configRelations="2" moduleId="org.eclipse.cdt.core.settings">\r
+               <cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.310915542">\r
+                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.310915542" moduleId="org.eclipse.cdt.core.settings" name="Debug">\r
+                               <externalSettings/>\r
+                               <extensions>\r
+                                       <extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>\r
+                                       <extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="org.eclipse.rtsc.xdctools.parsers.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                               </extensions>\r
+                       </storageModule>\r
+                       <storageModule moduleId="cdtBuildSystem" version="4.0.0">\r
+                               <configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" errorParsers="org.eclipse.rtsc.xdctools.parsers.ErrorParser;com.ti.ccstudio.errorparser.CoffErrorParser;com.ti.ccstudio.errorparser.LinkErrorParser;com.ti.ccstudio.errorparser.AsmErrorParser" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.310915542" name="Debug" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug" postbuildStep="" prebuildStep="">\r
+                                       <folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.310915542." name="/" resourcePath="">\r
+                                               <toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exe.DebugToolchain.1967934469" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exe.linkerDebug.430685845">\r
+                                                       <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.52667702" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">\r
+                                                               <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.TM4C1294NCPDT"/>\r
+                                                               <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>\r
+                                                               <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>\r
+                                                               <listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.5.0"/>\r
+                                                               <listOptionValue builtIn="false" value="LINKER_COMMAND_FILE="/>\r
+                                                               <listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>\r
+                                                               <listOptionValue builtIn="false" value="RTSC_MBS_VERSION=2.2.0"/>\r
+                                                               <listOptionValue builtIn="false" value="XDC_VERSION=3.30.3.47_core"/>\r
+                                                               <listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.rtsc.TIRTOStivac:2.0.2.36;"/>\r
+                                                               <listOptionValue builtIn="false" value="OUTPUT_TYPE=rtscApplication:executable"/>\r
+                                                       </option>\r
+                                                       <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1665147451" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.1.7" valueType="string"/>\r
+                                                       <targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exe.targetPlatformDebug.475622799" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exe.targetPlatformDebug"/>\r
+                                                       <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exe.builderDebug.1155972535" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exe.builderDebug"/>\r
+                                                       <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exe.compilerDebug.1809992799" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exe.compilerDebug">\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.SILICON_VERSION.1128130614" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.CODE_STATE.1849850139" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.CODE_STATE.16" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.ABI.1370297132" name="Application binary interface. [See 'General' page to edit] (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.ABI.eabi" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.FLOAT_SUPPORT.1569927309" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.GCC.1865549526" name="Enable support for GCC extensions (--gcc)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.GCC" value="true" valueType="boolean"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.DEFINE.2034635717" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.DEFINE" valueType="definedSymbols">\r
+                                                                       <listOptionValue builtIn="false" value="ccs=&quot;ccs&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="PART_TM4C1294NCPDT"/>\r
+                                                                       <listOptionValue builtIn="false" value="ccs"/>\r
+                                                                       <listOptionValue builtIn="false" value="TIVAWARE"/>\r
+                                                               </option>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.DEBUGGING_MODEL.1705113195" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.DIAG_WARNING.1978880115" name="Treat diagnostic &lt;id&gt; as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.DIAG_WARNING" valueType="stringList">\r
+                                                                       <listOptionValue builtIn="false" value="225"/>\r
+                                                               </option>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.DISPLAY_ERROR_NUMBER.43107833" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.DIAG_WRAP.1968323859" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.DIAG_WRAP.off" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.INCLUDE_PATH.1057830594" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.INCLUDE_PATH" valueType="includePath">\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${ZNP_POSIX_ROOT}/framework/platform/tirtos&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/include&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/TivaWare_C_Series-2.1.0.12573c&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${ZNP_POSIX_ROOT}/framework/mt&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${ZNP_POSIX_ROOT}/framework/mt/Af&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${ZNP_POSIX_ROOT}/framework/mt/Sapi&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${ZNP_POSIX_ROOT}/framework/mt/Sys&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${ZNP_POSIX_ROOT}/framework/mt/Zdo&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${ZNP_POSIX_ROOT}/framework/rpc&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${ZNP_POSIX_ROOT}/framework/platform/tirtos/Board&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${ZNP_POSIX_ROOT}/examples/cmdLine&quot;"/>\r
+                                                               </option>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.LITTLE_ENDIAN.1180294760" name="Little endian code [See 'General' page to edit] (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.GEN_FUNC_SUBSECTIONS.2058742410" name="Place each function in a separate subsection (--gen_func_subsections, -ms)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compiler.inputType__C_SRCS.1279506881" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compiler.inputType__C_SRCS"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compiler.inputType__CPP_SRCS.262844700" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compiler.inputType__CPP_SRCS"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compiler.inputType__ASM_SRCS.1565182391" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compiler.inputType__ASM_SRCS"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compiler.inputType__ASM2_SRCS.584915157" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compiler.inputType__ASM2_SRCS"/>\r
+                                                       </tool>\r
+                                                       <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exe.linkerDebug.430685845" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exe.linkerDebug">\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.MAP_FILE.1344034518" name="Input and output sections listed into &lt;file&gt; (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.MAP_FILE" value="&quot;${ProjName}.map&quot;" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.STACK_SIZE.559735948" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.STACK_SIZE" value="512" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.HEAP_SIZE.1688269619" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.HEAP_SIZE" value="0" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.OUTPUT_FILE.241575709" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.OUTPUT_FILE" value="&quot;${ProjName}.out&quot;" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.XML_LINK_INFO.1086202116" name="Detailed link information data-base into &lt;file&gt; (--xml_link_info, -xml_link_info)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.XML_LINK_INFO" value="&quot;${ProjName}_linkInfo.xml&quot;" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.DISPLAY_ERROR_NUMBER.480537223" name="Emit diagnostic identifier numbers (--display_error_number)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.DIAG_WRAP.1742610348" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.DIAG_WRAP.off" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.SEARCH_PATH.250280319" name="Add &lt;dir&gt; to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.SEARCH_PATH" valueType="libPaths">\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/lib&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/include&quot;"/>\r
+                                                               </option>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.LIBRARY.1319665308" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.LIBRARY" valueType="libs">\r
+                                                                       <listOptionValue builtIn="false" value="&quot;libc.a&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/TivaWare_C_Series-2.1.0.12573c/driverlib/ccs/Debug/driverlib.lib&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/TivaWare_C_Series-2.1.0.12573c/usblib/ccs/Debug/usblib.lib&quot;"/>\r
+                                                               </option>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exeLinker.inputType__CMD_SRCS.1755875582" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exeLinker.inputType__CMD_SRCS"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exeLinker.inputType__CMD2_SRCS.1961727087" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exeLinker.inputType__CMD2_SRCS"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exeLinker.inputType__GEN_CMDS.525270083" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exeLinker.inputType__GEN_CMDS"/>\r
+                                                       </tool>\r
+                                                       <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.hex.61849812" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.hex"/>\r
+                                                       <tool id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.926997370" name="XDCtools" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool">\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR.1892299582" name="Compiler tools directory (-c)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR" value="&quot;${CG_TOOL_ROOT}&quot;" valueType="string"/>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET.274587153" name="Target (-t)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET" value="ti.targets.arm.elf.M4F" valueType="string"/>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM.1877393404" name="Platform (-p)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM" value="ti.platforms.tiva:TM4C1294NCPDT" valueType="string"/>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW.1894489994" name="Platform (-p)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW" value="ti.platforms.tiva:TM4C1294NCPDT" valueType="string"/>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE.37623426" name="Build-profile (-r)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE" value="release" valueType="string"/>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH.1329745214" name="Package repositories (--xdcpath)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH" valueType="stringList">\r
+                                                                       <listOptionValue builtIn="false" value="${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/packages"/>\r
+                                                                       <listOptionValue builtIn="false" value="${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/bios_6_40_02_27/packages"/>\r
+                                                                       <listOptionValue builtIn="false" value="${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/ndk_2_23_01_01/packages"/>\r
+                                                                       <listOptionValue builtIn="false" value="${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/uia_2_00_01_34/packages"/>\r
+                                                                       <listOptionValue builtIn="false" value="${TARGET_CONTENT_BASE}"/>\r
+                                                               </option>\r
+                                                       </tool>\r
+                                               </toolChain>\r
+                                       </folderInfo>\r
+                                       <sourceEntries>\r
+                                               <entry excluding="framework/platform/tirtos/rpcTransportUart.c|framework/platform/tirtos/rpcTransportSpi.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>\r
+                                       </sourceEntries>\r
+                               </configuration>\r
+                       </storageModule>\r
+                       <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>\r
+               </cconfiguration>\r
+               <cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Release.1755249788">\r
+                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.1755249788" moduleId="org.eclipse.cdt.core.settings" name="Release">\r
+                               <externalSettings/>\r
+                               <extensions>\r
+                                       <extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>\r
+                                       <extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="org.eclipse.rtsc.xdctools.parsers.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                               </extensions>\r
+                       </storageModule>\r
+                       <storageModule moduleId="cdtBuildSystem" version="4.0.0">\r
+                               <configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" errorParsers="org.eclipse.rtsc.xdctools.parsers.ErrorParser;com.ti.ccstudio.errorparser.CoffErrorParser;com.ti.ccstudio.errorparser.LinkErrorParser;com.ti.ccstudio.errorparser.AsmErrorParser" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.1755249788" name="Release" parent="com.ti.ccstudio.buildDefinitions.TMS470.Release" postbuildStep="" prebuildStep="">\r
+                                       <folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Release.1755249788." name="/" resourcePath="">\r
+                                               <toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exe.ReleaseToolchain.486343816" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exe.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exe.linkerRelease.1052524764">\r
+                                                       <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.935329229" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">\r
+                                                               <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.TM4C1294NCPDT"/>\r
+                                                               <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>\r
+                                                               <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>\r
+                                                               <listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.5.0"/>\r
+                                                               <listOptionValue builtIn="false" value="LINKER_COMMAND_FILE="/>\r
+                                                               <listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>\r
+                                                               <listOptionValue builtIn="false" value="RTSC_MBS_VERSION=2.2.0"/>\r
+                                                               <listOptionValue builtIn="false" value="XDC_VERSION=3.30.3.47_core"/>\r
+                                                               <listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.rtsc.TIRTOStivac:2.0.2.36;"/>\r
+                                                               <listOptionValue builtIn="false" value="OUTPUT_TYPE=rtscApplication:executable"/>\r
+                                                       </option>\r
+                                                       <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.11864095" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.1.7" valueType="string"/>\r
+                                                       <targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exe.targetPlatformRelease.284108094" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exe.targetPlatformRelease"/>\r
+                                                       <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exe.builderRelease.122302236" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exe.builderRelease"/>\r
+                                                       <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exe.compilerRelease.40327940" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exe.compilerRelease">\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.SILICON_VERSION.1545847302" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.CODE_STATE.488489029" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.CODE_STATE.16" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.ABI.115583006" name="Application binary interface. [See 'General' page to edit] (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.ABI.eabi" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.FLOAT_SUPPORT.157598919" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.GCC.1714709844" name="Enable support for GCC extensions (--gcc)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.GCC" value="true" valueType="boolean"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.DEFINE.1442905686" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.DEFINE" valueType="definedSymbols">\r
+                                                                       <listOptionValue builtIn="false" value="ccs=&quot;ccs&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="PART_TM4C1294NCPDT"/>\r
+                                                                       <listOptionValue builtIn="false" value="ccs"/>\r
+                                                                       <listOptionValue builtIn="false" value="TIVAWARE"/>\r
+                                                               </option>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.DIAG_WARNING.2078709243" name="Treat diagnostic &lt;id&gt; as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.DIAG_WARNING" valueType="stringList">\r
+                                                                       <listOptionValue builtIn="false" value="225"/>\r
+                                                               </option>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.DISPLAY_ERROR_NUMBER.1113355575" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.DIAG_WRAP.2063791375" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.DIAG_WRAP.off" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.INCLUDE_PATH.2002563116" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.INCLUDE_PATH" valueType="includePath">\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/include&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/TivaWare_C_Series-2.1.0.12573c&quot;"/>\r
+                                                               </option>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.LITTLE_ENDIAN.1323822299" name="Little endian code [See 'General' page to edit] (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.GEN_FUNC_SUBSECTIONS.1017997577" name="Place each function in a separate subsection (--gen_func_subsections, -ms)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compiler.inputType__C_SRCS.1326016319" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compiler.inputType__C_SRCS"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compiler.inputType__CPP_SRCS.1229114643" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compiler.inputType__CPP_SRCS"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compiler.inputType__ASM_SRCS.1389815691" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compiler.inputType__ASM_SRCS"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compiler.inputType__ASM2_SRCS.311530158" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.compiler.inputType__ASM2_SRCS"/>\r
+                                                       </tool>\r
+                                                       <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exe.linkerRelease.1052524764" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exe.linkerRelease">\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.MAP_FILE.770390580" name="Input and output sections listed into &lt;file&gt; (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.MAP_FILE" value="&quot;${ProjName}.map&quot;" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.STACK_SIZE.613822896" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.STACK_SIZE" value="512" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.HEAP_SIZE.38517742" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.HEAP_SIZE" value="0" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.OUTPUT_FILE.1658902307" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.OUTPUT_FILE" value="&quot;${ProjName}.out&quot;" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.XML_LINK_INFO.1569026536" name="Detailed link information data-base into &lt;file&gt; (--xml_link_info, -xml_link_info)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.XML_LINK_INFO" value="&quot;${ProjName}_linkInfo.xml&quot;" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.DISPLAY_ERROR_NUMBER.805132379" name="Emit diagnostic identifier numbers (--display_error_number)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.DIAG_WRAP.668013843" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.DIAG_WRAP.off" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.SEARCH_PATH.374533597" name="Add &lt;dir&gt; to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.SEARCH_PATH" valueType="libPaths">\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/lib&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/include&quot;"/>\r
+                                                               </option>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.LIBRARY.1718678845" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.linkerID.LIBRARY" valueType="libs">\r
+                                                                       <listOptionValue builtIn="false" value="&quot;libc.a&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/TivaWare_C_Series-2.1.0.12573c/driverlib/ccs/Debug/driverlib.lib&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/TivaWare_C_Series-2.1.0.12573c/usblib/ccs/Debug/usblib.lib&quot;"/>\r
+                                                               </option>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exeLinker.inputType__CMD_SRCS.2133115732" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exeLinker.inputType__CMD_SRCS"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exeLinker.inputType__CMD2_SRCS.2016551771" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exeLinker.inputType__CMD2_SRCS"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exeLinker.inputType__GEN_CMDS.1894307567" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.exeLinker.inputType__GEN_CMDS"/>\r
+                                                       </tool>\r
+                                                       <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.1.hex.1850611720" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.1.hex"/>\r
+                                                       <tool id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.2050568160" name="XDCtools" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool">\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR.667499747" name="Compiler tools directory (-c)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR" value="&quot;${CG_TOOL_ROOT}&quot;" valueType="string"/>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET.1263631110" name="Target (-t)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET" value="ti.targets.arm.elf.M4F" valueType="string"/>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM.1954705901" name="Platform (-p)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM" value="ti.platforms.tiva:TM4C1294NCPDT" valueType="string"/>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW.1410975180" name="Platform (-p)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW" value="ti.platforms.tiva:TM4C1294NCPDT" valueType="string"/>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE.919799387" name="Build-profile (-r)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE" value="release" valueType="string"/>\r
+                                                               <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH.1801042817" name="Package repositories (--xdcpath)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH" valueType="stringList">\r
+                                                                       <listOptionValue builtIn="false" value="${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/packages"/>\r
+                                                                       <listOptionValue builtIn="false" value="${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/bios_6_40_02_27/packages"/>\r
+                                                                       <listOptionValue builtIn="false" value="${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/ndk_2_23_01_01/packages"/>\r
+                                                                       <listOptionValue builtIn="false" value="${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/uia_2_00_01_34/packages"/>\r
+                                                                       <listOptionValue builtIn="false" value="${TARGET_CONTENT_BASE}"/>\r
+                                                               </option>\r
+                                                       </tool>\r
+                                               </toolChain>\r
+                                       </folderInfo>\r
+                               </configuration>\r
+                       </storageModule>\r
+                       <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>\r
+               </cconfiguration>\r
+       </storageModule>\r
+       <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>\r
+       <storageModule moduleId="cdtBuildSystem" version="4.0.0">\r
+               <project id="cmdLine.com.ti.ccstudio.buildDefinitions.TMS470.ProjectType.969426873" name="ARM" projectType="com.ti.ccstudio.buildDefinitions.TMS470.ProjectType"/>\r
+       </storageModule>\r
+       <storageModule moduleId="scannerConfiguration"/>\r
+       <storageModule moduleId="org.eclipse.cdt.core.language.mapping">\r
+               <project-mappings>\r
+                       <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.asmSource" language="com.ti.ccstudio.core.TIASMLanguage"/>\r
+                       <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cHeader" language="com.ti.ccstudio.core.TIGCCLanguage"/>\r
+                       <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cSource" language="com.ti.ccstudio.core.TIGCCLanguage"/>\r
+                       <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxHeader" language="com.ti.ccstudio.core.TIGPPLanguage"/>\r
+                       <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxSource" language="com.ti.ccstudio.core.TIGPPLanguage"/>\r
+               </project-mappings>\r
+       </storageModule>\r
+</cproject>\r
diff --git a/examples/cmdLine/build/tirtos/ccs/.project b/examples/cmdLine/build/tirtos/ccs/.project
new file mode 100644 (file)
index 0000000..4edc1b6
--- /dev/null
@@ -0,0 +1,221 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<projectDescription>\r
+       <name>cmdLine</name>\r
+       <comment></comment>\r
+       <projects>\r
+       </projects>\r
+       <buildSpec>\r
+               <buildCommand>\r
+                       <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>\r
+                       <arguments>\r
+                       </arguments>\r
+               </buildCommand>\r
+               <buildCommand>\r
+                       <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>\r
+                       <triggers>full,incremental,</triggers>\r
+                       <arguments>\r
+                       </arguments>\r
+               </buildCommand>\r
+       </buildSpec>\r
+       <natures>\r
+               <nature>org.eclipse.rtsc.xdctools.buildDefinitions.XDC.xdcNature</nature>\r
+               <nature>com.ti.ccstudio.core.ccsNature</nature>\r
+               <nature>org.eclipse.cdt.core.cnature</nature>\r
+               <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>\r
+               <nature>org.eclipse.cdt.core.ccnature</nature>\r
+               <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>\r
+       </natures>\r
+       <linkedResources>\r
+               <link>\r
+                       <name>Board/Board.h</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/platform/tirtos/Board/Board.h</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>Board/EK_TM4C1294XL.c</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/platform/tirtos/Board/EK_TM4C1294XL.c</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>Board/EK_TM4C1294XL.h</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/platform/tirtos/Board/EK_TM4C1294XL.h</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>application/cmdLine.c</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/examples/cmdLine/cmdLine.c</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>application/cmdLine.h</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/examples/cmdLine/cmdLine.h</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>application/main.c</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/examples/cmdLine/build/tirtos/main.c</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/mt/mtParser.c</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/mt/mtParser.c</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/mt/mtParser.h</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/mt/mtParser.h</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/rpc/queue.c</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/rpc/queue.c</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/rpc/queue.h</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/rpc/queue.h</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/rpc/rpc.c</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/rpc/rpc.c</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/rpc/rpc.h</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/rpc/rpc.h</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/mt/AF/mtAf.c</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/mt/Af/mtAf.c</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/mt/AF/mtAf.h</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/mt/Af/mtAf.h</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/mt/SAPI/mtSapi.c</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/mt/Sapi/mtSapi.c</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/mt/SAPI/mtSapi.h</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/mt/Sapi/mtSapi.h</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/mt/SYS/mtSys.c</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/mt/Sys/mtSys.c</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/mt/SYS/mtSys.h</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/mt/Sys/mtSys.h</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/mt/ZDO/mtZdo.c</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/mt/Zdo/mtZdo.c</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/mt/ZDO/mtZdo.h</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/mt/Zdo/mtZdo.h</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/platform/tirtos/UARTConsole.c</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/platform/tirtos/UARTConsole.c</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/platform/tirtos/UARTConsole.h</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/platform/tirtos/UARTConsole.h</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/platform/tirtos/dbgPrint.h</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/platform/tirtos/dbgPrint.h</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/platform/tirtos/fcntl.h</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/platform/tirtos/fcntl.h</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/platform/tirtos/hostConsole.c</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/platform/tirtos/hostConsole.c</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/platform/tirtos/hostConsole.h</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/platform/tirtos/hostConsole.h</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/platform/tirtos/rpcTransport.c</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/platform/tirtos/rpcTransport.c</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/platform/tirtos/rpcTransport.h</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/platform/tirtos/rpcTransport.h</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/platform/tirtos/rpcTransportSpi.c</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/platform/tirtos/rpcTransportSpi.c</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/platform/tirtos/rpcTransportUart.c</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/platform/tirtos/rpcTransportUart.c</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/platform/tirtos/semaphore.c</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/platform/tirtos/semaphore.c</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/platform/tirtos/semaphore.h</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/platform/tirtos/semaphore.h</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/platform/tirtos/termios.h</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/platform/tirtos/termios.h</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/platform/tirtos/time.c</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/platform/tirtos/time.c</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/platform/tirtos/time.h</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/platform/tirtos/time.h</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/platform/tirtos/unistd.c</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/platform/tirtos/unistd.c</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>framework/platform/tirtos/unistd.h</name>\r
+                       <type>1</type>\r
+                       <locationURI>ZNP_POSIX_ROOT/framework/platform/tirtos/unistd.h</locationURI>\r
+               </link>\r
+       </linkedResources>\r
+       <variableList>\r
+               <variable>\r
+                       <name>ZNP_POSIX_ROOT</name>\r
+                       <value>$%7BPARENT-5-PROJECT_LOC%7D</value>\r
+               </variable>\r
+       </variableList>\r
+</projectDescription>\r
diff --git a/examples/cmdLine/build/tirtos/ccs/EK_TM4C1294XL.cmd b/examples/cmdLine/build/tirtos/ccs/EK_TM4C1294XL.cmd
new file mode 100644 (file)
index 0000000..cf41e83
--- /dev/null
@@ -0,0 +1,45 @@
+/******************************************************************************
+ *
+ * Default Linker Command file for the Texas Instruments TM4C1294NCPDT
+ *
+ * This is derived from revision 11167 of the TivaWare Library.
+ *
+ *****************************************************************************/
+
+--retain=g_pfnVectors
+
+MEMORY
+{
+    FLASH (RX) : origin = 0x00000000, length = 0x00100000
+    SRAM (RWX) : origin = 0x20000000, length = 0x00040000
+}
+
+/* The following command line options are set as part of the CCS project.    */
+/* If you are building using the command line, or for some reason want to    */
+/* define them here, you can uncomment and modify these lines as needed.     */
+/* If you are using CCS for building, it is probably better to make any such */
+/* modifications in your CCS project and leave this file alone.              */
+/*                                                                           */
+/* --heap_size=0                                                             */
+/* --stack_size=256                                                          */
+/* --library=rtsv7M4_T_le_eabi.lib                                           */
+
+/* Section allocation in memory */
+
+SECTIONS
+{
+    .intvecs:   > 0x00000000
+    .text   :   > FLASH
+    .const  :   > FLASH
+    .cinit  :   > FLASH
+    .pinit  :   > FLASH
+    .init_array : > FLASH
+
+    .vtable :   > 0x20000000
+    .data   :   > SRAM
+    .bss    :   > SRAM
+    .sysmem :   > SRAM
+    .stack  :   > SRAM
+}
+
+__STACK_TOP = __stack + 512;
diff --git a/examples/cmdLine/build/tirtos/ccs/macros.ini_initial b/examples/cmdLine/build/tirtos/ccs/macros.ini_initial
new file mode 100644 (file)
index 0000000..6c9e42e
--- /dev/null
@@ -0,0 +1 @@
+ZNP_POSIX_ROOT = ../../../../../\r
diff --git a/examples/cmdLine/build/tirtos/ccs/src/.exclude b/examples/cmdLine/build/tirtos/ccs/src/.exclude
new file mode 100755 (executable)
index 0000000..8c86331
--- /dev/null
@@ -0,0 +1 @@
+This file exists to prevent Eclipse/CDT from adding the C sources contained in this directory (or below) to any enclosing project.
diff --git a/examples/cmdLine/build/tirtos/ccs/src/makefile.libs b/examples/cmdLine/build/tirtos/ccs/src/makefile.libs
new file mode 100755 (executable)
index 0000000..8073dc0
--- /dev/null
@@ -0,0 +1,62 @@
+#
+# This file was generated based on the configuration script:
+#     C:\Users\a0741319\Documents\VirtualBox VMs\VM-Ubuntu-11.04-Share\ZnpHostFrameWork\znp-posix-framework\examples\cmdLine\build\tirtos\ccs\ti_rtos.cfg
+#
+# This makefile may be included in other makefiles that need to build
+# the libraries containing the compiled source files generated as
+# part of the configuration step.
+
+#
+# ======== GEN_SRC_DIR =========
+# The path to the sources generated during configuration
+#
+# This path must be either absolute or relative to the build directory.
+#
+# The absolute path to the generated source directory (at the time the
+# sources were generated) is:
+#    C:\Users\a0741319\Documents\VirtualBox VMs\VM-Ubuntu-11.04-Share\ZnpHostFrameWork\znp-posix-framework\examples\cmdLine\build\tirtos\ccs\src
+#
+GEN_SRC_DIR ?= ../src
+
+ifeq (,$(wildcard $(GEN_SRC_DIR)))
+$(error "ERROR: GEN_SRC_DIR must be set to the directory containing the generated sources")
+endif
+
+#
+# ======== .force ========
+# The .force goal is used to force the build of any goal that names it as
+# a prerequisite
+#
+.PHONY: .force
+      
+#
+# ======== library macros ========
+#
+sysbios_SRC = $(GEN_SRC_DIR)/sysbios
+sysbios_LIB = $(GEN_SRC_DIR)/sysbios/sysbios.aem4f
+
+#
+# ======== dependencies ========
+#
+all: $(sysbios_LIB)
+clean: .sysbios_clean
+
+
+# ======== convenient build goals ========
+.PHONY: sysbios
+sysbios: $(GEN_SRC_DIR)/sysbios/sysbios.aem4f
+
+# CDT managed make executables depend on $(OBJS)
+OBJS += $(sysbios_LIB)
+
+#
+# ======== rules ========
+#
+$(sysbios_LIB): .force 
+       @echo making $@ ...
+       @$(MAKE) -C $(sysbios_SRC)
+
+.sysbios_clean:
+       @echo cleaning $(sysbios_SRC) ...
+       -@$(MAKE) --no-print-directory -C $(sysbios_SRC) clean
+
diff --git a/examples/cmdLine/build/tirtos/ccs/src/sysbios/BIOS.obj b/examples/cmdLine/build/tirtos/ccs/src/sysbios/BIOS.obj
new file mode 100755 (executable)
index 0000000..0fcd80a
Binary files /dev/null and b/examples/cmdLine/build/tirtos/ccs/src/sysbios/BIOS.obj differ
diff --git a/examples/cmdLine/build/tirtos/ccs/src/sysbios/dmtimer_Timer_asm.obj b/examples/cmdLine/build/tirtos/ccs/src/sysbios/dmtimer_Timer_asm.obj
new file mode 100755 (executable)
index 0000000..62031b7
Binary files /dev/null and b/examples/cmdLine/build/tirtos/ccs/src/sysbios/dmtimer_Timer_asm.obj differ
diff --git a/examples/cmdLine/build/tirtos/ccs/src/sysbios/ducati_CTM_asm.obj b/examples/cmdLine/build/tirtos/ccs/src/sysbios/ducati_CTM_asm.obj
new file mode 100755 (executable)
index 0000000..8b11a24
Binary files /dev/null and b/examples/cmdLine/build/tirtos/ccs/src/sysbios/ducati_CTM_asm.obj differ
diff --git a/examples/cmdLine/build/tirtos/ccs/src/sysbios/ducati_Core_asm.obj b/examples/cmdLine/build/tirtos/ccs/src/sysbios/ducati_Core_asm.obj
new file mode 100755 (executable)
index 0000000..8ec0f00
Binary files /dev/null and b/examples/cmdLine/build/tirtos/ccs/src/sysbios/ducati_Core_asm.obj differ
diff --git a/examples/cmdLine/build/tirtos/ccs/src/sysbios/m3_Clobber_asm.obj b/examples/cmdLine/build/tirtos/ccs/src/sysbios/m3_Clobber_asm.obj
new file mode 100755 (executable)
index 0000000..769e15e
Binary files /dev/null and b/examples/cmdLine/build/tirtos/ccs/src/sysbios/m3_Clobber_asm.obj differ
diff --git a/examples/cmdLine/build/tirtos/ccs/src/sysbios/m3_Hwi_asm.obj b/examples/cmdLine/build/tirtos/ccs/src/sysbios/m3_Hwi_asm.obj
new file mode 100755 (executable)
index 0000000..be6856b
Binary files /dev/null and b/examples/cmdLine/build/tirtos/ccs/src/sysbios/m3_Hwi_asm.obj differ
diff --git a/examples/cmdLine/build/tirtos/ccs/src/sysbios/m3_Hwi_asm_switch.obj b/examples/cmdLine/build/tirtos/ccs/src/sysbios/m3_Hwi_asm_switch.obj
new file mode 100755 (executable)
index 0000000..488c485
Binary files /dev/null and b/examples/cmdLine/build/tirtos/ccs/src/sysbios/m3_Hwi_asm_switch.obj differ
diff --git a/examples/cmdLine/build/tirtos/ccs/src/sysbios/m3_IntrinsicsSupport_asm.obj b/examples/cmdLine/build/tirtos/ccs/src/sysbios/m3_IntrinsicsSupport_asm.obj
new file mode 100755 (executable)
index 0000000..b5530b7
Binary files /dev/null and b/examples/cmdLine/build/tirtos/ccs/src/sysbios/m3_IntrinsicsSupport_asm.obj differ
diff --git a/examples/cmdLine/build/tirtos/ccs/src/sysbios/m3_TaskSupport_asm.obj b/examples/cmdLine/build/tirtos/ccs/src/sysbios/m3_TaskSupport_asm.obj
new file mode 100755 (executable)
index 0000000..4640a58
Binary files /dev/null and b/examples/cmdLine/build/tirtos/ccs/src/sysbios/m3_TaskSupport_asm.obj differ
diff --git a/examples/cmdLine/build/tirtos/ccs/src/sysbios/makefile b/examples/cmdLine/build/tirtos/ccs/src/sysbios/makefile
new file mode 100755 (executable)
index 0000000..89f8164
--- /dev/null
@@ -0,0 +1,136 @@
+
+XOPTS = -I"C:/ti/xdctools_3_30_04_52_core/packages/" -Dxdc_target_types__=C:/ti/tirtos_tivac_2_00_02_36/products/bios_6_40_02_27/packages/ti/targets/arm/elf/std.h -Dxdc_target_name__=M4F
+
+vpath % C:/ti/tirtos_tivac_2_00_02_36/products/bios_6_40_02_27/packages/ti/sysbios/
+vpath %.c C:/ti/xdctools_3_30_04_52_core/packages/
+
+CCOPTS    = --endian=little -mv7M4 --abi=eabi --float_support=fpv4spd16 -q -ms --opt_for_speed=2  --program_level_compile -o3 -g --optimize_with_debug 
+
+XDC_ROOT  = C:/ti/xdctools_3_30_04_52_core/packages/
+
+BIOS_ROOT = C:/ti/tirtos_tivac_2_00_02_36/products/bios_6_40_02_27/packages/ti/sysbios/
+
+BIOS_DEFS =  -Dti_sysbios_BIOS_swiEnabled__D=TRUE -Dti_sysbios_BIOS_taskEnabled__D=TRUE -Dti_sysbios_BIOS_clockEnabled__D=TRUE -Dti_sysbios_BIOS_runtimeCreatesEnabled__D=TRUE -Dti_sysbios_hal_Hwi_DISABLE_ALL_HOOKS -Dti_sysbios_knl_Swi_DISABLE_ALL_HOOKS -Dti_sysbios_knl_Task_DISABLE_ALL_HOOKS -Dti_sysbios_BIOS_smpEnabled__D=FALSE -Dti_sysbios_Build_useHwiMacros -Dti_sysbios_knl_Swi_numPriorities__D=16 -Dti_sysbios_knl_Task_deleteTerminatedTasks__D=FALSE -Dti_sysbios_knl_Task_numPriorities__D=16 -Dti_sysbios_knl_Task_checkStackFlag__D=TRUE -Dti_sysbios_knl_Clock_TICK_SOURCE=ti_sysbios_knl_Clock_TickSource_TIMER -Dti_sysbios_knl_Clock_TICK_MODE=ti_sysbios_knl_Clock_TickMode_PERIODIC -Dti_sysbios_hal_Core_delegate_getId=ti_sysbios_hal_CoreNull_getId__E -Dti_sysbios_hal_Core_delegate_interruptCore=ti_sysbios_hal_CoreNull_interruptCore__E -Dti_sysbios_hal_Core_delegate_lock=ti_sysbios_hal_CoreNull_lock__E -Dti_sysbios_hal_Core_delegate_unlock=ti_sysbios_hal_CoreNull_unlock__E -Dti_sysbios_hal_Core_numCores__D=1 -Dti_sysbios_hal_CoreNull_numCores__D=1 -Dti_sysbios_utils_Load_taskEnabled__D=FALSE -Dti_sysbios_utils_Load_swiEnabled__D=FALSE -Dti_sysbios_family_arm_m3_Hwi_dispatcherSwiSupport__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_dispatcherTaskSupport__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_dispatcherAutoNestingSupport__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_dispatcherIrpTrackingSupport__D=TRUE -Dti_sysbios_knl_Semaphore_supportsEvents__D=FALSE -Dti_sysbios_knl_Semaphore_supportsPriority__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_enableException__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_disablePriority__D=32U -Dti_sysbios_family_arm_m3_Hwi_numSparseInterrupts__D=0U
+
+BIOS_INC  = -I"C:/ti/tirtos_tivac_2_00_02_36/products/bios_6_40_02_27/packages/"
+
+TARGET_INC = -I"C:/ti/tirtos_tivac_2_00_02_36/products/bios_6_40_02_27/packages/"
+
+INCS = $(BIOS_INC) $(TARGET_INC) 
+
+CC = c:/ti/ccsv6/tools/compiler/arm_5.1.5/bin/armcl -c $(CCOPTS) -I c:/ti/ccsv6/tools/compiler/arm_5.1.5/include
+ASM = c:/ti/ccsv6/tools/compiler/arm_5.1.5/bin/armcl -c $(CCOPTS) -I c:/ti/ccsv6/tools/compiler/arm_5.1.5/include
+AR = c:/ti/ccsv6/tools/compiler/arm_5.1.5/bin/armar rq
+
+DEL = cmd.exe /q /c del /f
+CP = cmd.exe /q /c copy /Y
+
+define RM
+       $(if $(wildcard $1),$(DEL) $1,:)
+endef
+
+define ASSEMBLE
+       @echo asmem4f $< ...
+       @$(ASM) $(BIOS_DEFS) $(XOPTS) $(INCS) $<
+endef
+
+all: sysbios.aem4f
+
+m3_Clobber_asm.obj: family/arm/m3/Clobber_asm.sv7M makefile
+       @-$(call RM, $@)
+       $(ASSEMBLE) --output_file=m3_Clobber_asm.obj
+
+m3_IntrinsicsSupport_asm.obj: family/arm/m3/IntrinsicsSupport_asm.sv7M makefile
+       @-$(call RM, $@)
+       $(ASSEMBLE) --output_file=m3_IntrinsicsSupport_asm.obj
+
+m3_TaskSupport_asm.obj: family/arm/m3/TaskSupport_asm.sv7M makefile
+       @-$(call RM, $@)
+       $(ASSEMBLE) --output_file=m3_TaskSupport_asm.obj
+
+m3_Hwi_asm.obj: family/arm/m3/Hwi_asm.sv7M makefile
+       @-$(call RM, $@)
+       $(ASSEMBLE) --output_file=m3_Hwi_asm.obj
+
+m3_Hwi_asm_switch.obj: family/arm/m3/Hwi_asm_switch.sv7M makefile
+       @-$(call RM, $@)
+       $(ASSEMBLE) --output_file=m3_Hwi_asm_switch.obj
+
+ducati_CTM_asm.obj: family/arm/ducati/CTM_asm.sv7M makefile
+       @-$(call RM, $@)
+       $(ASSEMBLE) --output_file=ducati_CTM_asm.obj
+
+ducati_Core_asm.obj: family/arm/ducati/Core_asm.sv7M makefile
+       @-$(call RM, $@)
+       $(ASSEMBLE) --output_file=ducati_Core_asm.obj
+
+omap4430_Power_saveCpu.obj: family/arm/ducati/omap4430/Power_saveCpu.sv7M makefile
+       @-$(call RM, $@)
+       $(ASSEMBLE) --output_file=omap4430_Power_saveCpu.obj
+
+omap4430_Power_resumeCpu.obj: family/arm/ducati/omap4430/Power_resumeCpu.sv7M makefile
+       @-$(call RM, $@)
+       $(ASSEMBLE) --output_file=omap4430_Power_resumeCpu.obj
+
+smp_Power_saveCpu.obj: family/arm/ducati/smp/Power_saveCpu.sv7M makefile
+       @-$(call RM, $@)
+       $(ASSEMBLE) --output_file=smp_Power_saveCpu.obj
+
+smp_Power_resumeCpu.obj: family/arm/ducati/smp/Power_resumeCpu.sv7M makefile
+       @-$(call RM, $@)
+       $(ASSEMBLE) --output_file=smp_Power_resumeCpu.obj
+
+dmtimer_Timer_asm.obj: timers/dmtimer/Timer_asm.sv7M makefile
+       @-$(call RM, $@)
+       $(ASSEMBLE) --output_file=dmtimer_Timer_asm.obj
+
+
+BIOS.obj: BIOS.c knl/Clock.c knl/Idle.c knl/Intrinsics.c knl/Event.c knl/Mailbox.c knl/Queue.c knl/Semaphore.c knl/Swi.c knl/Swi_andn.c knl/Task.c hal/Hwi.c hal/Hwi_stack.c hal/Hwi_startup.c heaps/HeapMem.c gates/GateHwi.c gates/GateMutex.c family/arm/m3/Hwi.c family/arm/m3/TaskSupport.c family/arm/lm4/TimestampProvider.c family/arm/lm4/Timer.c utils/Load.c utils/Load_CPU.c makefile
+       @-$(call RM, $@)
+       @echo clem4f $< ...
+       @$(CC) $(BIOS_DEFS) $(XOPTS) $(INCS) \
+       $(BIOS_ROOT)BIOS.c \
+       $(BIOS_ROOT)knl/Clock.c \
+       $(BIOS_ROOT)knl/Idle.c \
+       $(BIOS_ROOT)knl/Intrinsics.c \
+       $(BIOS_ROOT)knl/Event.c \
+       $(BIOS_ROOT)knl/Mailbox.c \
+       $(BIOS_ROOT)knl/Queue.c \
+       $(BIOS_ROOT)knl/Semaphore.c \
+       $(BIOS_ROOT)knl/Swi.c \
+       $(BIOS_ROOT)knl/Swi_andn.c \
+       $(BIOS_ROOT)knl/Task.c \
+       $(BIOS_ROOT)hal/Hwi.c \
+       $(BIOS_ROOT)hal/Hwi_stack.c \
+       $(BIOS_ROOT)hal/Hwi_startup.c \
+       $(BIOS_ROOT)heaps/HeapMem.c \
+       $(BIOS_ROOT)gates/GateHwi.c \
+       $(BIOS_ROOT)gates/GateMutex.c \
+       $(BIOS_ROOT)family/arm/m3/Hwi.c \
+       $(BIOS_ROOT)family/arm/m3/TaskSupport.c \
+       $(BIOS_ROOT)family/arm/lm4/TimestampProvider.c \
+       $(BIOS_ROOT)family/arm/lm4/Timer.c \
+       $(BIOS_ROOT)utils/Load.c \
+       $(BIOS_ROOT)utils/Load_CPU.c \
+
+sysbios.aem4f: BIOS.obj m3_Clobber_asm.obj m3_IntrinsicsSupport_asm.obj m3_TaskSupport_asm.obj m3_Hwi_asm.obj m3_Hwi_asm_switch.obj ducati_CTM_asm.obj ducati_Core_asm.obj omap4430_Power_saveCpu.obj omap4430_Power_resumeCpu.obj smp_Power_saveCpu.obj smp_Power_resumeCpu.obj dmtimer_Timer_asm.obj
+       @-$(call RM, $@)
+       @echo arem4f $^ ...
+       @$(AR) $@ $^
+
+
+clean:
+       @-$(call RM, sysbios.aem4f)
+       @-$(call RM, BIOS.obj)
+       @-$(call RM, m3_Clobber_asm.obj)
+       @-$(call RM, m3_IntrinsicsSupport_asm.obj)
+       @-$(call RM, m3_TaskSupport_asm.obj)
+       @-$(call RM, m3_Hwi_asm.obj)
+       @-$(call RM, m3_Hwi_asm_switch.obj)
+       @-$(call RM, ducati_CTM_asm.obj)
+       @-$(call RM, ducati_Core_asm.obj)
+       @-$(call RM, omap4430_Power_saveCpu.obj)
+       @-$(call RM, omap4430_Power_resumeCpu.obj)
+       @-$(call RM, smp_Power_saveCpu.obj)
+       @-$(call RM, smp_Power_resumeCpu.obj)
+       @-$(call RM, dmtimer_Timer_asm.obj)
diff --git a/examples/cmdLine/build/tirtos/ccs/src/sysbios/omap4430_Power_resumeCpu.obj b/examples/cmdLine/build/tirtos/ccs/src/sysbios/omap4430_Power_resumeCpu.obj
new file mode 100755 (executable)
index 0000000..dd24d24
Binary files /dev/null and b/examples/cmdLine/build/tirtos/ccs/src/sysbios/omap4430_Power_resumeCpu.obj differ
diff --git a/examples/cmdLine/build/tirtos/ccs/src/sysbios/omap4430_Power_saveCpu.obj b/examples/cmdLine/build/tirtos/ccs/src/sysbios/omap4430_Power_saveCpu.obj
new file mode 100755 (executable)
index 0000000..8a4fd21
Binary files /dev/null and b/examples/cmdLine/build/tirtos/ccs/src/sysbios/omap4430_Power_saveCpu.obj differ
diff --git a/examples/cmdLine/build/tirtos/ccs/src/sysbios/smp_Power_resumeCpu.obj b/examples/cmdLine/build/tirtos/ccs/src/sysbios/smp_Power_resumeCpu.obj
new file mode 100755 (executable)
index 0000000..b54875c
Binary files /dev/null and b/examples/cmdLine/build/tirtos/ccs/src/sysbios/smp_Power_resumeCpu.obj differ
diff --git a/examples/cmdLine/build/tirtos/ccs/src/sysbios/smp_Power_saveCpu.obj b/examples/cmdLine/build/tirtos/ccs/src/sysbios/smp_Power_saveCpu.obj
new file mode 100755 (executable)
index 0000000..41ceeb5
Binary files /dev/null and b/examples/cmdLine/build/tirtos/ccs/src/sysbios/smp_Power_saveCpu.obj differ
diff --git a/examples/cmdLine/build/tirtos/ccs/src/sysbios/sysbios.aem4f b/examples/cmdLine/build/tirtos/ccs/src/sysbios/sysbios.aem4f
new file mode 100755 (executable)
index 0000000..1fa7d04
Binary files /dev/null and b/examples/cmdLine/build/tirtos/ccs/src/sysbios/sysbios.aem4f differ
diff --git a/examples/cmdLine/build/tirtos/ccs/target_config.ccxml b/examples/cmdLine/build/tirtos/ccs/target_config.ccxml
new file mode 100644 (file)
index 0000000..7a583d5
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
+<configurations XML_version="1.2" id="configurations_0">\r
+    <configuration XML_version="1.2" id="Stellaris In-Circuit Debug Interface_0">\r
+    <instance XML_version="1.2" desc="Stellaris In-Circuit Debug Interface_0" href="connections/Stellaris_ICDI_Connection.xml" id="Stellaris In-Circuit Debug Interface_0" xml="Stellaris_ICDI_Connection.xml" xmlpath="connections"/>\r
+    <connection XML_version="1.2" id="Stellaris In-Circuit Debug Interface_0">\r
+      <instance XML_version="1.2" href="drivers/stellaris_cs_dap.xml" id="drivers" xml="stellaris_cs_dap.xml" xmlpath="drivers"/>\r
+      <instance XML_version="1.2" href="drivers/stellaris_cortex_m4.xml" id="drivers" xml="stellaris_cortex_m4.xml" xmlpath="drivers"/>\r
+      <platform XML_version="1.2" id="platform_0">\r
+        <instance XML_version="1.2" desc="Stellaris TM4C1294NCPDT_0" href="devices/tm4c1294ncpdt.xml" id="Stellaris TM4C1294NCPDT_0" xml="tm4c1294ncpdt.xml" xmlpath="devices"/>\r
+      </platform>\r
+    </connection>\r
+  </configuration>\r
+</configurations>\r
diff --git a/examples/cmdLine/build/tirtos/ccs/ti_rtos.cfg b/examples/cmdLine/build/tirtos/ccs/ti_rtos.cfg
new file mode 100644 (file)
index 0000000..e0cbb88
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2014, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * *  Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * *  Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * *  Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ *  ======== empty.cfg ========
+ */
+
+/* ================ General configuration ================ */
+var Defaults = xdc.useModule('xdc.runtime.Defaults');
+var Diags = xdc.useModule('xdc.runtime.Diags');
+var Error = xdc.useModule('xdc.runtime.Error');
+var Log = xdc.useModule('xdc.runtime.Log');
+var Main = xdc.useModule('xdc.runtime.Main');
+var Memory = xdc.useModule('xdc.runtime.Memory');
+var System = xdc.useModule('xdc.runtime.System');
+var Text = xdc.useModule('xdc.runtime.Text');
+
+var BIOS = xdc.useModule('ti.sysbios.BIOS');
+var Clock = xdc.useModule('ti.sysbios.knl.Clock');
+var Task = xdc.useModule('ti.sysbios.knl.Task');
+var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
+var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
+var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
+//var FatFS = xdc.useModule('ti.sysbios.fatfs.FatFS');
+
+/* ================ System configuration ================ */
+var SysMin = xdc.useModule('xdc.runtime.SysMin');
+var UART = xdc.useModule('ti.drivers.UART');
+var Mailbox = xdc.useModule('ti.sysbios.knl.Mailbox');
+System.SupportProxy = SysMin;
+
+/* ================ Logging configuration ================ */
+var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
+
+/* ================ Kernel configuration ================ */
+/* Use Custom library */
+var BIOS = xdc.useModule('ti.sysbios.BIOS');
+BIOS.libType = BIOS.LibType_Custom;
+BIOS.logsEnabled = true;
+BIOS.assertsEnabled = true;
+
+/* ================ Driver configuration ================ */
+var TIRTOS = xdc.useModule('ti.tirtos.TIRTOS');
+
+var GPIO = xdc.useModule('ti.drivers.GPIO');
+var task0Params = new Task.Params();
+task0Params.instance.name = "appTaskHdl";
+task0Params.priority = 2;
+task0Params.stackSize = 16384;
+Program.global.appTaskHdl = Task.create("&appTaskFxn", task0Params);
+var task0Params0 = new Task.Params();
+task0Params0.instance.name = "rpcTaskHdl";
+task0Params0.stackSize = 16384;
+Program.global.rpcTaskHdl = Task.create("&rpcTaskFxn", task0Params0);
+Memory.defaultHeapSize = 16384;
+Program.stack = 16384;
diff --git a/examples/cmdLine/build/tirtos/main.c b/examples/cmdLine/build/tirtos/main.c
new file mode 100755 (executable)
index 0000000..5ed56c1
--- /dev/null
@@ -0,0 +1,101 @@
+/**************************************************************************************************\r
+ * Filename:       main.c\r
+ * Description:    This file contains the main for the TI-RTOS platform.\r
+ *\r
+ *\r
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/\r
+ *\r
+ *\r
+ *  Redistribution and use in source and binary forms, with or without\r
+ *  modification, are permitted provided that the following conditions\r
+ *  are met:\r
+ *\r
+ *    Redistributions of source code must retain the above copyright\r
+ *    notice, this list of conditions and the following disclaimer.\r
+ *\r
+ *    Redistributions in binary form must reproduce the above copyright\r
+ *    notice, this list of conditions and the following disclaimer in the\r
+ *    documentation and/or other materials provided with the\r
+ *    distribution.\r
+ *\r
+ *    Neither the name of Texas Instruments Incorporated nor the names of\r
+ *    its contributors may be used to endorse or promote products derived\r
+ *    from this software without specific prior written permission.\r
+ *\r
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ *\r
+ */\r
+/* XDCtools Header files */\r
+#include <xdc/std.h>\r
+#include <xdc/cfg/global.h>\r
+#include <xdc/runtime/System.h>\r
+\r
+/* BIOS Header files */\r
+#include <ti/sysbios/BIOS.h>\r
+\r
+/* TI-RTOS Header files */\r
+#include <ti/drivers/GPIO.h>\r
+#include <ti/drivers/SPI.h>\r
+\r
+/* Example/Board Header files */\r
+#include "Board.h"\r
+#include "UARTConsole.h"\r
+\r
+#include "rpc.h"\r
+#include "cmdLine.h"\r
+\r
+#include "dbgPrint.h"\r
+\r
+Void rpcTaskFxn(UArg arg0, UArg arg1)\r
+{\r
+       while (1)\r
+       {\r
+               rpcProcess();\r
+       }\r
+}\r
+\r
+Void appTaskFxn(UArg arg0, UArg arg1)\r
+{\r
+       //init the RPC queue\r
+       rpcInitMq();\r
+\r
+       //init the application thread to register the callbacks\r
+       appInit();\r
+\r
+       while (1)\r
+       {\r
+               appProcess(NULL);\r
+       }\r
+}\r
+\r
+int main(void)\r
+{\r
+       /* Call board init functions. */\r
+       Board_initGeneral();\r
+       Board_initGPIO();\r
+       Board_initUART();\r
+\r
+       UARTConsole_open(false);\r
+\r
+       int serialPortFd = rpcOpen(NULL, 0);\r
+       if (serialPortFd == -1)\r
+       {\r
+               dbg_print(PRINT_LEVEL_ERROR, "could not open serial port\n");\r
+               //exit(-1);\r
+               while (1)\r
+                       ;\r
+       }\r
+\r
+       /* Start BIOS */\r
+       BIOS_start();\r
+}\r
diff --git a/examples/cmdLine/build/windows/Makefile b/examples/cmdLine/build/windows/Makefile
new file mode 100644 (file)
index 0000000..95c58e0
--- /dev/null
@@ -0,0 +1,79 @@
+
+SBU_REV= "0.1"
+
+
+INCLUDE = -I$(PROJ_DIR)..\.. -I$(PROJ_DIR)..\..\..\..\framework\platform\windows -I$(PROJ_DIR)..\..\..\..\framework\rpcWindows -I$(PROJ_DIR)..\..\..\..\framework\mt -I$(PROJ_DIR)..\..\..\..\framework\mt\Af -I$(PROJ_DIR)..\..\..\..\framework\mt\Zdo -I$(PROJ_DIR)..\..\..\..\framework\mt\Sys -I$(PROJ_DIR)..\..\..\..\framework\mt\Sapi
+
+CC= gcc.exe
+#CC=\usr\local\angstrom\arm\bin\arm-angstrom-linux-gnueabi-gcc
+
+CFLAGS= -Wall -g -Wall  -c
+LIBS =
+DEFS += -D_OBJC_NO_COM
+PROJ_DIR=
+
+Debug: cmdLine.exe
+
+cmdLine.exe: main.o cmdLine.o queue.o semaphore.o rpc.o mtParser.o mtZdo.o mtSys.o mtAf.o mtSapi.o dbgPrint.o hostConsole.o rpcTransport.o
+       $(CC) $(LIBS) -o cmdLine.exe main.o cmdLine.o queue.o semaphore.o rpc.o mtParser.o mtZdo.o mtSys.o mtAf.o mtSapi.o dbgPrint.o hostConsole.o rpcTransport.o
+
+# rule for file "main.o".
+main.o: $(PROJ_DIR)main.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)main.c
+
+# rule for file "cmdLine.o".
+cmdLine.o: $(PROJ_DIR)..\..\cmdLine.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)..\..\cmdLine.c\r
+\r
+# rule for file "rpcTransport.o".
+queue.o: $(PROJ_DIR)..\..\..\..\framework\platform\windows\queue.h $(PROJ_DIR)..\..\..\..\framework\platform\windows\queue.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)..\..\..\..\framework\platform\windows\queue.c\r
+\r
+# rule for file "rpcTransport.o".
+semaphore.o: $(PROJ_DIR)..\..\..\..\framework\platform\windows\semaphore.h $(PROJ_DIR)..\..\..\..\framework\platform\windows\semaphore.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)..\..\..\..\framework\platform\windows\semaphore.c
+
+# rule for file "rpc.o".
+rpc.o: $(PROJ_DIR)..\..\..\..\framework\rpc\rpc.h $(PROJ_DIR)..\..\..\..\framework\rpcWindows\rpc.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)..\..\..\..\framework\rpcWindows\rpc.c
+
+# rule for file "mtParser.o".
+mtParser.o: $(PROJ_DIR)..\..\..\..\framework\mt\mtParser.h $(PROJ_DIR)..\..\..\..\framework\mt\mtParser.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)..\..\..\..\framework\mt\mtParser.c
+
+# rule for file "mtZdo.o".
+mtZdo.o: $(PROJ_DIR)..\..\..\..\framework\mt\Zdo\mtZdo.h $(PROJ_DIR)..\..\..\..\framework\mt\Zdo\mtZdo.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)..\..\..\..\framework\mt\Zdo\mtZdo.c
+
+# rule for file "mtSys.o".
+mtSys.o: $(PROJ_DIR)..\..\..\..\framework\mt\Sys\mtSys.h $(PROJ_DIR)..\..\..\..\framework\mt\Sys\mtSys.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)..\..\..\..\framework\mt\Sys\mtSys.c
+
+# rule for file "mtAf.o".
+mtAf.o: $(PROJ_DIR)..\..\..\..\framework\mt\Af\mtAf.h $(PROJ_DIR)..\..\..\..\framework\mt\Af\mtAf.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)..\..\..\..\framework\mt\Af\mtAf.c
+
+# rule for file "mtSapi.o".
+mtSapi.o: $(PROJ_DIR)..\..\..\..\framework\mt\Sapi\mtSapi.h $(PROJ_DIR)..\..\..\..\framework\mt\Sapi\mtSapi.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)..\..\..\..\framework\mt\Sapi\mtSapi.c
+
+# rule for file "dbgPrint.o".
+dbgPrint.o: $(PROJ_DIR)..\..\..\..\framework\platform\windows\dbgPrint.h $(PROJ_DIR)..\..\..\..\framework\platform\windows\dbgPrint.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)..\..\..\..\framework\platform\windows\dbgPrint.c
+
+# rule for file "hostConsole.o".
+hostConsole.o: $(PROJ_DIR)..\..\..\..\framework\platform\windows\hostConsole.h $(PROJ_DIR)..\..\..\..\framework\platform\windows\hostConsole.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)..\..\..\..\framework\platform\windows\hostConsole.c
+
+
+\r
+
+\r
+# rule for file "rpcTransport.o".
+rpcTransport.o: $(PROJ_DIR)..\..\..\..\framework\platform\windows\rpcTransport.h $(PROJ_DIR)..\..\..\..\framework\platform\windows\rpcTransport.c
+       $(CC) $(CFLAGS) $(INCLUDE) $(DEFS) $(PROJ_DIR)..\..\..\..\framework\platform\windows\rpcTransport.c\r
+
+# rule for cleaning files generated during compilations.
+cleanDebug:
+       -del cmdLine.exe *.o\r
+       echo Clean done
diff --git a/examples/cmdLine/build/windows/cmdLineBuild/cmdLineBuild.cbp b/examples/cmdLine/build/windows/cmdLineBuild/cmdLineBuild.cbp
new file mode 100644 (file)
index 0000000..9295c42
--- /dev/null
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+       <FileVersion major="1" minor="6" />
+       <Project>
+               <Option title="cmdLineBuild" />
+               <Option makefile_is_custom="1" />
+               <Option execution_dir="../../windows" />
+               <Option pch_mode="2" />
+               <Option compiler="gcc" />
+               <Build>
+                       <Target title="Debug">
+                               <Option output="bin/Debug/cmdLineBuild" prefix_auto="1" extension_auto="1" />
+                               <Option object_output="obj/Debug/" />
+                               <Option type="1" />
+                               <Option compiler="gcc" />
+                               <Option projectIncludeDirsRelation="2" />
+                               <Option projectResourceIncludeDirsRelation="2" />
+                               <Option projectLibDirsRelation="2" />
+                               <Compiler>
+                                       <Add option="-g" />
+                                       <Add directory="../../../../../framework/rpcWindows" />
+                                       <Add directory="../../../../../framework/mt/Af" />
+                                       <Add directory="../../../../cmdLine" />
+                                       <Add directory="../../../../../framework/mt" />
+                                       <Add directory="../../../../../framework/mt/Sapi" />
+                                       <Add directory="../../../../../framework/mt/Zdo" />
+                                       <Add directory="../../../../../framework/mt/Sys" />
+                                       <Add directory="../../../../../framework/platform/windows" />
+                               </Compiler>
+                               <ResourceCompiler>
+                                       <Add directory="../../../../../framework/rpcWindows" />
+                                       <Add directory="../../../../cmdLine" />
+                                       <Add directory="../../../../../framework/mt" />
+                                       <Add directory="../../../../../framework/mt/Af" />
+                                       <Add directory="../../../../../framework/mt/Sapi" />
+                                       <Add directory="../../../../../framework/mt/Zdo" />
+                                       <Add directory="../../../../../framework/mt/Sys" />
+                                       <Add directory="../../../../../framework/platform/windows" />
+                               </ResourceCompiler>
+                               <Linker>
+                                       <Add directory="../../../../../framework/rpcWindows" />
+                                       <Add directory="../../../../../framework/mt/Af" />
+                                       <Add directory="../../../../cmdLine" />
+                                       <Add directory="../../../../../framework/mt" />
+                                       <Add directory="../../../../../framework/mt/Sapi" />
+                                       <Add directory="../../../../../framework/mt/Zdo" />
+                                       <Add directory="../../../../../framework/mt/Sys" />
+                                       <Add directory="../../../../../framework/platform/windows" />
+                               </Linker>
+                       </Target>
+                       <Target title="Release">
+                               <Option output="bin/Release/cmdLineBuild" prefix_auto="1" extension_auto="1" />
+                               <Option object_output="obj/Release/" />
+                               <Option type="1" />
+                               <Option compiler="gcc" />
+                               <Compiler>
+                                       <Add option="-O2" />
+                                       <Add directory="../../../../../framework/mt/Af" />
+                                       <Add directory="../../../../cmdLine" />
+                                       <Add directory="../../../../../framework/mt" />
+                                       <Add directory="../../../../../framework/mt/Sapi" />
+                                       <Add directory="../../../../../framework/mt/Zdo" />
+                                       <Add directory="../../../../../framework/mt/Sys" />
+                                       <Add directory="../../../../../framework/rpcWindows" />
+                                       <Add directory="../../../../../framework/platform/windows" />
+                               </Compiler>
+                               <ResourceCompiler>
+                                       <Add directory="../../../../cmdLine" />
+                                       <Add directory="../../../../../framework/mt" />
+                                       <Add directory="../../../../../framework/mt/Af" />
+                                       <Add directory="../../../../../framework/mt/Sapi" />
+                                       <Add directory="../../../../../framework/mt/Zdo" />
+                                       <Add directory="../../../../../framework/mt/Sys" />
+                                       <Add directory="../../../../../framework/rpcWindows" />
+                                       <Add directory="../../../../../framework/platform/windows" />
+                               </ResourceCompiler>
+                               <Linker>
+                                       <Add option="-s" />
+                                       <Add directory="../../../../../framework/mt/Af" />
+                                       <Add directory="../../../../cmdLine" />
+                                       <Add directory="../../../../../framework/mt" />
+                                       <Add directory="../../../../../framework/mt/Sapi" />
+                                       <Add directory="../../../../../framework/mt/Zdo" />
+                                       <Add directory="../../../../../framework/mt/Sys" />
+                                       <Add directory="../../../../../framework/rpcWindows" />
+                                       <Add directory="../../../../../framework/platform/windows" />
+                               </Linker>
+                       </Target>
+               </Build>
+               <Compiler>
+                       <Add option="-Wall" />
+                       <Add directory="../../../../../framework/rpcWindows" />
+                       <Add directory="../../../../cmdLine" />
+                       <Add directory="../../../../../framework/mt" />
+                       <Add directory="../../../../../framework/mt/Af" />
+                       <Add directory="../../../../../framework/mt/Sapi" />
+                       <Add directory="../../../../../framework/mt/Zdo" />
+                       <Add directory="../../../../../framework/mt/Sys" />
+                       <Add directory="../../../../../framework/platform/windows" />
+               </Compiler>
+               <ResourceCompiler>
+                       <Add directory="../../../../../framework/rpcWindows" />
+                       <Add directory="../../../../cmdLine" />
+                       <Add directory="../../../../../framework/mt" />
+                       <Add directory="../../../../../framework/mt/Af" />
+                       <Add directory="../../../../../framework/mt/Sapi" />
+                       <Add directory="../../../../../framework/mt/Zdo" />
+                       <Add directory="../../../../../framework/mt/Sys" />
+                       <Add directory="../../../../../framework/platform/windows" />
+               </ResourceCompiler>
+               <Linker>
+                       <Add directory="../../../../../framework/rpcWindows" />
+                       <Add directory="../../../../../framework/mt/Af" />
+                       <Add directory="../../../../cmdLine" />
+                       <Add directory="../../../../../framework/mt" />
+                       <Add directory="../../../../../framework/mt/Sapi" />
+                       <Add directory="../../../../../framework/mt/Zdo" />
+                       <Add directory="../../../../../framework/mt/Sys" />
+                       <Add directory="../../../../../framework/platform/windows" />
+               </Linker>
+               <Unit filename="../main.c">
+                       <Option compilerVar="CC" />
+               </Unit>
+               <Extensions>
+                       <code_completion />
+                       <envvars />
+                       <debugger />
+               </Extensions>
+       </Project>
+</CodeBlocks_project_file>
diff --git a/examples/cmdLine/build/windows/cmdLineBuild/cmdLineBuild.layout b/examples/cmdLine/build/windows/cmdLineBuild/cmdLineBuild.layout
new file mode 100644 (file)
index 0000000..7efa686
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_layout_file>
+       <ActiveTarget name="Debug" />
+       <File name="..\main.c" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
+               <Cursor>
+                       <Cursor1 position="2575" topLine="83" />
+               </Cursor>
+       </File>
+</CodeBlocks_layout_file>
diff --git a/examples/cmdLine/build/windows/main.c b/examples/cmdLine/build/windows/main.c
new file mode 100644 (file)
index 0000000..04240b1
--- /dev/null
@@ -0,0 +1,107 @@
+/**************************************************************************************************\r
+ * Filename:       main.c\r
+ * Description:    This file contains the main for the gnu platform.\r
+ *\r
+ *\r
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/\r
+ *\r
+ *\r
+ *  Redistribution and use in source and binary forms, with or without\r
+ *  modification, are permitted provided that the following conditions\r
+ *  are met:\r
+ *\r
+ *    Redistributions of source code must retain the above copyright\r
+ *    notice, this list of conditions and the following disclaimer.\r
+ *\r
+ *    Redistributions in binary form must reproduce the above copyright\r
+ *    notice, this list of conditions and the following disclaimer in the\r
+ *    documentation and/or other materials provided with the\r
+ *    distribution.\r
+ *\r
+ *    Neither the name of Texas Instruments Incorporated nor the names of\r
+ *    its contributors may be used to endorse or promote products derived\r
+ *    from this software without specific prior written permission.\r
+ *\r
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ *\r
+ */\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include <process.h>\r
+#include "rpc.h"\r
+#include "cmdLine.h"\r
+\r
+#include "dbgPrint.h"\r
+\r
+void *rpcTask(void *argument)\r
+{\r
+  while(1)\r
+  {\r
+       rpcProcess();\r
+  }\r
+\r
+  dbg_print(PRINT_LEVEL_WARNING, "rpcTask exited!\n");\r
+}\r
+\r
+void *appTask(void *argument)\r
+{\r
+  while(1)\r
+  {\r
+               appProcess(NULL);\r
+  }\r
+}
+
+\r
+\r
+int main(int argc, char* argv[])\r
+{\r
+    //int retval = 0;\r
+    char * selected_serial_port;\r
+    int param = 0;\r
+    int * pparam = &param;\r
+\r
+    dbg_print(PRINT_LEVEL_INFO, "%s -- %s %s\n", argv[0], __DATE__, __TIME__);\r
+\r
+    // accept only 1\r
+    if (argc < 2) {\r
+        usage(argv[0]);\r
+        dbg_print(PRINT_LEVEL_INFO, "attempting to use COM6\n\n");\r
+        selected_serial_port = "COM10";\r
+    } else {\r
+        selected_serial_port = argv[1];\r
+\r
+    }\r
+\r
+    int serialPortFd = rpcOpen(selected_serial_port, 0);\r
+    if (serialPortFd == -1) {\r
+               dbg_print(PRINT_LEVEL_ERROR, "could not open serial port\n");\r
+        exit(-1);\r
+    }\r
+\r
+\r
+    //init the application thread to register the callbacks\r
+    rpcInitMq();\r
+\r
+    appInit();\r
+    //Start the Rx thread\r
+    dbg_print(PRINT_LEVEL_INFO, "creating RPC thread\n");\r
+   _beginthread( rpcTask, 0, (void *) pparam );\r
+    param++;\r
+\r
+    //Start the example thread\r
+    dbg_print(PRINT_LEVEL_INFO, "creating example thread\n");\r
+    _beginthread( appTask, 0, (void *) pparam );\r
+    param++;\r
+    while(1);\r
+\r
+}\r
diff --git a/examples/cmdLine/cmdLine.c b/examples/cmdLine/cmdLine.c
new file mode 100644 (file)
index 0000000..32019fc
--- /dev/null
@@ -0,0 +1,3470 @@
+/**************************************************************************************************\r
+ * Filename:       cmdLine.c\r
+ * Description:    This file contains cmdLine application.\r
+ *\r
+ *\r
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/\r
+ *\r
+ *\r
+ *  Redistribution and use in source and binary forms, with or without\r
+ *  modification, are permitted provided that the following conditions\r
+ *  are met:\r
+ *\r
+ *    Redistributions of source code must retain the above copyright\r
+ *    notice, this list of conditions and the following disclaimer.\r
+ *\r
+ *    Redistributions in binary form must reproduce the above copyright\r
+ *    notice, this list of conditions and the following disclaimer in the\r
+ *    documentation and/or other materials provided with the\r
+ *    distribution.\r
+ *\r
+ *    Neither the name of Texas Instruments Incorporated nor the names of\r
+ *    its contributors may be used to endorse or promote products derived\r
+ *    from this software without specific prior written permission.\r
+ *\r
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ *\r
+ */\r
+\r
+/*********************************************************************\r
+ * INCLUDES\r
+ */\r
+#include <string.h>\r
+#include <stdio.h>\r
+#include <unistd.h>\r
+#include <stdlib.h>\r
+\r
+#include "rpc.h"\r
+#include "mtSys.h"\r
+#include "mtZdo.h"\r
+#include "mtAf.h"\r
+#include "mtParser.h"\r
+#include "mtSapi.h"\r
+#include "rpcTransport.h"\r
+#include "dbgPrint.h"\r
+#include "hostConsole.h"\r
+\r
+/*********************************************************************\r
+ * MACROS\r
+ */\r
+#define KNRM  "\x1B[0m"\r
+#define KRED  "\x1B[31m"\r
+#define KGRN  "\x1B[32m"\r
+#define KYEL  "\x1B[33m"\r
+#define KBLU  "\x1B[34m"\r
+#define KMAG  "\x1B[35m"\r
+#define KCYN  "\x1B[36m"\r
+#define KWHT  "\x1B[37m"\r
+\r
+#define SET_RSP_COLOR(); consolePrint("%s", KYEL);\r
+#define SET_HELP_COLOR(); consolePrint("%s", KGRN);\r
+#define SET_PARAM_COLOR(); consolePrint("%s", KCYN);\r
+#define SET_NRM_COLOR(); consolePrint("%s", KNRM);\r
+\r
+/*********************************************************************\r
+ * TYPES\r
+ */\r
+\r
+/*********************************************************************\r
+ * LOCAL VARIABLE\r
+ */\r
+\r
+//init ZDO device state\r
+devStates_t devState = DEV_HOLD;\r
+uint8_t gSrcEndPoint = 1;\r
+uint8_t gDstEndPoint = 1;\r
+\r
+/***********************************************************************/\r
+\r
+void usage(char* exeName)\r
+{\r
+       consolePrint("Usage: ./%s <port>\n", exeName);\r
+       consolePrint("Eample: ./%s /dev/ttyACM0\n", exeName);\r
+}\r
+\r
+/*********************************************************************\r
+ * LOCAL FUNCTIONS\r
+ */\r
+//ZDO Callbacks\r
+static uint8_t mtZdoStateChangeIndCb(uint8_t newDevState);\r
+static uint8_t mtZdoGetLinkKeyCb(GetLinkKeySrspFormat_t *msg);\r
+static uint8_t mtZdoNwkAddrRspCb(NwkAddrRspFormat_t *msg);\r
+static uint8_t mtZdoIeeeAddrRspCb(IeeeAddrRspFormat_t *msg);\r
+static uint8_t mtZdoNodeDescRspCb(NodeDescRspFormat_t *msg);\r
+static uint8_t mtZdoPowerDescRspCb(PowerDescRspFormat_t *msg);\r
+static uint8_t mtZdoSimpleDescRspCb(SimpleDescRspFormat_t *msg);\r
+static uint8_t mtZdoActiveEpRspCb(ActiveEpRspFormat_t *msg);\r
+static uint8_t mtZdoMatchDescRspCb(MatchDescRspFormat_t *msg);\r
+static uint8_t mtZdoComplexDescRspCb(ComplexDescRspFormat_t *msg);\r
+static uint8_t mtZdoUserDescRspCb(UserDescRspFormat_t *msg);\r
+static uint8_t mtZdoUserDescConfCb(UserDescConfFormat_t *msg);\r
+static uint8_t mtZdoServerDiscRspCb(ServerDiscRspFormat_t *msg);\r
+static uint8_t mtZdoEndDeviceBindRspCb(EndDeviceBindRspFormat_t *msg);\r
+static uint8_t mtZdoBindRspCb(BindRspFormat_t *msg);\r
+static uint8_t mtZdoUnbindRspCb(UnbindRspFormat_t *msg);\r
+static uint8_t mtZdoMgmtNwkDiscRspCb(MgmtNwkDiscRspFormat_t *msg);\r
+static uint8_t mtZdoMgmtLqiRspCb(MgmtLqiRspFormat_t *msg);\r
+static uint8_t mtZdoMgmtRtgRspCb(MgmtRtgRspFormat_t *msg);\r
+static uint8_t mtZdoMgmtBindRspCb(MgmtBindRspFormat_t *msg);\r
+static uint8_t mtZdoMgmtLeaveRspCb(MgmtLeaveRspFormat_t *msg);\r
+static uint8_t mtZdoMgmtDirectJoinRspCb(MgmtDirectJoinRspFormat_t *msg);\r
+static uint8_t mtZdoMgmtPermitJoinRspCb(MgmtPermitJoinRspFormat_t *msg);\r
+static uint8_t mtZdoEndDeviceAnnceIndCb(EndDeviceAnnceIndFormat_t *msg);\r
+static uint8_t mtZdoMatchDescRspSentCb(MatchDescRspSentFormat_t *msg);\r
+static uint8_t mtZdoStatusErrorRspCb(StatusErrorRspFormat_t *msg);\r
+static uint8_t mtZdoSrcRtgIndCb(SrcRtgIndFormat_t *msg);\r
+static uint8_t mtZdoBeaconNotifyIndCb(BeaconNotifyIndFormat_t *msg);\r
+static uint8_t mtZdoJoinCnfCb(JoinCnfFormat_t *msg);\r
+static uint8_t mtZdoNwkDiscoveryCnfCb(NwkDiscoveryCnfFormat_t *msg);\r
+static uint8_t mtZdoLeaveIndCb(LeaveIndFormat_t *msg);\r
+static uint8_t mtZdoMsgCbIncomingCb(MsgCbIncomingFormat_t *msg);\r
+\r
+//SYS Callbacks\r
+//static uint8_t mtSysResetInd(uint8_t resetReason, uint8_t version[5]);\r
+static uint8_t mtSysPingSrspCb(PingSrspFormat_t *msg);\r
+static uint8_t mtSysGetExtAddrSrspCb(GetExtAddrSrspFormat_t *msg);\r
+static uint8_t mtSysRamReadSrspCb(RamReadSrspFormat_t *msg);\r
+static uint8_t mtSysResetIndCb(ResetIndFormat_t *msg);\r
+static uint8_t mtSysVersionSrspCb(VersionSrspFormat_t *msg);\r
+static uint8_t mtSysOsalNvReadSrspCb(OsalNvReadSrspFormat_t *msg);\r
+static uint8_t mtSysOsalNvLengthSrspCb(OsalNvLengthSrspFormat_t *msg);\r
+static uint8_t mtSysOsalTimerExpiredCb(OsalTimerExpiredFormat_t *msg);\r
+static uint8_t mtSysStackTuneSrspCb(StackTuneSrspFormat_t *msg);\r
+static uint8_t mtSysAdcReadSrspCb(AdcReadSrspFormat_t *msg);\r
+static uint8_t mtSysGpioSrspCb(GpioSrspFormat_t *msg);\r
+static uint8_t mtSysRandomSrspCb(RandomSrspFormat_t *msg);\r
+static uint8_t mtSysGetTimeSrspCb(GetTimeSrspFormat_t *msg);\r
+static uint8_t mtSysSetTxPowerSrspCb(SetTxPowerSrspFormat_t *msg);\r
+\r
+//AF callbacks\r
+static uint8_t mtAfDataConfirmCb(DataConfirmFormat_t *msg);\r
+static uint8_t mtAfIncomingMsgCb(IncomingMsgFormat_t *msg);\r
+static uint8_t mtAfIncomingMsgExt(IncomingMsgExtFormat_t *msg);\r
+static uint8_t mtAfDataRetrieveSrspCb(DataRetrieveSrspFormat_t *msg);\r
+static uint8_t mtAfReflectErrorCb(ReflectErrorFormat_t *msg);\r
+\r
+//SAPI Callbacks\r
+static uint8_t mtSapiReadConfigurationSrspCb(ReadConfigurationSrspFormat_t *msg);\r
+static uint8_t mtSapiGetDeviceInfoSrspCb(GetDeviceInfoSrspFormat_t *msg);\r
+static uint8_t mtSapiFindDeviceCnfCb(FindDeviceCnfFormat_t *msg);\r
+static uint8_t mtSapiSendDataCnfCb(SendDataCnfFormat_t *msg);\r
+static uint8_t mtSapiReceiveDataIndCb(ReceiveDataIndFormat_t *msg);\r
+static uint8_t mtSapiAllowBindCnfCb(AllowBindCnfFormat_t *msg);\r
+static uint8_t mtSapiBindCnfCb(BindCnfFormat_t *msg);\r
+static uint8_t mtSapiStartCnfCb(StartCnfFormat_t *msg);\r
+\r
+//helper functions\r
+static uint8_t setNVStartup(uint8_t startupOption);\r
+static uint8_t setNVChanList(uint32_t chanList);\r
+static uint8_t setNVPanID(uint32_t panId);\r
+static uint8_t setNVDevType(uint8_t devType);\r
+static int32_t startNetwork(void);\r
+static int32_t registerAf(void);\r
+\r
+typedef struct\r
+{\r
+       char *name;\r
+       uint8_t size;\r
+       uint8_t isList;\r
+} cmdAtt_t;\r
+\r
+typedef struct\r
+{\r
+       char *cmdName;\r
+       char *cmdDesc;\r
+       uint8_t attNum;\r
+       cmdAtt_t atts[20];\r
+} cmd_t;\r
+#define COMMANDS_SIZE  72\r
+\r
+cmd_t commands[COMMANDS_SIZE];\r
+\r
+/*********************************************************************\r
+ * CALLBACK FUNCTIONS\r
+ */\r
+\r
+// SYS callbacks\r
+static mtSysCb_t mtSysCb =\r
+       { mtSysPingSrspCb, mtSysGetExtAddrSrspCb, mtSysRamReadSrspCb,\r
+               mtSysResetIndCb, mtSysVersionSrspCb, mtSysOsalNvReadSrspCb,\r
+               mtSysOsalNvLengthSrspCb, mtSysOsalTimerExpiredCb,\r
+               mtSysStackTuneSrspCb, mtSysAdcReadSrspCb, mtSysGpioSrspCb,\r
+               mtSysRandomSrspCb, mtSysGetTimeSrspCb, mtSysSetTxPowerSrspCb };\r
+\r
+static mtZdoCb_t mtZdoCb =\r
+       { mtZdoNwkAddrRspCb,       // MT_ZDO_NWK_ADDR_RSP\r
+               mtZdoIeeeAddrRspCb,      // MT_ZDO_IEEE_ADDR_RSP\r
+               mtZdoNodeDescRspCb,      // MT_ZDO_NODE_DESC_RSP\r
+               mtZdoPowerDescRspCb,     // MT_ZDO_POWER_DESC_RSP\r
+               mtZdoSimpleDescRspCb,    // MT_ZDO_SIMPLE_DESC_RSP\r
+               mtZdoActiveEpRspCb,      // MT_ZDO_ACTIVE_EP_RSP\r
+               mtZdoMatchDescRspCb,     // MT_ZDO_MATCH_DESC_RSP\r
+               mtZdoComplexDescRspCb,   // MT_ZDO_COMPLEX_DESC_RSP\r
+               mtZdoUserDescRspCb,      // MT_ZDO_USER_DESC_RSP\r
+               mtZdoUserDescConfCb,     // MT_ZDO_USER_DESC_CONF\r
+               mtZdoServerDiscRspCb,    // MT_ZDO_SERVER_DISC_RSP\r
+               mtZdoEndDeviceBindRspCb, // MT_ZDO_END_DEVICE_BIND_RSP\r
+               mtZdoBindRspCb,          // MT_ZDO_BIND_RSP\r
+               mtZdoUnbindRspCb,        // MT_ZDO_UNBIND_RSP\r
+               mtZdoMgmtNwkDiscRspCb,   // MT_ZDO_MGMT_NWK_DISC_RSP\r
+               mtZdoMgmtLqiRspCb,       // MT_ZDO_MGMT_LQI_RSP\r
+               mtZdoMgmtRtgRspCb,       // MT_ZDO_MGMT_RTG_RSP\r
+               mtZdoMgmtBindRspCb,      // MT_ZDO_MGMT_BIND_RSP\r
+               mtZdoMgmtLeaveRspCb,     // MT_ZDO_MGMT_LEAVE_RSP\r
+               mtZdoMgmtDirectJoinRspCb,     // MT_ZDO_MGMT_DIRECT_JOIN_RSP\r
+               mtZdoMgmtPermitJoinRspCb,     // MT_ZDO_MGMT_PERMIT_JOIN_RSP\r
+               mtZdoStateChangeIndCb,   // MT_ZDO_STATE_CHANGE_IND\r
+               mtZdoEndDeviceAnnceIndCb,   // MT_ZDO_END_DEVICE_ANNCE_IND\r
+               mtZdoSrcRtgIndCb,        // MT_ZDO_SRC_RTG_IND\r
+               mtZdoBeaconNotifyIndCb,  //MT_ZDO_BEACON_NOTIFY_IND\r
+               mtZdoJoinCnfCb,                  //MT_ZDO_JOIN_CNF\r
+               mtZdoNwkDiscoveryCnfCb,  //MT_ZDO_NWK_DISCOVERY_CNF\r
+               NULL,                    // MT_ZDO_CONCENTRATOR_IND_CB\r
+               mtZdoLeaveIndCb,         // MT_ZDO_LEAVE_IND\r
+               mtZdoStatusErrorRspCb,   //MT_ZDO_STATUS_ERROR_RSP\r
+               mtZdoMatchDescRspSentCb,  //MT_ZDO_MATCH_DESC_RSP_SENT\r
+               mtZdoMsgCbIncomingCb, mtZdoGetLinkKeyCb };\r
+\r
+static mtAfCb_t mtAfCb =\r
+       { mtAfDataConfirmCb,                            //MT_AF_DATA_CONFIRM\r
+               mtAfIncomingMsgCb,                              //MT_AF_INCOMING_MSG\r
+               mtAfIncomingMsgExt,                             //MT_AF_INCOMING_MSG_EXT\r
+               mtAfDataRetrieveSrspCb,                 //MT_AF_DATA_RETRIEVE\r
+               mtAfReflectErrorCb,                         //MT_AF_REFLECT_ERROR\r
+           };\r
+\r
+// SAPI callbacks\r
+static mtSapiCb_t mtSapiCb =\r
+       { mtSapiReadConfigurationSrspCb,                                //MT_SAPI_READ_CONFIGURATION\r
+               mtSapiGetDeviceInfoSrspCb,                              //MT_SAPI_GET_DEVICE_INFO\r
+               mtSapiFindDeviceCnfCb,                          //MT_SAPI_FIND_DEVICE_CNF\r
+               mtSapiSendDataCnfCb,                            //MT_SAPI_SEND_DATA_CNF\r
+               mtSapiReceiveDataIndCb,                         //MT_SAPI_RECEIVE_DATA_IND\r
+               mtSapiAllowBindCnfCb,                           //MT_SAPI_ALLOW_BIND_CNF\r
+               mtSapiBindCnfCb,                                //MT_SAPI_BIND_CNF\r
+               mtSapiStartCnfCb,                               //MT_SAPI_START_CNF\r
+           };\r
+\r
+static void InitCmds(void)\r
+{\r
+\r
+       commands[0].cmdName = "SYS_PING";\r
+       commands[0].cmdDesc =\r
+               " This command issues PING requests to verify if a device is active and check the\n"\r
+                               " capability of the device.\n";\r
+       commands[0].attNum = 0;\r
+       commands[1].cmdName = "SYS_SET_EXTADDR";\r
+       commands[1].cmdDesc =\r
+               " This command is used to set the extended address of the device.\n";\r
+       commands[1].attNum = 1;\r
+       commands[1].atts[0].name = "ExtAddr";\r
+       commands[1].atts[0].size = 8;\r
+       commands[1].atts[0].isList = 0;\r
+       commands[2].cmdName = "SYS_GET_EXTADDR";\r
+       commands[2].cmdDesc =\r
+               " This command is used to get the extended address of the device.\n";\r
+       commands[2].attNum = 0;\r
+       commands[3].cmdName = "SYS_RAM_READ";\r
+       commands[3].cmdDesc =\r
+               " This command is used by the tester to read a single memory location in the target\n"\r
+                               " RAM. The command accepts an address value and returns the memory value present in\n"\r
+                               " the target RAM at that address.\n";\r
+       commands[3].attNum = 2;\r
+       commands[3].atts[0].name = "Address";\r
+       commands[3].atts[0].size = 2;\r
+       commands[3].atts[0].isList = 0;\r
+       commands[3].atts[1].name = "Len";\r
+       commands[3].atts[1].size = 1;\r
+       commands[3].atts[1].isList = 0;\r
+       commands[4].cmdName = "SYS_RAM_WRITE";\r
+       commands[4].cmdDesc =\r
+               " This command is used by the tester to write to a particular location in the target\n"\r
+                               " RAM. The command accepts an address location and a memory value. The memory value\n"\r
+                               " is written to the address location in the target RAM.\n";\r
+       commands[4].attNum = 3;\r
+       commands[4].atts[0].name = "Address";\r
+       commands[4].atts[0].size = 2;\r
+       commands[4].atts[0].isList = 0;\r
+       commands[4].atts[1].name = "Len";\r
+       commands[4].atts[1].size = 1;\r
+       commands[4].atts[1].isList = 0;\r
+       commands[4].atts[2].name = "Value";\r
+       commands[4].atts[2].size = 1;\r
+       commands[4].atts[2].isList = 128;\r
+       commands[5].cmdName = "SYS_RESET_REQ";\r
+       commands[5].cmdDesc =\r
+               " This command is sent by the tester to reset the target device.\n";\r
+       commands[5].attNum = 1;\r
+       commands[5].atts[0].name = "Type";\r
+       commands[5].atts[0].size = 1;\r
+       commands[5].atts[0].isList = 0;\r
+       commands[6].cmdName = "SYS_VERSION";\r
+       commands[6].cmdDesc =\r
+               " This command is used to request for the device\'s version string.\n";\r
+       commands[6].attNum = 0;\r
+       commands[7].cmdName = "SYS_OSAL_NV_READ";\r
+       commands[7].cmdDesc =\r
+               " This command is used by the tester to read a single memory item from the target\n"\r
+                               " non-volatile memory. The command accepts an attribute Id value and data offset and\n"\r
+                               " returns the memory value present in the target for the specified attribute Id.\n";\r
+       commands[7].attNum = 2;\r
+       commands[7].atts[0].name = "Id";\r
+       commands[7].atts[0].size = 2;\r
+       commands[7].atts[0].isList = 0;\r
+       commands[7].atts[1].name = "Offset";\r
+       commands[7].atts[1].size = 1;\r
+       commands[7].atts[1].isList = 0;\r
+       commands[8].cmdName = "SYS_OSAL_NV_WRITE";\r
+       commands[8].cmdDesc =\r
+               " This command is used by the tester to write to a particular item in non-volatile\n"\r
+                               " memory. The command accepts an attribute Id, data offset, data length, and attribute\n"\r
+                               " value. The attribute value is written to the location specified for the attribute\n"\r
+                               " Id in the target.\n";\r
+       commands[8].attNum = 4;\r
+       commands[8].atts[0].name = "Id";\r
+       commands[8].atts[0].size = 2;\r
+       commands[8].atts[0].isList = 0;\r
+       commands[8].atts[1].name = "Offset";\r
+       commands[8].atts[1].size = 1;\r
+       commands[8].atts[1].isList = 0;\r
+       commands[8].atts[2].name = "Len";\r
+       commands[8].atts[2].size = 1;\r
+       commands[8].atts[2].isList = 0;\r
+       commands[8].atts[3].name = "Value";\r
+       commands[8].atts[3].size = 1;\r
+       commands[8].atts[3].isList = 246;\r
+       commands[9].cmdName = "SYS_OSAL_NV_ITEM_INIT";\r
+       commands[9].cmdDesc =\r
+               " This command is used by the tester to write to a particular item in non-volatile\n"\r
+                               " memory. The command accepts an attribute Id, data offset, data length, and attribute\n"\r
+                               " value. The attribute value is written to the location specified for the attribute\n"\r
+                               " Id in the target.\n";\r
+       commands[9].attNum = 4;\r
+       commands[9].atts[0].name = "Id";\r
+       commands[9].atts[0].size = 2;\r
+       commands[9].atts[0].isList = 0;\r
+       commands[9].atts[1].name = "ItemLen";\r
+       commands[9].atts[1].size = 2;\r
+       commands[9].atts[1].isList = 0;\r
+       commands[9].atts[2].name = "InitLen";\r
+       commands[9].atts[2].size = 1;\r
+       commands[9].atts[2].isList = 0;\r
+       commands[9].atts[3].name = "InitData";\r
+       commands[9].atts[3].size = 1;\r
+       commands[9].atts[3].isList = 245;\r
+       commands[10].cmdName = "SYS_OSAL_NV_DELETE";\r
+       commands[10].cmdDesc =\r
+               " This command is used by the tester to delete an item from the non-volatile memory.\n"\r
+                               " The ItemLen parameter must match the length of the NV item or the command will fail.\n"\r
+                               " Use this command with caution â€“ deleted items cannot be recovered.\n";\r
+       commands[10].attNum = 2;\r
+       commands[10].atts[0].name = "Id";\r
+       commands[10].atts[0].size = 2;\r
+       commands[10].atts[0].isList = 0;\r
+       commands[10].atts[1].name = "ItemLen";\r
+       commands[10].atts[1].size = 2;\r
+       commands[10].atts[1].isList = 0;\r
+       commands[11].cmdName = "SYS_OSAL_NV_LENGTH";\r
+       commands[11].cmdDesc =\r
+               " This command is used by the tester to get the length of an item in non-volatile\n"\r
+                               " memory. A returned length of zero indicates that the NV item does not exist.\n";\r
+       commands[11].attNum = 1;\r
+       commands[11].atts[0].name = "Id";\r
+       commands[11].atts[0].size = 2;\r
+       commands[11].atts[0].isList = 0;\r
+       commands[12].cmdName = "SYS_OSAL_START_TIMER";\r
+       commands[12].cmdDesc =\r
+               " This command is used by the tester to start a timer event. The event will expired\n"\r
+                               " after the indicated amount of time and a notification will be sent back to the tester.\n";\r
+       commands[12].attNum = 2;\r
+       commands[12].atts[0].name = "Id";\r
+       commands[12].atts[0].size = 1;\r
+       commands[12].atts[0].isList = 0;\r
+       commands[12].atts[1].name = "Timeout";\r
+       commands[12].atts[1].size = 2;\r
+       commands[12].atts[1].isList = 0;\r
+       commands[13].cmdName = "SYS_OSAL_STOP_TIMER";\r
+       commands[13].cmdDesc =\r
+               " This command is used by the tester to stop a timer event.\n";\r
+       commands[13].attNum = 1;\r
+       commands[13].atts[0].name = "Id";\r
+       commands[13].atts[0].size = 1;\r
+       commands[13].atts[0].isList = 0;\r
+       commands[14].cmdName = "SYS_STACK_TUNE";\r
+       commands[14].cmdDesc =\r
+               " This command is used by the tester to tune intricate or arcane settings at runtime.\n";\r
+       commands[14].attNum = 2;\r
+       commands[14].atts[0].name = "Operation";\r
+       commands[14].atts[0].size = 1;\r
+       commands[14].atts[0].isList = 0;\r
+       commands[14].atts[1].name = "Value";\r
+       commands[14].atts[1].size = 1;\r
+       commands[14].atts[1].isList = 0;\r
+       commands[15].cmdName = "SYS_ADC_READ";\r
+       commands[15].cmdDesc =\r
+               " This command reads a value from the ADC based on specified channel and resolution.\n";\r
+       commands[15].attNum = 2;\r
+       commands[15].atts[0].name = "Channel";\r
+       commands[15].atts[0].size = 1;\r
+       commands[15].atts[0].isList = 0;\r
+       commands[15].atts[1].name = "Resolution";\r
+       commands[15].atts[1].size = 1;\r
+       commands[15].atts[1].isList = 0;\r
+       commands[16].cmdName = "SYS_GPIO";\r
+       commands[16].cmdDesc =\r
+               " This command is used by the tester to control the GPIO pins.\n";\r
+       commands[16].attNum = 2;\r
+       commands[16].atts[0].name = "Operation";\r
+       commands[16].atts[0].size = 1;\r
+       commands[16].atts[0].isList = 0;\r
+       commands[16].atts[1].name = "Value";\r
+       commands[16].atts[1].size = 1;\r
+       commands[16].atts[1].isList = 0;\r
+       commands[17].cmdName = "SYS_RANDOM";\r
+       commands[17].cmdDesc =\r
+               " This command is used by the tester to get a random 16-bit number.\n";\r
+       commands[17].attNum = 0;\r
+       commands[18].cmdName = "SYS_SET_TIME";\r
+       commands[18].cmdDesc =\r
+               " This command is used by the tester to set the target system date and time. The time\n"\r
+                               " can be specified in seconds since 00:00:00 on January 1, 2000 or in parsed\n"\r
+                               " date/time components.\n";\r
+       commands[18].attNum = 7;\r
+       commands[18].atts[0].name = "UTCTime";\r
+       commands[18].atts[0].size = 4;\r
+       commands[18].atts[0].isList = 0;\r
+       commands[18].atts[1].name = "Hour";\r
+       commands[18].atts[1].size = 1;\r
+       commands[18].atts[1].isList = 0;\r
+       commands[18].atts[2].name = "Minute";\r
+       commands[18].atts[2].size = 1;\r
+       commands[18].atts[2].isList = 0;\r
+       commands[18].atts[3].name = "Second";\r
+       commands[18].atts[3].size = 1;\r
+       commands[18].atts[3].isList = 0;\r
+       commands[18].atts[4].name = "Month";\r
+       commands[18].atts[4].size = 1;\r
+       commands[18].atts[4].isList = 0;\r
+       commands[18].atts[5].name = "Day";\r
+       commands[18].atts[5].size = 1;\r
+       commands[18].atts[5].isList = 0;\r
+       commands[18].atts[6].name = "Year";\r
+       commands[18].atts[6].size = 2;\r
+       commands[18].atts[6].isList = 0;\r
+       commands[19].cmdName = "SYS_GET_TIME";\r
+       commands[19].cmdDesc =\r
+               " This command is used by the tester to get the target system date and time. The time\n"\r
+                               " is returned in seconds since 00:00:00 on January 1, 2000 and parsed date/time\n"\r
+                               " components.\n";\r
+       commands[19].attNum = 0;\r
+       commands[20].cmdName = "SYS_SET_TX_POWER";\r
+       commands[20].cmdDesc =\r
+               " This command is used by the tester to set the target system radio transmit power.\n"\r
+                               " The returned TX power is the actual setting applied to the radio â€“ nearest characterized\n"\r
+                               " value for the specific radio.\n";\r
+       commands[20].attNum = 1;\r
+       commands[20].atts[0].name = "TxPower";\r
+       commands[20].atts[0].size = 1;\r
+       commands[20].atts[0].isList = 0;\r
+       commands[21].cmdName = "AF_REGISTER";\r
+       commands[21].cmdDesc =\r
+               " This command enables the tester to register an application's endpoint description.\n";\r
+       commands[21].attNum = 9;\r
+       commands[21].atts[0].name = "EndPoint";\r
+       commands[21].atts[0].size = 1;\r
+       commands[21].atts[0].isList = 0;\r
+       commands[21].atts[1].name = "AppProfId";\r
+       commands[21].atts[1].size = 2;\r
+       commands[21].atts[1].isList = 0;\r
+       commands[21].atts[2].name = "AppDeviceId";\r
+       commands[21].atts[2].size = 2;\r
+       commands[21].atts[2].isList = 0;\r
+       commands[21].atts[3].name = "AppDevVer";\r
+       commands[21].atts[3].size = 1;\r
+       commands[21].atts[3].isList = 0;\r
+       commands[21].atts[4].name = "LatencyReq";\r
+       commands[21].atts[4].size = 1;\r
+       commands[21].atts[4].isList = 0;\r
+       commands[21].atts[5].name = "AppNumInClusters";\r
+       commands[21].atts[5].size = 1;\r
+       commands[21].atts[5].isList = 0;\r
+       commands[21].atts[6].name = "AppInClusterList";\r
+       commands[21].atts[6].size = 2;\r
+       commands[21].atts[6].isList = 16;\r
+       commands[21].atts[7].name = "AppNumOutClusters";\r
+       commands[21].atts[7].size = 1;\r
+       commands[21].atts[7].isList = 0;\r
+       commands[21].atts[8].name = "AppOutClusterList";\r
+       commands[21].atts[8].size = 2;\r
+       commands[21].atts[8].isList = 16;\r
+       commands[22].cmdName = "AF_DATA_REQUEST";\r
+       commands[22].cmdDesc =\r
+               " This command is used by the tester to build and send a message through AF layer.\n";\r
+       commands[22].attNum = 9;\r
+       commands[22].atts[0].name = "DstAddr";\r
+       commands[22].atts[0].size = 2;\r
+       commands[22].atts[0].isList = 0;\r
+       commands[22].atts[1].name = "DstEndpoint";\r
+       commands[22].atts[1].size = 1;\r
+       commands[22].atts[1].isList = 0;\r
+       commands[22].atts[2].name = "SrcEndpoint";\r
+       commands[22].atts[2].size = 1;\r
+       commands[22].atts[2].isList = 0;\r
+       commands[22].atts[3].name = "ClusterID";\r
+       commands[22].atts[3].size = 2;\r
+       commands[22].atts[3].isList = 0;\r
+       commands[22].atts[4].name = "TransID";\r
+       commands[22].atts[4].size = 1;\r
+       commands[22].atts[4].isList = 0;\r
+       commands[22].atts[5].name = "Options";\r
+       commands[22].atts[5].size = 1;\r
+       commands[22].atts[5].isList = 0;\r
+       commands[22].atts[6].name = "Radius";\r
+       commands[22].atts[6].size = 1;\r
+       commands[22].atts[6].isList = 0;\r
+       commands[22].atts[7].name = "Len";\r
+       commands[22].atts[7].size = 1;\r
+       commands[22].atts[7].isList = 0;\r
+       commands[22].atts[8].name = "Data";\r
+       commands[22].atts[8].size = 1;\r
+       commands[22].atts[8].isList = 128;\r
+       commands[23].cmdName = "AF_DATA_REQUEST_EXT";\r
+       commands[23].cmdDesc =\r
+               " This extended form of the AF_DATA_REQUEST must be used to send an inter-pan message\n"\r
+                               " (note that the target code must be compiled with the INTER_PAN flag defined.) This\n"\r
+                               " extended data request must also be used when making a request with a huge data byte\n"\r
+                               " count which is defined to be a size that would cause the RPC request to exceed the\n"\r
+                               " maximum allowed size:\n \tMT_RPC_DATA_MAX â€“ sizeof(AF_DATA_REQUEST_EXT)\n Where"\r
+                               " sizeof(AF_DATA_REQUEST_EXT) counts everything but the data bytes and now stands\n"\r
+                               " at 20. When making an AF_DATA_REQUEST_EXT with a huge data byte count, the request\n"\r
+                               " shall not contain any data bytes. The huge data buffer is sent over separately as\n"\r
+                               " a sequence of one or more AF_DATA_STORE requests. Note that the outgoing huge message\n"\r
+                               " is timed-out in 15 seconds; thus all AF_DATA_STORE requests must be completed within\n"\r
+                               " 15 seconds of an AF_DATA_REQUEST_EXT with a huge data byte count. And any AF_DATA_REQUEST_EXT\n"\r
+                               " with a huge data byte count must be completed (or timed-out) before another will\n"\r
+                               " be started. The default timeout can be changed by defining the following to other\n"\r
+                               " values:\n \t#if !defined MT_AF_EXEC_CNT\n \t#define MT_AF_EXEC_CNT 15\n \t#endif\n"\r
+                               " \t#if !defined MT_AF_EXEC_DLY\n \t#define MT_AF_EXEC_DLY 1000\n \t#endif\n";\r
+       commands[23].attNum = 11;\r
+       commands[23].atts[0].name = "DstAddrMode";\r
+       commands[23].atts[0].size = 1;\r
+       commands[23].atts[0].isList = 0;\r
+       commands[23].atts[1].name = "DstAddr";\r
+       commands[23].atts[1].size = 8;\r
+       commands[23].atts[1].isList = 0;\r
+       commands[23].atts[2].name = "DstEndpoint";\r
+       commands[23].atts[2].size = 1;\r
+       commands[23].atts[2].isList = 0;\r
+       commands[23].atts[3].name = "DstPanID";\r
+       commands[23].atts[3].size = 2;\r
+       commands[23].atts[3].isList = 0;\r
+       commands[23].atts[4].name = "SrcEndpoint";\r
+       commands[23].atts[4].size = 1;\r
+       commands[23].atts[4].isList = 0;\r
+       commands[23].atts[5].name = "ClusterId";\r
+       commands[23].atts[5].size = 2;\r
+       commands[23].atts[5].isList = 0;\r
+       commands[23].atts[6].name = "TransId";\r
+       commands[23].atts[6].size = 1;\r
+       commands[23].atts[6].isList = 0;\r
+       commands[23].atts[7].name = "Options";\r
+       commands[23].atts[7].size = 1;\r
+       commands[23].atts[7].isList = 0;\r
+       commands[23].atts[8].name = "Radius";\r
+       commands[23].atts[8].size = 1;\r
+       commands[23].atts[8].isList = 0;\r
+       commands[23].atts[9].name = "Len";\r
+       commands[23].atts[9].size = 2;\r
+       commands[23].atts[9].isList = 0;\r
+       commands[23].atts[10].name = "Data";\r
+       commands[23].atts[10].size = 1;\r
+       commands[23].atts[10].isList = 230;\r
+       commands[24].cmdName = "AF_DATA_REQUEST_SRC_RTG";\r
+       commands[24].cmdDesc =\r
+               " This command is used by the tester to build and send a message through AF layer\n"\r
+                               " using source routing.\n";\r
+       commands[24].attNum = 11;\r
+       commands[24].atts[0].name = "DstAddr";\r
+       commands[24].atts[0].size = 2;\r
+       commands[24].atts[0].isList = 0;\r
+       commands[24].atts[1].name = "DstEndpoint";\r
+       commands[24].atts[1].size = 1;\r
+       commands[24].atts[1].isList = 0;\r
+       commands[24].atts[2].name = "SrcEndpoint";\r
+       commands[24].atts[2].size = 1;\r
+       commands[24].atts[2].isList = 0;\r
+       commands[24].atts[3].name = "ClusterID";\r
+       commands[24].atts[3].size = 2;\r
+       commands[24].atts[3].isList = 0;\r
+       commands[24].atts[4].name = "TransID";\r
+       commands[24].atts[4].size = 1;\r
+       commands[24].atts[4].isList = 0;\r
+       commands[24].atts[5].name = "Options";\r
+       commands[24].atts[5].size = 1;\r
+       commands[24].atts[5].isList = 0;\r
+       commands[24].atts[6].name = "Radius";\r
+       commands[24].atts[6].size = 1;\r
+       commands[24].atts[6].isList = 0;\r
+       commands[24].atts[7].name = "RelayCount";\r
+       commands[24].atts[7].size = 1;\r
+       commands[24].atts[7].isList = 0;\r
+       commands[24].atts[8].name = "RelayList";\r
+       commands[24].atts[8].size = 2;\r
+       commands[24].atts[8].isList = 255;\r
+       commands[24].atts[9].name = "Len";\r
+       commands[24].atts[9].size = 1;\r
+       commands[24].atts[9].isList = 0;\r
+       commands[24].atts[10].name = "Data";\r
+       commands[24].atts[10].size = 1;\r
+       commands[24].atts[10].isList = 128;\r
+       commands[25].cmdName = "AF_INTER_PAN_CTL";\r
+       commands[25].cmdDesc =\r
+               " Inter-Pan control command and data. The data content depends upon the command and\n"\r
+                               " the available commands are enumerated as InterPanCtl_t.\n";\r
+       commands[25].attNum = 2;\r
+       commands[25].atts[0].name = "Command";\r
+       commands[25].atts[0].size = 1;\r
+       commands[25].atts[0].isList = 0;\r
+       commands[25].atts[1].name = "Data";\r
+       commands[25].atts[1].size = 1;\r
+       commands[25].atts[1].isList = 3;\r
+       commands[26].cmdName = "AF_DATA_STORE";\r
+       commands[26].cmdDesc =\r
+               " Huge AF data request data buffer store command and data.\n";\r
+       commands[26].attNum = 3;\r
+       commands[26].atts[0].name = "Index";\r
+       commands[26].atts[0].size = 2;\r
+       commands[26].atts[0].isList = 0;\r
+       commands[26].atts[1].name = "Length";\r
+       commands[26].atts[1].size = 1;\r
+       commands[26].atts[1].isList = 0;\r
+       commands[26].atts[2].name = "Data";\r
+       commands[26].atts[2].size = 1;\r
+       commands[26].atts[2].isList = 247;\r
+       commands[27].cmdName = "AF_DATA_RETRIEVE";\r
+       commands[27].cmdDesc =\r
+               " Huge AF incoming message data buffer retrieve command.\n";\r
+       commands[27].attNum = 3;\r
+       commands[27].atts[0].name = "TimeStamp";\r
+       commands[27].atts[0].size = 4;\r
+       commands[27].atts[0].isList = 0;\r
+       commands[27].atts[1].name = "Index";\r
+       commands[27].atts[1].size = 2;\r
+       commands[27].atts[1].isList = 0;\r
+       commands[27].atts[2].name = "Length";\r
+       commands[27].atts[2].size = 1;\r
+       commands[27].atts[2].isList = 0;\r
+       commands[28].cmdName = "AF_APSF_CONFIG_SET";\r
+       commands[28].cmdDesc = " MT proxy for afAPSF_ConfigSet().\n";\r
+       commands[28].attNum = 3;\r
+       commands[28].atts[0].name = "Endpoint";\r
+       commands[28].atts[0].size = 1;\r
+       commands[28].atts[0].isList = 0;\r
+       commands[28].atts[1].name = "FrameDelay";\r
+       commands[28].atts[1].size = 1;\r
+       commands[28].atts[1].isList = 0;\r
+       commands[28].atts[2].name = "WindowSize";\r
+       commands[28].atts[2].size = 1;\r
+       commands[28].atts[2].isList = 0;\r
+       commands[29].cmdName = "ZDO_NWK_ADDR_REQ";\r
+       commands[29].cmdDesc =\r
+               " This message will request the device to send a Network Address Request.\n"\r
+                               " This message sends a broadcast message looking for a 16 bit address with a known\n"\r
+                               " 64 bit IEEE address.\n";\r
+       commands[29].attNum = 3;\r
+       commands[29].atts[0].name = "IEEEAddress";\r
+       commands[29].atts[0].size = 8;\r
+       commands[29].atts[0].isList = 0;\r
+       commands[29].atts[1].name = "ReqType";\r
+       commands[29].atts[1].size = 1;\r
+       commands[29].atts[1].isList = 0;\r
+       commands[29].atts[2].name = "StartIndex";\r
+       commands[29].atts[2].size = 1;\r
+       commands[29].atts[2].isList = 0;\r
+       commands[30].cmdName = "ZDO_IEEE_ADDR_REQ";\r
+       commands[30].cmdDesc =\r
+               " This command will request a device's IEEE 64-bit address.\n";\r
+       commands[30].attNum = 3;\r
+       commands[30].atts[0].name = "ShortAddr";\r
+       commands[30].atts[0].size = 2;\r
+       commands[30].atts[0].isList = 0;\r
+       commands[30].atts[1].name = "ReqType";\r
+       commands[30].atts[1].size = 1;\r
+       commands[30].atts[1].isList = 0;\r
+       commands[30].atts[2].name = "StartIndex";\r
+       commands[30].atts[2].size = 1;\r
+       commands[30].atts[2].isList = 0;\r
+       commands[31].cmdName = "ZDO_NODE_DESC_REQ";\r
+       commands[31].cmdDesc =\r
+               " This command is generated to inquire about the Node Descriptor information of the\n"\r
+                               " destination device\n";\r
+       commands[31].attNum = 2;\r
+       commands[31].atts[0].name = "DstAddr";\r
+       commands[31].atts[0].size = 2;\r
+       commands[31].atts[0].isList = 0;\r
+       commands[31].atts[1].name = "NwkAddrOfInterest";\r
+       commands[31].atts[1].size = 2;\r
+       commands[31].atts[1].isList = 0;\r
+       commands[32].cmdName = "ZDO_POWER_DESC_REQ";\r
+       commands[32].cmdDesc =\r
+               " This command is generated to inquire about the Power Descriptor information of the\n"\r
+                               " destination device.\n";\r
+       commands[32].attNum = 2;\r
+       commands[32].atts[0].name = "DstAddr";\r
+       commands[32].atts[0].size = 2;\r
+       commands[32].atts[0].isList = 0;\r
+       commands[32].atts[1].name = "NwkAddrOfInterest";\r
+       commands[32].atts[1].size = 2;\r
+       commands[32].atts[1].isList = 0;\r
+       commands[33].cmdName = "ZDO_SIMPLE_DESC_REQ";\r
+       commands[33].cmdDesc =\r
+               " This command is generated to inquire as to the Simple Descriptor of the destination\n"\r
+                               " devices Endpoint.\n";\r
+       commands[33].attNum = 3;\r
+       commands[33].atts[0].name = "DstAddr";\r
+       commands[33].atts[0].size = 2;\r
+       commands[33].atts[0].isList = 0;\r
+       commands[33].atts[1].name = "NwkAddrOfInterest";\r
+       commands[33].atts[1].size = 2;\r
+       commands[33].atts[1].isList = 0;\r
+       commands[33].atts[2].name = "Endpoint";\r
+       commands[33].atts[2].size = 1;\r
+       commands[33].atts[2].isList = 0;\r
+       commands[34].cmdName = "ZDO_ACTIVE_EP_REQ";\r
+       commands[34].cmdDesc =\r
+               " This command is generated to request a list of active endpoint from the destination\n"\r
+                               " device.\n";\r
+       commands[34].attNum = 2;\r
+       commands[34].atts[0].name = "DstAddr";\r
+       commands[34].atts[0].size = 2;\r
+       commands[34].atts[0].isList = 0;\r
+       commands[34].atts[1].name = "NwkAddrOfInterest";\r
+       commands[34].atts[1].size = 2;\r
+       commands[34].atts[1].isList = 0;\r
+       commands[35].cmdName = "ZDO_MATCH_DESC_REQ";\r
+       commands[35].cmdDesc =\r
+               " This command is generated to request the device match descriptor.\n";\r
+       commands[35].attNum = 7;\r
+       commands[35].atts[0].name = "DstAddr";\r
+       commands[35].atts[0].size = 2;\r
+       commands[35].atts[0].isList = 0;\r
+       commands[35].atts[1].name = "NwkAddrOfInterest";\r
+       commands[35].atts[1].size = 2;\r
+       commands[35].atts[1].isList = 0;\r
+       commands[35].atts[2].name = "ProfileID";\r
+       commands[35].atts[2].size = 2;\r
+       commands[35].atts[2].isList = 0;\r
+       commands[35].atts[3].name = "NumInClusters";\r
+       commands[35].atts[3].size = 1;\r
+       commands[35].atts[3].isList = 0;\r
+       commands[35].atts[4].name = "InClusterList";\r
+       commands[35].atts[4].size = 2;\r
+       commands[35].atts[4].isList = 16;\r
+       commands[35].atts[5].name = "NumOutClusters";\r
+       commands[35].atts[5].size = 1;\r
+       commands[35].atts[5].isList = 0;\r
+       commands[35].atts[6].name = "OutClusterList";\r
+       commands[35].atts[6].size = 2;\r
+       commands[35].atts[6].isList = 16;\r
+       commands[36].cmdName = "ZDO_COMPLEX_DESC_REQ";\r
+       commands[36].cmdDesc =\r
+               " This command is generated to request for the destination device’s complex descriptor.\n";\r
+       commands[36].attNum = 2;\r
+       commands[36].atts[0].name = "DstAddr";\r
+       commands[36].atts[0].size = 2;\r
+       commands[36].atts[0].isList = 0;\r
+       commands[36].atts[1].name = "NwkAddrOfInterest";\r
+       commands[36].atts[1].size = 2;\r
+       commands[36].atts[1].isList = 0;\r
+       commands[37].cmdName = "ZDO_USER_DESC_REQ";\r
+       commands[37].cmdDesc =\r
+               " This command is generated to request for the destination device’s user descriptor.\n";\r
+       commands[37].attNum = 2;\r
+       commands[37].atts[0].name = "DstAddr";\r
+       commands[37].atts[0].size = 2;\r
+       commands[37].atts[0].isList = 0;\r
+       commands[37].atts[1].name = "NwkAddrOfInterest";\r
+       commands[37].atts[1].size = 2;\r
+       commands[37].atts[1].isList = 0;\r
+       commands[38].cmdName = "ZDO_DEVICE_ANNCE";\r
+       commands[38].cmdDesc =\r
+               " This command will cause the CC2480 device to issue an â€œEnd device announceâ€�\n"\r
+                               " broadcast packet to the network. This is typically used by an end-device to announce\n"\r
+                               " itself to the network.\n";\r
+       commands[38].attNum = 3;\r
+       commands[38].atts[0].name = "NWKAddr";\r
+       commands[38].atts[0].size = 2;\r
+       commands[38].atts[0].isList = 0;\r
+       commands[38].atts[1].name = "IEEEAddr";\r
+       commands[38].atts[1].size = 8;\r
+       commands[38].atts[1].isList = 0;\r
+       commands[38].atts[2].name = "Capabilities";\r
+       commands[38].atts[2].size = 1;\r
+       commands[38].atts[2].isList = 0;\r
+       commands[39].cmdName = "ZDO_USER_DESC_SET";\r
+       commands[39].cmdDesc =\r
+               " This command is generated to write a User Descriptor value to the targeted device\n";\r
+       commands[39].attNum = 4;\r
+       commands[39].atts[0].name = "DstAddr";\r
+       commands[39].atts[0].size = 2;\r
+       commands[39].atts[0].isList = 0;\r
+       commands[39].atts[1].name = "NwkAddrOfInterest";\r
+       commands[39].atts[1].size = 2;\r
+       commands[39].atts[1].isList = 0;\r
+       commands[39].atts[2].name = "Len";\r
+       commands[39].atts[2].size = 1;\r
+       commands[39].atts[2].isList = 0;\r
+       commands[39].atts[3].name = "UserDescriptor";\r
+       commands[39].atts[3].size = 1;\r
+       commands[39].atts[3].isList = 16;\r
+       commands[40].cmdName = "ZDO_SERVER_DISC_REQ";\r
+       commands[40].cmdDesc =\r
+               " The command is used for local device to discover the location of a particular system\n"\r
+                               " server or servers as indicated by the ServerMask parameter. The destination addressing\n"\r
+                               " on this request is broadcast to all RxOnWhenIdle devices.\n";\r
+       commands[40].attNum = 1;\r
+       commands[40].atts[0].name = "ServerMask";\r
+       commands[40].atts[0].size = 2;\r
+       commands[40].atts[0].isList = 0;\r
+       commands[41].cmdName = "ZDO_END_DEVICE_BIND_REQ";\r
+       commands[41].cmdDesc =\r
+               " This command is generated to request an End Device Bind with the destination device.\n";\r
+       commands[41].attNum = 9;\r
+       commands[41].atts[0].name = "DstAddr";\r
+       commands[41].atts[0].size = 2;\r
+       commands[41].atts[0].isList = 0;\r
+       commands[41].atts[1].name = "LocalCoordinator";\r
+       commands[41].atts[1].size = 2;\r
+       commands[41].atts[1].isList = 0;\r
+       commands[41].atts[2].name = "CoordinatorIEEE";\r
+       commands[41].atts[2].size = 8;\r
+       commands[41].atts[2].isList = 0;\r
+       commands[41].atts[3].name = "EndPoint";\r
+       commands[41].atts[3].size = 1;\r
+       commands[41].atts[3].isList = 0;\r
+       commands[41].atts[4].name = "ProfileID";\r
+       commands[41].atts[4].size = 2;\r
+       commands[41].atts[4].isList = 0;\r
+       commands[41].atts[5].name = "NumInClusters";\r
+       commands[41].atts[5].size = 1;\r
+       commands[41].atts[5].isList = 0;\r
+       commands[41].atts[6].name = "InClusterList";\r
+       commands[41].atts[6].size = 2;\r
+       commands[41].atts[6].isList = 16;\r
+       commands[41].atts[7].name = "NumOutClusters";\r
+       commands[41].atts[7].size = 1;\r
+       commands[41].atts[7].isList = 0;\r
+       commands[41].atts[8].name = "OutClusterList";\r
+       commands[41].atts[8].size = 2;\r
+       commands[41].atts[8].isList = 16;\r
+       commands[42].cmdName = "ZDO_BIND_REQ";\r
+       commands[42].cmdDesc = " This command is generated to request a Bind.\n";\r
+       commands[42].attNum = 7;\r
+       commands[42].atts[0].name = "DstAddr";\r
+       commands[42].atts[0].size = 2;\r
+       commands[42].atts[0].isList = 0;\r
+       commands[42].atts[1].name = "SrcAddress";\r
+       commands[42].atts[1].size = 8;\r
+       commands[42].atts[1].isList = 0;\r
+       commands[42].atts[2].name = "SrcEndpoint";\r
+       commands[42].atts[2].size = 1;\r
+       commands[42].atts[2].isList = 0;\r
+       commands[42].atts[3].name = "ClusterID";\r
+       commands[42].atts[3].size = 2;\r
+       commands[42].atts[3].isList = 0;\r
+       commands[42].atts[4].name = "DstAddrMode";\r
+       commands[42].atts[4].size = 1;\r
+       commands[42].atts[4].isList = 0;\r
+       commands[42].atts[5].name = "DstAddress";\r
+       commands[42].atts[5].size = 8;\r
+       commands[42].atts[5].isList = 0;\r
+       commands[42].atts[6].name = "DstEndpoint";\r
+       commands[42].atts[6].size = 1;\r
+       commands[42].atts[6].isList = 0;\r
+       commands[43].cmdName = "ZDO_UNBIND_REQ";\r
+       commands[43].cmdDesc =\r
+               " This command is generated to request an un-bind.\n";\r
+       commands[43].attNum = 7;\r
+       commands[43].atts[0].name = "DstAddr";\r
+       commands[43].atts[0].size = 2;\r
+       commands[43].atts[0].isList = 0;\r
+       commands[43].atts[1].name = "SrcAddress";\r
+       commands[43].atts[1].size = 8;\r
+       commands[43].atts[1].isList = 0;\r
+       commands[43].atts[2].name = "SrcEndpoint";\r
+       commands[43].atts[2].size = 1;\r
+       commands[43].atts[2].isList = 0;\r
+       commands[43].atts[3].name = "ClusterID";\r
+       commands[43].atts[3].size = 2;\r
+       commands[43].atts[3].isList = 0;\r
+       commands[43].atts[4].name = "DstAddrMode";\r
+       commands[43].atts[4].size = 1;\r
+       commands[43].atts[4].isList = 0;\r
+       commands[43].atts[5].name = "DstAddress";\r
+       commands[43].atts[5].size = 8;\r
+       commands[43].atts[5].isList = 0;\r
+       commands[43].atts[6].name = "DstEndpoint";\r
+       commands[43].atts[6].size = 1;\r
+       commands[43].atts[6].isList = 0;\r
+       commands[44].cmdName = "ZDO_MGMT_NWK_DISC_REQ";\r
+       commands[44].cmdDesc =\r
+               " This command is generated to request the destination device to perform a network\n"\r
+                               " discovery.\n";\r
+       commands[44].attNum = 4;\r
+       commands[44].atts[0].name = "DstAddr";\r
+       commands[44].atts[0].size = 2;\r
+       commands[44].atts[0].isList = 0;\r
+       commands[44].atts[1].name = "ScanChannels";\r
+       commands[44].atts[1].size = 4;\r
+       commands[44].atts[1].isList = 0;\r
+       commands[44].atts[2].name = "ScanDuration";\r
+       commands[44].atts[2].size = 1;\r
+       commands[44].atts[2].isList = 0;\r
+       commands[44].atts[3].name = "StartIndex";\r
+       commands[44].atts[3].size = 1;\r
+       commands[44].atts[3].isList = 0;\r
+       commands[45].cmdName = "ZDO_MGMT_LQI_REQ";\r
+       commands[45].cmdDesc =\r
+               " This command is generated to request the destination device to perform a LQI query\n"\r
+                               " of other devices in the network.\n";\r
+       commands[45].attNum = 2;\r
+       commands[45].atts[0].name = "DstAddr";\r
+       commands[45].atts[0].size = 2;\r
+       commands[45].atts[0].isList = 0;\r
+       commands[45].atts[1].name = "StartIndex";\r
+       commands[45].atts[1].size = 1;\r
+       commands[45].atts[1].isList = 0;\r
+       commands[46].cmdName = "ZDO_MGMT_RTG_REQ";\r
+       commands[46].cmdDesc =\r
+               " This command is generated to request the Routing Table of the destination device\n";\r
+       commands[46].attNum = 2;\r
+       commands[46].atts[0].name = "DstAddr";\r
+       commands[46].atts[0].size = 2;\r
+       commands[46].atts[0].isList = 0;\r
+       commands[46].atts[1].name = "StartIndex";\r
+       commands[46].atts[1].size = 1;\r
+       commands[46].atts[1].isList = 0;\r
+       commands[47].cmdName = "ZDO_MGMT_BIND_REQ";\r
+       commands[47].cmdDesc =\r
+               " This command is generated to request the Binding Table of the destination device.\n";\r
+       commands[47].attNum = 2;\r
+       commands[47].atts[0].name = "DstAddr";\r
+       commands[47].atts[0].size = 2;\r
+       commands[47].atts[0].isList = 0;\r
+       commands[47].atts[1].name = "StartIndex";\r
+       commands[47].atts[1].size = 1;\r
+       commands[47].atts[1].isList = 0;\r
+       commands[48].cmdName = "ZDO_MGMT_LEAVE_REQ";\r
+       commands[48].cmdDesc =\r
+               " This command is generated to request a Management Leave Request for the target device\n";\r
+       commands[48].attNum = 3;\r
+       commands[48].atts[0].name = "DstAddr";\r
+       commands[48].atts[0].size = 2;\r
+       commands[48].atts[0].isList = 0;\r
+       commands[48].atts[1].name = "DeviceAddr";\r
+       commands[48].atts[1].size = 8;\r
+       commands[48].atts[1].isList = 0;\r
+       commands[48].atts[2].name = "RemoveChildre_Rejoin";\r
+       commands[48].atts[2].size = 1;\r
+       commands[48].atts[2].isList = 0;\r
+       commands[49].cmdName = "ZDO_MGMT_DIRECT_JOIN_REQ";\r
+       commands[49].cmdDesc =\r
+               " This command is generated to request the Management Direct Join Request of a designated\n"\r
+                               " device.\n";\r
+       commands[49].attNum = 3;\r
+       commands[49].atts[0].name = "DstAddr";\r
+       commands[49].atts[0].size = 2;\r
+       commands[49].atts[0].isList = 0;\r
+       commands[49].atts[1].name = "DeviceAddr";\r
+       commands[49].atts[1].size = 8;\r
+       commands[49].atts[1].isList = 0;\r
+       commands[49].atts[2].name = "CapInfo";\r
+       commands[49].atts[2].size = 1;\r
+       commands[49].atts[2].isList = 0;\r
+       commands[50].cmdName = "ZDO_MGMT_PERMIT_JOIN_REQ";\r
+       commands[50].cmdDesc =\r
+               " This command is generated to set the Permit Join for the destination device\n";\r
+       commands[50].attNum = 4;\r
+       commands[50].atts[0].name = "AddrMode";\r
+       commands[50].atts[0].size = 1;\r
+       commands[50].atts[0].isList = 0;\r
+       commands[50].atts[1].name = "DstAddr";\r
+       commands[50].atts[1].size = 2;\r
+       commands[50].atts[1].isList = 0;\r
+       commands[50].atts[2].name = "Duration";\r
+       commands[50].atts[2].size = 1;\r
+       commands[50].atts[2].isList = 0;\r
+       commands[50].atts[3].name = "TCSignificance";\r
+       commands[50].atts[3].size = 1;\r
+       commands[50].atts[3].isList = 0;\r
+       commands[51].cmdName = "ZDO_MGMT_NWK_UPDATE_REQ";\r
+       commands[51].cmdDesc =\r
+               " This command is provided to allow updating of network configuration parameters or\n"\r
+                               " to request information from devices on network conditions in the local operating\n"\r
+                               " environment.\n";\r
+       commands[51].attNum = 6;\r
+       commands[51].atts[0].name = "DstAddr";\r
+       commands[51].atts[0].size = 2;\r
+       commands[51].atts[0].isList = 0;\r
+       commands[51].atts[1].name = "DstAddrMode";\r
+       commands[51].atts[1].size = 1;\r
+       commands[51].atts[1].isList = 0;\r
+       commands[51].atts[2].name = "ChannelMask";\r
+       commands[51].atts[2].size = 4;\r
+       commands[51].atts[2].isList = 0;\r
+       commands[51].atts[3].name = "ScanDuration";\r
+       commands[51].atts[3].size = 1;\r
+       commands[51].atts[3].isList = 0;\r
+       commands[51].atts[4].name = "ScanCount";\r
+       commands[51].atts[4].size = 1;\r
+       commands[51].atts[4].isList = 0;\r
+       commands[51].atts[5].name = "NwkManagerAddr";\r
+       commands[51].atts[5].size = 2;\r
+       commands[51].atts[5].isList = 0;\r
+       commands[52].cmdName = "ZDO_STARTUP_FROM_APP";\r
+       commands[52].cmdDesc = " This command starts the device in the network.\n";\r
+       commands[52].attNum = 1;\r
+       commands[52].atts[0].name = "StartDelay";\r
+       commands[52].atts[0].size = 2;\r
+       commands[52].atts[0].isList = 0;\r
+       commands[53].cmdName = "ZDO_AUTO_FIND_DESTINATION";\r
+       commands[53].cmdDesc =\r
+               " This function will issue a Match Description Request for the requested endpoint\n"\r
+                               " outputs. This message will generate a broadcast message.\n";\r
+       commands[53].attNum = 1;\r
+       commands[53].atts[0].name = "Endpoint";\r
+       commands[53].atts[0].size = 1;\r
+       commands[53].atts[0].isList = 0;\r
+       commands[54].cmdName = "ZDO_SET_LINK_KEY";\r
+       commands[54].cmdDesc =\r
+               " This command sets the application link key for a given device.\n";\r
+       commands[54].attNum = 3;\r
+       commands[54].atts[0].name = "ShortAddr";\r
+       commands[54].atts[0].size = 2;\r
+       commands[54].atts[0].isList = 0;\r
+       commands[54].atts[1].name = "IEEEaddr";\r
+       commands[54].atts[1].size = 8;\r
+       commands[54].atts[1].isList = 0;\r
+       commands[54].atts[2].name = "LinkKeyData";\r
+       commands[54].atts[2].size = 16;\r
+       commands[54].atts[2].isList = 0;\r
+       commands[55].cmdName = "ZDO_REMOVE_LINK_KEY";\r
+       commands[55].cmdDesc =\r
+               " This command removes the application link key of a given device.\n";\r
+       commands[55].attNum = 1;\r
+       commands[55].atts[0].name = "IEEEaddr";\r
+       commands[55].atts[0].size = 8;\r
+       commands[55].atts[0].isList = 0;\r
+       commands[56].cmdName = "ZDO_GET_LINK_KEY";\r
+       commands[56].cmdDesc =\r
+               " This command retrieves the application link key of a given device.\n";\r
+       commands[56].attNum = 1;\r
+       commands[56].atts[0].name = "IEEEaddr";\r
+       commands[56].atts[0].size = 8;\r
+       commands[56].atts[0].isList = 0;\r
+       commands[57].cmdName = "ZDO_NWK_DISCOVERY_REQ";\r
+       commands[57].cmdDesc =\r
+               " This command is used to initiate a network discovery (active scan).\n";\r
+       commands[57].attNum = 2;\r
+       commands[57].atts[0].name = "ScanChannels";\r
+       commands[57].atts[0].size = 4;\r
+       commands[57].atts[0].isList = 0;\r
+       commands[57].atts[1].name = "ScanDuration";\r
+       commands[57].atts[1].size = 1;\r
+       commands[57].atts[1].isList = 0;\r
+       commands[58].cmdName = "ZDO_JOIN_REQ";\r
+       commands[58].cmdDesc =\r
+               " This command is used to request the device to join itself to a parent device on\n"\r
+                               " a network.\n";\r
+       commands[58].attNum = 6;\r
+       commands[58].atts[0].name = "LogicalChannel";\r
+       commands[58].atts[0].size = 1;\r
+       commands[58].atts[0].isList = 0;\r
+       commands[58].atts[1].name = "PanID";\r
+       commands[58].atts[1].size = 2;\r
+       commands[58].atts[1].isList = 0;\r
+       commands[58].atts[2].name = "ExtendedPanID";\r
+       commands[58].atts[2].size = 8;\r
+       commands[58].atts[2].isList = 0;\r
+       commands[58].atts[3].name = "ChosenParent";\r
+       commands[58].atts[3].size = 2;\r
+       commands[58].atts[3].isList = 0;\r
+       commands[58].atts[4].name = "ParentDepth";\r
+       commands[58].atts[4].size = 1;\r
+       commands[58].atts[4].isList = 0;\r
+       commands[58].atts[5].name = "StackProfile";\r
+       commands[58].atts[5].size = 1;\r
+       commands[58].atts[5].isList = 0;\r
+       commands[59].cmdName = "ZDO_MSG_CB_REGISTER";\r
+       commands[59].cmdDesc = " This command registers for a ZDO callback.\n";\r
+       commands[59].attNum = 1;\r
+       commands[59].atts[0].name = "ClusterID";\r
+       commands[59].atts[0].size = 2;\r
+       commands[59].atts[0].isList = 0;\r
+       commands[60].cmdName = "ZDO_MSG_CB_REMOVE";\r
+       commands[60].cmdDesc =\r
+               " This command removes a registration for a ZDO callback\n";\r
+       commands[60].attNum = 1;\r
+       commands[60].atts[0].name = "ClusterID";\r
+       commands[60].atts[0].size = 2;\r
+       commands[60].atts[0].isList = 0;\r
+       commands[61].cmdName = "ZB_SYSTEM_RESET";\r
+       commands[61].cmdDesc =\r
+               " This command will reset the device by using a soft reset (i.e. a jump to the reset\n"\r
+                               " vector) vice a hardware reset (i.e. watchdog reset.) This is especially useful in\n"\r
+                               " the CC2531, for instance, so that the USB host does not have to contend with the\n"\r
+                               " USB H/W resetting (and thus causing the USB host to re-enumerate the device which\n"\r
+                               " can cause an open virtual serial port to hang.)\n";\r
+       commands[61].attNum = 0;\r
+       commands[62].cmdName = "ZB_APP_REGISTER_REQ";\r
+       commands[62].cmdDesc =\r
+               " This command enables the application processor to register its application with\n"\r
+                               " a ZNP device.\n";\r
+       commands[62].attNum = 9;\r
+       commands[62].atts[0].name = "AppEndpoint";\r
+       commands[62].atts[0].size = 1;\r
+       commands[62].atts[0].isList = 0;\r
+       commands[62].atts[1].name = "AppProfileId";\r
+       commands[62].atts[1].size = 2;\r
+       commands[62].atts[1].isList = 0;\r
+       commands[62].atts[2].name = "DeviceId";\r
+       commands[62].atts[2].size = 2;\r
+       commands[62].atts[2].isList = 0;\r
+       commands[62].atts[3].name = "DeviceVersion";\r
+       commands[62].atts[3].size = 1;\r
+       commands[62].atts[3].isList = 0;\r
+       commands[62].atts[4].name = "Unused";\r
+       commands[62].atts[4].size = 1;\r
+       commands[62].atts[4].isList = 0;\r
+       commands[62].atts[5].name = "InputCommandsNum";\r
+       commands[62].atts[5].size = 1;\r
+       commands[62].atts[5].isList = 0;\r
+       commands[62].atts[6].name = "InputCommandsList";\r
+       commands[62].atts[6].size = 2;\r
+       commands[62].atts[6].isList = 255;\r
+       commands[62].atts[7].name = "OutputCommandsNum";\r
+       commands[62].atts[7].size = 1;\r
+       commands[62].atts[7].isList = 0;\r
+       commands[62].atts[8].name = "OutputCommandsList";\r
+       commands[62].atts[8].size = 2;\r
+       commands[62].atts[8].isList = 255;\r
+       commands[63].cmdName = "ZB_START_REQ";\r
+       commands[63].cmdDesc =\r
+               " This command starts the ZigBee stack. When the ZigBee stack starts, the device reads\n"\r
+                               " configuration parameters from nonvolatile memory and the device joins its network.\n"\r
+                               " The ZigBee stack calls the zb_StartConfirm callback function when the startup process\n"\r
+                               " completes. After the start request process completes, the device is ready to send,\n"\r
+                               " receive, and route network traffic.\n";\r
+       commands[63].attNum = 0;\r
+       commands[64].cmdName = "ZB_PERMIT_JOINING_REQ";\r
+       commands[64].cmdDesc =\r
+               " This command is used to control the joining permissions and thus allows or disallows\n"\r
+                               " new devices from joining the network.\n";\r
+       commands[64].attNum = 2;\r
+       commands[64].atts[0].name = "Destination";\r
+       commands[64].atts[0].size = 2;\r
+       commands[64].atts[0].isList = 0;\r
+       commands[64].atts[1].name = "Timeout";\r
+       commands[64].atts[1].size = 1;\r
+       commands[64].atts[1].isList = 0;\r
+       commands[65].cmdName = "ZB_BIND_DEVICE";\r
+       commands[65].cmdDesc =\r
+               " This command establishes or removes a â€˜binding’ between two devices. Once bound,\n"\r
+                               " an application can send messages to a device by referencing the commandId for the\n"\r
+                               " binding.\n";\r
+       commands[65].attNum = 3;\r
+       commands[65].atts[0].name = "Create";\r
+       commands[65].atts[0].size = 1;\r
+       commands[65].atts[0].isList = 0;\r
+       commands[65].atts[1].name = "CommandId";\r
+       commands[65].atts[1].size = 2;\r
+       commands[65].atts[1].isList = 0;\r
+       commands[65].atts[2].name = "DstIeee";\r
+       commands[65].atts[2].size = 8;\r
+       commands[65].atts[2].isList = 0;\r
+       commands[66].cmdName = "ZB_ALLOW_BIND";\r
+       commands[66].cmdDesc =\r
+               " This command puts the device into the Allow Binding Mode for a given period of time.\n"\r
+                               " A peer device can establish a binding to a device in the Allow Binding Mode by calling\n"\r
+                               " zb_BindDevice with a destination address of NULL.\n";\r
+       commands[66].attNum = 1;\r
+       commands[66].atts[0].name = "Timeout";\r
+       commands[66].atts[0].size = 1;\r
+       commands[66].atts[0].isList = 0;\r
+       commands[67].cmdName = "ZB_SEND_DATA_REQ";\r
+       commands[67].cmdDesc =\r
+               " This command initiates transmission of data to a peer device.\n";\r
+       commands[67].attNum = 7;\r
+       commands[67].atts[0].name = "Destination";\r
+       commands[67].atts[0].size = 2;\r
+       commands[67].atts[0].isList = 0;\r
+       commands[67].atts[1].name = "CommandId";\r
+       commands[67].atts[1].size = 2;\r
+       commands[67].atts[1].isList = 0;\r
+       commands[67].atts[2].name = "Handle";\r
+       commands[67].atts[2].size = 1;\r
+       commands[67].atts[2].isList = 0;\r
+       commands[67].atts[3].name = "Ack";\r
+       commands[67].atts[3].size = 1;\r
+       commands[67].atts[3].isList = 0;\r
+       commands[67].atts[4].name = "Radius";\r
+       commands[67].atts[4].size = 1;\r
+       commands[67].atts[4].isList = 0;\r
+       commands[67].atts[5].name = "Len";\r
+       commands[67].atts[5].size = 1;\r
+       commands[67].atts[5].isList = 0;\r
+       commands[67].atts[6].name = "Data";\r
+       commands[67].atts[6].size = 1;\r
+       commands[67].atts[6].isList = 99;\r
+       commands[68].cmdName = "ZB_FIND_DEVICE_REQ";\r
+       commands[68].cmdDesc =\r
+               " This command is used to determine the short address for a device in the network.\n"\r
+                               " The device initiating a call to zbFindDeviceRequest and the device being discovered\n"\r
+                               " must both be a member of the same network. When the search is complete, the zbFindDeviceConfirm\n"\r
+                               " callback function is called.\n";\r
+       commands[68].attNum = 1;\r
+       commands[68].atts[0].name = "SearchKey";\r
+       commands[68].atts[0].size = 8;\r
+       commands[68].atts[0].isList = 0;\r
+       commands[69].cmdName = "ZB_WRITE_CONFIGURATION";\r
+       commands[69].cmdDesc =\r
+               " This command is used to write a Configuration Property to nonvolatile memory.\n";\r
+       commands[69].attNum = 3;\r
+       commands[69].atts[0].name = "ConfigId";\r
+       commands[69].atts[0].size = 1;\r
+       commands[69].atts[0].isList = 0;\r
+       commands[69].atts[1].name = "Len";\r
+       commands[69].atts[1].size = 1;\r
+       commands[69].atts[1].isList = 0;\r
+       commands[69].atts[2].name = "Value";\r
+       commands[69].atts[2].size = 1;\r
+       commands[69].atts[2].isList = 128;\r
+       commands[70].cmdName = "ZB_GET_DEVICE_INFO";\r
+       commands[70].cmdDesc =\r
+               " This command retrieves a Device Information Property.\n";\r
+       commands[70].attNum = 1;\r
+       commands[70].atts[0].name = "Param";\r
+       commands[70].atts[0].size = 1;\r
+       commands[70].atts[0].isList = 0;\r
+       commands[71].cmdName = "ZB_READ_CONFIGURATION";\r
+       commands[71].cmdDesc =\r
+               " This command is used to get a configuration property from nonvolatile memory.\n";\r
+       commands[71].attNum = 1;\r
+       commands[71].atts[0].name = "ConfigId";\r
+       commands[71].atts[0].size = 1;\r
+       commands[71].atts[0].isList = 0;\r
+}\r
+\r
+/********************************************************************\r
+ * START OF SYS CALL BACK FUNCTIONS\r
+ */\r
+\r
+static uint8_t mtSysPingSrspCb(PingSrspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtSysPingSrspCb\n");\r
+       consolePrint("Capabilities: 0x%04X\n", msg->Capabilities);\r
+       SET_NRM_COLOR();\r
+       return 0;\r
+}\r
+static uint8_t mtSysGetExtAddrSrspCb(GetExtAddrSrspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtSysGetExtAddrSrspCb\n");\r
+       consolePrint("ExtAddr: 0x%016llX\n", (long long unsigned int) msg->ExtAddr);\r
+       SET_NRM_COLOR();\r
+       return 0;\r
+}\r
+static uint8_t mtSysRamReadSrspCb(RamReadSrspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtSysRamReadSrspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+               consolePrint("Len: 0x%02X\n", msg->Len);\r
+               uint32_t i;\r
+               for (i = 0; i < msg->Len; i++)\r
+               {\r
+                       consolePrint("Value[%d]: 0x%02X\n", i, msg->Value[i]);\r
+               }\r
+       }\r
+       else\r
+       {\r
+               consolePrint("RamReadSrsp Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+       return msg->Status;\r
+}\r
+static uint8_t mtSysResetIndCb(ResetIndFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("ZNP Version: %d.%d.%d\n", msg->MajorRel, msg->MinorRel,\r
+               msg->HwRev);\r
+       SET_NRM_COLOR();\r
+       return 0;\r
+}\r
+static uint8_t mtSysVersionSrspCb(VersionSrspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtSysVersionSrspCb\n");\r
+       consolePrint("TransportRev: 0x%02X\n", msg->TransportRev);\r
+       consolePrint("Product: 0x%02X\n", msg->Product);\r
+       consolePrint("MajorRel: 0x%02X\n", msg->MajorRel);\r
+       consolePrint("MinorRel: 0x%02X\n", msg->MinorRel);\r
+       consolePrint("MaintRel: 0x%02X\n", msg->MaintRel);\r
+       SET_NRM_COLOR();\r
+       return 0;\r
+}\r
+static uint8_t mtSysOsalNvReadSrspCb(OsalNvReadSrspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtSysOsalNvReadSrspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+               consolePrint("Len: 0x%02X\n", msg->Len);\r
+               uint32_t i;\r
+               for (i = 0; i < msg->Len; i++)\r
+               {\r
+                       consolePrint("Value[%d]: 0x%02X\n", i, msg->Value[i]);\r
+               }\r
+       }\r
+       else\r
+       {\r
+               consolePrint("OsalNvReadSrsp Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+       return msg->Status;\r
+}\r
+static uint8_t mtSysOsalNvLengthSrspCb(OsalNvLengthSrspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtSysOsalNvLengthSrspCb\n");\r
+       consolePrint("ItemLen: 0x%04X\n", msg->ItemLen);\r
+       SET_NRM_COLOR();\r
+       return 0;\r
+}\r
+static uint8_t mtSysOsalTimerExpiredCb(OsalTimerExpiredFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtSysOsalTimerExpiredCb\n");\r
+       consolePrint("Id: 0x%02X\n", msg->Id);\r
+       SET_NRM_COLOR();\r
+       return 0;\r
+}\r
+static uint8_t mtSysStackTuneSrspCb(StackTuneSrspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtSysStackTuneSrspCb\n");\r
+       consolePrint("Value: 0x%02X\n", msg->Value);\r
+       SET_NRM_COLOR();\r
+       return 0;\r
+}\r
+static uint8_t mtSysAdcReadSrspCb(AdcReadSrspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtSysAdcReadSrspCb\n");\r
+       consolePrint("Value: 0x%04X\n", msg->Value);\r
+       SET_NRM_COLOR();\r
+       return 0;\r
+}\r
+static uint8_t mtSysGpioSrspCb(GpioSrspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtSysGpioSrspCb\n");\r
+       consolePrint("Value: 0x%02X\n", msg->Value);\r
+       SET_NRM_COLOR();\r
+       return 0;\r
+}\r
+static uint8_t mtSysRandomSrspCb(RandomSrspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtSysRandomSrspCb\n");\r
+       consolePrint("Value: 0x%04X\n", msg->Value);\r
+       SET_NRM_COLOR();\r
+       return 0;\r
+}\r
+static uint8_t mtSysGetTimeSrspCb(GetTimeSrspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtSysGetTimeSrspCb\n");\r
+       consolePrint("UTCTime: 0x%08X\n", msg->UTCTime);\r
+       consolePrint("Hour: 0x%02X\n", msg->Hour);\r
+       consolePrint("Minute: 0x%02X\n", msg->Minute);\r
+       consolePrint("Second: 0x%02X\n", msg->Second);\r
+       consolePrint("Month: 0x%02X\n", msg->Month);\r
+       consolePrint("Day: 0x%02X\n", msg->Day);\r
+       consolePrint("Year: 0x%04X\n", msg->Year);\r
+       SET_NRM_COLOR();\r
+       return 0;\r
+}\r
+static uint8_t mtSysSetTxPowerSrspCb(SetTxPowerSrspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtSysSetTxPowerSrspCb\n");\r
+       consolePrint("TxPower: 0x%02X\n", msg->TxPower);\r
+       SET_NRM_COLOR();\r
+       return 0;\r
+}\r
+/********************************************************************\r
+ * END OF SYS CALL BACK FUNCTIONS\r
+ */\r
+\r
+/********************************************************************\r
+ * START OF ZDO CALL BACK FUNCTIONS\r
+ */\r
+\r
+/********************************************************************\r
+ * @fn     Callback function for ZDO State Change Indication\r
+\r
+ * @brief  receives the AREQ status and specifies the change ZDO state\r
+ *\r
+ * @param  uint8 zdoState\r
+ *\r
+ * @return SUCCESS or FAILURE\r
+ */\r
+static uint8_t mtZdoStateChangeIndCb(uint8_t newDevState)\r
+{\r
+       SET_RSP_COLOR();\r
+\r
+       switch ((devStates_t) newDevState)\r
+       {\r
+       case DEV_HOLD:\r
+               dbg_print(PRINT_LEVEL_INFO,\r
+                       "mtZdoStateChangeIndCb: Initialized - not started automatically\n");\r
+               break;\r
+       case DEV_INIT:\r
+               dbg_print(PRINT_LEVEL_INFO,\r
+                       "mtZdoStateChangeIndCb: Initialized - not connected to anything\n");\r
+               break;\r
+       case DEV_NWK_DISC:\r
+               dbg_print(PRINT_LEVEL_INFO,\r
+                       "mtZdoStateChangeIndCb: Discovering PAN's to join\n");\r
+               consolePrint("Network Discovering\n");\r
+               break;\r
+       case DEV_NWK_JOINING:\r
+               dbg_print(PRINT_LEVEL_INFO, "mtZdoStateChangeIndCb: Joining a PAN\n");\r
+               consolePrint("Network Joining\n");\r
+               break;\r
+       case DEV_NWK_REJOIN:\r
+               dbg_print(PRINT_LEVEL_INFO,\r
+                       "mtZdoStateChangeIndCb: ReJoining a PAN, only for end devices\n");\r
+               consolePrint("Network Rejoining\n");\r
+               break;\r
+       case DEV_END_DEVICE_UNAUTH:\r
+               consolePrint("Network Authenticating\n");\r
+               dbg_print(PRINT_LEVEL_INFO,\r
+                       "mtZdoStateChangeIndCb: Joined but not yet authenticated by trust center\n");\r
+               break;\r
+       case DEV_END_DEVICE:\r
+               consolePrint("Network Joined\n");\r
+               dbg_print(PRINT_LEVEL_INFO,\r
+                       "mtZdoStateChangeIndCb: Started as device after authentication\n");\r
+               break;\r
+       case DEV_ROUTER:\r
+               consolePrint("Network Joined\n");\r
+               dbg_print(PRINT_LEVEL_INFO,\r
+                       "mtZdoStateChangeIndCb: Device joined, authenticated and is a router\n");\r
+               break;\r
+       case DEV_COORD_STARTING:\r
+               consolePrint("Network Starting\n");\r
+               dbg_print(PRINT_LEVEL_INFO,\r
+                       "mtZdoStateChangeIndCb: Started as Zigbee Coordinator\n");\r
+               break;\r
+       case DEV_ZB_COORD:\r
+               consolePrint("Network Started\n");\r
+               dbg_print(PRINT_LEVEL_INFO,\r
+                       "mtZdoStateChangeIndCb: Started as Zigbee Coordinator\n");\r
+               break;\r
+       case DEV_NWK_ORPHAN:\r
+               consolePrint("Network Orphaned\n");\r
+               dbg_print(PRINT_LEVEL_INFO,\r
+                       "mtZdoStateChangeIndCb: Device has lost information about its parent\n");\r
+               break;\r
+       default:\r
+               dbg_print(PRINT_LEVEL_INFO, "mtZdoStateChangeIndCb: unknown state");\r
+               break;\r
+       }\r
+\r
+       devState = (devStates_t) newDevState;\r
+\r
+       SET_NRM_COLOR();\r
+\r
+       return SUCCESS;\r
+}\r
+\r
+static uint8_t mtZdoGetLinkKeyCb(GetLinkKeySrspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+\r
+       consolePrint("mtZdoGetLinkKeyCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+               consolePrint("IEEEAddr: 0x%016llX\n",\r
+                       (long long unsigned int) msg->IEEEAddr);\r
+       }\r
+       else\r
+       {\r
+               consolePrint("GetLinkKey Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoNwkAddrRspCb(NwkAddrRspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoNwkAddrRspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+               consolePrint("IEEEAddr: 0x%016llX\n",\r
+                       (long long unsigned int) msg->IEEEAddr);\r
+               consolePrint("NwkAddr: 0x%04X\n", msg->NwkAddr);\r
+               consolePrint("StartIndex: 0x%02X\n", msg->StartIndex);\r
+               consolePrint("NumAssocDev: 0x%02X\n", msg->NumAssocDev);\r
+               uint32_t i;\r
+               for (i = 0; i < msg->NumAssocDev; i++)\r
+               {\r
+                       consolePrint("AssocDevList[%d]: 0x%04X\n", i, msg->AssocDevList[i]);\r
+               }\r
+       }\r
+       else\r
+       {\r
+               consolePrint("NwkAddrRsp Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoIeeeAddrRspCb(IeeeAddrRspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoIeeeAddrRspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+               consolePrint("IEEEAddr: 0x%016llX\n",\r
+                       (long long unsigned int) msg->IEEEAddr);\r
+               //consolePrint("%08X\n", msg -> IEEEAddr);\r
+               consolePrint("NwkAddr: 0x%04X\n", msg->NwkAddr);\r
+               consolePrint("StartIndex: 0x%02X\n", msg->StartIndex);\r
+               consolePrint("NumAssocDev: 0x%02X\n", msg->NumAssocDev);\r
+               uint32_t i;\r
+               for (i = 0; i < msg->NumAssocDev; i++)\r
+               {\r
+                       consolePrint("AssocDevList[%d]: 0x%04X\n", i, msg->AssocDevList[i]);\r
+               }\r
+       }\r
+       else\r
+       {\r
+               consolePrint("IeeeAddrRsp Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoNodeDescRspCb(NodeDescRspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoNodeDescRspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+               consolePrint("NwkAddr: 0x%04X\n", msg->NwkAddr);\r
+               consolePrint("LoTy_ComDescAv_UsrDesAv: 0x%02X\n",\r
+                       msg->LoTy_ComDescAv_UsrDesAv);\r
+               consolePrint("APSFlg_FrqBnd: 0x%02X\n", msg->APSFlg_FrqBnd);\r
+               consolePrint("MACCapFlg: 0x%02X\n", msg->MACCapFlg);\r
+               consolePrint("ManufacturerCode: 0x%04X\n", msg->ManufacturerCode);\r
+               consolePrint("MaxBufferSize: 0x%02X\n", msg->MaxBufferSize);\r
+               consolePrint("MaxTransferSize: 0x%04X\n", msg->MaxTransferSize);\r
+               consolePrint("ServerMask: 0x%04X\n", msg->ServerMask);\r
+               consolePrint("MaxOutTransferSize: 0x%04X\n", msg->MaxOutTransferSize);\r
+               consolePrint("DescriptorCapabilities: 0x%02X\n",\r
+                       msg->DescriptorCapabilities);\r
+       }\r
+       else\r
+       {\r
+               consolePrint("NodeDescRsp Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoPowerDescRspCb(PowerDescRspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoPowerDescRspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+               consolePrint("NwkAddr: 0x%04X\n", msg->NwkAddr);\r
+               consolePrint("CurrntPwrMode_AvalPwrSrcs: 0x%02X\n",\r
+                       msg->CurrntPwrMode_AvalPwrSrcs);\r
+               consolePrint("CurrntPwrSrc_CurrntPwrSrcLvl: 0x%02X\n",\r
+                       msg->CurrntPwrSrc_CurrntPwrSrcLvl);\r
+       }\r
+       else\r
+       {\r
+               consolePrint("PowerDescRsp Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoSimpleDescRspCb(SimpleDescRspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoSimpleDescRspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+               consolePrint("NwkAddr: 0x%04X\n", msg->NwkAddr);\r
+               consolePrint("Len: 0x%02X\n", msg->Len);\r
+               consolePrint("Endpoint: 0x%02X\n", msg->Endpoint);\r
+               consolePrint("ProfileID: 0x%04X\n", msg->ProfileID);\r
+               consolePrint("DeviceID: 0x%04X\n", msg->DeviceID);\r
+               consolePrint("DeviceVersion: 0x%02X\n", msg->DeviceVersion);\r
+               consolePrint("NumInClusters: 0x%02X\n", msg->NumInClusters);\r
+               uint32_t i;\r
+               for (i = 0; i < msg->NumInClusters; i++)\r
+               {\r
+                       consolePrint("InClusterList[%d]: 0x%04X\n", i,\r
+                               msg->InClusterList[i]);\r
+               }\r
+               consolePrint("NumOutClusters: 0x%02X\n", msg->NumOutClusters);\r
+               for (i = 0; i < msg->NumOutClusters; i++)\r
+               {\r
+                       consolePrint("OutClusterList[%d]: 0x%04X\n", i,\r
+                               msg->OutClusterList[i]);\r
+               }\r
+       }\r
+       else\r
+       {\r
+               consolePrint("SimpleDescRsp Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoActiveEpRspCb(ActiveEpRspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoActiveEpRspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+               consolePrint("NwkAddr: 0x%04X\n", msg->NwkAddr);\r
+               consolePrint("ActiveEPCount: 0x%02X\n", msg->ActiveEPCount);\r
+               uint32_t i;\r
+               for (i = 0; i < msg->ActiveEPCount; i++)\r
+               {\r
+                       consolePrint("ActiveEPList[%d]: 0x%02X\n", i, msg->ActiveEPList[i]);\r
+               }\r
+       }\r
+       else\r
+       {\r
+               consolePrint("ActiveEpRsp Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoMatchDescRspCb(MatchDescRspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoMatchDescRspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+               consolePrint("NwkAddr: 0x%04X\n", msg->NwkAddr);\r
+               consolePrint("MatchLength: 0x%02X\n", msg->MatchLength);\r
+               uint32_t i;\r
+               for (i = 0; i < msg->MatchLength; i++)\r
+               {\r
+                       consolePrint("MatchList[%d]: 0x%02X\n", i, msg->MatchList[i]);\r
+               }\r
+       }\r
+       else\r
+       {\r
+               consolePrint("MatchDescRsp Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoComplexDescRspCb(ComplexDescRspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoComplexDescRspCb\n");\r
+\r
+       consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+       consolePrint("Status: 0x%02X\n", msg->Status);\r
+       consolePrint("NwkAddr: 0x%04X\n", msg->NwkAddr);\r
+       consolePrint("ComplexLength: 0x%02X\n", msg->ComplexLength);\r
+       uint32_t i;\r
+       for (i = 0; i < msg->ComplexLength; i++)\r
+       {\r
+               consolePrint("ComplexList[%d]: 0x%02X\n", i, msg->ComplexList[i]);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoUserDescRspCb(UserDescRspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoUserDescRspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+               consolePrint("NwkAddr: 0x%04X\n", msg->NwkAddr);\r
+               consolePrint("Len: 0x%02X\n", msg->Len);\r
+               uint32_t i;\r
+               for (i = 0; i < msg->Len; i++)\r
+               {\r
+                       consolePrint("CUserDescriptor[%d]: 0x%02X\n", i,\r
+                               msg->CUserDescriptor[i]);\r
+               }\r
+       }\r
+       else\r
+       {\r
+               consolePrint("UserDescRsp Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoUserDescConfCb(UserDescConfFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoUserDescConfCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+               consolePrint("NwkAddr: 0x%04X\n", msg->NwkAddr);\r
+       }\r
+       else\r
+       {\r
+               consolePrint("UserDescConf Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoServerDiscRspCb(ServerDiscRspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoServerDiscRspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+               consolePrint("ServerMask: 0x%04X\n", msg->ServerMask);\r
+       }\r
+       else\r
+       {\r
+               consolePrint("ServerDiscRsp Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoEndDeviceBindRspCb(EndDeviceBindRspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoEndDeviceBindRspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+       }\r
+       else\r
+       {\r
+               consolePrint("EndDeviceBindRsp Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoBindRspCb(BindRspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoBindRspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+       }\r
+       else\r
+       {\r
+               consolePrint("BindRsp Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoUnbindRspCb(UnbindRspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoUnbindRspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+       }\r
+       else\r
+       {\r
+               consolePrint("UnbindRsp Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoMgmtNwkDiscRspCb(MgmtNwkDiscRspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoMgmtNwkDiscRspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+               consolePrint("NetworkCount: 0x%02X\n", msg->NetworkCount);\r
+               consolePrint("StartIndex: 0x%02X\n", msg->StartIndex);\r
+               consolePrint("NetworkListCount: 0x%02X\n", msg->NetworkListCount);\r
+\r
+               uint32_t i;\r
+               for (i = 0; i < msg->NetworkListCount; i++)\r
+               {\r
+                       consolePrint("mtZdoNetworkListItems[%d]:\n", i);\r
+                       consolePrint("\tPanID: 0x%016llX\n",\r
+                               (long long unsigned int) msg->NetworkList[i].PanID);\r
+                       consolePrint("\tLogicalChannel: 0x%02X\n",\r
+                               msg->NetworkList[i].LogicalChannel);\r
+                       consolePrint("\tStackProf_ZigVer: 0x%02X\n",\r
+                               msg->NetworkList[i].StackProf_ZigVer);\r
+                       consolePrint("\tBeacOrd_SupFramOrd: 0x%02X\n",\r
+                               msg->NetworkList[i].BeacOrd_SupFramOrd);\r
+                       consolePrint("\tPermitJoin: 0x%02X\n\n",\r
+                               msg->NetworkList[i].PermitJoin);\r
+               }\r
+       }\r
+       else\r
+       {\r
+               consolePrint("MgmtNwkDiscRsp Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoMgmtLqiRspCb(MgmtLqiRspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoMgmtLqiRspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+               consolePrint("NeighborTableEntries: 0x%02X\n",\r
+                       msg->NeighborTableEntries);\r
+               consolePrint("StartIndex: 0x%02X\n", msg->StartIndex);\r
+               consolePrint("NeighborLqiListCount: 0x%02X\n",\r
+                       msg->NeighborLqiListCount);\r
+               uint32_t i;\r
+               for (i = 0; i < msg->NeighborLqiListCount; i++)\r
+               {\r
+\r
+                       consolePrint("mtZdoNeighborLqiListItem[%d]:\n", i);\r
+\r
+                       consolePrint("\tExtendedPanID: 0x%016llX\n",\r
+                               (long long unsigned int) msg->NeighborLqiList[i].ExtendedPanID);\r
+                       consolePrint("\tExtendedAddress: 0x%016llX\n",\r
+                               (long long unsigned int) msg->NeighborLqiList[i].ExtendedAddress);\r
+                       consolePrint("\tNetworkAddress: 0x%04X\n",\r
+                               msg->NeighborLqiList[i].NetworkAddress);\r
+                       consolePrint("\tDevTyp_RxOnWhenIdle_Relat: 0x%02X\n",\r
+                               msg->NeighborLqiList[i].DevTyp_RxOnWhenIdle_Relat);\r
+                       consolePrint("\tPermitJoining: 0x%02X\n",\r
+                               msg->NeighborLqiList[i].PermitJoining);\r
+                       consolePrint("\tDepth: 0x%02X\n", msg->NeighborLqiList[i].Depth);\r
+                       consolePrint("\tLQI: 0x%02X\n", msg->NeighborLqiList[i].LQI);\r
+               }\r
+       }\r
+       else\r
+       {\r
+               consolePrint("MgmtLqiRsp Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoMgmtRtgRspCb(MgmtRtgRspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoMgmtRtgRspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+               consolePrint("RoutingTableEntries: 0x%02X\n", msg->RoutingTableEntries);\r
+               consolePrint("StartIndex: 0x%02X\n", msg->StartIndex);\r
+               consolePrint("RoutingTableListCount: 0x%02X\n",\r
+                       msg->RoutingTableListCount);\r
+               uint32_t i;\r
+               for (i = 0; i < msg->RoutingTableListCount; i++)\r
+               {\r
+                       consolePrint("RoutingTableListItem[%d]:\n", i);\r
+                       consolePrint("\tDstAddr: 0x%04X\n",\r
+                               msg->RoutingTableList[i].DstAddr);\r
+                       consolePrint("\tStatus: 0x%02X\n", msg->RoutingTableList[i].Status);\r
+                       consolePrint("\tNextHop: 0x%04X\n",\r
+                               msg->RoutingTableList[i].NextHop);\r
+               }\r
+       }\r
+       else\r
+       {\r
+               consolePrint("MgmtRtgRsp Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoMgmtBindRspCb(MgmtBindRspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoMgmtBindRspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+               consolePrint("BindingTableEntries: 0x%02X\n", msg->BindingTableEntries);\r
+               consolePrint("StartIndex: 0x%02X\n", msg->StartIndex);\r
+               consolePrint("BindingTableListCount: 0x%02X\n",\r
+                       msg->BindingTableListCount);\r
+               uint32_t i;\r
+               for (i = 0; i < msg->BindingTableListCount; i++)\r
+               {\r
+                       consolePrint("BindingTableList[%d]:\n", i);\r
+                       consolePrint("SrcIEEEAddr: 0x%016llX\n",\r
+                               (long long unsigned int) msg->BindingTableList[i].SrcIEEEAddr);\r
+                       consolePrint("\tSrcEndpoint: 0x%02X\n",\r
+                               msg->BindingTableList[i].SrcEndpoint);\r
+                       consolePrint("\tClusterID: 0x%02X\n",\r
+                               msg->BindingTableList[i].ClusterID);\r
+                       consolePrint("\tDstAddrMode: 0x%02X\n",\r
+                               msg->BindingTableList[i].DstAddrMode);\r
+                       consolePrint("DstIEEEAddr: 0x%016llX\n",\r
+                               (long long unsigned int) msg->BindingTableList[i].DstIEEEAddr);\r
+                       consolePrint("\tDstEndpoint: 0x%02X\n",\r
+                               msg->BindingTableList[i].DstEndpoint);\r
+               }\r
+       }\r
+       else\r
+       {\r
+               consolePrint("MgmtBindRsp Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoMgmtLeaveRspCb(MgmtLeaveRspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoMgmtLeaveRspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+       }\r
+       else\r
+       {\r
+               consolePrint("MgmtLeaveRsp Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoMgmtDirectJoinRspCb(MgmtDirectJoinRspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoMgmtDirectJoinRspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+       }\r
+       else\r
+       {\r
+               consolePrint("MgmtDirectJoinRsp Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoMgmtPermitJoinRspCb(MgmtPermitJoinRspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoMgmtPermitJoinRspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+       }\r
+       else\r
+       {\r
+               consolePrint("MgmtPermitJoinRsp Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoEndDeviceAnnceIndCb(EndDeviceAnnceIndFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoEndDeviceAnnceIndCb\n");\r
+       consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+       consolePrint("NwkAddr: 0x%04X\n", msg->NwkAddr);\r
+       consolePrint("IEEEAddr: 0x%016llX\n",\r
+               (long long unsigned int) msg->IEEEAddr);\r
+       consolePrint("Capabilities: 0x%02X\n", msg->Capabilities);\r
+       SET_NRM_COLOR();\r
+       return 0;\r
+}\r
+static uint8_t mtZdoMatchDescRspSentCb(MatchDescRspSentFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoMatchDescRspSentCb\n");\r
+       consolePrint("NwkAddr: 0x%04X\n", msg->NwkAddr);\r
+       consolePrint("NumInClusters: 0x%02X\n", msg->NumInClusters);\r
+       uint32_t i;\r
+       for (i = 0; i < msg->NumInClusters; i++)\r
+       {\r
+               consolePrint("InClusterList[%d]: 0x%04X\n", i, msg->InClusterList[i]);\r
+       }\r
+       consolePrint("NumOutClusters: 0x%02X\n", msg->NumOutClusters);\r
+       for (i = 0; i < msg->NumOutClusters; i++)\r
+       {\r
+               consolePrint("OutClusterList[%d]: 0x%04X\n", i, msg->OutClusterList[i]);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return 0;\r
+}\r
+static uint8_t mtZdoStatusErrorRspCb(StatusErrorRspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoStatusErrorRspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+       }\r
+       else\r
+       {\r
+               consolePrint("StatusErrorRsp Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoSrcRtgIndCb(SrcRtgIndFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoSrcRtgIndCb\n");\r
+       consolePrint("DstAddr: 0x%04X\n", msg->DstAddr);\r
+       consolePrint("RelayCount: 0x%02X\n", msg->RelayCount);\r
+       uint32_t i;\r
+       for (i = 0; i < msg->RelayCount; i++)\r
+       {\r
+               consolePrint("RelayList[%d]: 0x%04X\n", i, msg->RelayList[i]);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return 0;\r
+}\r
+static uint8_t mtZdoBeaconNotifyIndCb(BeaconNotifyIndFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoBeaconNotifyIndCb\n");\r
+       consolePrint("BeaconCount: 0x%02X\n", msg->BeaconCount);\r
+       uint32_t i;\r
+       for (i = 0; i < msg->BeaconCount; i++)\r
+       {\r
+               consolePrint("BeaconListItem[%d]:\n", i);\r
+\r
+               consolePrint("\tSrcAddr: 0x%04X\n", msg->BeaconList[i].SrcAddr);\r
+               consolePrint("\tPanId: 0x%04X\n", msg->BeaconList[i].PanId);\r
+               consolePrint("\tLogicalChannel: 0x%02X\n",\r
+                       msg->BeaconList[i].LogicalChannel);\r
+               consolePrint("\tPermitJoining: 0x%02X\n",\r
+                       msg->BeaconList[i].PermitJoining);\r
+               consolePrint("\tRouterCap: 0x%02X\n", msg->BeaconList[i].RouterCap);\r
+               consolePrint("\tPDevCap: 0x%02X\n", msg->BeaconList[i].DevCap);\r
+               consolePrint("\tProtocolVer: 0x%02X\n", msg->BeaconList[i].ProtocolVer);\r
+               consolePrint("\tStackProf: 0x%02X\n", msg->BeaconList[i].StackProf);\r
+               consolePrint("\tLQI: 0x%02X\n", msg->BeaconList[i].Lqi);\r
+               consolePrint("\tDepth: 0x%02X\n", msg->BeaconList[i].Depth);\r
+               consolePrint("\tUpdateId: 0x%02X\n", msg->BeaconList[i].UpdateId);\r
+               consolePrint("ExtendedPanID: 0x%016llX\n",\r
+                       (long long unsigned int) msg->BeaconList[i].ExtendedPanId);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return 0;\r
+}\r
+static uint8_t mtZdoJoinCnfCb(JoinCnfFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoJoinCnfCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+               consolePrint("DevAddr: 0x%04X\n", msg->DevAddr);\r
+               consolePrint("ParentAddr: 0x%04X\n", msg->ParentAddr);\r
+       }\r
+       else\r
+       {\r
+               consolePrint("JoinCnf Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoNwkDiscoveryCnfCb(NwkDiscoveryCnfFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoNwkDiscoveryCnfCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+       }\r
+       else\r
+       {\r
+               consolePrint("NwkDiscoveryCnf Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtZdoLeaveIndCb(LeaveIndFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtZdoLeaveIndCb\n");\r
+       consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+       consolePrint("ExtAddr: 0x%016llX\n", (long long unsigned int) msg->ExtAddr);\r
+       consolePrint("Request: 0x%02X\n", msg->Request);\r
+       consolePrint("Remove: 0x%02X\n", msg->Remove);\r
+       consolePrint("Rejoin: 0x%02X\n", msg->Rejoin);\r
+       return 0;\r
+}\r
+static uint8_t mtZdoMsgCbIncomingCb(MsgCbIncomingFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+\r
+       consolePrint("mtZdoMsgCbIncomingCb\n");\r
+       consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+       consolePrint("WasBroadcast: 0x%02X\n", msg->WasBroadcast);\r
+       consolePrint("ClusterID: 0x%04X\n", msg->ClusterID);\r
+       consolePrint("SecurityUse: 0x%02X\n", msg->SecurityUse);\r
+       consolePrint("SeqNum: 0x%02X\n", msg->SeqNum);\r
+       consolePrint("MacDstAddr: 0x%04X\n", msg->MacDstAddr);\r
+       uint32_t i;\r
+       for (i = 0; i < msg->MacDstAddr; i++)\r
+       {\r
+               consolePrint("Data[%d]: 0x%02X\n", i, msg->Data[i]);\r
+       }\r
+       SET_NRM_COLOR();\r
+       return 0;\r
+}\r
+\r
+/********************************************************************\r
+ * END OF ZDO CALL BACK FUNCTIONS\r
+ */\r
+\r
+/********************************************************************\r
+ * START OF AF CALL BACK FUNCTIONS\r
+ */\r
+\r
+static uint8_t mtAfDataConfirmCb(DataConfirmFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtAfDataConfirmCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+               consolePrint("Endpoint: 0x%02X\n", msg->Endpoint);\r
+               consolePrint("TransId: 0x%02X\n", msg->TransId);\r
+       }\r
+       else\r
+       {\r
+               consolePrint("DataConfirm Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtAfIncomingMsgCb(IncomingMsgFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtAfIncomingMsgCb\n");\r
+       consolePrint("GroupId: 0x%04X\n", msg->GroupId);\r
+       consolePrint("ClusterId: 0x%04X\n", msg->ClusterId);\r
+       consolePrint("SrcAddr: 0x%04X\n", msg->SrcAddr);\r
+       consolePrint("SrcEndpoint: 0x%02X\n", msg->SrcEndpoint);\r
+       consolePrint("DstEndpoint: 0x%02X\n", msg->DstEndpoint);\r
+       consolePrint("WasVroadcast: 0x%02X\n", msg->WasVroadcast);\r
+       consolePrint("LinkQuality: 0x%02X\n", msg->LinkQuality);\r
+       consolePrint("SecurityUse: 0x%02X\n", msg->SecurityUse);\r
+       consolePrint("TimeStamp: 0x%08X\n", msg->TimeStamp);\r
+       consolePrint("TransSeqNum: 0x%02X\n", msg->TransSeqNum);\r
+       consolePrint("Len: 0x%02X\n", msg->Len);\r
+       uint32_t i;\r
+       for (i = 0; i < msg->Len; i++)\r
+       {\r
+               consolePrint("Data[%d]: 0x%02X\n", i, msg->Data[i]);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return 0;\r
+}\r
+static uint8_t mtAfIncomingMsgExt(IncomingMsgExtFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtAfIncomingMsgExt\n");\r
+       consolePrint("GroupId: 0x%04X\n", msg->GroupId);\r
+       consolePrint("ClusterId: 0x%04X\n", msg->ClusterId);\r
+       consolePrint("SrcAddrMode: 0x%02X\n", msg->SrcAddrMode);\r
+       consolePrint("SrcAddr: 0x%016llX\n", (long long unsigned int) msg->SrcAddr);\r
+       consolePrint("SrcEndpoint: 0x%02X\n", msg->SrcEndpoint);\r
+       consolePrint("SrcPanId: 0x%04X\n", msg->SrcPanId);\r
+       consolePrint("DstEndpoint: 0x%02X\n", msg->DstEndpoint);\r
+       consolePrint("WasVroadcast: 0x%02X\n", msg->WasVroadcast);\r
+       consolePrint("LinkQuality: 0x%02X\n", msg->LinkQuality);\r
+       consolePrint("SecurityUse: 0x%02X\n", msg->SecurityUse);\r
+       consolePrint("TimeStamp: 0x%08X\n", msg->TimeStamp);\r
+       consolePrint("TransSeqNum: 0x%02X\n", msg->TransSeqNum);\r
+       consolePrint("Len: 0x%02X\n", msg->Len);\r
+       uint32_t i;\r
+       for (i = 0; i < msg->Len; i++)\r
+       {\r
+               consolePrint("Data[%d]: 0x%02X\n", i, msg->Data[i]);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return 0;\r
+}\r
+static uint8_t mtAfDataRetrieveSrspCb(DataRetrieveSrspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtAfDataRetrieveSrspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+               consolePrint("Length: 0x%02X\n", msg->Length);\r
+               uint32_t i;\r
+               for (i = 0; i < msg->Length; i++)\r
+               {\r
+                       consolePrint("Data[%d]: 0x%02X\n", i, msg->Data[i]);\r
+               }\r
+       }\r
+       else\r
+       {\r
+               consolePrint("DataRetrieveSrsp Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+\r
+       return msg->Status;\r
+}\r
+static uint8_t mtAfReflectErrorCb(ReflectErrorFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtAfReflectErrorCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+               consolePrint("Endpoint: 0x%02X\n", msg->Endpoint);\r
+               consolePrint("TransId: 0x%02X\n", msg->TransId);\r
+               consolePrint("DstAddrMode: 0x%02X\n", msg->DstAddrMode);\r
+               consolePrint("DstAddr: 0x%04X\n", msg->DstAddr);\r
+       }\r
+       else\r
+       {\r
+               consolePrint("ReflectError Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+\r
+       SET_NRM_COLOR();\r
+       return msg->Status;\r
+}\r
+\r
+/********************************************************************\r
+ * END OF AF CALL BACK FUNCTIONS\r
+ */\r
+\r
+/********************************************************************\r
+ * START OF SAPI CALL BACK FUNCTIONS\r
+ */\r
+\r
+static uint8_t mtSapiReadConfigurationSrspCb(ReadConfigurationSrspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtSapiReadConfigurationSrspCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+               consolePrint("ConfigId: 0x%02X\n", msg->ConfigId);\r
+               consolePrint("Len: 0x%02X\n", msg->Len);\r
+               uint32_t i;\r
+               for (i = 0; i < msg->Len; i++)\r
+               {\r
+                       consolePrint("Value[%d]: 0x%02X\n", i, msg->Value[i]);\r
+               }\r
+       }\r
+       else\r
+       {\r
+               consolePrint("ReadConfigurationSrsp Status: FAIL 0x%02X\n",\r
+                       msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+       return msg->Status;\r
+}\r
+static uint8_t mtSapiGetDeviceInfoSrspCb(GetDeviceInfoSrspFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtSapiGetDeviceInfoSrspCb\n");\r
+\r
+       switch (msg->Param)\r
+       {\r
+       case 0:\r
+               consolePrint("Param: (0x%02X) State\n", msg->Param);\r
+               consolePrint("Value: 0x%01X\n", msg->Value[0]);\r
+               break;\r
+       case 1:\r
+               consolePrint("Param: (0x%02X) IEEE Address\n", msg->Param);\r
+               consolePrint(\r
+                       "Value: 0x%02X:0x%02X:0x%02X:0x%02X:0x%02X:0x%02X:0x%02X:0x%02X\n",\r
+                       (unsigned char) msg->Value[0], (unsigned char) msg->Value[1],\r
+                       (unsigned char) msg->Value[2], (unsigned char) msg->Value[3],\r
+                       (unsigned char) msg->Value[4], (unsigned char) msg->Value[5],\r
+                       (unsigned char) msg->Value[6], (unsigned char) msg->Value[7]);\r
+               break;\r
+       case 2:\r
+               consolePrint("Param: (0x%02X) Short Address\n", msg->Param);\r
+               consolePrint("Value: 0x%04X\n",\r
+                       BUILD_UINT16(msg->Value[0], msg->Value[1]));\r
+               break;\r
+       case 3:\r
+               consolePrint("Param: (0x%02X) Parent Short Address\n", msg->Param);\r
+               consolePrint("Value: 0x%04X\n",\r
+                       BUILD_UINT16(msg->Value[0], msg->Value[1]));\r
+               break;\r
+       case 4:\r
+               consolePrint("Param: (0x%02X) Parent IEEE Address\n", msg->Param);\r
+               consolePrint(\r
+                       "Value: 0x%02X:0x%02X:0x%02X:0x%02X:0x%02X:0x%02X:0x%02X:0x%02X\n",\r
+                       (unsigned char) msg->Value[0], (unsigned char) msg->Value[1],\r
+                       (unsigned char) msg->Value[2], (unsigned char) msg->Value[3],\r
+                       (unsigned char) msg->Value[4], (unsigned char) msg->Value[5],\r
+                       (unsigned char) msg->Value[6], (unsigned char) msg->Value[7]);\r
+               break;\r
+       case 5:\r
+               consolePrint("Param: (0x%02X) Channel\n", msg->Param);\r
+               consolePrint("Value: 0x%01X\n", msg->Value[0]);\r
+               break;\r
+       case 6:\r
+               consolePrint("Param: (0x%02X) PAN ID\n", msg->Param);\r
+               consolePrint("Value: 0x%04X\n",\r
+                       BUILD_UINT16(msg->Value[0], msg->Value[1]));\r
+               break;\r
+       case 7:\r
+               consolePrint("Param: (0x%02X) Extended PAN ID\n", msg->Param);\r
+               consolePrint(\r
+                       "Value: 0x%02X:0x%02X:0x%02X:0x%02X:0x%02X:0x%02X:0x%02X:0x%02X\n",\r
+                       (unsigned char) msg->Value[0], (unsigned char) msg->Value[1],\r
+                       (unsigned char) msg->Value[2], (unsigned char) msg->Value[3],\r
+                       (unsigned char) msg->Value[4], (unsigned char) msg->Value[5],\r
+                       (unsigned char) msg->Value[6], (unsigned char) msg->Value[7]);\r
+               break;\r
+\r
+       }\r
+\r
+       SET_NRM_COLOR();\r
+\r
+       return 0;\r
+}\r
+static uint8_t mtSapiFindDeviceCnfCb(FindDeviceCnfFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtSapiFindDeviceCnfCb\n");\r
+       consolePrint("SearchKey: 0x%04X\n", msg->SearchKey);\r
+       consolePrint("Result: 0x%016llX\n", (long long unsigned int) msg->Result);\r
+       SET_NRM_COLOR();\r
+       return 0;\r
+}\r
+static uint8_t mtSapiSendDataCnfCb(SendDataCnfFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtSapiSendDataCnfCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("Handle: 0x%02X\n", msg->Handle);\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+       }\r
+       else\r
+       {\r
+               consolePrint("SendDataCnf Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+       return msg->Status;\r
+}\r
+static uint8_t mtSapiReceiveDataIndCb(ReceiveDataIndFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtSapiReceiveDataIndCb\n");\r
+       consolePrint("Source: 0x%04X\n", msg->Source);\r
+       consolePrint("Command: 0x%04X\n", msg->Command);\r
+       consolePrint("Len: 0x%04X\n", msg->Len);\r
+       uint32_t i;\r
+       for (i = 0; i < msg->Len; i++)\r
+       {\r
+               consolePrint("Data[%d]: 0x%02X\n", i, msg->Data[i]);\r
+       }\r
+       SET_NRM_COLOR();\r
+       return 0;\r
+}\r
+static uint8_t mtSapiAllowBindCnfCb(AllowBindCnfFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtSapiAllowBindCnfCb\n");\r
+       consolePrint("Source: 0x%04X\n", msg->Source);\r
+       SET_NRM_COLOR();\r
+       return 0;\r
+}\r
+static uint8_t mtSapiBindCnfCb(BindCnfFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtSapiBindCnfCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("CommandId: 0x%04X\n", msg->CommandId);\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+       }\r
+       else\r
+       {\r
+               consolePrint("BindCnf Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+       return msg->Status;\r
+}\r
+static uint8_t mtSapiStartCnfCb(StartCnfFormat_t *msg)\r
+{\r
+       SET_RSP_COLOR();\r
+       consolePrint("mtSapiStartCnfCb\n");\r
+       if (msg->Status == MT_RPC_SUCCESS)\r
+       {\r
+               consolePrint("Status: 0x%02X\n", msg->Status);\r
+       }\r
+       else\r
+       {\r
+               consolePrint("StartCnf Status: FAIL 0x%02X\n", msg->Status);\r
+       }\r
+       SET_NRM_COLOR();\r
+       return msg->Status;\r
+}\r
+\r
+/********************************************************************\r
+ * END OF SAPI CALL BACK FUNCTIONS\r
+ */\r
+\r
+// helper functions for building and sending the NV messages\r
+static uint8_t setNVStartup(uint8_t startupOption)\r
+{\r
+       uint8_t status;\r
+       OsalNvWriteFormat_t nvWrite;\r
+\r
+       // sending startup option\r
+       nvWrite.Id = ZCD_NV_STARTUP_OPTION;\r
+       nvWrite.Offset = 0;\r
+       nvWrite.Len = 1;\r
+       nvWrite.Value[0] = startupOption;\r
+       status = sysOsalNvWrite(&nvWrite);\r
+\r
+       dbg_print(PRINT_LEVEL_INFO, "\n");\r
+\r
+       dbg_print(PRINT_LEVEL_INFO, "NV Write Startup Option cmd sent[%d]...\n",\r
+               status);\r
+\r
+       return status;\r
+}\r
+\r
+static uint8_t setNVDevType(uint8_t devType)\r
+{\r
+       uint8_t status;\r
+       OsalNvWriteFormat_t nvWrite;\r
+\r
+       nvWrite.Id = ZCD_NV_LOGICAL_TYPE;\r
+       nvWrite.Offset = 0;\r
+       nvWrite.Len = 1;\r
+       nvWrite.Value[0] = devType;\r
+       status = sysOsalNvWrite(&nvWrite);\r
+\r
+       dbg_print(PRINT_LEVEL_INFO, "\n");\r
+       dbg_print(PRINT_LEVEL_INFO, "NV Write Device Type cmd sent... [%d]\n",\r
+               status);\r
+\r
+       return status;\r
+}\r
+\r
+static uint8_t setNVPanID(uint32_t panId)\r
+{\r
+       uint8_t status;\r
+       OsalNvWriteFormat_t nvWrite;\r
+\r
+       dbg_print(PRINT_LEVEL_INFO, "\n");\r
+       dbg_print(PRINT_LEVEL_INFO, "NV Write PAN ID cmd sending...\n");\r
+\r
+       nvWrite.Id = ZCD_NV_PANID;\r
+       nvWrite.Offset = 0;\r
+       nvWrite.Len = 2;\r
+       nvWrite.Value[0] = LO_UINT16(panId);\r
+       nvWrite.Value[1] = HI_UINT16(panId);\r
+       status = sysOsalNvWrite(&nvWrite);\r
+\r
+       dbg_print(PRINT_LEVEL_INFO, "\n");\r
+       dbg_print(PRINT_LEVEL_INFO, "NV Write PAN ID cmd sent...[%d]\n", status);\r
+\r
+       return status;\r
+}\r
+\r
+static uint8_t setNVChanList(uint32_t chanList)\r
+{\r
+       OsalNvWriteFormat_t nvWrite;\r
+       uint8_t status;\r
+\r
+       // setting chanList\r
+       nvWrite.Id = ZCD_NV_CHANLIST;\r
+       nvWrite.Offset = 0;\r
+       nvWrite.Len = 4;\r
+       nvWrite.Value[0] = BREAK_UINT32(chanList, 0);\r
+       nvWrite.Value[1] = BREAK_UINT32(chanList, 1);\r
+       nvWrite.Value[2] = BREAK_UINT32(chanList, 2);\r
+       nvWrite.Value[3] = BREAK_UINT32(chanList, 3);\r
+       status = sysOsalNvWrite(&nvWrite);\r
+\r
+       dbg_print(PRINT_LEVEL_INFO, "\n");\r
+       dbg_print(PRINT_LEVEL_INFO, "NV Write Channel List cmd sent...[%d]\n",\r
+               status);\r
+\r
+       return status;\r
+}\r
+\r
+static int32_t startNetwork(void)\r
+{\r
+       char cDevType;\r
+       uint8_t devType;\r
+       int32_t status;\r
+       uint8_t newNwk = 0;\r
+       char sCh[128];\r
+\r
+       do\r
+       {\r
+               consolePrint("Do you wish to start/join a new network? (y/n)\n");\r
+               consoleGetLine(sCh, 128);\r
+               if (sCh[0] == 'n' || sCh[0] == 'N')\r
+               {\r
+                       status = setNVStartup(0);\r
+               }\r
+               else if (sCh[0] == 'y' || sCh[0] == 'Y')\r
+               {\r
+                       status = setNVStartup(\r
+                       ZCD_STARTOPT_CLEAR_STATE | ZCD_STARTOPT_CLEAR_CONFIG);\r
+                       newNwk = 1;\r
+\r
+               }\r
+               else\r
+               {\r
+                       consolePrint("Incorrect input please type y or n\n");\r
+               }\r
+       } while (sCh[0] != 'y' && sCh[0] != 'Y' && sCh[0] != 'n' && sCh[0] != 'N');\r
+\r
+       if (status != MT_RPC_SUCCESS)\r
+       {\r
+               dbg_print(PRINT_LEVEL_WARNING, "network start failed\n");\r
+               return -1;\r
+       }\r
+       consolePrint("Resetting ZNP\n");\r
+       ResetReqFormat_t resReq;\r
+       resReq.Type = 1;\r
+       sysResetReq(&resReq);\r
+       //flush the rsp\r
+       rpcWaitMqClientMsg(5000);\r
+\r
+       if (newNwk)\r
+       {\r
+               consolePrint(\r
+                       "Enter device type c: Coordinator, r: Router, e: End Device:\n");\r
+               consoleGetLine(sCh, 128);\r
+               cDevType = sCh[0];\r
+\r
+               switch (cDevType)\r
+               {\r
+               case 'c':\r
+               case 'C':\r
+                       devType = DEVICETYPE_COORDINATOR;\r
+                       break;\r
+               case 'r':\r
+               case 'R':\r
+                       devType = DEVICETYPE_ROUTER;\r
+                       break;\r
+               case 'e':\r
+               case 'E':\r
+               default:\r
+                       devType = DEVICETYPE_ENDDEVICE;\r
+                       break;\r
+               }\r
+               status = setNVDevType(devType);\r
+\r
+               if (status != MT_RPC_SUCCESS)\r
+               {\r
+                       dbg_print(PRINT_LEVEL_WARNING, "setNVDevType failed\n");\r
+                       return 0;\r
+               }\r
+               //Select random PAN ID for Coord and join any PAN for RTR/ED\r
+               status = setNVPanID(0xFFFF);\r
+               if (status != MT_RPC_SUCCESS)\r
+               {\r
+                       dbg_print(PRINT_LEVEL_WARNING, "setNVPanID failed\n");\r
+                       return -1;\r
+               }\r
+               consolePrint("Enter channel 11-26:\n");\r
+               consoleGetLine(sCh, 128);\r
+\r
+               status = setNVChanList(1 << atoi(sCh));\r
+               if (status != MT_RPC_SUCCESS)\r
+               {\r
+                       dbg_print(PRINT_LEVEL_INFO, "setNVPanID failed\n");\r
+                       return -1;\r
+               }\r
+\r
+       }\r
+\r
+       registerAf();\r
+       consolePrint("EndPoint: 1\n");\r
+\r
+       status = zdoInit();\r
+       if (status == NEW_NETWORK)\r
+       {\r
+               dbg_print(PRINT_LEVEL_INFO, "zdoInit NEW_NETWORK\n");\r
+               status = MT_RPC_SUCCESS;\r
+       }\r
+       else if (status == RESTORED_NETWORK)\r
+       {\r
+               dbg_print(PRINT_LEVEL_INFO, "zdoInit RESTORED_NETWORK\n");\r
+               status = MT_RPC_SUCCESS;\r
+       }\r
+       else\r
+       {\r
+               dbg_print(PRINT_LEVEL_INFO, "zdoInit failed\n");\r
+               status = -1;\r
+       }\r
+\r
+       dbg_print(PRINT_LEVEL_INFO, "process zdoStatechange callbacks\n");\r
+\r
+       //flush AREQ ZDO State Change messages\r
+       while (status != -1)\r
+       {\r
+               status = rpcWaitMqClientMsg(5000);\r
+\r
+               if (((devType == DEVICETYPE_COORDINATOR) && (devState == DEV_ZB_COORD))\r
+                       || ((devType == DEVICETYPE_ROUTER) && (devState == DEV_ROUTER))\r
+                       || ((devType == DEVICETYPE_ENDDEVICE)\r
+                               && (devState == DEV_END_DEVICE)))\r
+               {\r
+                       break;\r
+               }\r
+       }\r
+       //set startup option back to keep configuration in case of reset\r
+       status = setNVStartup(0);\r
+       if (devState < DEV_END_DEVICE)\r
+       {\r
+               //start network failed\r
+               return -1;\r
+       }\r
+\r
+       return 0;\r
+}\r
+\r
+static int32_t registerAf(void)\r
+{\r
+       int32_t status = 0;\r
+       RegisterFormat_t reg;\r
+\r
+       reg.EndPoint = 1;\r
+       reg.AppProfId = 0x0104;\r
+       reg.AppDeviceId = 0x0100;\r
+       reg.AppDevVer = 1;\r
+       reg.LatencyReq = 0;\r
+       reg.AppNumInClusters = 1;\r
+       reg.AppInClusterList[0] = 0x0006;\r
+       reg.AppNumOutClusters = 0;\r
+\r
+       status = afRegister(&reg);\r
+       return status;\r
+}\r
+\r
+/*********************************************************************\r
+ * INTERFACE FUNCTIONS\r
+ */\r
+uint32_t appInit(void)\r
+{\r
+       int32_t status = 0;\r
+       uint32_t msgCnt = 0;\r
+\r
+       //Flush all messages from the que\r
+       while (status != -1)\r
+       {\r
+               status = rpcWaitMqClientMsg(10);\r
+               if (status != -1)\r
+               {\r
+                       msgCnt++;\r
+               }\r
+       }\r
+\r
+       dbg_print(PRINT_LEVEL_INFO, "flushed %d message from msg queue\n", msgCnt);\r
+\r
+       //Register Callbacks MT system callbacks\r
+       sysRegisterCallbacks(mtSysCb);\r
+       zdoRegisterCallbacks(mtZdoCb);\r
+       afRegisterCallbacks(mtAfCb);\r
+       sapiRegisterCallbacks(mtSapiCb);\r
+\r
+       return 0;\r
+}\r
+/*********************************************************************\r
+ * START OF COMMANDS PROCESSING\r
+ */\r
+static void sendCmd(uint8_t* req, uint8_t index)\r
+{\r
+       switch (index)\r
+       {\r
+       case 0:\r
+               sysPing();\r
+               break;\r
+       case 1:\r
+               sysSetExtAddr((SetExtAddrFormat_t*) req);\r
+               break;\r
+       case 2:\r
+               sysGetExtAddr();\r
+               break;\r
+       case 3:\r
+               sysRamRead((RamReadFormat_t*) req);\r
+               break;\r
+       case 4:\r
+               sysRamWrite((RamWriteFormat_t*) req);\r
+               break;\r
+       case 5:\r
+               sysResetReq((ResetReqFormat_t*) req);\r
+               break;\r
+       case 6:\r
+               sysVersion();\r
+               break;\r
+       case 7:\r
+               sysOsalNvRead((OsalNvReadFormat_t*) req);\r
+               break;\r
+       case 8:\r
+               sysOsalNvWrite((OsalNvWriteFormat_t*) req);\r
+               break;\r
+       case 9:\r
+               sysOsalNvItemInit((OsalNvItemInitFormat_t*) req);\r
+               break;\r
+       case 10:\r
+               sysOsalNvDelete((OsalNvDeleteFormat_t*) req);\r
+               break;\r
+       case 11:\r
+               sysOsalNvLength((OsalNvLengthFormat_t*) req);\r
+               break;\r
+       case 12:\r
+               sysOsalStartTimer((OsalStartTimerFormat_t*) req);\r
+               break;\r
+       case 13:\r
+               sysOsalStopTimer((OsalStopTimerFormat_t*) req);\r
+               break;\r
+       case 14:\r
+               sysStackTune((StackTuneFormat_t*) req);\r
+               break;\r
+       case 15:\r
+               sysAdcRead((AdcReadFormat_t*) req);\r
+               break;\r
+       case 16:\r
+               sysGpio((GpioFormat_t*) req);\r
+               break;\r
+       case 17:\r
+               sysRandom();\r
+               break;\r
+       case 18:\r
+               sysSetTime((SetTimeFormat_t*) req);\r
+               break;\r
+       case 19:\r
+               sysGetTime();\r
+               break;\r
+       case 20:\r
+               sysSetTxPower((SetTxPowerFormat_t*) req);\r
+               break;\r
+       case 21:\r
+               afRegister((RegisterFormat_t*) req);\r
+               break;\r
+       case 22:\r
+               afDataRequest((DataRequestFormat_t*) req);\r
+               break;\r
+       case 23:\r
+               afDataRequestExt((DataRequestExtFormat_t*) req);\r
+               break;\r
+       case 24:\r
+               afDataRequestSrcRtg((DataRequestSrcRtgFormat_t*) req);\r
+               break;\r
+       case 25:\r
+               afInterPanCtl((InterPanCtlFormat_t*) req);\r
+               break;\r
+       case 26:\r
+               afDataStore((DataStoreFormat_t*) req);\r
+               break;\r
+       case 27:\r
+               afDataRetrieve((DataRetrieveFormat_t*) req);\r
+               break;\r
+       case 28:\r
+               afApsfConfigSet((ApsfConfigSetFormat_t*) req);\r
+               break;\r
+       case 29:\r
+               zdoNwkAddrReq((NwkAddrReqFormat_t*) req);\r
+               break;\r
+       case 30:\r
+               zdoIeeeAddrReq((IeeeAddrReqFormat_t*) req);\r
+               break;\r
+       case 31:\r
+               zdoNodeDescReq((NodeDescReqFormat_t*) req);\r
+               break;\r
+       case 32:\r
+               zdoPowerDescReq((PowerDescReqFormat_t*) req);\r
+               break;\r
+       case 33:\r
+               zdoSimpleDescReq((SimpleDescReqFormat_t*) req);\r
+               break;\r
+       case 34:\r
+               zdoActiveEpReq((ActiveEpReqFormat_t*) req);\r
+               break;\r
+       case 35:\r
+               zdoMatchDescReq((MatchDescReqFormat_t*) req);\r
+               break;\r
+       case 36:\r
+               zdoComplexDescReq((ComplexDescReqFormat_t*) req);\r
+               break;\r
+       case 37:\r
+               zdoUserDescReq((UserDescReqFormat_t*) req);\r
+               break;\r
+       case 38:\r
+               zdoDeviceAnnce((DeviceAnnceFormat_t*) req);\r
+               break;\r
+       case 39:\r
+               zdoUserDescSet((UserDescSetFormat_t*) req);\r
+               break;\r
+       case 40:\r
+               zdoServerDiscReq((ServerDiscReqFormat_t*) req);\r
+               break;\r
+       case 41:\r
+               zdoEndDeviceBindReq((EndDeviceBindReqFormat_t*) req);\r
+               break;\r
+       case 42:\r
+               zdoBindReq((BindReqFormat_t*) req);\r
+               break;\r
+       case 43:\r
+               zdoUnbindReq((UnbindReqFormat_t*) req);\r
+               break;\r
+       case 44:\r
+               zdoMgmtNwkDiscReq((MgmtNwkDiscReqFormat_t*) req);\r
+               break;\r
+       case 45:\r
+               zdoMgmtLqiReq((MgmtLqiReqFormat_t*) req);\r
+               break;\r
+       case 46:\r
+               zdoMgmtRtgReq((MgmtRtgReqFormat_t*) req);\r
+               break;\r
+       case 47:\r
+               zdoMgmtBindReq((MgmtBindReqFormat_t*) req);\r
+               break;\r
+       case 48:\r
+               zdoMgmtLeaveReq((MgmtLeaveReqFormat_t*) req);\r
+               break;\r
+       case 49:\r
+               zdoMgmtDirectJoinReq((MgmtDirectJoinReqFormat_t*) req);\r
+               break;\r
+       case 50:\r
+               zdoMgmtPermitJoinReq((MgmtPermitJoinReqFormat_t*) req);\r
+               break;\r
+       case 51:\r
+               zdoMgmtNwkUpdateReq((MgmtNwkUpdateReqFormat_t*) req);\r
+               break;\r
+       case 52:\r
+               zdoStartupFromApp((StartupFromAppFormat_t*) req);\r
+               break;\r
+       case 53:\r
+               zdoAutoFindDestination((AutoFindDestinationFormat_t*) req);\r
+               break;\r
+       case 54:\r
+               zdoSetLinkKey((SetLinkKeyFormat_t*) req);\r
+               break;\r
+       case 55:\r
+               zdoRemoveLinkKey((RemoveLinkKeyFormat_t*) req);\r
+               break;\r
+       case 56:\r
+               zdoGetLinkKey((GetLinkKeyFormat_t*) req);\r
+               break;\r
+       case 57:\r
+               zdoNwkDiscoveryReq((NwkDiscoveryReqFormat_t*) req);\r
+               break;\r
+       case 58:\r
+               zdoJoinReq((JoinReqFormat_t*) req);\r
+               break;\r
+       case 59:\r
+               zdoMsgCbRegister((MsgCbRegisterFormat_t*) req);\r
+               break;\r
+       case 60:\r
+               zdoMsgCbRemove((MsgCbRemoveFormat_t*) req);\r
+               break;\r
+       case 61:\r
+               zbSystemReset();\r
+               break;\r
+       case 62:\r
+               zbAppRegisterReq((AppRegisterReqFormat_t*) req);\r
+               break;\r
+       case 63:\r
+               zbStartReq();\r
+               break;\r
+       case 64:\r
+               zbPermitJoiningReq((PermitJoiningReqFormat_t*) req);\r
+               break;\r
+       case 65:\r
+               zbBindDevice((BindDeviceFormat_t*) req);\r
+               break;\r
+       case 66:\r
+               zbAllowBind((AllowBindFormat_t*) req);\r
+               break;\r
+       case 67:\r
+               zbSendDataReq((SendDataReqFormat_t*) req);\r
+               break;\r
+       case 68:\r
+               zbFindDeviceReq((FindDeviceReqFormat_t*) req);\r
+               break;\r
+       case 69:\r
+               zbWriteConfiguration((WriteConfigurationFormat_t*) req);\r
+               break;\r
+       case 70:\r
+               zbGetDeviceInfo((GetDeviceInfoFormat_t*) req);\r
+               break;\r
+       case 71:\r
+               zbReadConfiguration((ReadConfigurationFormat_t*) req);\r
+               break;\r
+\r
+       }\r
+\r
+}\r
+uint8_t matchedCmds[250];\r
+uint8_t matchedLength;\r
+static void inputCmd(uint16_t index)\r
+{\r
+       char value[128];\r
+       char* strPos = value;\r
+       uint8_t commandSize = 0;\r
+       uint8_t attSize = 0;\r
+       uint16_t currentPos = 0;\r
+\r
+       uint8_t x;\r
+       for (x = 0; x < commands[index].attNum; x++)\r
+       {\r
+               commandSize += commands[index].atts[x].size\r
+                       * (commands[index].atts[x].isList == 0 ?\r
+                               1 : commands[index].atts[x].isList);\r
+               commandSize += (\r
+                       (commands[index].atts[x].size == 2 && (commandSize % 2) != 0) ?\r
+                               1 : 0);\r
+       }\r
+\r
+       uint8_t *input = malloc(commandSize);\r
+       int tem;\r
+\r
+       SET_PARAM_COLOR();\r
+       consolePrint("Command: %s\n", commands[index].cmdName);\r
+       SET_NRM_COLOR();\r
+       for (x = 0; x < commands[index].attNum; x++)\r
+       {\r
+               attSize = commands[index].atts[x].size;\r
+               if (commands[index].atts[x].isList == 0)\r
+               {\r
+                       SET_PARAM_COLOR();\r
+                       consolePrint("Enter %s: (%dB)\n", commands[index].atts[x].name,\r
+                               attSize);\r
+                       SET_NRM_COLOR();\r
+                       consoleGetLine(value, 128);\r
+\r
+                       if (attSize == 2)\r
+                       {\r
+                               sscanf(value, "%x", &tem);\r
+                               sprintf(value, "%04X", tem);\r
+                               //strPos = value;\r
+                               if (currentPos % 2 != 0)\r
+                               {\r
+                                       currentPos++;\r
+                               }\r
+                       }\r
+                       else if (attSize == 4)\r
+                       {\r
+                               sscanf(value, "%x", &tem);\r
+                               sprintf(value, "%08X", tem);\r
+                               //strPos = value;\r
+                       }\r
+                       else if (attSize == 1)\r
+                       {\r
+                               sscanf(value, "%x", &tem);\r
+                               sprintf(value, "%02X", tem);\r
+                               //strPos = value;\r
+                       }\r
+                       strPos = value;\r
+                       uint8_t idx;\r
+                       for (idx = 0; idx < attSize; idx++)\r
+                       {\r
+                               if (strlen(strPos) > 0)\r
+                               {\r
+\r
+                                       sscanf(strPos, "%2hhx",\r
+                                               &input[currentPos + attSize - 1 - idx]);\r
+                                       strPos += (strPos[2] == ':' ? 3 : 2);\r
+                               }\r
+                               else\r
+                               {\r
+                                       input[currentPos + attSize - 1 - idx] = 0;\r
+                               }\r
+\r
+                       }\r
+                       currentPos += attSize;\r
+               }\r
+       &nbs