Updated TI Linux Sensor To Cloud to the latest TI 15.4-Stack v2.4, now with CC13x2... master
authorBrock Allen <brock-allen@ti.com>
Tue, 6 Mar 2018 03:22:04 +0000 (19:22 -0800)
committerBrock Allen <brock-allen@ti.com>
Tue, 6 Mar 2018 03:22:04 +0000 (19:22 -0800)
210 files changed:
.gitignore
components/api/Makefile
components/api/inc/api_mac.h
components/api/inc/api_mac_linux.h
components/api/inc/mt_msg.h
components/api/inc/mt_msg_dbg.h
components/api/src/api_mac.c
components/api/src/mt_msg.c
components/api/src/mt_msg_dbg_core.c
components/api/src/mt_msg_dbg_load.c
components/api/src/mt_msg_ini.c
components/common/Makefile
components/common/inc/bitsnbits.h
components/common/inc/compiler.h
components/common/inc/compiler_gcc.h
components/common/inc/debug_helpers.h
components/common/inc/fatal.h
components/common/inc/fifo.h
components/common/inc/hexline.h
components/common/inc/hlos_specific.h
components/common/inc/ini_file.h
components/common/inc/log.h
components/common/inc/mutex.h
components/common/inc/rand_data.h
components/common/inc/stream.h
components/common/inc/stream_private.h
components/common/inc/stream_socket.h
components/common/inc/stream_uart.h
components/common/inc/threads.h
components/common/inc/ti_semaphore.h
components/common/inc/timer.h
components/common/inc/unix_fdrw.h
components/common/inc/void_ptr.h
components/common/linux/linux_specific.c
components/common/linux/linux_uart.c
components/common/src/debug_helpers.c
components/common/src/fatal.c
components/common/src/fifo.c
components/common/src/hexline.c
components/common/src/ini_file.c
components/common/src/log.c
components/common/src/log_ini.c
components/common/src/mutex.c
components/common/src/rand_data.c
components/common/src/stream_common.c
components/common/src/stream_file.c
components/common/src/stream_mem.c
components/common/src/stream_socket_client.c
components/common/src/stream_socket_ini.c
components/common/src/stream_socket_private.c
components/common/src/stream_socket_private.h
components/common/src/stream_socket_server.c
components/common/src/stream_uart_ini.c
components/common/src/threads.c
components/common/src/ti_semaphore.c
components/common/src/timer.c
components/common/src/timer_cb.c
components/common/src/unix_fdrw.c
components/nv/Makefile
components/nv/inc/nv_linux.h
components/nv/inc/nvintf.h
components/nv/linux/nv_linux.c
example/collector/Makefile
example/collector/appsrv.c
example/collector/appsrv.h
example/collector/cllc.c
example/collector/cllc.h
example/collector/collector.c
example/collector/collector.cfg
example/collector/collector.h
example/collector/common/native_oad/oad_protocol.c
example/collector/common/native_oad/oad_protocol.h
example/collector/common/native_oad/oad_target.h
example/collector/common/util/board_gpio.h [new file with mode: 0644]
example/collector/common/util/board_lcd.h
example/collector/config.h
example/collector/csf.h
example/collector/csf_linux.c
example/collector/csf_linux.h
example/collector/linux_main.c
example/collector/llc.h
example/collector/oad_image_header.h [new file with mode: 0644]
example/collector/oad_protocol.c
example/collector/oad_protocol.h
example/collector/oad_storage.h [new file with mode: 0644]
example/collector/run_collector.sh
example/collector/smsgs.h
example/collector/timac_features.h
example/collector/util.c
example/collector/util.h
example/commissioner/scripts/configureCollector.sh
example/commissioner/scripts/eraseNV.sh
example/commissioner/scripts/launch_gateway.sh
example/ibm-frontend/app.js
example/ibm-frontend/cloudClient/devices/device.js [deleted file]
example/ibm-frontend/cloudClient/ibmCloudClient.js [moved from example/ibm-frontend/cloudClient/cloudClient.js with 64% similarity]
example/ibm-frontend/cloudClient/nwkinfo/nwkinfo.js [deleted file]
example/ibm-frontend/cloudWebServer/cloudWebServer.js
example/ibm-frontend/cloudWebServer/public/dist/css/bootstrap-theme.css [moved from example/ibm-frontend/public/dist/css/bootstrap-theme.css with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/css/bootstrap-theme.css.map [moved from example/ibm-frontend/public/dist/css/bootstrap-theme.css.map with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/css/bootstrap-theme.min.css [moved from example/ibm-frontend/public/dist/css/bootstrap-theme.min.css with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/css/bootstrap-theme.min.css.map [moved from example/ibm-frontend/public/dist/css/bootstrap-theme.min.css.map with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/css/bootstrap.css [moved from example/ibm-frontend/public/dist/css/bootstrap.css with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/css/bootstrap.css.map [moved from example/ibm-frontend/public/dist/css/bootstrap.css.map with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/css/bootstrap.min.css [moved from example/ibm-frontend/public/dist/css/bootstrap.min.css with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/css/bootstrap.min.css.map [new file with mode: 0644]
example/ibm-frontend/cloudWebServer/public/dist/fonts/glyphicons-halflings-regular.eot [moved from example/ibm-frontend/public/dist/fonts/glyphicons-halflings-regular.eot with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/fonts/glyphicons-halflings-regular.svg [moved from example/ibm-frontend/public/dist/fonts/glyphicons-halflings-regular.svg with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/fonts/glyphicons-halflings-regular.ttf [moved from example/ibm-frontend/public/dist/fonts/glyphicons-halflings-regular.ttf with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/fonts/glyphicons-halflings-regular.woff [moved from example/ibm-frontend/public/dist/fonts/glyphicons-halflings-regular.woff with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/fonts/glyphicons-halflings-regular.woff2 [moved from example/ibm-frontend/public/dist/fonts/glyphicons-halflings-regular.woff2 with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/images/Fan.png [moved from example/ibm-frontend/public/dist/images/Fan.png with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/images/Humidity.png [moved from example/ibm-frontend/public/dist/images/Humidity.png with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/images/Light.png [moved from example/ibm-frontend/public/dist/images/Light.png with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/images/Lock.png [moved from example/ibm-frontend/public/dist/images/Lock.png with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/images/Motion.png [moved from example/ibm-frontend/public/dist/images/Motion.png with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/images/No_Motion.png [moved from example/ibm-frontend/public/dist/images/No_Motion.png with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/images/Pressure.png [moved from example/ibm-frontend/public/dist/images/Pressure.png with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/images/Temperature.png [moved from example/ibm-frontend/public/dist/images/Temperature.png with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/images/Unlock.png [moved from example/ibm-frontend/public/dist/images/Unlock.png with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/images/battery_full.png [moved from example/ibm-frontend/public/dist/images/battery_full.png with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/images/battery_half.png [moved from example/ibm-frontend/public/dist/images/battery_half.png with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/images/battery_low.png [moved from example/ibm-frontend/public/dist/images/battery_low.png with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/images/door.png [moved from example/ibm-frontend/public/dist/images/door.png with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/images/door_open.png [moved from example/ibm-frontend/public/dist/images/door_open.png with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/images/no_leak.png [new file with mode: 0644]
example/ibm-frontend/cloudWebServer/public/dist/images/time.png [moved from example/ibm-frontend/public/dist/images/time.png with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/images/water_leak.png [new file with mode: 0644]
example/ibm-frontend/cloudWebServer/public/dist/jquery/jquery-1.12.0.min.js [moved from example/ibm-frontend/public/dist/jquery/jquery-1.12.0.min.js with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/js/bootstrap.js [moved from example/ibm-frontend/public/dist/js/bootstrap.js with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/js/bootstrap.min.js [moved from example/ibm-frontend/public/dist/js/bootstrap.min.js with 100% similarity]
example/ibm-frontend/cloudWebServer/public/dist/js/jquery.canvasjs.min.js [new file with mode: 0644]
example/ibm-frontend/cloudWebServer/public/dist/js/npm.js [moved from example/ibm-frontend/public/dist/js/npm.js with 100% similarity]
example/ibm-frontend/cloudWebServer/public/index.html [new file with mode: 0644]
example/ibm-frontend/package.json
example/ibm-frontend/public/dist/css/jquery.jqplot.css [deleted file]
example/ibm-frontend/public/dist/css/jquery.jqplot.min.css [deleted file]
example/ibm-frontend/public/dist/jquery/jqplot.barRenderer.js [deleted file]
example/ibm-frontend/public/dist/jquery/jqplot.canvasAxisLabelRenderer.js [deleted file]
example/ibm-frontend/public/dist/jquery/jqplot.canvasAxisTickRenderer.js [deleted file]
example/ibm-frontend/public/dist/jquery/jqplot.canvasTextRenderer.js [deleted file]
example/ibm-frontend/public/dist/jquery/jqplot.categoryAxisRenderer.js [deleted file]
example/ibm-frontend/public/dist/jquery/jqplot.dateAxisRenderer.js [deleted file]
example/ibm-frontend/public/dist/jquery/jqplot.logAxisRenderer.js [deleted file]
example/ibm-frontend/public/dist/jquery/jquery.jqplot.min.js [deleted file]
example/ibm-frontend/public/images/newapp-icon.png [deleted file]
example/ibm-frontend/public/index.html [deleted file]
example/ibm-frontend/public/stylesheets/style.css [deleted file]
example/iot-gateway/appClient/appclient.js
example/iot-gateway/appClient/devices/device.js
example/iot-gateway/appClient/nwkinfo/nwkinfo.js
example/iot-gateway/cloudAdapter/awsCloudAdapter.js
example/iot-gateway/cloudAdapter/ibmCloudAdapter.js
example/iot-gateway/cloudAdapter/ibmQuickstartAdapter.js
example/iot-gateway/iot-gateway.js
example/iot-gateway/package-lock.json [new file with mode: 0644]
example/iot-gateway/run_gateway.sh
example/iot-gateway/webserver/collectorApp.html
example/iot-gateway/webserver/public/dist/images/no_leak.png [new file with mode: 0644]
example/iot-gateway/webserver/public/dist/images/water_leak.png [new file with mode: 0644]
example/iot-gateway/webserver/webserver.js
example/npi_server2/Makefile
example/npi_server2/apimac-msgs.cfg
example/npi_server2/app_main.c
example/npi_server2/linux_main.c
example/npi_server2/npi_server2.cfg
example/npi_server2/npi_server2.h
example/prebuilt/bbb_collector [deleted file]
example/prebuilt/bbb_npi_server2 [deleted file]
firmware/CC13x0_LaunchPad/coprocessor_cc13x0_lp.hex [new file with mode: 0644]
firmware/CC13x0_LaunchPad/coprocessor_cc13x0_lp.map [new file with mode: 0644]
firmware/CC13x0_LaunchPad/coprocessor_cc13xx_lp.hex [deleted file]
firmware/CC13x0_LaunchPad/sensor_cc13x0_lp_default_433.hex [new file with mode: 0644]
firmware/CC13x0_LaunchPad/sensor_cc13x0_lp_default_433.map [new file with mode: 0644]
firmware/CC13x0_LaunchPad/sensor_cc13x0_lp_default_863.hex [new file with mode: 0644]
firmware/CC13x0_LaunchPad/sensor_cc13x0_lp_default_863.map [new file with mode: 0644]
firmware/CC13x0_LaunchPad/sensor_cc13x0_lp_default_915.hex [new file with mode: 0644]
firmware/CC13x0_LaunchPad/sensor_cc13x0_lp_default_915.map [new file with mode: 0644]
firmware/CC13x0_LaunchPad/sensor_default_433MHz.hex [deleted file]
firmware/CC13x0_LaunchPad/sensor_default_433_config.h [new file with mode: 0644]
firmware/CC13x0_LaunchPad/sensor_default_863_config.h [new file with mode: 0644]
firmware/CC13x0_LaunchPad/sensor_default_868MHz.hex [deleted file]
firmware/CC13x0_LaunchPad/sensor_default_915MHz.hex [deleted file]
firmware/CC13x0_LaunchPad/sensor_default_915_config.h [new file with mode: 0644]
firmware/CC13x2_LaunchPad/coprocessor_cc13x2_lp.hex [new file with mode: 0644]
firmware/CC13x2_LaunchPad/coprocessor_cc13x2_lp.map [new file with mode: 0644]
firmware/CC13x2_LaunchPad/sensor_cc13x2_lp_default.hex [new file with mode: 0644]
firmware/CC13x2_LaunchPad/sensor_cc13x2_lp_default.map [new file with mode: 0644]
firmware/CC13x2_LaunchPad/sensor_cc13x2_lp_default_863.hex [new file with mode: 0644]
firmware/CC13x2_LaunchPad/sensor_cc13x2_lp_default_863.map [new file with mode: 0644]
firmware/CC13x2_LaunchPad/sensor_default_863_config.h [new file with mode: 0644]
firmware/CC13x2_LaunchPad/sensor_default_config.h [new file with mode: 0644]
prebuilt/bin/apimac-msgs.cfg [moved from example/prebuilt/apimac-msgs.cfg with 99% similarity]
prebuilt/bin/bbb_cc13xx-sbl [new file with mode: 0644]
prebuilt/bin/bbb_collector [new file with mode: 0644]
prebuilt/bin/bbb_npi_server2 [new file with mode: 0644]
prebuilt/bin/collector.cfg [moved from example/prebuilt/collector.cfg with 77% similarity]
prebuilt/bin/host_cc13xx-sbl [new file with mode: 0644]
prebuilt/bin/host_collector [new file with mode: 0644]
prebuilt/bin/host_npi_server2 [new file with mode: 0644]
prebuilt/bin/npi_server2.cfg [moved from example/prebuilt/npi_server2.cfg with 98% similarity]
prebuilt/bin/run_collector.sh [moved from example/prebuilt/run_collector.sh with 100% similarity]
prebuilt/run_demo.sh [moved from run_demo.sh with 83% similarity]
scripts/autostart_gui.sh [new file with mode: 0644]
scripts/front_matter.mak
scripts/setup_gateway.sh [new file with mode: 0644]
scripts/setup_wireless_cape.sh [new file with mode: 0644]
setup_beaglebone.sh
tutorials/generic_sensor_tutorial/final/SensorToCloud/Sub-1GHzSensortoCloudIndustrialIoTG_manifest.html
tutorials/generic_sensor_tutorial/tutorial/SensorToCloud/Sub-1GHzSensortoCloudIndustrialIoTG_manifest.html

index e063346dd5b35e53fe852761df7f8a64a785b71a..7e675de2e0cb3ef12da97bfebd34c9c5de44c6c2 100644 (file)
@@ -3,3 +3,8 @@
 *~
 *.swo
 example/commissioner/webserver/uploads/*
+*.o
+*.d
+*.a
+**/node_modules
+**/obj
\ No newline at end of file
index f7e43857bfcd8e38651f03b1bb2371e64d5476fb..901baa72f56f4daad5e035929787e95f49c75ee5 100644 (file)
@@ -4,7 +4,7 @@
 # @brief TIMAC 2.0 makefile for the Linux API MAC and MT Layer 
 #
 # Group: WCS LPC
-# $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+# $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 #
 #############################################################
 # $License: BSD3 2016 $
@@ -40,7 +40,7 @@
 #   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #############################################################
 # $Release Name: TI-15.4Stack Linux x64 SDK$
-# $Release Date: Jun 28, 2017 (2.02.00.03)$
+# $Release Date: Sept 27, 2017 (2.04.00.13)$
 #############################################################
 
 # By default, we make the library file
index 6c020db11dd9278300becd76abf932dd95cc56f4..6bb0ef177515027f079d7737483e429cb0e56c05 100644 (file)
@@ -1,11 +1,11 @@
 /******************************************************************************
 
  @file api_mac.h
-i
+
  @brief TI-15.4 Stack API
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -41,7 +41,7 @@ i
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 #ifndef API_MAC_H
 #define API_MAC_H
@@ -250,7 +250,10 @@ extern "C"
  #define APIMAC_GENERIC_CHINA_LRM_433_PHY_130    130
   /*! 863MHz ETSI LRM Frequency band operating mode #1 */
  #define APIMAC_GENERIC_ETSI_LRM_863_PHY_131     131
-
+ /*! PHY IDs - 915MHz US Frequency band operating mode # 3 */
+#define APIMAC_GENERIC_US_915_PHY_132            132
+ /*! 863MHz ETSI Frequency band operating mode #2 */
+#define APIMAC_GENERIC_ETSI_863_PHY_133          133
 /*! PHY IDs - MRFSK Generic Phy ID start */
 #define APIMAC_MRFSK_GENERIC_PHY_ID_BEGIN APIMAC_GENERIC_CHINA_433_PHY_128
 /*! PHY IDs - MRFSK Generic Phy ID end */
@@ -752,6 +755,14 @@ typedef enum
      Range Extender Mode from 0 to 2
      */
     ApiMac_attribute_rangeExtender = 0xF5,
+    /*!
+     enable Ack Pending for Data Pkts
+     */
+    ApiMac_attribute_enDataAckPending = 0xF6,
+    /*!
+     RF Freq Selection from 1 to 2
+     */
+    ApiMac_attribute_rfFreq = 0xF7,
 } ApiMac_attribute_uint8_t;
 
 /*! Standard PIB Get and Set Attributes - size uint16_t */
@@ -964,10 +975,6 @@ typedef enum
     ApiMac_FHAttribute_fanTPSVersion = 0x2012,
     /*! Additional base wait time to sense target channel */
     ApiMac_FHAttribute_CsmaBaseBacoff = 0x201A,
-    /*! Number of non-sleepy device - uint8_t */
-    ApiMac_FHAttribute_numNonSleepDevice = 0x201b,
-    /*! Number of sleepy device - uint8_t */
-    ApiMac_FHAttribute_numSleepDevice = 0x201c,
 
 } ApiMac_FHAttribute_uint8_t;
 
@@ -988,6 +995,13 @@ typedef enum
     ApiMac_FHAttribute_panVersion = 0x2014,
     /*! Time in min during which the node info considered as valid - uint16_t */
     ApiMac_FHAttribute_neighborValidTime = 0x2019,
+    /*! Number of non-sleepy device - uint16_t */
+    ApiMac_FHAttribute_numNonSleepDevice = 0x201b,
+    /*! Number of sleepy device - uint16_t */
+    ApiMac_FHAttribute_numSleepDevice = 0x201c,
+    /*! Number of temp table node - uint16_t */
+    ApiMac_FHAttribute_numTempTableNode = 0x201d,
+
 } ApiMac_FHAttribute_uint16_t;
 
 /*! Frequency Hopping PIB Get and Set Attributes - size uint32_t */
@@ -1207,7 +1221,7 @@ typedef struct _apimac_mrfskphydesc
     /*! 2-FSK/2-GFSK/4-FSK/4-GFSK */
     uint8_t fskModScheme;
     /*! Symbol rate selection */
-    uint8_t symbolRate;
+    uint16_t symbolRate;
     /*!
      Modulation index as a value encoded in
      MR-FSK Generic PHY Descriptor IE
index 8151ed59734184d371e86ed0aa32203c868b3e09..dab67588fdba4ed039524eb08b4053063263ae0b 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Linux implimentation header for api_mac
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #if !defined(API_MAC_LINUX_H)
index e0d6050584aafa430c142bd012e321c592172eb8..7f2a4f3c62634374639e42704218a92f62be687e 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API mt msg layer, linux implementation
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 /*!
index 2be0b27f7041abce6546757e5ad8f7c96d8dc61b..7367ab5c2bdee57609e97f53ada083e03693be60 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 mt msg - debug decoder header
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #if !defined( MT_MSG_DBG_H )
index f23f2c814644fb7dc90ec512e8cb5910a32803c5..9eee1e2d6f9ecdc079fbfeacbb08e6ec4cae757a 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 /******************************************************************************
index e5db39f285de3eae0d3ddec1729523782b2327c3..2312c34fd4c49730f08b793daa772c26d1255a2f 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API mt layer implimentation.
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 /******************************************************************************
index 8c7ade24cfdf41ce60092cbaf956bd43d7c402f8..1e13fadc19a1fa94e99f55863e0d4456a93cb638 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 mt msg - debug decoder.
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
index 02ad35e38b3a025e6b8d3eba9325385e2e3dc12f..15999996cb620738ba2322eb32b4397f34c7449d 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 mt msg - debug decoder config file parser.
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
index 833842bddcf8cbd3c36a1658c36e6cabc095767a..a3acda829fa0ae9598edd8ab093f72dc1aebbf57 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API parse interface config from ini file
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 /******************************************************************************
index 41d0ba23d5999b292e97fb16197e7aac02ff4e80..4276d6e0b8d38fd6f3323c7194b097a8cb28b120 100644 (file)
@@ -4,7 +4,7 @@
 # @brief TIMAC 2.0 Common Library Makefile
 #
 # Group: WCS LPC
-# $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+# $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 #
 #############################################################
 # $License: BSD3 2016 $
@@ -40,7 +40,7 @@
 #   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #############################################################
 # $Release Name: TI-15.4Stack Linux x64 SDK$
-# $Release Date: Jun 28, 2017 (2.02.00.03)$
+# $Release Date: Sept 27, 2017 (2.04.00.13)$
 #############################################################
 
 # By default, we make the library file
index 20a0f46bed1f978763c8ee247084e677120ec608..1d32cc77549343f264df2c489e80f81acfbc6261 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API bitsnbits - bit numbers, K & M values, bit manipulation
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #if !defined(bitsnbits_h)
index 987c9c276d7955e9e1827be1545db65c6e1a22f3..d8b99c8d74393ef0332b4be55b96aeb11894b043 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Handle different compiler types macros, etc.
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #if defined(__linux__)
index b2068272a7dc2145476621b1b0ba3677989896cc..9a8b13be7c8a340cc597c43c437b56cfe46d1f9f 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API gcc compiler specific items.
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 /*
index 4e5d8aa025bcd90e7cca6955926f38927e6f7657..0529a2a61447472aaabcc3de323f31052fb90517 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Application Server Debug(test) thread.
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 #if !defined(DEBUG_THREAD_H)
 #define DEBUG_THREAD_H
index 9d89bd6fcafe229dcb89b1ccde6bf19a73a771a2..845fb3300323f78cd5755a75a5f3ac7d88e56b32 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API handle fatal errors
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #if !defined(FATAL_H)
index ffffb0b79be0aafa4ce1acb2cb3aa506711996a6..219c53b0ebfbf5cff257f4337dadba9dafb97a73 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API generic fifo interface
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #if !defined(FIFO_H)
index baca738c5505422f1501588f65c616eec1a1673d..ffe189887ea44be56d946e06519ca9cf31ddfe45 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Debug hex dump helper functions
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #if !defined(HEXLINE_H)
index 9d0b73a023b1f1a28524a486210b141b9d5b28fd..cca2afe90b924a7e96c04b9a2b5a4aa878a51ba3 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Prototypes for Highlevel OS specific functions. (HLOS = Windows, Linux, etc)
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #if !defined(HLOS_SPECIFIC_H)
index 0321a7927eb22231782535d0d27bc8ec896b6a4e..f218fb2d5a9f74f8d991ac3435ae019de815c488 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Parse INI files to configure appliations
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include <stdint.h>
index 2ea557627fb4ff52d68d7450d197d8ae0cecd1b0..2447af021b58c14e4171a3ef19ba1ea37bd2e728 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API generic log to file or stream
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #if !defined(LOG_H)
@@ -206,17 +206,19 @@ void LOG_close(void);
 #define LOG_ALWAYS 0         /*! override and log this */
 /* All DBG items should be specific bits! */
 
-#define LOG_FATAL        _bit0
-#define LOG_ERROR        _bit1
-#define LOG_WARN         _bit2
-#define LOG_DBG_MUTEX    _bit3  /*! mutex debug messages enabled */
-#define LOG_DBG_THREAD   _bit4  /*! thread debug messages enabled */
-#define LOG_DBG_FIFO     _bit5  /*! fifo   debug messages enabled */
-#define LOG_DBG_UART       _bit6  /*! uart   debug messages enabled */
-#define LOG_DBG_UART_RAW   _bit7  /*! uart   debug (raw rd/wr bytes)*/
-#define LOG_DBG_SLEEP      _bit8  /*! sleep  debug messages enabled */
-#define LOG_DBG_SOCKET     _bit9  /*! socket debug messages enabled */
-#define LOG_DBG_SOCKET_RAW _bit9  /*! socket debug messages enabled */
+#define LOG_FATAL             _bit0
+#define LOG_ERROR             _bit1
+#define LOG_WARN              _bit2
+#define LOG_DBG_MUTEX         _bit3   /*! mutex debug messages enabled */
+#define LOG_DBG_THREAD        _bit4   /*! thread debug messages enabled */
+#define LOG_DBG_FIFO          _bit5   /*! fifo   debug messages enabled */
+#define LOG_DBG_UART          _bit6   /*! uart   debug messages enabled */
+#define LOG_DBG_UART_RAW      _bit7   /*! uart   debug (raw rd/wr bytes)*/
+#define LOG_DBG_SLEEP         _bit8   /*! sleep  debug messages enabled */
+#define LOG_DBG_SOCKET        _bit9   /*! socket debug messages enabled */
+#define LOG_DBG_SOCKET_RAW    _bit9   /*! socket debug messages enabled */
+#define LOG_DBG_COLLECTOR     _bit10  /*! Collector debug messages enabled */
+#define LOG_DBG_COLLECTOR_RAW _bit11  /*! Collector raw data debug messages enabled */
 
 /* Bit ranges */
 #define LOG_DBG_NV_bitnum_first 12
index 0f6809fb2bbdb7b6d2dda27b2b4a8d5a81230b1d..8718abdd8d3fdf0fca41b0a1f23987fad41d69d7 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API generic abstract mutex implimentation
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #if !defined(MUTEX_H)
index acf8050ce1454fff0d287c3b60206fae39c2dc28..5271418a4fe06ffdcd11691861e7721817b2d658 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Pseudo-random number generator
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #if !defined(RAND_DATA_H)
index 8a4d9d6e11f5fc845a53e66a0c3d9f0e2047815e..4782eb352e87f5a05d350da293d97eff9fc86505 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API generic byte stream abstraction header
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #if !defined(STREAM_H)
index 5a617a9104a29b365edbbe33a90c37da86a6df09..ac914cdf6e042005d3a7ea99fe59aed64a48d830 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Internal "stream" implimentation details
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 /*
index 75f260720f91365cd607903b3e70c2cc3cde93a7..4e56c8c834e2a7637d7434e7822c9081fd622632 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Header for streams that are sockets.
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #if !defined(STREAM_SOCKET_H)
index 832c563a26e6fba8fdd044bcf21dcf56e446274e..ee1d45e1338983e8ad9bce708cad780394615083 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Header for streams that are uarts
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #if !defined(STREAM_UART_H)
index 82debde740c089837ab4c587c199285b73f0a8a5..f324c9822a8bbb09acbf5cef19531f5728d5fd9e 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API generic thread abstraction header
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #if !defined(THREADS_H)
index 96da27dc9e710a3846d4b7b97b73eb8955a4525c..3eee3c63e758d7856040210c2588d4bb13d2c42a 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Semaphore abstraction
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 /*
index 99e4bd5281a983e7dffa67d001dd5c332d228de5..2028b4e469ff77d92178213a160d47b6e9cfbf9b 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API timer implimentation
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #if !defined(TIMER_H)
index d905742cf5a90ee98ccbe5d83a61a787f4501b88..b94073aab72728e02e3ff3ef59332b2035cc9583 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Unix style File descriptor read/write operations
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #if !defined(UNIX_FDRW_H)
index b464c4c1a782bcdc8eef2981bb4487949d5397df..cab72267905b5d0e08d375b5edcc3c2b45bce17c 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Compiler macros to handle void pointers
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #if !defined(VOID_PTR_H)
index 2abe5987f3587e595a26383fdaec0c6738f24976..27d040eb1fe060092a744a736968a219687d4d06 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Linux specific HLOS implimentation functions
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 
index 8d3830655e1cff2df8affd6c7c01b807293aec04..8841181bb2f0a07b80a5a0477a166912d9fd0fa7 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Linux specific HLOS implimentation for uart stream
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "stream.h"
index 492f4114e528993ebb66b4be1881bffe3bf97606..8b53dbe110d77b76772f407c2d80b522c267ade0 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API helper/debug functions.
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
index 15c0eddcf550c8cc772fc60522986dcd1fb9d61f..99dcd097c92788395f0075ebab5f4b3efc719928 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Handle fatal exit conditions
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include <compiler.h>
index ac821e9fc7149a785fb1d841b6a71303442c1bc2..ffaa0d6ca51c96b633f482123f736ce1d9b6fea2 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Generic FIFO implimentation
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
index f2aebed33d26a8b0b1698615625017f728f0fc1d..7ab99e429ceb4c930bb3e859dd969c04b8183273 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Implimentation for hexline debug dump
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
index b7692c6e0f7d5581f398bdc8bec3ed8e50e8b5cd..f179d4458ec572b00f158c901c8ced3b87ee3e13 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Implimentation file to parse INI files
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
index 643b7644fb1e689c80e0cacc874fd4146cbc3c67..d71706794f5ac406ba57bf7031d11d7b14652cb9 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Log file implimentation
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
index 421ff1a6b86b155dc09634ef416942a382e1f03d..4495051b899b23f9e9230f60c3d88840c8758b1a 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Parse log file settings from an INI file
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
 #include <string.h>
 
 const struct ini_flag_name log_builtin_flag_names[] = {
-    { .name = "everything"         , .value = LOG_EVERYTHING     },
-    { .name = "warning"            , .value = LOG_WARN           },
-    { .name = "error"              , .value = LOG_ERROR          },
-    { .name = "fatal"              , .value = LOG_FATAL          },
-    { .name = "sys_dbg_mutex"      , .value = LOG_DBG_MUTEX      },
-    { .name = "sys_dbg_thread"     , .value = LOG_DBG_THREAD     },
-    { .name = "sys_dbg_fifo"       , .value = LOG_DBG_FIFO       },
-    { .name = "sys_dbg_uart"       , .value = LOG_DBG_UART       },
-    { .name = "sys_dbg_uart_raw"   , .value = LOG_DBG_UART_RAW   },
-    { .name = "sys_dbg_sleep"      , .value = LOG_DBG_SLEEP      },
-    { .name = "sys_dbg_socket"     , .value = LOG_DBG_SOCKET     },
-    { .name = "sys_dbg_socket_raw" , .value = LOG_DBG_SOCKET_RAW },
+    { .name = "everything"            , .value = LOG_EVERYTHING           },
+    { .name = "warning"               , .value = LOG_WARN                 },
+    { .name = "error"                 , .value = LOG_ERROR                },
+    { .name = "fatal"                 , .value = LOG_FATAL                },
+    { .name = "sys_dbg_mutex"         , .value = LOG_DBG_MUTEX            },
+    { .name = "sys_dbg_thread"        , .value = LOG_DBG_THREAD           },
+    { .name = "sys_dbg_fifo"          , .value = LOG_DBG_FIFO             },
+    { .name = "sys_dbg_uart"          , .value = LOG_DBG_UART             },
+    { .name = "sys_dbg_uart_raw"      , .value = LOG_DBG_UART_RAW         },
+    { .name = "sys_dbg_sleep"         , .value = LOG_DBG_SLEEP            },
+    { .name = "sys_dbg_socket"        , .value = LOG_DBG_SOCKET           },
+    { .name = "sys_dbg_socket_raw"    , .value = LOG_DBG_SOCKET_RAW       },
+    { .name = "sys_dbg_collector"     , .value = LOG_DBG_COLLECTOR        },
+    { .name = "sys_dbg_collector_raw" , .value = LOG_DBG_COLLECTOR_RAW    },
     /* terminate list */
-    { .name = NULL                          }
+    { .name = NULL                                                        }
 };
 
 /*
index 29f5ca6818926232d5271203165b2c917896afb4..5f2513b3c336665c9a05cdb13ad20b0ba9a38859 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Mutex abstraction
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
index eb380a608b27835158420ee3105d579e20dd1abe..de01932d8e75ba3e1492f66c9b8d8d28416b093b 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Random data generator implimentation
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
index f1d94c248308cf5a1abbfddbeafb9fb9ffe88b3e..c782b6563bdb9e20c25e0e7c76fb91a758037d2d 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Common/shared code for all stream types
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
index a5de14d5b3281f796904531d72371e7ca526e10f..5a140266b09e0e53d853a06e3adb9eeeefc7eb89 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Treat a file as a stream.
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
index 20bb2950e41a9ee59f8bae74afbae80880d502da..04ae201a68ea097f0f6ffe093a2a02938e54d153 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Treat a chunk of memory as a stream
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
index caf139dd69df8cd8868a341087a10a2ebf615893..9d03e7fe6219e14e65f4e37989d1e4b80bd6eb43 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Socket client abstraction API
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
index 344288117f5ab3267c6bdf5791cdb4d6312fe1cc..e9e23508344b8a986c4887ac44a6f4e40d1b1637 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Parse INI files to socket interfaces
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
index 327a6f642869f6055407820d01ae3c162d074f14..3f9cc2296d50d6312849edf3672832788fd11d44 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Socket abstraction shared code (server & client)
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
index 31c53250dfaa1257551fe7744332e2d27a3c7ee4..96236b303417f25e4c6855f5c7900ccbf14af1a0 100644 (file)
@@ -5,7 +5,7 @@
                   server & client socket abstraction layer.
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -41,7 +41,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #if !defined(STEAM_SOCKET_PRIVATE_H)
index 00b67fd8b45041b3f476eab879f521e3cf662f3b..4b1313d0d3e7a0fad5e3665bb811cc71a1dc1d02 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API STREAM implimentation file for a server socket.
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
index 2ee5f11aa6cc7aceae8ca96f8ed4c7d726034544..46aff64dbe78694fad33b170dd910f50e387353c 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Parse INI files to configure uart interfaces
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
index b6c1dadf9d61a5d4050daa176d76bdeb7f442a3d..5ed9fb36293112f1c6df5de60133b4805359b651 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API CC1310, CC1350
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
index 7d179a0a806524382521362c6f98211b6d66d1af..6177d1ab44b36edfc4c3e2330d173e62d7484921 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Implimentation of the semaphore abstraction
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
index a7a80be4c464ad134cc9f23bd5fb768912b1d3c4..f0e2d4eb642566b0e9a4df79852bda96268b2b5b 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Generic Timer abstraction functions
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
index 2b16ad914e299cbaede852c75521d1ed9cd26ddb..180f445f39c86e75f4b6f70ebd60805049fae972 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Callback timer abstraction
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
index e0d20b3129902aa74a15797416fc598a8abecd57..8f50bd762d2d08252df132c90cbb0ddb5952f66e 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Unix File Descriptor RD/WR implimentation
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
index f14bf93279bbd03a0988bd2b582a660a53bb481e..568ed09facb42c60d66f295831bc3bd4755f7fc3 100755 (executable)
@@ -4,7 +4,7 @@
 # @brief TIMAC 2.0 NV (nonvolatile) Library Makefile
 #
 # Group: WCS LPC
-# $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+# $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 #
 #############################################################
 # $License: BSD3 2016 $
@@ -40,7 +40,7 @@
 #   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #############################################################
 # $Release Name: TI-15.4Stack Linux x64 SDK$
-# $Release Date: Jun 28, 2017 (2.02.00.03)$
+# $Release Date: Sept 27, 2017 (2.04.00.13)$
 #############################################################
 
 # By default, we make the library file
index 8efe7a6b928982211dea058cc5f2040f2b43759a..806d7d84db7f36a0aba3bd20ae71b169d7656c58 100755 (executable)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API nv_linux.h NV implimentation for linux.
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #if !defined(NV_LINUX_H)
index c64529802cf1bc104183185139b4273fa277d599..c96f13a17aa32281b6326effff5a7169c8526a94 100755 (executable)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Linux version of NV module Header
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
 *****************************************************************************/
 
 #ifndef NVINTF_H
index 473ef01683eade65792317323eebe3b82dc15ed0..2751690ee209ae48b09c30e9847f1ec2503227f3 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Linux version of NV module
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
 *****************************************************************************/
 
 /******************************************************************************
index d2bd82c0ccdd884fac738db1bb2791d1aee5bd1a..4014ac2527065c9987109b99f9335073c5d9ec52 100644 (file)
@@ -4,29 +4,29 @@
 # @brief TIMAC 2.0 Collector Example Application Makefile
 #
 # Group: WCS LPC
-# $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+# $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 #
 #############################################################
 # $License: BSD3 2016 $
-#
+#  
 #   Copyright (c) 2015, 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
 #   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #############################################################
 # $Release Name: TI-15.4Stack Linux x64 SDK$
-# $Release Date: Jun 28, 2017 (2.02.00.03)$
+# $Release Date: Sept 27, 2017 (2.04.00.13)$
 #############################################################
 
 _default: _app
 
-
 COMPONENTS_HOME=../../components
 SDK_HOME=../../../
 
@@ -53,34 +52,16 @@ HERE=$(shell pwd)
 CFLAGS += -include ${HERE}/timac_features.h
 CFLAGS += -DAUTO_START
 CFLAGS += -DNV_RESTORE
+CFLAGS += -DPROCESS_JS
 #CFLAGS += -DFCS_TYPE16
 CFLAGS += -DIS_HEADLESS
+#CFLAGS += -DTIRTOS_IN_ROM
 CFLAGS += -I.
 CFLAGS += -I${COMPONENTS_HOME}/common/inc
 CFLAGS += -I${COMPONENTS_HOME}/nv/inc
 CFLAGS += -I${COMPONENTS_HOME}/api/inc
 CFLAGS += -I${SDK_HOME}
 
-#----------------------------------------
-# NOTE: to use the Protobuf-C package that is built
-# locally to the  "../google/"  directory you must do 4 things:
-#
-# Step 1: Go build the protobuf packages
-#    See the file: ../google/Makefile for details.
-#    hint:  cd ../google
-#    hint:  make all
-#
-# Step 2: uncomment this line.
-#CFLAGS+= -I$(PROTOC_INSTALL_DIR)/include
-#
-# STEP 3: Remove the "protobuf-c.c
-#
-# STEP 4:
-#   Link the protobuf-c library
-#   To do this, you will need to cross-compile the
-#   protobuf-C library and related items to your target.
-#
-
 include ../../scripts/front_matter.mak
 
 APP_NAME = collector
@@ -104,37 +85,6 @@ APP_LIBDIRS += ${COMPONENTS_HOME}/api/${OBJDIR}
 APP_LIBDIRS += ${COMPONENTS_HOME}/common/${OBJDIR}
 APP_LIBDIRS += ${OBJDIR}
 
-# This runs the protobuf-c compiler to convert
-# the protocol definition file (.proto)
-# into a C and H file ...
-#
-# To rebuild these, you will need to install
-# the "protobuf-c" compiler.
-#
-# NOTE:
-#    Please do not do this: "apt-get install protobuf-c"
-# WHY?
-#    The assumption is you will debug/develop/primary-test
-#    your application on a desktop linux (x86) linux machine.
-#    Why? Because it is simple to do that.
-#
-# This means:
-#    You will need the protobuf compiler for X86.
-#    And that means you must also use the protobuf compiler for ARM
-#
-# The problem:
-#    The two versions (X86 vrs ARM) are different version numbers.
-#    And may always be out of sync with each other, to solve this problem..
-#
-# The solution:
-#    See the directory: ../google/Makefile
-#    That makefile will fetch/clone, build and locally-install the
-#    protobuf solution used here at TI during development.
-#
-# https://developers.google.com/protocol-buffers/
-#
-
-
 include ../../scripts/app.mak
 
 #  ========================================
index 4ce011a5ee63d5fd2d30dd3acecc586321a25981..5dece238f3d3ac27d46d95072e2667c4e64206ee 100644 (file)
@@ -4,29 +4,29 @@
  @brief TIMAC 2.0 API User Interface Collector API
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
-
+  
    Copyright (c) 2015, 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
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
 *****************************************************************************/
 
 /******************************************************************************
@@ -55,7 +55,6 @@
 #include <stdint.h>
 #include <inttypes.h>
 
-
 #include "debug_helpers.h"
 
 #include "collector.h"
 /******************************************************************************
  Typedefs
 *****************************************************************************/
-typedef enum cmdIds {
-    APPSRV_DEVICE_JOINED_IND = 0,
-    APPSRV_DEVICE_LEFT_IND = 1,
-    APPSRV_NWK_INFO_IND = 2,
-    APPSRV_GET_NWK_INFO_REQ = 3,
-    APPSRV_GET_NWK_INFO_RSP = 4,
-    APPSRV_GET_NWK_INFO_CNF = 5,
-    APPSRV_GET_DEVICE_ARRAY_REQ = 6,
-    APPSRV_GET_DEVICE_ARRAY_CNF = 7,
-    APPSRV_DEVICE_NOTACTIVE_UPDATE_IND = 8,
-    APPSRV_DEVICE_DATA_RX_IND = 9,
-    APPSRV_COLLECTOR_STATE_CNG_IND = 10,
-    APPSRV_SET_JOIN_PERMIT_REQ = 11,
-    APPSRV_SET_JOIN_PERMIT_CNF = 12,
-    APPSRV_TX_DATA_REQ = 13,
-    APPSRV_TX_DATA_CNF = 14,
-    APPSRV_RMV_DEVICE_REQ = 15,
-    APPSRV_RMV_DEVICE_RSP = 16
-} Cmd_Ids_t;
-
-typedef enum smgsCmdIds{
-    SMGS_CONFIG_REQ = 1,
-    SMGS_CONFIG_RSP = 2,
-    SMGS_TRACKING_REQ = 3,
-    SMGS_TRACKING_RSP = 4,
-    SMGS_SENSOR_DATA = 5,
-    SMGS_TOGGLE_REQ = 6,
-    SMGS_TOGGLE_RSP = 7
-}Smgs_Cmd_Ids_t;
-
-typedef enum msgComponents {
-    HEADER_LEN = 4,
-    TX_DATA_CNF_LEN = 4,
-    JOIN_PERMIT_CNF_LEN = 4,
-    NWK_INFO_REQ_LEN = 18,
-    NWK_INFO_IND_LEN = 17,
-    DEV_ARRAY_HEAD_LEN = 3,
-    DEV_ARRAY_INFO_LEN = 18,
-    DEVICE_JOINED_IND_LEN = 18,
-    MAX_SENSOR_DATA_LEN = 255,
-    DEVICE_NOT_ACTIVE_LEN = 13,
-    STATE_CHG_IND_LEN = 1,
-    REMOVE_DEVICE_RSP_LEN = 0
-} Msg_Components_t;
-
-typedef enum nwkModes {
-    BEACON_ENABLED = 1,
-    NON_BEACON = 2,
-    FREQUENCY_HOPPING = 3
-} Nwk_Modes_t;
-
-typedef enum rmvDeviceStatus {
-    RMV_STATUS_SUCCESS = 0,
-    RMV_STATUS_FAIL = 1
-} Rmv_Device_Status_t;
-
-typedef enum apiMacAssocStatus {
-    API_MAC_STATUS_SUCCESS = 0,
-    API_MAC_STATUS_PAN_AT_CAP = 1,
-    API_MAC_STATUS_ACCESS_DENIED = 2
-} Api_Mac_Assoc_Status_t;
-
-typedef enum {
-    APPSRV_SYS_ID_RPC = 10
-} TimacAppSrvSysId_No_Pb_t;
-
-typedef enum sDataMsgType{
-    SENSOR_DATA_MSG = 0x01,
-    CONFIG_RSP_MSG = 0x02
-} S_Data_Msg_Type_t;
+
 
 struct appsrv_connection {
-    /*! is this item busy (broadcasting) */
+    /*! Is this item busy (broadcasting) */
     bool is_busy;
-    /*! has something gone wrong this is set to true */
+    /*! If something has gone wrong this is set to true */
     bool is_dead;
-    /*! name for us in debug logs */
+    /*! Name for us in debug logs */
     char *dbg_name;
 
-    /* what connection number is this? */
+    /* What connection number is this? */
     int  connection_id;
 
     /*! The socket interface to the gateway */
@@ -179,11 +109,11 @@ struct appsrv_connection {
 
 /*! The interface the API mac uses, points to either the socket or the uart */
 struct mt_msg_interface *API_MAC_msg_interface;
-/*! generic template for all gateway connections */
+/*! Generic template for all gateway connections */
 struct socket_cfg appClient_socket_cfg;
-/*! configuration for apimac if using a socket (ie: npi server) */
+/*! Configuration for apimac if using a socket (ie: npi server) */
 struct socket_cfg npi_socket_cfg;
-/*! uart configuration for apimac if talking to UART instead of npi */
+/*! UART configuration for apimac if talking to UART instead of npi */
 struct uart_cfg   uart_cfg;
 
 /*! Generic template for all gateway interfaces
@@ -298,9 +228,9 @@ static void send_AppsrvTxDataCnf(int status)
 
     struct mt_msg *pMsg;
     pMsg = MT_MSG_alloc(
-                len,
-                MT_MSG_cmd0_areq(APPSRV_SYS_ID_RPC),
-                APPSRV_TX_DATA_CNF);
+        len,
+        MT_MSG_cmd0_areq(APPSRV_SYS_ID_RPC),
+        APPSRV_TX_DATA_CNF);
 
     /* Create duplicate pointer to msg buffer for building */
     pBuff = pMsg->iobuf + HEADER_LEN;
@@ -329,9 +259,9 @@ static void send_AppSrvJoinPermitCnf(int status)
 
     struct mt_msg *pMsg;
     pMsg = MT_MSG_alloc(
-                len,
-                MT_MSG_cmd0_areq(APPSRV_SYS_ID_RPC),
-                APPSRV_SET_JOIN_PERMIT_CNF);
+        len,
+        MT_MSG_cmd0_areq(APPSRV_SYS_ID_RPC),
+        APPSRV_SET_JOIN_PERMIT_CNF);
 
     /* Create duplicate pointer to msg buffer for building */
     pBuff = pMsg->iobuf + HEADER_LEN;
@@ -350,8 +280,6 @@ static void send_AppSrvJoinPermitCnf(int status)
     pMsg = NULL;
 }
 
-
-
 /*!
  * @brief handle a data request from the gateway
  * @param pCONN - where the request came from
@@ -366,57 +294,58 @@ static void appsrv_processTxDataReq(struct appsrv_connection *pCONN,
     uint16_t shortAddr;
 
     /* Parse msg */
-    msgId = (uint8_t) pIncomingMsg->iobuf[ind];
+    msgId = (uint8_t)pIncomingMsg->iobuf[ind];
     ind += 1;
 
-    shortAddr = (uint16_t) (pIncomingMsg->iobuf[ind]) |
-                           (pIncomingMsg->iobuf[ind + 1] << 8);
+    shortAddr = (uint16_t)(pIncomingMsg->iobuf[ind]) |
+                (pIncomingMsg->iobuf[ind + 1] << 8);
     ind += 2;
 
     ApiMac_sAddr_t pDstAddr;
     pDstAddr.addrMode = ApiMac_addrType_short;
     pDstAddr.addr.shortAddr = shortAddr;
 
-    if(msgId == SMGS_CONFIG_REQ)
+    if (msgId == Smsgs_cmdIds_configReq)
     {
         uint16_t framecontrol;
         uint32_t pollingInterval;
         uint32_t reportingInterval;
         uint8_t configStatus;
 
-        pollingInterval = (uint32_t) (pIncomingMsg->iobuf[ind]) |
-                           (pIncomingMsg->iobuf[ind + 1] << 8);
+        pollingInterval = (uint32_t)(pIncomingMsg->iobuf[ind]) |
+                          (pIncomingMsg->iobuf[ind + 1] << 8);
         ind += 2;
 
-        reportingInterval = (uint32_t) (pIncomingMsg->iobuf[ind]) |
-                           (pIncomingMsg->iobuf[ind + 1] << 8);
+        reportingInterval = (uint32_t)(pIncomingMsg->iobuf[ind]) |
+                            (pIncomingMsg->iobuf[ind + 1] << 8);
         ind += 2;
 
-        framecontrol = (uint16_t) (pIncomingMsg->iobuf[ind]) |
-                           (pIncomingMsg->iobuf[ind + 1] << 8);
+        framecontrol = (uint16_t)(pIncomingMsg->iobuf[ind]) |
+                       (pIncomingMsg->iobuf[ind + 1] << 8);
 
         configStatus = Csf_sendConfigRequest(&pDstAddr, framecontrol, reportingInterval, pollingInterval);
         LOG_printf(LOG_APPSRV_MSG_CONTENT, " Config-req sent\n");
         LOG_printf(LOG_APPSRV_MSG_CONTENT, "Config status: %x\n", configStatus);
     }
 
-    else if(msgId == SMGS_TOGGLE_REQ)
+    else if (msgId == Smsgs_cmdIds_toggleLedReq)
     {
         LOG_printf(LOG_APPSRV_MSG_CONTENT, " Toggle-req received\n");
         Csf_sendToggleLedRequest(&pDstAddr);
     }
 
+    else if (msgId == Smsgs_cmdIds_buzzerCtrlReq)
+    {
+        LOG_printf(LOG_APPSRV_MSG_CONTENT, " Buzzer-Ctrl Req received\n");
+        Csf_sendBuzzerCtrlRequest(&pDstAddr);
+    }
+
     status = ApiMac_status_success;
     send_AppsrvTxDataCnf(status);
 }
 
-/*!
- * @brief handle a remove device request from the gateway
- * @param pCONN - where the request came from
- * @param pIncommingMsg - the msg from the gateway
- */
 static void appsrv_processRemoveDeviceReq(struct appsrv_connection *pCONN,
-                                    struct mt_msg *pIncomingMsg)
+                                          struct mt_msg *pIncomingMsg)
 {
     int ind = HEADER_LEN;
     uint16_t shortAddr;
@@ -424,13 +353,14 @@ static void appsrv_processRemoveDeviceReq(struct appsrv_connection *pCONN,
     Llc_deviceListItem_t devListItem;
     ApiMac_status_t status;
 
-    shortAddr = (uint16_t) (pIncomingMsg->iobuf[ind]) |
-                           (pIncomingMsg->iobuf[ind + 1] << 8);
+    shortAddr = (uint16_t)(pIncomingMsg->iobuf[ind]) |
+                (pIncomingMsg->iobuf[ind + 1] << 8);
 
     dstAddr.addrMode = ApiMac_addrType_short;
     dstAddr.addr.shortAddr = shortAddr;
 
-    if(Csf_getDevice(&dstAddr,&devListItem)){
+    if (Csf_getDevice(&dstAddr, &devListItem))
+    {
         /* Send disassociation request to specified sensor */
         ApiMac_mlmeDisassociateReq_t disassocReq;
         memset(&disassocReq, 0, sizeof(ApiMac_mlmeDisassociateReq_t));
@@ -454,13 +384,13 @@ static void appsrv_processSetJoinPermitReq(struct appsrv_connection *pCONN,
 {
     int status;
     uint32_t duration;
-    duration = (uint32_t) (pIncomingMsg->iobuf[HEADER_LEN]) |
-                          (pIncomingMsg->iobuf[HEADER_LEN + 1] << 8) |
-                          (pIncomingMsg->iobuf[HEADER_LEN + 2] << 16) |
-                          (pIncomingMsg->iobuf[HEADER_LEN + 3] << 24);
+    duration = (uint32_t)(pIncomingMsg->iobuf[HEADER_LEN]) |
+               (pIncomingMsg->iobuf[HEADER_LEN + 1] << 8) |
+               (pIncomingMsg->iobuf[HEADER_LEN + 2] << 16) |
+               (pIncomingMsg->iobuf[HEADER_LEN + 3] << 24);
 
     /* Set the join permit */
-    LOG_printf(LOG_APPSRV_MSG_CONTENT, "\nSending duration: 0x%x\n\n",duration);
+    LOG_printf(LOG_APPSRV_MSG_CONTENT, "\nSending duration: 0x%x\n\n", duration);
     status = Cllc_setJoinPermit(duration);
 
     /* Send cnf msg  */
@@ -483,14 +413,16 @@ static void appsrv_processGetNwkInfoReq(struct appsrv_connection *pCONN)
     uint8_t networkMode;
     uint8_t state = Csf_getCllcState();
 
-    LOG_printf(LOG_APPSRV_MSG_CONTENT, "\nSending NwkCnf STATE = %x\n\n",state);
+    LOG_printf(LOG_APPSRV_MSG_CONTENT, "\nSending NwkCnf STATE = %x\n\n", state);
 
-    if(CONFIG_FH_ENABLE == true){
+    if (CONFIG_FH_ENABLE == true)
+    {
         networkMode = FREQUENCY_HOPPING;
     }
 
-    else{
-        if((CONFIG_MAC_SUPERFRAME_ORDER == 15) && (CONFIG_MAC_BEACON_ORDER == 15))
+    else
+    {
+        if ((CONFIG_MAC_SUPERFRAME_ORDER == 15) && (CONFIG_MAC_BEACON_ORDER == 15))
         {
             networkMode = NON_BEACON;
         }
@@ -502,9 +434,9 @@ static void appsrv_processGetNwkInfoReq(struct appsrv_connection *pCONN)
 
     struct mt_msg *pMsg;
     pMsg = MT_MSG_alloc(
-                len,
-                MT_MSG_cmd0_areq(APPSRV_SYS_ID_RPC),
-                APPSRV_GET_NWK_INFO_CNF);
+        len,
+        MT_MSG_cmd0_areq(APPSRV_SYS_ID_RPC),
+        APPSRV_GET_NWK_INFO_CNF);
 
     /* Create duplicate pointer to msg buffer for building */
     pBuff = pMsg->iobuf + HEADER_LEN;
@@ -544,60 +476,60 @@ static void appsrv_processGetNwkInfoReq(struct appsrv_connection *pCONN)
  */
 static void appsrv_processGetDeviceArrayReq(struct appsrv_connection *pCONN)
 {
-uint16_t n = 0;
-uint8_t *pBuff;
-Csf_deviceInformation_t *pDeviceInfo;
+    uint16_t n = 0;
+    uint8_t *pBuff;
+    Csf_deviceInformation_t *pDeviceInfo;
 
-uint8_t status = API_MAC_STATUS_SUCCESS;
-n = (uint16_t) Csf_getDeviceInformationList(&pDeviceInfo);
+    uint8_t status = ApiMac_status_success;
+    n = (uint16_t)Csf_getDeviceInformationList(&pDeviceInfo);
 
-int len = DEV_ARRAY_HEAD_LEN + (DEV_ARRAY_INFO_LEN * n);
+    int len = DEV_ARRAY_HEAD_LEN + (DEV_ARRAY_INFO_LEN * n);
 
-struct mt_msg *pMsg;
+    struct mt_msg *pMsg;
     pMsg = MT_MSG_alloc(
-                len,
-                MT_MSG_cmd0_areq(APPSRV_SYS_ID_RPC),
-                APPSRV_GET_DEVICE_ARRAY_CNF);
+        len,
+        MT_MSG_cmd0_areq(APPSRV_SYS_ID_RPC),
+        APPSRV_GET_DEVICE_ARRAY_CNF);
 
-/* Create duplicate pointer to msg buffer for building */
-pBuff = pMsg->iobuf + HEADER_LEN;
+    /* Create duplicate pointer to msg buffer for building */
+    pBuff = pMsg->iobuf + HEADER_LEN;
 
-/* Build msg */
-*pBuff++ = status;
-*pBuff++ = (uint8_t)(n & 0xFF);
-*pBuff++ = (uint8_t)((n >> 8) & 0xFF);
+    /* Build msg */
+    *pBuff++ = status;
+    *pBuff++ = (uint8_t)(n & 0xFF);
+    *pBuff++ = (uint8_t)((n >> 8) & 0xFF);
 
-uint16_t x;
-for(x = 0 ; x < n ; x++)
-{
-    *pBuff++ = (uint8_t)(pDeviceInfo[x].devInfo.panID & 0xFF);
-    *pBuff++ = (uint8_t)((pDeviceInfo[x].devInfo.panID >> 8) & 0xFF);
-    *pBuff++ = (uint8_t)(pDeviceInfo[x].devInfo.shortAddress & 0xFF);
-    *pBuff++ = (uint8_t)((pDeviceInfo[x].devInfo.shortAddress >> 8) & 0xFF);
-    *pBuff++ = (uint8_t)(pDeviceInfo[x].devInfo.extAddress[0]);
-    *pBuff++ = (uint8_t)(pDeviceInfo[x].devInfo.extAddress[1]);
-    *pBuff++ = (uint8_t)(pDeviceInfo[x].devInfo.extAddress[2]);
-    *pBuff++ = (uint8_t)(pDeviceInfo[x].devInfo.extAddress[3]);
-    *pBuff++ = (uint8_t)(pDeviceInfo[x].devInfo.extAddress[4]);
-    *pBuff++ = (uint8_t)(pDeviceInfo[x].devInfo.extAddress[5]);
-    *pBuff++ = (uint8_t)(pDeviceInfo[x].devInfo.extAddress[6]);
-    *pBuff++ = (uint8_t)(pDeviceInfo[x].devInfo.extAddress[7]);
-    *pBuff++ = (uint8_t)(pDeviceInfo[x].capInfo.panCoord);
-    *pBuff++ = (uint8_t)(pDeviceInfo[x].capInfo.ffd);
-    *pBuff++ = (uint8_t)(pDeviceInfo[x].capInfo.mainsPower);
-    *pBuff++ = (uint8_t)(pDeviceInfo[x].capInfo.rxOnWhenIdle);
-    *pBuff++ = (uint8_t)(pDeviceInfo[x].capInfo.security);
-    *pBuff++ = (uint8_t)(pDeviceInfo[x].capInfo.allocAddr);
-}
+    uint16_t x;
+    for (x = 0; x < n; x++)
+    {
+        *pBuff++ = (uint8_t)(pDeviceInfo[x].devInfo.panID & 0xFF);
+        *pBuff++ = (uint8_t)((pDeviceInfo[x].devInfo.panID >> 8) & 0xFF);
+        *pBuff++ = (uint8_t)(pDeviceInfo[x].devInfo.shortAddress & 0xFF);
+        *pBuff++ = (uint8_t)((pDeviceInfo[x].devInfo.shortAddress >> 8) & 0xFF);
+        *pBuff++ = (uint8_t)(pDeviceInfo[x].devInfo.extAddress[0]);
+        *pBuff++ = (uint8_t)(pDeviceInfo[x].devInfo.extAddress[1]);
+        *pBuff++ = (uint8_t)(pDeviceInfo[x].devInfo.extAddress[2]);
+        *pBuff++ = (uint8_t)(pDeviceInfo[x].devInfo.extAddress[3]);
+        *pBuff++ = (uint8_t)(pDeviceInfo[x].devInfo.extAddress[4]);
+        *pBuff++ = (uint8_t)(pDeviceInfo[x].devInfo.extAddress[5]);
+        *pBuff++ = (uint8_t)(pDeviceInfo[x].devInfo.extAddress[6]);
+        *pBuff++ = (uint8_t)(pDeviceInfo[x].devInfo.extAddress[7]);
+        *pBuff++ = (uint8_t)(pDeviceInfo[x].capInfo.panCoord);
+        *pBuff++ = (uint8_t)(pDeviceInfo[x].capInfo.ffd);
+        *pBuff++ = (uint8_t)(pDeviceInfo[x].capInfo.mainsPower);
+        *pBuff++ = (uint8_t)(pDeviceInfo[x].capInfo.rxOnWhenIdle);
+        *pBuff++ = (uint8_t)(pDeviceInfo[x].capInfo.security);
+        *pBuff++ = (uint8_t)(pDeviceInfo[x].capInfo.allocAddr);
+    }
 
-/* Send msg */
-MT_MSG_setDestIface(pMsg, &(pCONN->socket_interface));
-MT_MSG_wrBuf(pMsg, NULL, len);
-MT_MSG_txrx(pMsg);
-MT_MSG_free(pMsg);
-pMsg = NULL;
+    /* Send msg */
+    MT_MSG_setDestIface(pMsg, &(pCONN->socket_interface));
+    MT_MSG_wrBuf(pMsg, NULL, len);
+    MT_MSG_txrx(pMsg);
+    MT_MSG_free(pMsg);
+    pMsg = NULL;
 
-if(pDeviceInfo)
+    if (pDeviceInfo)
     {
         Csf_freeDeviceInformationList(n, pDeviceInfo);
         pDeviceInfo = NULL;
@@ -701,12 +633,14 @@ void appsrv_networkUpdate(bool restored, Llc_netInfo_t *networkInfo)
     uint8_t networkMode;
     uint8_t state = Csf_getCllcState();
 
-    if(CONFIG_FH_ENABLE == true){
+    if (CONFIG_FH_ENABLE == true)
+    {
         networkMode = FREQUENCY_HOPPING;
     }
 
-    else{
-        if((CONFIG_MAC_SUPERFRAME_ORDER == 15) && (CONFIG_MAC_BEACON_ORDER == 15))
+    else
+    {
+        if ((CONFIG_MAC_SUPERFRAME_ORDER == 15) && (CONFIG_MAC_BEACON_ORDER == 15))
         {
             networkMode = NON_BEACON;
         }
@@ -718,9 +652,9 @@ void appsrv_networkUpdate(bool restored, Llc_netInfo_t *networkInfo)
 
     struct mt_msg *pMsg;
     pMsg = MT_MSG_alloc(
-                len,
-                MT_MSG_cmd0_areq(APPSRV_SYS_ID_RPC),
-                APPSRV_NWK_INFO_IND);
+        len,
+        MT_MSG_cmd0_areq(APPSRV_SYS_ID_RPC),
+        APPSRV_NWK_INFO_IND);
 
     /* Create duplicate pointer to msg buffer for building purposes */
     pBuff = pMsg->iobuf + HEADER_LEN;
@@ -753,6 +687,7 @@ void appsrv_networkUpdate(bool restored, Llc_netInfo_t *networkInfo)
 }
 
 /*!
+
   Csf module calls this function to inform the user/appClient
   that a device has joined the network
 
@@ -765,9 +700,9 @@ void appsrv_deviceUpdate(Llc_deviceListItem_t *pDevListItem)
 
     struct mt_msg *pMsg;
     pMsg = MT_MSG_alloc(
-                len,
-                MT_MSG_cmd0_areq(APPSRV_SYS_ID_RPC),
-                APPSRV_DEVICE_JOINED_IND);
+        len,
+        MT_MSG_cmd0_areq(APPSRV_SYS_ID_RPC),
+        APPSRV_DEVICE_JOINED_IND);
 
     /* Create duplicate pointer to msg buffer for building purposes */
     pBuff = pMsg->iobuf + HEADER_LEN;
@@ -800,6 +735,7 @@ void appsrv_deviceUpdate(Llc_deviceListItem_t *pDevListItem)
     pMsg = NULL;
 }
 
+#ifndef PROCESS_JS
 /*
  * @brief common code to handle sensor data messages
  * @param pSrcAddr - address related to this message
@@ -827,18 +763,18 @@ static void appsrv_deviceSensorData_common(ApiMac_sAddr_t *pSrcAddr,
     int len = 0;
     uint8_t *buffer;
     uint8_t *pBuff;
-    buffer = (uint8_t*)calloc(MAX_SENSOR_DATA_LEN,sizeof(uint8_t));
+    buffer = (uint8_t *)calloc(MAX_SENSOR_DATA_LEN, sizeof(uint8_t));
     pBuff = buffer;
 
     len += 1;
-    *pBuff++ =  (uint8_t)pSrcAddr->addrMode;
-    if(pSrcAddr->addrMode == ApiMac_addrType_short)
+    *pBuff++ = (uint8_t)pSrcAddr->addrMode;
+    if (pSrcAddr->addrMode == ApiMac_addrType_short)
     {
         len += 2;
         *pBuff++ = (uint8_t)(pSrcAddr->addr.shortAddr & 0xFF);
         *pBuff++ = (uint8_t)((pSrcAddr->addr.shortAddr >> 8) & 0xFF);
     }
-    else if(pSrcAddr->addrMode == ApiMac_addrType_extended)
+    else if (pSrcAddr->addrMode == ApiMac_addrType_extended)
     {
         len += 8;
         *pBuff++ = (uint8_t)(pSrcAddr->addr.extAddr[0]);
@@ -856,17 +792,19 @@ static void appsrv_deviceSensorData_common(ApiMac_sAddr_t *pSrcAddr,
 
     /* Msg type flag */
     uint8_t msgContent = 0;
-    if(pDataMsg != NULL){
+    if (pDataMsg != NULL)
+    {
         msgContent |= SENSOR_DATA_MSG;
     }
-    if(pRspMsg != NULL){
+    if (pRspMsg != NULL)
+    {
         msgContent |= CONFIG_RSP_MSG;
     }
 
     len += 1;
     *pBuff++ = msgContent;
 
-    if(pDataMsg != NULL)
+    if (pDataMsg != NULL)
     {
         len += 11;
         *pBuff++ = (uint8_t)(pDataMsg->cmdId);
@@ -880,7 +818,7 @@ static void appsrv_deviceSensorData_common(ApiMac_sAddr_t *pSrcAddr,
         *pBuff++ = (uint8_t)(pDataMsg->extAddress[5]);
         *pBuff++ = (uint8_t)(pDataMsg->extAddress[6]);
         *pBuff++ = (uint8_t)(pDataMsg->extAddress[7]);
-        if(pDataMsg->frameControl & Smsgs_dataFields_tempSensor)
+        if (pDataMsg->frameControl & Smsgs_dataFields_tempSensor)
         {
             len += 4;
             *pBuff++ = (uint8_t)(pDataMsg->tempSensor.ambienceTemp & 0xFF);
@@ -888,13 +826,13 @@ static void appsrv_deviceSensorData_common(ApiMac_sAddr_t *pSrcAddr,
             *pBuff++ = (uint8_t)(pDataMsg->tempSensor.objectTemp & 0xFF);
             *pBuff++ = (uint8_t)((pDataMsg->tempSensor.objectTemp >> 8) & 0xFF);
         }
-        if(pDataMsg->frameControl & Smsgs_dataFields_lightSensor)
+        if (pDataMsg->frameControl & Smsgs_dataFields_lightSensor)
         {
             len += 2;
             *pBuff++ = (uint8_t)(pDataMsg->lightSensor.rawData & 0xFF);
             *pBuff++ = (uint8_t)((pDataMsg->lightSensor.rawData >> 8) & 0xFF);
         }
-        if(pDataMsg->frameControl & Smsgs_dataFields_humiditySensor)
+        if (pDataMsg->frameControl & Smsgs_dataFields_humiditySensor)
         {
             len += 4;
             *pBuff++ = (uint8_t)(pDataMsg->humiditySensor.temp & 0xFF);
@@ -902,7 +840,7 @@ static void appsrv_deviceSensorData_common(ApiMac_sAddr_t *pSrcAddr,
             *pBuff++ = (uint8_t)(pDataMsg->humiditySensor.humidity & 0xFF);
             *pBuff++ = (uint8_t)((pDataMsg->humiditySensor.humidity >> 8) & 0xFF);
         }
-        if(pDataMsg->frameControl & Smsgs_dataFields_msgStats)
+        if (pDataMsg->frameControl & Smsgs_dataFields_msgStats)
         {
             len += 40;
             *pBuff++ = (uint8_t)(pDataMsg->msgStats.joinAttempts & 0xFF);
@@ -946,7 +884,7 @@ static void appsrv_deviceSensorData_common(ApiMac_sAddr_t *pSrcAddr,
             *pBuff++ = (uint8_t)(pDataMsg->msgStats.interimDelay & 0xFF);
             *pBuff++ = (uint8_t)((pDataMsg->msgStats.interimDelay >> 8) & 0xFF);
         }
-        if(pDataMsg->frameControl & Smsgs_dataFields_configSettings)
+        if (pDataMsg->frameControl & Smsgs_dataFields_configSettings)
         {
             len += 8;
             *pBuff++ = (uint8_t)(pDataMsg->configSettings.reportingInterval & 0xFF);
@@ -958,7 +896,7 @@ static void appsrv_deviceSensorData_common(ApiMac_sAddr_t *pSrcAddr,
             *pBuff++ = (uint8_t)((pDataMsg->configSettings.pollingInterval >> 16) & 0xFF);
             *pBuff++ = (uint8_t)((pDataMsg->configSettings.pollingInterval >> 24) & 0xFF);
         }
-        if(pDataMsg->frameControl & Smsgs_dataFields_pressureSensor)
+        if (pDataMsg->frameControl & Smsgs_dataFields_pressureSensor)
         {
             len += 4;
             *pBuff++ = (uint8_t)(pDataMsg->pressureSensor.tempValue & 0xFF);
@@ -966,12 +904,12 @@ static void appsrv_deviceSensorData_common(ApiMac_sAddr_t *pSrcAddr,
             *pBuff++ = (uint8_t)(pDataMsg->pressureSensor.pressureValue & 0xFF);
             *pBuff++ = (uint8_t)((pDataMsg->pressureSensor.pressureValue >> 8) & 0xFF);
         }
-        if(pDataMsg->frameControl & Smsgs_dataFields_motionSensor)
+        if (pDataMsg->frameControl & Smsgs_dataFields_motionSensor)
         {
             len += 1;
             *pBuff++ = (uint8_t)(pDataMsg->motionSensor.isMotion);
         }
-        if(pDataMsg->frameControl & Smsgs_dataFields_batterySensor)
+        if (pDataMsg->frameControl & Smsgs_dataFields_batterySensor)
         {
             len += 4;
             *pBuff++ = (uint8_t)(pDataMsg->batterySensor.voltageValue & 0xFF);
@@ -979,25 +917,31 @@ static void appsrv_deviceSensorData_common(ApiMac_sAddr_t *pSrcAddr,
             *pBuff++ = (uint8_t)((pDataMsg->batterySensor.voltageValue >> 16) & 0xFF);
             *pBuff++ = (uint8_t)((pDataMsg->batterySensor.voltageValue >> 24) & 0xFF);
         }
-        if(pDataMsg->frameControl & Smsgs_dataFields_hallEffectSensor)
+        if (pDataMsg->frameControl & Smsgs_dataFields_hallEffectSensor)
         {
             len += 2;
             *pBuff++ = (uint8_t)(pDataMsg->hallEffectSensor.isOpen);
             *pBuff++ = (uint8_t)(pDataMsg->hallEffectSensor.isTampered);
         }
-        if(pDataMsg->frameControl & Smsgs_dataFields_fanSensor)
+        if (pDataMsg->frameControl & Smsgs_dataFields_fanSensor)
         {
             len += 1;
             *pBuff++ = (uint8_t)(pDataMsg->fanSensor.fanSpeed);
         }
-        if(pDataMsg->frameControl & Smsgs_dataFields_doorLockSensor)
+        if (pDataMsg->frameControl & Smsgs_dataFields_doorLockSensor)
         {
             len += 1;
             *pBuff++ = (uint8_t)(pDataMsg->doorLockSensor.isLocked);
         }
+        if (pDataMsg->frameControl & Smsgs_dataFields_waterleakSensor)
+        {
+            len += 2;
+            *pBuff++ = (uint8_t)(pDataMsg->waterleakSensor.status);
+            *pBuff++ = (uint8_t)((pDataMsg->waterleakSensor.status >> 8) & 0xFF);
+        }
     }
 
-    if(pRspMsg != NULL)
+    if (pRspMsg != NULL)
     {
         len += 13;
         *pBuff++ = (uint8_t)pRspMsg->cmdId;
@@ -1017,12 +961,12 @@ static void appsrv_deviceSensorData_common(ApiMac_sAddr_t *pSrcAddr,
 
     struct mt_msg *pMsg;
     pMsg = MT_MSG_alloc(
-                len,
-                MT_MSG_cmd0_areq(APPSRV_SYS_ID_RPC),
-                APPSRV_DEVICE_DATA_RX_IND);
+        len,
+        MT_MSG_cmd0_areq(APPSRV_SYS_ID_RPC),
+        APPSRV_DEVICE_DATA_RX_IND);
 
     uint16_t i;
-    for(i = 0; i < len; i++)
+    for (i = 0; i < len; i++)
     {
         pMsg->iobuf[i + HEADER_LEN] = buffer[i];
     }
@@ -1035,19 +979,77 @@ static void appsrv_deviceSensorData_common(ApiMac_sAddr_t *pSrcAddr,
     pMsg = NULL;
 }
 
-
 /*!
- * @brief send the remove device response to gateway
+  Csf module calls this function to inform the user/appClient
+  that the device has responded to the configuration request
+
+  Public function defined in appsrv_Collector.h
+*/
+void appsrv_deviceConfigUpdate(ApiMac_sAddr_t *pSrcAddr, int8_t rssi,
+                               Smsgs_configRspMsg_t *pRspMsg)
+{
+    appsrv_deviceSensorData_common(pSrcAddr, rssi, NULL, pRspMsg);
+}
+#else
+/*
+ * @brief common code to handle sensor data messages
+ * @param pSrcAddr - address related to this message
+ *
+ * In the end, the message is sent to the gateway
  */
+void appsrv_deviceRawDataUpdate(ApiMac_mcpsDataInd_t *pDataInd)
+{
+    // Get the length (srcAddr + rssi + msdu.len)
+    uint16_t bufferLength = pDataInd->msdu.len + sizeof(pDataInd->rssi) + sizeof(ApiMac_sAddr_t);
+    uint8_t buffer[bufferLength];
+    memset(buffer, 0, bufferLength);
+    uint16_t idx = 0;
+    buffer[idx++] = pDataInd->srcAddr.addrMode;
+    if (pDataInd->srcAddr.addrMode == ApiMac_addrType_short)
+    {
+        buffer[idx++] = (uint8_t)(pDataInd->srcAddr.addr.shortAddr & 0xFF);
+        buffer[idx++] = (uint8_t)((pDataInd->srcAddr.addr.shortAddr >> 8) & 0xFF);
+    }
+    else if (pDataInd->srcAddr.addrMode == ApiMac_addrType_extended)
+    {
+        memcpy((buffer + idx), pDataInd->srcAddr.addr.extAddr, APIMAC_SADDR_EXT_LEN);
+        idx += APIMAC_SADDR_EXT_LEN;
+    }
+    buffer[idx++] = pDataInd->rssi;
+    memcpy((buffer + idx), pDataInd->msdu.p, pDataInd->msdu.len);
+
+    // initalize the message struct
+    struct mt_msg *pMsg;
+    pMsg = MT_MSG_alloc(
+        bufferLength,
+        MT_MSG_cmd0_areq(APPSRV_SYS_ID_RPC),
+        APPSRV_DEVICE_DATA_RX_IND);
+
+    //add the ApiMac data to the message iobuf
+    uint16_t i;
+    for (i = 0; i < bufferLength; i++)
+    {
+        pMsg->iobuf[i + HEADER_LEN] = buffer[i];
+    }
+
+    // send the message buffer over a socket to the appclient
+    MT_MSG_setDestIface(pMsg, &appClient_mt_interface_template);
+    MT_MSG_wrBuf(pMsg, NULL, bufferLength);
+    appsrv_broadcast(pMsg);
+    MT_MSG_free(pMsg);
+    pMsg = NULL;
+}
+#endif
+
 void appsrv_send_removeDeviceRsp(void)
 {
     int len = REMOVE_DEVICE_RSP_LEN;
 
     struct mt_msg *pMsg;
     pMsg = MT_MSG_alloc(
-                len,
-                MT_MSG_cmd0_areq(APPSRV_SYS_ID_RPC),
-                APPSRV_RMV_DEVICE_RSP);
+        len,
+        MT_MSG_cmd0_areq(APPSRV_SYS_ID_RPC),
+        APPSRV_RMV_DEVICE_RSP);
 
     /* Send msg */
     MT_MSG_setDestIface(pMsg, &appClient_mt_interface_template);
@@ -1057,17 +1059,6 @@ void appsrv_send_removeDeviceRsp(void)
     pMsg = NULL;
 }
 
-/*!
-  Csf module calls this function to inform the user/appClient
-  that the device has responded to the configuration request
-
-  Public function defined in appsrv_Collector.h
-*/
-void appsrv_deviceConfigUpdate(ApiMac_sAddr_t *pSrcAddr, int8_t rssi,
-                               Smsgs_configRspMsg_t *pRspMsg)
-{
-    appsrv_deviceSensorData_common(pSrcAddr, rssi, NULL, pRspMsg);
-}
 /*!
   Csf module calls this function to inform the user/appClient
   that a device is no longer active in the network
@@ -1082,9 +1073,9 @@ void appsrv_deviceNotActiveUpdate(ApiMac_deviceDescriptor_t *pDevInfo,
 
     struct mt_msg *pMsg;
     pMsg = MT_MSG_alloc(
-                len,
-                MT_MSG_cmd0_areq(APPSRV_SYS_ID_RPC),
-                APPSRV_DEVICE_NOTACTIVE_UPDATE_IND);
+        len,
+        MT_MSG_cmd0_areq(APPSRV_SYS_ID_RPC),
+        APPSRV_DEVICE_NOTACTIVE_UPDATE_IND);
 
     /* Create duplicate pointer to msg buffer for building purposes */
     pBuff = pMsg->iobuf + HEADER_LEN;
@@ -1112,7 +1103,7 @@ void appsrv_deviceNotActiveUpdate(ApiMac_deviceDescriptor_t *pDevInfo,
     pMsg = NULL;
 }
 
-
+#ifndef PROCESS_JS
 /*!
   Csf module calls this function to inform the user/appClient
   of the reported sensor data from a network device
@@ -1124,15 +1115,21 @@ void appsrv_deviceSensorDataUpdate(ApiMac_sAddr_t *pSrcAddr, int8_t rssi,
 {
     appsrv_deviceSensorData_common(pSrcAddr, rssi, pSensorMsg, NULL);
 }
+#endif
+
+/*!
+  TBD
 
+  Public function defined in appsrv_Collector.h
+*/
 void appsrv_stateChangeUpdate(Cllc_states_t state)
 {
     int len = STATE_CHG_IND_LEN;
     struct mt_msg *pMsg;
     pMsg = MT_MSG_alloc(
-                len,
-                MT_MSG_cmd0_areq(APPSRV_SYS_ID_RPC),
-                APPSRV_COLLECTOR_STATE_CNG_IND);
+        len,
+        MT_MSG_cmd0_areq(APPSRV_SYS_ID_RPC),
+        APPSRV_COLLECTOR_STATE_CNG_IND);
 
     /* Build msg, no need for duplicate pointer*/
     pMsg->iobuf[HEADER_LEN] = (uint8_t)(state & 0xFF);
@@ -1158,7 +1155,7 @@ static void appsrv_handle_appClient_request( struct appsrv_connection *pCONN,
 {
     int subsys = _bitsXYof(pMsg->cmd0 , 4, 0);
     int handled = true;
-    if(subsys != APPSRV_SYS_ID_RPC)
+    if (subsys != APPSRV_SYS_ID_RPC)
     {
         handled = false;
     }
@@ -1174,28 +1171,38 @@ static void appsrv_handle_appClient_request( struct appsrv_connection *pCONN,
              */
         case APPSRV_GET_DEVICE_ARRAY_REQ:
             /* Rcvd data from Client */
-            LOG_printf(LOG_APPSRV_MSG_CONTENT, "\nrcvd get device array msg\n");
+            LOG_printf(LOG_APPSRV_MSG_CONTENT, "______________________________\n");
+            LOG_printf(LOG_APPSRV_MSG_CONTENT, "rcvd get device array msg\n");
+            LOG_printf(LOG_APPSRV_MSG_CONTENT, "______________________________\n");
             appsrv_processGetDeviceArrayReq(pCONN);
             break;
 
         case APPSRV_GET_NWK_INFO_REQ:
-            LOG_printf(LOG_APPSRV_MSG_CONTENT,"\ngetnwkinfo req message\n");
+            LOG_printf(LOG_APPSRV_MSG_CONTENT, "______________________________\n");
+            LOG_printf(LOG_APPSRV_MSG_CONTENT, "getnwkinfo req message\n");
+            LOG_printf(LOG_APPSRV_MSG_CONTENT, "______________________________\n");
             appsrv_processGetNwkInfoReq(pCONN);
             break;
 
         case APPSRV_SET_JOIN_PERMIT_REQ:
-            LOG_printf(LOG_APPSRV_MSG_CONTENT,"\nrcvd join premit message\n ");
+            LOG_printf(LOG_APPSRV_MSG_CONTENT, "______________________________\n");
+            LOG_printf(LOG_APPSRV_MSG_CONTENT, "rcvd join premit message\n ");
+            LOG_printf(LOG_APPSRV_MSG_CONTENT, "______________________________\n");
             appsrv_processSetJoinPermitReq(pCONN, pMsg);
             break;
 
         case APPSRV_TX_DATA_REQ:
-            LOG_printf(LOG_APPSRV_MSG_CONTENT,"\nrcvd req to send message to a device\n ");
+            LOG_printf(LOG_APPSRV_MSG_CONTENT, "______________________________\n");
+            LOG_printf(LOG_APPSRV_MSG_CONTENT, "rcvd req to send message to a device\n ");
+            LOG_printf(LOG_APPSRV_MSG_CONTENT, "______________________________\n");
             appsrv_processTxDataReq(pCONN, pMsg);
             break;
-
         case APPSRV_RMV_DEVICE_REQ:
-            LOG_printf(LOG_APPSRV_MSG_CONTENT,"\nrcvd req to remove device\n ");
+            LOG_printf(LOG_APPSRV_MSG_CONTENT, "______________________________\n");
+            LOG_printf(LOG_APPSRV_MSG_CONTENT, "rcvd req to remove a device\n ");
+            LOG_printf(LOG_APPSRV_MSG_CONTENT, "______________________________\n");
             appsrv_processRemoveDeviceReq(pCONN, pMsg);
+            break;
         }
     }
     if(!handled)
@@ -1292,6 +1299,7 @@ static intptr_t s2appsrv_thread(intptr_t cookie)
         /* Same *MARKER* line at the end of the message */
         LOG_printf(LOG_DBG_MT_MSG_traffic, "END MSG: %s\n", star_line);
         MT_MSG_free(pMsg);
+        pMsg = NULL;
     }
 
     /* There is an interock here.
@@ -1508,6 +1516,7 @@ void APP_main(void)
         FATAL_printf( "Did not get device version info at startup - Bailing out\n");
     }
 
+
     LOG_printf( LOG_ALWAYS, "Found Mac Co-Processor Version info is:\n");
     LOG_printf( LOG_ALWAYS, "Transport: %d\n", MT_DEVICE_version_info.transport );
     LOG_printf( LOG_ALWAYS, "  Product: %d\n", MT_DEVICE_version_info.product   );
@@ -1628,3 +1637,4 @@ void APP_defaults(void)
  *  End:
  *  vim:set  filetype=c tabstop=4 shiftwidth=4 expandtab=true
  */
+
index 80c14865c5b204aea46bd84ce901fa8cc58c7eee..65b3801eb42e43caeb89830e8eb99401b5c9637d 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Application Server API
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
  #ifndef APPINTERFACE_H
  #define APPINTERFACE_H
@@ -83,7 +83,54 @@ extern struct uart_cfg         uart_cfg;
 /******************************************************************************
  Function Prototypes
  *****************************************************************************/
-
+#ifdef PROCESS_JS
+#define APPSRV_SYS_ID_RPC 10
+#define APPSRV_DEVICE_JOINED_IND 0
+#define APPSRV_DEVICE_LEFT_IND 1
+#define APPSRV_NWK_INFO_IND 2
+#define APPSRV_GET_NWK_INFO_REQ 3
+#define APPSRV_GET_NWK_INFO_RSP 4
+#define APPSRV_GET_NWK_INFO_CNF 5
+#define APPSRV_GET_DEVICE_ARRAY_REQ 6
+#define APPSRV_GET_DEVICE_ARRAY_CNF 7
+#define APPSRV_DEVICE_NOTACTIVE_UPDATE_IND 8
+#define APPSRV_DEVICE_DATA_RX_IND 9
+#define APPSRV_COLLECTOR_STATE_CNG_IND 10
+#define APPSRV_SET_JOIN_PERMIT_REQ 11
+#define APPSRV_SET_JOIN_PERMIT_CNF 12
+#define APPSRV_TX_DATA_REQ 13
+#define APPSRV_TX_DATA_CNF 14
+#define APPSRV_RMV_DEVICE_REQ 15
+#define APPSRV_RMV_DEVICE_RSP 16
+
+#define HEADER_LEN 4
+#define TX_DATA_CNF_LEN 4
+#define JOIN_PERMIT_CNF_LEN 4
+#define NWK_INFO_REQ_LEN 18
+#define NWK_INFO_IND_LEN 17
+#define DEV_ARRAY_HEAD_LEN 3
+#define DEV_ARRAY_INFO_LEN 18
+#define DEVICE_JOINED_IND_LEN 18
+#define DEVICE_NOT_ACTIVE_LEN 13
+#define STATE_CHG_IND_LEN 1
+#define REMOVE_DEVICE_RSP_LEN 0
+
+#define BEACON_ENABLED 1
+#define NON_BEACON 2
+#define FREQUENCY_HOPPING 3
+
+#define RMV_STATUS_SUCCESS 0
+#define RMV_STATUS_FAIL 1
+/*!
+ * @brief        Csf module calls this function to inform the applicaiton client
+                         of the reported sensor data from a network device
+ *
+ * @param
+ *
+ * @return
+ */
+void appsrv_deviceRawDataUpdate(ApiMac_mcpsDataInd_t *pDataInd);
+#endif
 /*
  * Sets defaults for the application.
  */
index fe63b196d0c42da6c1b9bd2dd33da4fa3cd0313e..66aeba256d4f3e97ec071b583ba1eb1094041444 100644 (file)
@@ -7,7 +7,7 @@
  This module is the Coordinator Logical Link Controller for the application.
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -43,7 +43,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 /******************************************************************************
  to each the device that associates to it
  */
 #define CLLC_ASSOC_DEVICE_STARTING_NUMBER 1
+/*! link quality */
+#define CONFIG_LINKQUALITY                1
+/*! percent filter */
+#define CONFIG_PERCENTFILTER              0xFF
 
 /******************************************************************************
  Security constants and definitions
@@ -200,6 +204,7 @@ STATIC uint8_t fhGtkHash2[] = CLLC_FH_GTK2HASH;
 STATIC uint8_t fhGtkHash3[] = CLLC_FH_GTK3HASH;
 STATIC uint32_t fhPAtrickleTime; /* linux: these come from the configuration file at startup */
 STATIC uint32_t fhPCtrickleTime;
+/* set of channels on which target nodes are expected to listen */
 STATIC uint8_t optPAChMask[APIMAC_154G_CHANNEL_BITMAP_SIZ];
 /* set of channels on which target nodes are expected to listen */
 STATIC uint8_t optPCChMask[APIMAC_154G_CHANNEL_BITMAP_SIZ];
@@ -263,6 +268,8 @@ STATIC CONST ApiMac_secLevel_t secLevel = ApiMac_secLevel_encMic32;
 STATIC CONST ApiMac_keyIdMode_t secKeyIdMode = ApiMac_keyIdMode_8;
 STATIC CONST uint8_t secKeyIndex = 3; /* cant be zero for implicit key identifier */
 
+bool networkStarted = 0;
+
 //STATIC bool macSecurity = CONFIG_SECURE;
 #define macSecurity CONFIG_SECURE /* linux, we use the config variable */
 
@@ -319,7 +326,9 @@ static void processIncomingAsyncUSIE(uint8_t frameType, uint8_t* pIEContent);
  */
 void Cllc_init(ApiMac_callbacks_t *pMacCbs, Cllc_callbacks_t *pCllcCbs)
 {
+
     uint16_t panId = CONFIG_PAN_ID;
+
     /* Linux specific init */
     if(CONFIG_FH_ENABLE)
     {
@@ -393,17 +402,19 @@ void Cllc_init(ApiMac_callbacks_t *pMacCbs, Cllc_callbacks_t *pCllcCbs)
         ApiMac_mlmeSetFhReqUint8(ApiMac_FHAttribute_unicastDwellInterval,
                                  CONFIG_DWELL_TIME);
         ApiMac_mlmeSetFhReqUint8(ApiMac_FHAttribute_broadcastDwellInterval,
-                                 CONFIG_DWELL_TIME);
+                                 FH_BROADCAST_DWELL_TIME);
 
-        /*
-         * set up the number of NON-sleep and sleep device
+        ApiMac_mlmeSetFhReqUint32(ApiMac_FHAttribute_BCInterval,
+                                  (FH_BROADCAST_INTERVAL >> 1));
+
+         /* set up the number of NON-sleep and sleep device
          * the order is important. Need to set up the number of non-sleep first
          */
 
-        ApiMac_mlmeSetFhReqUint8(ApiMac_FHAttribute_numNonSleepDevice,
-                                  FH_NUM_NON_SLEEPY_NEIGHBORS);
-        ApiMac_mlmeSetFhReqUint8(ApiMac_FHAttribute_numSleepDevice,
-                                  FH_NUM_SLEEPY_NEIGHBORS);
+        ApiMac_mlmeSetFhReqUint16(ApiMac_FHAttribute_numNonSleepDevice,
+                                 FH_NUM_NON_SLEEPY_HOPPING_NEIGHBORS);
+        ApiMac_mlmeSetFhReqUint16(ApiMac_FHAttribute_numSleepDevice,
+                                 FH_NUM_NON_SLEEPY_FIXED_CHANNEL_NEIGHBORS);
 
         /* set Exclude Channels */
         sizeOfChannelMask = sizeof(configChannelMask)/sizeof(uint8_t);
@@ -529,25 +540,45 @@ void Cllc_restoreNetwork(Llc_netInfo_t *pNetworkInfo, uint8_t numDevices,
     {
         ApiMac_mlmeSetReqArray(ApiMac_attribute_extendedAddress,
                        (uint8_t*)(pNetworkInfo->devInfo.extAddress));
-       ApiMac_mlmeSetReqUint16(ApiMac_attribute_shortAddress,
-                                  pNetworkInfo->devInfo.shortAddress);
     }
     else
     {
         coordInfoBlock.channel = pNetworkInfo->channel;
-
-        ApiMac_mlmeSetReqUint16(ApiMac_attribute_shortAddress,
-                                 pNetworkInfo->devInfo.shortAddress);
     }
 
+    ApiMac_mlmeSetReqUint16(ApiMac_attribute_shortAddress,
+                             pNetworkInfo->devInfo.shortAddress);
+
     sendStartReq(pNetworkInfo->fh);
 
-    /* repopulate association table */
-    for(i = 0; i < numDevices; i++, pDevList++)
+    if (pDevList)
+    {
+        /* repopulate association table */
+        for(i = 0; i < numDevices; i++, pDevList++)
+        {
+            /* Add to association table */
+            maintainAssocTable(&pDevList->devInfo, &pDevList->capInfo, 1, 0,
+                               (false));
+        }
+    }
+    else
     {
-        /* Add to association table */
-        maintainAssocTable(&pDevList->devInfo, &pDevList->capInfo, 1, 0,
-                           (false));
+        Llc_deviceListItem_t item;
+        /* repopulate association table */
+        for(i = 0; i < numDevices; i++)
+        {
+            Csf_getDeviceItem(i, &item);
+#ifdef FEATURE_MAC_SECURITY
+            /* Add device to security device table */
+            Cllc_addSecDevice(item.devInfo.panID,
+                              item.devInfo.shortAddress,
+                              &item.devInfo.extAddress,
+                              item.rxFrameCounter);
+#endif /* FEATURE_MAC_SECURITY */
+            /* Add to association table */
+            maintainAssocTable(&item.devInfo, &item.capInfo, 1, 0,
+                               (false));
+        }
     }
 }
 
@@ -780,20 +811,20 @@ static void processState(Cllc_coord_states_t state)
     switch(state)
     {
         case Cllc_coordStates_scanActive:
-                   if(!CONFIG_FH_ENABLE)
+            if(!CONFIG_FH_ENABLE)
             {
-            /* Active scan */
-            sendScanReq(ApiMac_scantype_active);
+                /* Active scan */
+                sendScanReq(ApiMac_scantype_active);
             }
-                       break;
+            break;
 
         case Cllc_coordStates_scanActiveCnf:
-                   if(!CONFIG_FH_ENABLE)
+            if(!CONFIG_FH_ENABLE)
             {
-            /* Energy detect scan */
-            sendScanReq(ApiMac_scantype_energyDetect);
+                /* Energy detect scan */
+                sendScanReq(ApiMac_scantype_energyDetect);
             }
-                       break;
+            break;
 
         case Cllc_coordStates_scanEdCnf:
 
@@ -1167,9 +1198,9 @@ static void assocIndCb(ApiMac_mlmeAssociateInd_t *pData)
 }
 
 /*!
- * @brief       Handle Disassociate Confirm callback
+ * @brief       Handle Disassociate indication callback
  *
- * @param       pData - pointer to Disassociate Confirm structure
+ * @param       pData - pointer to disassociate indication structure
  */
 static void disassocIndCb(ApiMac_mlmeDisassociateInd_t *pData)
 {
@@ -1333,13 +1364,6 @@ static void wsAsyncIndCb(ApiMac_mlmeWsAsyncInd_t *pData)
 
     processIncomingFHframe(pData->fhFrameType);
 
-#ifdef FEATURE_MAC_SECURITY
-    /* Add EUI to security device table */
-    Cllc_addSecDevice(pData->srcPanId, pData->srcAddr.addr.shortAddr,
-                      &(pData->srcAddr.addr.extAddr), pData->frameCntr);
-#endif /* FEATURE_MAC_SECURITY */
-
-
     if(macCallbacksCopy.pWsAsyncIndCb != NULL)
     {
         macCallbacksCopy.pWsAsyncIndCb(pData);
@@ -1443,6 +1467,12 @@ static void sendAsyncReq(uint8_t frameType)
     ApiMac_mlmeWSAsyncReq_t asyncReq;
     uint8_t sizeOfChannelMask;
     uint8_t asyncChannelMask[APIMAC_154G_CHANNEL_BITMAP_SIZ];
+
+    if(networkStarted == 0)
+    {
+      return;
+    }
+
     memcpy( asyncChannelMask, linux_FH_ASYNC_CHANNEL_MASK, sizeof(asyncChannelMask));
 
     /* set of Exclude Channels */
@@ -1503,7 +1533,7 @@ static void sendAsyncReq(uint8_t frameType)
         ApiMac_mlmeSetFhReqArray(ApiMac_FHAttribute_netName,
                                  (uint8_t*)&fhNetname[0]);
         ApiMac_mlmeSetFhReqUint16(ApiMac_FHAttribute_panSize,
-                                  (CONFIG_FH_PAN_SIZE));
+                                  (CONFIG_MAX_DEVICES));
 
         /* Fill in the information for async request */
         asyncReq.frameType = ApiMac_wisunAsyncFrame_advertisement;
@@ -1580,6 +1610,8 @@ static void sendStartReq(bool startFH)
 
     /* send Start Req to MAC API */
     ApiMac_mlmeStartReq(&startReq);
+
+    networkStarted = 1;
 }
 
 /*!
@@ -1691,11 +1723,11 @@ static void processIncomingAsyncUSIE(uint8_t frameType, uint8_t* pIEContent)
         /* Check if channel plan is based on REG_DOMAIN */
         if (chPlan == 0)
         {
-            fixedChannel = Util_parseUint16(pIEContent + 6);
+            fixedChannel = Util_parseUint16(pIEContent + USIE_FIXED_CHANNEL_OFFSET_CP0);
         }
         else
         {
-            fixedChannel = Util_parseUint16(pIEContent + 8);
+            fixedChannel = Util_parseUint16(pIEContent + USIE_FIXED_CHANNEL_OFFSET_CP1);
         }
         if(fixedChannel < APIMAC_154G_MAX_NUM_CHANNEL)
         {
index 8aa2e0cfcb7a53301ebffe1da3f39381f52cae08..1d1d25235b428124e30ced72df5b172789288feb 100644 (file)
@@ -5,7 +5,7 @@
  @brief Coordinator Logical Link Controller
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -41,7 +41,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 #ifndef CLLC_H
 #define CLLC_H
@@ -77,12 +77,6 @@ extern "C"
 /*! Association status */
 #define CLLC_ASSOC_STATUS_ALIVE 0x0001
 
-#if ((CONFIG_PHY_ID >= APIMAC_MRFSK_GENERIC_PHY_ID_BEGIN + 1) && (CONFIG_PHY_ID <= APIMAC_MRFSK_GENERIC_PHY_ID_END))
-#define LRM_MODE  1
-#else
-#define LRM_MODE  0
-#endif
-
 /*!
  Coordinator State Values
  */
index dc876e5f0063266d73d67f7e9c2f089b03bda86a..aaccc90b6b925371d5239594d60dbbebcea21100 100644 (file)
@@ -5,29 +5,29 @@
  @brief TIMAC 2.0 Collector Example Application
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
-
+  
    Copyright (c) 2015, 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
@@ -41,7 +41,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 /******************************************************************************
@@ -60,7 +60,9 @@
 
 #include "log.h"
 
-#include <oad_protocol.h>
+#include "oad_protocol.h"
+#include "oad_storage.h"
+#include "oad_image_header.h"
 
 /******************************************************************************
  Constants and definitions
 /* App Config request marker for the MSDU handle */
 #define APP_CONFIG_MSDU_HANDLE 0x40
 
+/* App Broadcast Cmd Msg marker for the MSDU Handle */
+#define APP_BROADCAST_MSDU_HANDLE 0x20
 /* Default configuration frame control */
-#define CONFIG_FRAME_CONTROL (Smsgs_dataFields_tempSensor | \
-                              Smsgs_dataFields_lightSensor | \
-                              Smsgs_dataFields_humiditySensor | \
-                              Smsgs_dataFields_msgStats | \
-                              Smsgs_dataFields_configSettings | \
-                              Smsgs_dataFields_pressureSensor | \
-                              Smsgs_dataFields_motionSensor | \
-                              Smsgs_dataFields_batterySensor | \
-                              Smsgs_dataFields_hallEffectSensor | \
-                              Smsgs_dataFields_fanSensor | \
-                              Smsgs_dataFields_doorLockSensor)
-
-#if ((CONFIG_PHY_ID >= APIMAC_MRFSK_STD_PHY_ID_BEGIN) && (CONFIG_PHY_ID <= APIMAC_MRFSK_GENERIC_PHY_ID_BEGIN))
-/* MAC Indirect Persistent Timeout */
-#define INDIRECT_PERSISTENT_TIME 750
-/* Default configuration reporting interval, in milliseconds */
-#define CONFIG_REPORTING_INTERVAL_DEFAULT 90000
-
-/* Default configuration polling interval, in milliseconds */
-#define CONFIG_POLLING_INTERVAL_DEFAULT 6000
+#define CONFIG_FRAME_CONTROL (0xFFFF)
 
 /* Delay for config request retry in busy network */
-#define CONFIG_DELAY 1000
+#define CONFIG_DELAY 2000
 #define CONFIG_RESPONSE_DELAY 3*CONFIG_DELAY
 /* Tracking timeouts */
 #define TRACKING_CNF_DELAY_TIME 2000 /* in milliseconds */
-#define TRACKING_DELAY_TIME 60000 /* in milliseconds */
-#define TRACKING_TIMEOUT_TIME (CONFIG_POLLING_INTERVAL * 2) /*in milliseconds*/
-#else
-/* MAC Indirect Persistent Timeout
- * This is in units of aBaseSuperframeDuration.
- * It will be scaled accordingly for beacon mode.
- * */
-#define INDIRECT_PERSISTENT_TIME 3750
-/* Default configuration reporting interval, in milliseconds */
-#define CONFIG_REPORTING_INTERVAL_DEFAULT 300000
+#define TRACKING_TIMEOUT_TIME (CONFIG_POLLING_INTERVAL * 3) /*in milliseconds*/
+/* Initial delay before broadcast transmissions are started in FH mode */
+#define BROADCAST_CMD_START_TIME 60000
 
-/* Default configuration polling interval, in milliseconds */
-#define CONFIG_POLLING_INTERVAL_DEFAULT 60000
+/* Number of superframe periods to hold a indirect packet at collector for
+Sensor to poll and get the frame*/
+#define BCN_MODE_INDIRECT_PERSISTENT_TIME 3
 
-/* Delay for config request retry in busy network */
-#define CONFIG_DELAY 5000
-#define CONFIG_RESPONSE_DELAY 3*CONFIG_DELAY
-/* Tracking timeouts */
-#define TRACKING_CNF_DELAY_TIME 10000 /* in milliseconds */
-#define TRACKING_DELAY_TIME 300000 /* in milliseconds */
-#define TRACKING_TIMEOUT_TIME (CONFIG_POLLING_INTERVAL_DEFAULT * 2) /*in milliseconds*/
-#endif
+#if ((CONFIG_PHY_ID >= APIMAC_MRFSK_STD_PHY_ID_BEGIN) && (CONFIG_PHY_ID <= APIMAC_MRFSK_GENERIC_PHY_ID_BEGIN))
 
-int linux_CONFIG_REPORTING_INTERVAL = CONFIG_REPORTING_INTERVAL_DEFAULT;
-#define CONFIG_REPORTING_INTERVAL linux_CONFIG_REPORTING_INTERVAL
-int linux_CONFIG_POLLING_INTERVAL = CONFIG_POLLING_INTERVAL_DEFAULT;
-#define CONFIG_POLLING_INTERVAL linux_CONFIG_POLLING_INTERVAL
+/* MAC Indirect Persistent Timeout */
+#define INDIRECT_PERSISTENT_TIME ((5 * 1000 * CONFIG_POLLING_INTERVAL / 2)/ \
+                                  (BASE_SUPER_FRAME_DURATION * \
+                                   SYMBOL_DURATION_50_kbps))
+
+#elif ((CONFIG_PHY_ID >= APIMAC_GENERIC_US_915_PHY_132) && (CONFIG_PHY_ID <= APIMAC_GENERIC_ETSI_863_PHY_133))
+
+/* MAC Indirect Persistent Timeout */
+#define INDIRECT_PERSISTENT_TIME ((5 * 1000 * CONFIG_POLLING_INTERVAL / 2)/ \
+                                  (BASE_SUPER_FRAME_DURATION * \
+                                   SYMBOL_DURATION_200_kbps))
+
+#elif (CONFIG_PHY_ID == APIMAC_PHY_ID_NONE)
+
+/* MAC Indirect Persistent Timeout */
+#define INDIRECT_PERSISTENT_TIME ((5 * 1000 * CONFIG_POLLING_INTERVAL / 2)/ \
+                                  (BASE_SUPER_FRAME_DURATION * \
+                                   SYMBOL_DURATION_250_kbps))
+
+#else
+/* MAC Indirect Persistent Timeout */
+#define INDIRECT_PERSISTENT_TIME ((5 * 1000 * CONFIG_POLLING_INTERVAL / 2)/ \
+                                  (BASE_SUPER_FRAME_DURATION * \
+                                    SYMBOL_DURATION_LRM))
+#endif
 
 /* Assoc Table (CLLC) status settings */
 #define ASSOC_CONFIG_SENT       0x0100    /* Config Req sent */
@@ -225,6 +218,7 @@ static bool sendMsg(Smsgs_cmdIds_t type, uint16_t dstShortAddr, bool rxOnIdle,
                     uint8_t *pData);
 static void generateConfigRequests(void);
 static void generateTrackingRequests(void);
+static void generateBroadcastCmd(void);
 static void sendTrackingRequest(Cllc_associated_devices_t *pDev);
 static void commStatusIndCB(ApiMac_mlmeCommStatusInd_t *pCommStatusInd);
 static void pollIndCB(ApiMac_mlmePollInd_t *pPollInd);
@@ -343,19 +337,37 @@ void Collector_init(void)
     /* Initialize the platform specific functions */
     Csf_init(sem);
 
+    ApiMac_mlmeSetReqUint8(ApiMac_attribute_phyCurrentDescriptorId,
+                           (uint8_t)CONFIG_PHY_ID);
+
+    ApiMac_mlmeSetReqUint8(ApiMac_attribute_channelPage,
+                           (uint8_t)CONFIG_CHANNEL_PAGE);
+
     /* Set the indirect persistent timeout */
     if(CONFIG_MAC_BEACON_ORDER != NON_BEACON_ORDER)
     {
-        ApiMac_mlmeSetReqUint16(ApiMac_attribute_transactionPersistenceTime, (INDIRECT_PERSISTENT_TIME >> CONFIG_MAC_BEACON_ORDER));
+        ApiMac_mlmeSetReqUint16(ApiMac_attribute_transactionPersistenceTime,
+            BCN_MODE_INDIRECT_PERSISTENT_TIME);
     }
     else
     {
-        ApiMac_mlmeSetReqUint16(ApiMac_attribute_transactionPersistenceTime, INDIRECT_PERSISTENT_TIME);
+        ApiMac_mlmeSetReqUint16(ApiMac_attribute_transactionPersistenceTime,
+            INDIRECT_PERSISTENT_TIME);
     }
-
     ApiMac_mlmeSetReqUint8(ApiMac_attribute_phyTransmitPowerSigned,
                            (uint8_t)CONFIG_TRANSMIT_POWER);
-
+    /* Set Min BE */
+    ApiMac_mlmeSetReqUint8(ApiMac_attribute_backoffExponent,
+                              (uint8_t)CONFIG_MIN_BE);
+    /* Set Max BE */
+    ApiMac_mlmeSetReqUint8(ApiMac_attribute_maxBackoffExponent,
+                              (uint8_t)CONFIG_MAX_BE);
+    /* Set MAC MAX CSMA Backoffs */
+    ApiMac_mlmeSetReqUint8(ApiMac_attribute_maxCsmaBackoffs,
+                              (uint8_t)CONFIG_MAC_MAX_CSMA_BACKOFFS);
+    /* Set MAC MAX Frame Retries */
+    ApiMac_mlmeSetReqUint8(ApiMac_attribute_maxFrameRetries,
+                              (uint8_t)CONFIG_MAX_RETRIES);
 #ifdef FCS_TYPE16
     /* Set the fcs type */
     ApiMac_mlmeSetReqBool(ApiMac_attribute_fcsType,
@@ -364,6 +376,12 @@ void Collector_init(void)
 
     /* Initialize the app clocks */
     initializeClocks();
+    if(CONFIG_FH_ENABLE && (FH_BROADCAST_DWELL_TIME > 0))
+    {
+        /* Start broadcast frame transmissions in FH mode if broadcast dwell time
+         * is greater than zero */
+        Csf_setBroadcastClock(BROADCAST_CMD_START_TIME);
+    }
 
     if(CONFIG_AUTO_START)
     {
@@ -419,6 +437,21 @@ void Collector_process(void)
         Util_clearEvent(&Collector_events, COLLECTOR_CONFIG_EVT);
     }
 
+    /*
+     Collector generate a broadcast command message for FH mode
+     */
+    if(Collector_events & COLLECTOR_BROADCAST_TIMEOUT_EVT)
+    {
+        /* Clear the event */
+        Util_clearEvent(&Collector_events, COLLECTOR_BROADCAST_TIMEOUT_EVT);
+        if(FH_BROADCAST_INTERVAL > 0 && (!CERTIFICATION_TEST_MODE))
+        {
+            generateBroadcastCmd();
+            /* set clock for next broadcast command */
+            Csf_setBroadcastClock(FH_BROADCAST_INTERVAL);
+        }
+    }
+
     /* Process LLC Events */
     Cllc_process();
 
@@ -556,7 +589,7 @@ uint32_t Collector_updateFwList(char *new_oad_file)
     uint32_t oad_file_id;
     bool found = false;
 
-    LOG_printf( LOG_ALWAYS, "Collector_updateFwList: new oad file: %s\n",
+    LOG_printf( LOG_DBG_COLLECTOR, "Collector_updateFwList: new oad file: %s\n",
                           new_oad_file);
 
     /* Does OAD file exist */
@@ -564,7 +597,7 @@ uint32_t Collector_updateFwList(char *new_oad_file)
     {
         if(strcmp(new_oad_file, oad_file_list[oad_file_idx].oad_file) == 0)
         {
-            LOG_printf( LOG_ALWAYS, "Collector_updateFwList: found ID: %d\n",
+            LOG_printf( LOG_DBG_COLLECTOR, "Collector_updateFwList: found ID: %d\n",
                           oad_file_list[oad_file_idx].oad_file_id);
             oad_file_id = oad_file_list[oad_file_idx].oad_file_id;
             found = true;
@@ -582,7 +615,7 @@ uint32_t Collector_updateFwList(char *new_oad_file)
         oad_file_list[latest_oad_file_idx].oad_file_id = oad_file_id;
         strncpy(oad_file_list[latest_oad_file_idx].oad_file, new_oad_file, 256);
 
-        LOG_printf( LOG_ALWAYS, "Collector_updateFwList: Added %s, ID %d\n",
+        LOG_printf( LOG_DBG_COLLECTOR, "Collector_updateFwList: Added %s, ID %d\n",
               oad_file_list[latest_oad_file_idx].oad_file,
               oad_file_list[latest_oad_file_idx].oad_file_id);
 
@@ -623,7 +656,7 @@ Collector_status_t Collector_sendFwVersionRequest(ApiMac_sAddr_t *pDstAddr)
 Collector_status_t Collector_startFwUpdate(ApiMac_sAddr_t *pDstAddr, uint32_t oad_file_id)
 {
     Collector_status_t status = Collector_status_invalid_state;
-    uint8_t imgInfoData[16];
+    uint8_t imgInfoData[OADProtocol_AGAMA_IMAGE_HDR_LEN];
     uint32_t oad_file_idx;
     FILE *oadFile;
 
@@ -631,7 +664,7 @@ Collector_status_t Collector_startFwUpdate(ApiMac_sAddr_t *pDstAddr, uint32_t oa
     {
         if(oad_file_list[oad_file_idx].oad_file_id == oad_file_id)
         {
-          LOG_printf( LOG_ALWAYS, "Collector_startFwUpdate: opening file: %s\n",
+          LOG_printf( LOG_DBG_COLLECTOR, "Collector_startFwUpdate: opening file: %s\n",
                           oad_file_list[oad_file_idx].oad_file);
 
           oadFile = fopen(oad_file_list[oad_file_idx].oad_file, "r");
@@ -641,17 +674,74 @@ Collector_status_t Collector_startFwUpdate(ApiMac_sAddr_t *pDstAddr, uint32_t oa
 
     if(oadFile)
     {
+        LOG_printf( LOG_DBG_COLLECTOR, "Collector_startFwUpdate: opened file....\n");
+
         fseek(oadFile, IMG_HDR_ADDR, SEEK_SET);
 
-        if(fread(imgInfoData, 1, 16, oadFile) == 16)
+        if(fread(imgInfoData, 1, OADProtocol_AGAMA_IMAGE_HDR_LEN, oadFile) == OADProtocol_AGAMA_IMAGE_HDR_LEN)
         {
-            LOG_printf( LOG_ALWAYS, "Collector_startFwUpdate: sending ImgIdentifyReq\n");
+            //check if it is a unified OAD binary
+            OADStorage_imgIdentifyPld_t imgIdPld;
+           
 
-            oadBNumBlocks = ((imgInfoData[6]) | (imgInfoData[7] << 8) ) / (OAD_BLOCK_SIZE / 4);
+           imgHdr_t* pImgHdr = (imgHdr_t*) imgInfoData;
 
-            if(OADProtocol_sendImgIdentifyReq((void*) pDstAddr, oad_file_id, imgInfoData) == OADProtocol_Status_Success)
+            if((strncmp((const char*) pImgHdr->fixedHdr.imgID, CC26X2_OAD_IMG_ID_VAL, 8) == 0)
+                               || (strncmp((const char*) pImgHdr->fixedHdr.imgID, CC13X2_OAD_IMG_ID_VAL, 8) == 0))
             {
-                status = Collector_status_success;
+                LOG_printf( LOG_DBG_COLLECTOR, "Collector_startFwUpdate: unified OAD image\n");
+                               
+                //copy image indentify payload
+                memcpy(imgIdPld.imgID, pImgHdr->fixedHdr.imgID, 8);
+                imgIdPld.bimVer = pImgHdr->fixedHdr.bimVer;
+                imgIdPld.metaVer = pImgHdr->fixedHdr.metaVer;
+                imgIdPld.imgCpStat = pImgHdr->fixedHdr.imgCpStat;
+                imgIdPld.crcStat = pImgHdr->fixedHdr.crcStat;
+                imgIdPld.imgType = pImgHdr->fixedHdr.imgType;
+                imgIdPld.imgNo = pImgHdr->fixedHdr.imgNo;
+                imgIdPld.len = pImgHdr->fixedHdr.len;
+                memcpy(imgIdPld.softVer, pImgHdr->fixedHdr.softVer, 4);
+
+                LOG_printf( LOG_DBG_COLLECTOR, "Collector_startFwUpdate: sending ImgIdentifyReq, Img Len %x\n", pImgHdr->fixedHdr.len);
+                
+                               oadBNumBlocks = pImgHdr->fixedHdr.len / OAD_BLOCK_SIZE;
+
+                if(pImgHdr->fixedHdr.len % OAD_BLOCK_SIZE)
+                {
+                    //there are some remaining bytes in an additional block
+                    oadBNumBlocks++;
+                }
+
+               if(OADProtocol_sendImgIdentifyReq((void*) pDstAddr, oad_file_id, (uint8_t*) &imgIdPld) == OADProtocol_Status_Success)
+                {
+                    status = Collector_status_success;
+                }
+            }
+            else
+            {
+                               uint32_t oadImgLen = ((imgInfoData[6]) | (imgInfoData[7] << 8));
+                               
+                LOG_printf( LOG_DBG_COLLECTOR, "Collector_startFwUpdate: Not a unified OAD image\n");
+                LOG_printf( LOG_DBG_COLLECTOR, "Collector_startFwUpdate: sending ImgIdentifyReq, Img Len %x\n", oadImgLen);
+
+                oadBNumBlocks =  oadImgLen / (OAD_BLOCK_SIZE / 4);
+
+                if(oadImgLen % OAD_BLOCK_SIZE)
+                {
+                    //there are some remaining bytes in an additional block
+                    oadBNumBlocks++;
+                }
+
+                if(oadImgLen % OAD_BLOCK_SIZE)
+                {
+                    //there are some remaining bytes in an additional block
+                    oadBNumBlocks++;
+                }
+
+                if(OADProtocol_sendImgIdentifyReq((void*) pDstAddr, oad_file_id, imgInfoData) == OADProtocol_Status_Success)
+                {
+                    status = Collector_status_success;
+                }
             }
         }
 
@@ -659,7 +749,7 @@ Collector_status_t Collector_startFwUpdate(ApiMac_sAddr_t *pDstAddr, uint32_t oa
     }
     else
     {
-        LOG_printf( LOG_ALWAYS, "Collector_startFwUpdate: could not open file: %s\n",
+        LOG_printf( LOG_DBG_COLLECTOR, "Collector_startFwUpdate: could not open file: %s\n",
                         oad_file_list[oad_file_idx].oad_file);
         status = Collector_status_invalid_file;
     }
@@ -696,6 +786,7 @@ static void initializeClocks(void)
     /* Initialize the tracking clock */
     Csf_initializeTrackingClock();
     Csf_initializeConfigClock();
+    Csf_initializeBroadcastClock();
 }
 
 /*!
@@ -838,6 +929,13 @@ static void dataCnfCB(ApiMac_mcpsDataCnf_t *pDataCnf)
                 Collector_statistics.configReqRequestSent++;
             }
         }
+        else if(pDataCnf->msduHandle & APP_BROADCAST_MSDU_HANDLE)
+        {
+            if(pDataCnf->status == ApiMac_status_success)
+            {
+                Collector_statistics.broadcastMsgSentCnt++;
+            }
+        }
         else
         {
             /* Tracking Request */
@@ -888,10 +986,12 @@ static void dataCnfCB(ApiMac_mcpsDataCnf_t *pDataCnf)
  */
 static void dataIndCB(ApiMac_mcpsDataInd_t *pDataInd)
 {
+    int i;
+
     if((pDataInd != NULL) && (pDataInd->msdu.p != NULL)
        && (pDataInd->msdu.len > 0))
     {
-        Smsgs_cmdIds_t cmdId = (Smsgs_cmdIds_t)*(pDataInd->msdu.p);
+      Smsgs_cmdIds_t cmdId = (Smsgs_cmdIds_t)*(pDataInd->msdu.p);
 
 #ifdef FEATURE_MAC_SECURITY
         if(Cllc_securityCheck(&(pDataInd->sec)) == false)
@@ -910,6 +1010,24 @@ static void dataIndCB(ApiMac_mcpsDataInd_t *pDataInd)
                 /* Switch to the short address for internal tracking */
                 pDataInd->srcAddr.addrMode = ApiMac_addrType_short;
                 pDataInd->srcAddr.addr.shortAddr = shortAddr;
+
+                LOG_printf(LOG_DBG_COLLECTOR_RAW,"Sensor MSG Short: 0x%04x\
+                    Extended: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n Data Len: %d Data: ",
+                    shortAddr,
+                    pDataInd->srcAddr.addr.extAddr[7],
+                    pDataInd->srcAddr.addr.extAddr[6],
+                    pDataInd->srcAddr.addr.extAddr[5],
+                    pDataInd->srcAddr.addr.extAddr[4],
+                    pDataInd->srcAddr.addr.extAddr[3],
+                    pDataInd->srcAddr.addr.extAddr[2],
+                    pDataInd->srcAddr.addr.extAddr[1],
+                    pDataInd->srcAddr.addr.extAddr[0], pDataInd->msdu.len);
+
+                for (i = 0; i < pDataInd->msdu.len; i++)
+                {
+                  LOG_printf(LOG_DBG_COLLECTOR_RAW, "%02X ", pDataInd->msdu.p[i]);
+                }
+                LOG_printf(LOG_DBG_COLLECTOR_RAW, "\n");
             }
             else
             {
@@ -917,11 +1035,35 @@ static void dataIndCB(ApiMac_mcpsDataInd_t *pDataInd)
                 return;
             }
         }
+        /* Log using short address */
+        else {
+            LOG_printf(LOG_DBG_COLLECTOR_RAW,"Sensor MSG Short: 0x%04x Data Len: %d Data: ",
+             pDataInd->srcAddr.addr.shortAddr, pDataInd->msdu.len);
+
+            for (i = 0; i < pDataInd->msdu.len; i++)
+            {
+              LOG_printf(LOG_DBG_COLLECTOR_RAW, "%02X ", pDataInd->msdu.p[i]);
+            }
+            LOG_printf(LOG_DBG_COLLECTOR_RAW, "\n");
+        }
 
         switch(cmdId)
         {
             case Smsgs_cmdIds_configRsp:
+#ifndef PROCESS_JS
                 processConfigResponse(pDataInd);
+#else
+                Collector_statistics.configResponseReceived++;
+                Cllc_associated_devices_t *pDev = findDevice(&pDataInd->srcAddr);
+                if (pDev != NULL)
+                {
+                    /* Clear the sent flag and set the response flag */
+                    pDev->status &= ~ASSOC_CONFIG_SENT;
+                    pDev->status |= ASSOC_CONFIG_RSP;
+                }
+                Util_setEvent(&Collector_events, COLLECTOR_CONFIG_EVT);
+                Csf_deviceRawDataUpdate(pDataInd);
+#endif
                 break;
 
             case Smsgs_cmdIds_trackingRsp:
@@ -933,7 +1075,13 @@ static void dataIndCB(ApiMac_mcpsDataInd_t *pDataInd)
                 break;
 
             case Smsgs_cmdIds_sensorData:
+#ifndef PROCESS_JS
                 processSensorData(pDataInd);
+#else
+                Collector_statistics.sensorMessagesReceived++;
+                processDataRetry(&(pDataInd->srcAddr));
+                Csf_deviceRawDataUpdate(pDataInd);
+#endif
                 break;
 
             case Smsgs_cmdIds_rampdata:
@@ -946,6 +1094,9 @@ static void dataIndCB(ApiMac_mcpsDataInd_t *pDataInd)
 
             default:
                 /* Should not receive other messages */
+#ifdef PROCESS_JS
+                Csf_deviceRawDataUpdate(pDataInd);
+#endif
                 break;
         }
     }
@@ -963,7 +1114,6 @@ static void processStartEvent(void)
     /* See if there is existing network information */
     if(Csf_getNetworkInformation(&netInfo))
     {
-        Llc_deviceListItem_t *pDevList = NULL;
         uint16_t numDevices = 0;
 
 #ifdef FEATURE_MAC_SECURITY
@@ -972,43 +1122,8 @@ static void processStartEvent(void)
 #endif /* FEATURE_MAC_SECURITY */
 
         numDevices = Csf_getNumDeviceListEntries();
-        if (numDevices > 0)
-        {
-            /* Allocate enough memory for all know devices */
-            pDevList = (Llc_deviceListItem_t *)Csf_malloc(
-                            sizeof(Llc_deviceListItem_t) * numDevices);
-            if(pDevList)
-            {
-                uint8_t i = 0;
-
-                /* Use a temp pointer to cycle through the list */
-                Llc_deviceListItem_t *pItem = pDevList;
-                for(i = 0; i < numDevices; i++, pItem++)
-                {
-                    Csf_getDeviceItem(i, pItem);
-
-#ifdef FEATURE_MAC_SECURITY
-                    /* Add device to security device table */
-                    Cllc_addSecDevice(pItem->devInfo.panID,
-                                      pItem->devInfo.shortAddress,
-                                      &pItem->devInfo.extAddress,
-                                      pItem->rxFrameCounter);
-#endif /* FEATURE_MAC_SECURITY */
-                }
-            }
-            else
-            {
-                numDevices = 0;
-            }
-        }
-
         /* Restore with the network and device information */
-        Cllc_restoreNetwork(&netInfo, (uint8_t)numDevices, pDevList);
-
-        if (pDevList)
-        {
-            Csf_free(pDevList);
-        }
+        Cllc_restoreNetwork(&netInfo, (uint8_t)numDevices, NULL);
 
         restarted = true;
     }
@@ -1057,7 +1172,6 @@ static void processConfigResponse(ApiMac_mcpsDataInd_t *pDataInd)
 
         configRsp.pollingInterval = Util_buildUint32(pBuf[0], pBuf[1], pBuf[2],
                                                      pBuf[3]);
-
         pDev = findDevice(&pDataInd->srcAddr);
         if(pDev != NULL)
         {
@@ -1065,7 +1179,6 @@ static void processConfigResponse(ApiMac_mcpsDataInd_t *pDataInd)
             pDev->status &= ~ASSOC_CONFIG_SENT;
             pDev->status |= ASSOC_CONFIG_RSP;
         }
-
         /* Report the config response */
         Csf_deviceConfigUpdate(&pDataInd->srcAddr, pDataInd->rssi,
                                &configRsp);
@@ -1153,6 +1266,7 @@ static void processSensorData(ApiMac_mcpsDataInd_t *pDataInd)
     sensorData.frameControl = Util_buildUint16(pBuf[0], pBuf[1]);
     pBuf += 2;
 
+    /* Parse data in order of frameControl mask, starting with LSB */
     if(sensorData.frameControl & Smsgs_dataFields_tempSensor)
     {
         sensorData.tempSensor.ambienceTemp = Util_buildUint16(pBuf[0], pBuf[1]);
@@ -1235,6 +1349,12 @@ static void processSensorData(ApiMac_mcpsDataInd_t *pDataInd)
         sensorData.msgStats.interimDelay = Util_buildUint16(pBuf[0],
                                                             pBuf[1]);
         pBuf += 2;
+        sensorData.msgStats.numBroadcastMsgRcvd = Util_buildUint16(pBuf[0],
+                                                                   pBuf[1]);
+        pBuf += 2;
+        sensorData.msgStats.numBroadcastMsglost = Util_buildUint16(pBuf[0],
+                                                                   pBuf[1]);
+        pBuf += 2;
     }
 
     if(sensorData.frameControl & Smsgs_dataFields_configSettings)
@@ -1248,52 +1368,6 @@ static void processSensorData(ApiMac_mcpsDataInd_t *pDataInd)
                                                                      pBuf[1],
                                                                      pBuf[2],
                                                                      pBuf[3]);
-        pBuf += 4;
-    }
-
-    if(sensorData.frameControl & Smsgs_dataFields_pressureSensor)
-    {
-        sensorData.pressureSensor.pressureValue = Util_buildUint32(pBuf[0],
-                                                                    pBuf[1],
-                                                                    pBuf[2],
-                                                                    pBuf[3]);
-        pBuf += 4;
-        sensorData.pressureSensor.tempValue =  Util_buildUint32(pBuf[0],
-                                                                pBuf[1],
-                                                                pBuf[2],
-                                                                pBuf[3]);
-        pBuf += 4;
-    }
-
-    if(sensorData.frameControl & Smsgs_dataFields_motionSensor)
-    {
-      sensorData.motionSensor.isMotion = *pBuf++;
-    }
-
-    if(sensorData.frameControl & Smsgs_dataFields_batterySensor)
-    {
-
-      sensorData.batterySensor.voltageValue = Util_buildUint32(pBuf[0],
-                                                                     pBuf[1],
-                                                                     pBuf[2],
-                                                                     pBuf[3]);
-      pBuf +=4;
-    }
-
-    if(sensorData.frameControl & Smsgs_dataFields_hallEffectSensor)
-    {
-      sensorData.hallEffectSensor.isOpen = *pBuf++;
-      sensorData.hallEffectSensor.isTampered = *pBuf++;
-    }
-
-    if(sensorData.frameControl & Smsgs_dataFields_fanSensor)
-    {
-      sensorData.fanSensor.fanSpeed = *pBuf++;
-    }
-
-    if(sensorData.frameControl & Smsgs_dataFields_doorLockSensor)
-    {
-      sensorData.doorLockSensor.isLocked = *pBuf++;
     }
 
     Collector_statistics.sensorMessagesReceived++;
@@ -1419,6 +1493,10 @@ static uint8_t getMsduHandle(Smsgs_cmdIds_t msgType)
     {
         msduHandle |= APP_CONFIG_MSDU_HANDLE;
     }
+    else if(msgType == Smgs_cmdIds_broadcastCtrlMsg)
+    {
+        msduHandle |= APP_BROADCAST_MSDU_HANDLE;
+    }
 
     return (msduHandle);
 }
@@ -1447,7 +1525,7 @@ static bool sendMsg(Smsgs_cmdIds_t type, uint16_t dstShortAddr, bool rxOnIdle,
     dataReq.dstAddr.addr.shortAddr = dstShortAddr;
     dataReq.srcAddrMode = ApiMac_addrType_short;
 
-    if(fhEnabled && !LRM_MODE)
+    if(fhEnabled && rxOnIdle)
     {
         Llc_deviceListItem_t item;
 
@@ -1496,6 +1574,49 @@ static bool sendMsg(Smsgs_cmdIds_t type, uint16_t dstShortAddr, bool rxOnIdle,
     }
 }
 
+/*!
+ * @brief      Send MAC broadcast data request. Only supported in FH mode.
+ *
+ * @param      type - message type
+ * @param      len - length of payload
+ * @param      pData - pointer to the buffer
+ */
+static void sendBroadcastMsg(Smsgs_cmdIds_t type, uint16_t len,
+                    uint8_t *pData)
+{
+    ApiMac_mcpsDataReq_t dataReq;
+
+    /* Only supported for FH mode */
+    if(!fhEnabled)
+    {
+        return;
+    }
+    /* Fill the data request field */
+    memset(&dataReq, 0, sizeof(ApiMac_mcpsDataReq_t));
+
+    dataReq.dstAddr.addrMode = ApiMac_addrType_none;
+    dataReq.srcAddrMode = ApiMac_addrType_short;
+
+    dataReq.dstPanId = devicePanId;
+
+    dataReq.msduHandle = getMsduHandle(type);
+
+    dataReq.txOptions.ack = false;
+    dataReq.txOptions.indirect = false;
+
+
+    dataReq.msdu.len = len;
+    dataReq.msdu.p = pData;
+
+#ifdef FEATURE_MAC_SECURITY
+    /* Fill in the appropriate security fields */
+    Cllc_securityFill(&dataReq.sec);
+#endif /* FEATURE_MAC_SECURITY */
+
+    /* Send the message */
+    ApiMac_mcpsDataReq(&dataReq);
+}
+
 /*!
  * @brief      Generate Config Requests for all associate devices
  *             that need one.
@@ -1716,6 +1837,23 @@ static void generateTrackingRequests(void)
     }
 }
 
+/*!
+ * @brief      Generate Broadcast Cmd Request Message
+ */
+static void generateBroadcastCmd(void)
+{
+    uint8_t buffer[SMSGS_BROADCAST_CMD_LENGTH];
+    uint8_t *pBuf = buffer;
+
+    /* Build the message */
+    *pBuf++ = (uint8_t)Smgs_cmdIds_broadcastCtrlMsg;
+    *pBuf++ = Util_loUint16(Collector_statistics.broadcastMsgSentCnt);
+    *pBuf++ = Util_hiUint16(Collector_statistics.broadcastMsgSentCnt);
+
+    sendBroadcastMsg(Smgs_cmdIds_broadcastCtrlMsg, SMSGS_BROADCAST_CMD_LENGTH,
+                     buffer);
+}
+
 /*!
  * @brief      Generate Tracking Requests for a device
  *
@@ -1877,7 +2015,7 @@ static void processConfigRetry(void)
  */
 static void oadFwVersionRspCb(void* pSrcAddr, char *fwVersionStr)
 {
-    LOG_printf( LOG_ALWAYS, "oadFwVersionRspCb from %x\n", ((ApiMac_sAddr_t*)pSrcAddr)->addr.shortAddr);
+    LOG_printf( LOG_DBG_COLLECTOR, "oadFwVersionRspCb from %x\n", ((ApiMac_sAddr_t*)pSrcAddr)->addr.shortAddr);
     Csf_deviceSensorFwVerUpdate(((ApiMac_sAddr_t*)pSrcAddr)->addr.shortAddr, fwVersionStr);
 }
 
@@ -1896,7 +2034,7 @@ static void oadBlockReqCb(void* pSrcAddr, uint8_t imgId, uint16_t blockNum, uint
     uint32_t oad_file_idx;
     FILE *oadFile = NULL;
 
-    LOG_printf( LOG_ALWAYS, "oadBlockReqCb[%d:%x] from %x\n", imgId, blockNum, ((ApiMac_sAddr_t*)pSrcAddr)->addr.shortAddr);
+    LOG_printf( LOG_DBG_COLLECTOR, "oadBlockReqCb[%d:%x] from %x\n", imgId, blockNum, ((ApiMac_sAddr_t*)pSrcAddr)->addr.shortAddr);
 
     Csf_deviceSensorOadUpdate( ((ApiMac_sAddr_t*)pSrcAddr)->addr.shortAddr, imgId, blockNum, oadBNumBlocks);
 
@@ -1904,7 +2042,7 @@ static void oadBlockReqCb(void* pSrcAddr, uint8_t imgId, uint16_t blockNum, uint
     {
         if(oad_file_list[oad_file_idx].oad_file_id == imgId)
         {
-            LOG_printf( LOG_ALWAYS, "oadBlockReqCb: openinging %d:%d:%s\n", oad_file_idx,
+            LOG_printf( LOG_DBG_COLLECTOR, "oadBlockReqCb: openinging %d:%d:%s\n", oad_file_idx,
                                     oad_file_list[oad_file_idx].oad_file_id,
                                     oad_file_list[oad_file_idx].oad_file);
 
@@ -1919,7 +2057,7 @@ static void oadBlockReqCb(void* pSrcAddr, uint8_t imgId, uint16_t blockNum, uint
         fseek(oadFile, (blockNum * OAD_BLOCK_SIZE), SEEK_SET);
         byteRead = (int) fread(blockBuf, 1, OAD_BLOCK_SIZE, oadFile);
 
-        LOG_printf( LOG_ALWAYS, "oadBlockReqCb: read %d bytes from position %d of %p\n",
+        LOG_printf( LOG_DBG_COLLECTOR, "oadBlockReqCb: read %d bytes from position %d of %p\n",
                                                     byteRead, (blockNum * OAD_BLOCK_SIZE), oadFile);
 
         if(byteRead == 0)
@@ -1933,7 +2071,7 @@ static void oadBlockReqCb(void* pSrcAddr, uint8_t imgId, uint16_t blockNum, uint
     }
     else
     {
-      LOG_printf( LOG_ALWAYS, "imgId %d file not found\n", imgId);
+      LOG_printf( LOG_DBG_COLLECTOR, "imgId %d file not found\n", imgId);
     }
 }
 
@@ -1987,6 +2125,44 @@ static OADProtocol_Status_t oadRadioAccessPacketSend(void* pDstAddr, uint8_t *pM
 
     return status;
 }
+
+/*!
+ Build and send the buzzer ctrl message to a device.
+
+ Public function defined in collector.h
+ */
+Collector_status_t Collector_sendBuzzerCtrlRequest(ApiMac_sAddr_t *pDstAddr)
+{
+    Collector_status_t status = Collector_status_invalid_state;
+
+    /* Are we in the right state? */
+    if (cllcState >= Cllc_states_started)
+    {
+        Llc_deviceListItem_t item;
+
+        /* Is the device a known device? */
+        if (Csf_getDevice(pDstAddr, &item))
+        {
+            uint8_t buffer[SMSGS_BUZZER_CTRL_REQUEST_MSG_LEN];
+
+            /* Build the message */
+            buffer[0] = (uint8_t)Smsgs_cmdIds_buzzerCtrlReq;
+
+            sendMsg(Smsgs_cmdIds_buzzerCtrlReq, item.devInfo.shortAddress,
+                    item.capInfo.rxOnWhenIdle,
+                    SMSGS_BUZZER_CTRL_REQUEST_MSG_LEN,
+                    buffer);
+
+            status = Collector_status_success;
+        }
+        else
+        {
+            status = Collector_status_deviceNotFound;
+        }
+    }
+
+    return (status);
+}
 /*
  *  ========================================
  *  Texas Instruments Micro Controller Style
index 3aae923b4aad2c3b8ab8830a15e2255f303147c8..cf990e302c4fa5fa9d475253be38cc8ce3cbe97f 100644 (file)
@@ -1,32 +1,32 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ; @file collector.cfg
 ;
-; @brief TIMAC 2.0 Main application configuration file
+; @brief TIMAC 2.0 Main application configuration file 
 ;
 ; Group: WCS LPC
-; $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+; $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 ;
 ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ; $License: BSD3 2016 $
-;
+;  
 ;   Copyright (c) 2015, 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
@@ -40,7 +40,7 @@
 ;   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ; $Release Name: TI-15.4Stack Linux x64 SDK$
-; $Release Date: Jun 28, 2017 (2.02.00.03)$
+; $Release Date: Sept 27, 2017 (2.04.00.13)$
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 [log]
        ; flag = everything
        ;----------------------------------------
        ; Sometimes you want EVERYTHING - except some things..
-       ; names startign with "not-" turn *OFF* the flag
+       ; names starting with "not-" turn *OFF* the flag 
        ; These are good examples to turn off.
        ; Uncomment as desired
        ; flag = not-sys_dbg_mutex
        ; flag = not-sys_dbg_thread
        ; flag = not-sys_dbg_fifo
        ; flag = not-sys_dbg_uart
+       ; flag = not-sys_dbg_uart_raw
        ; flag = not-sys_dbg_sleep
        ; flag = not-sys_dbg_socket
+       ; flag = not-sys_dbg_socket_raw
+       ; flag = not-sys_dbg_collector
+       ; flag = not-sys_dbg_collector_raw
+       ; flag = not-appsrv-connections
+       ; flag = not-appsrv-broadcasts
+       ; flag = not-appsrv-msg-content
        ; flag = not-nv-debug
        ; flag = not-nv-rdwr
        ;----------------------------------------
        server_backlog = 5
        ; Limit to inet4, not inet6
        inet = 4
-
+       
 ; If collector application connects to an NPI SERVER (ie: npi_server2), this is how it connects
 [npi-socket-cfg]
        type = client
        inet = 4
 
 ; If collector app connects directly to a UART (no-npi-server) this is how to connect.
-[uart-cfg]
+[uart-cfg] 
        ;; Launchpads use USB and show up as: /dev/ttyACM0 and ACM1
        ;; Solutions using an FTDI or Prolific cable use /dev/ttyUSB0 or USB1
        ;; Hard serial ports are: /dev/ttyS0 to ttyS9
        len-2bytes = false
        ; When flushing (tossing) wait for 50mSec to see when the IO is quite
        flush-timeout-msecs = 50
-
+       
 ; Please refer to the UART-INTERFACE for more details
 ; This is the protocol specifics when using the NPI-SERVER
 [npi-socket-interface]
        len-2bytes = true
        ; when flushing the IO - wat at most 10mSecs
        flush-timeout-msecs = 10
-
+       
 [application]
-       ; Do not reload the NV settings, start fresh each time
-       load-nv-sim = false
+       ; Set to false to not reload the NV settings and start fresh each time
+       load-nv-sim = true
 
-       ;The collector app can use either a socket or uart connection to the co-processor
-       ;; Alternatively:  'interface = socket'
+       ; The collector app can use either a socket or uart connection to the co-processor
+       ; Alternatively:  'interface = socket'
        interface = uart
 
-       ; Many of the "config-ITEMS" allow for direct configuration
+       ; Many of the "config-ITEMS" allow for direct configuration 
        ; and overriding the 'config.h' default values
 
        ; Automatically start the device in the network.
        config-channel-page = 9
 
        ; Coordinator short address.
-       config-coord-short-addr = 0x1234
+       config-coord-short-addr = 0xaabb
 
        ; To enable Doubling of PA/PC trickle time,
        ; useful when network has non sleepy nodes and
        ; stay on a specific channel before hopping to the next.
        config-dwell-time = 250
 
+       ; Application Broadcast Msg generation interval.
+       ; Value should be set greater than 200 ms,
+       ; When set to a non zero value, it will cause all joined
+       ; sleepy devices to be awake for 200 ms every broadcast msg interval.
+       ; If set to 0, it shall disable broadcast messages and will not cause
+       ; sleepy devices any additional power overhead.
+       config-broadcast-interval = 10000
+
+       ; The number of non sleepy channel hopping end devices to be supported.
+       ; It is to be noted that the total number of non sleepy devices supported
+       ; must be less than 50. Stack will allocate memory proportional
+       ; to the number of end devices requested.
+       config-fh-num-non-sleepy-hopping-neighbors = 5
+
+       ; The number of non sleepy fixed channel end devices to be supported.
+       ; It is to be noted that the total number of non sleepy devices supported
+       ; must be less than 50. Stack will allocate memory proportional
+       ; to the number of end devices requested.
+       config-fh-num-sleepy-non-sleepy-fixed-channel-neighbors = 5
+
+       ; Configure the FH broadcast dwell time
+       config-fh-broadcast-dwell-time = 100
+
        ; List of channels to target the Async frames.
        ; Each decimal number in the list represents a corresponding channel to
        ; be scanned.
        ; Configure value for the ApiMac_FHAttribute_netName.
        config-fh-netname = "FHTest"
 
-       ; Configure value for PAN size PIB.
-       config-fh-pan-size = 0x0032
-
-       ; The device will respond to an enhanced beacon requet if mpduLinkQuality
-       ; is higher than or equal to this value.
-       config-linkquality = 1
-
        ; Setting beacon order to 15 will disable the beacon, 8 is a good value for
        ; beacon mode
        config-mac-beacon-order = 15
        ; Setting superframe order to 15 will disable the superframe, 8 is a good value
        ; for beacon mode
        config-mac-superframe-order = 15
+
        ; Personal Area network ID
        config-pan-id = 0xAcDc
-       ; The device shall randomly determine if it is to respond to the enhanced
-       ; beacon request based on meeting this probability 0-100% (0-0xff).
-       config-percentfilter = 0x0ff
 
        ; PHY Configuration ID, set the ID to one of the below ID's
        ; e.g. 3 for 863 MHz
        ; - 863MHz ETSI Frequency band operating mode #3: 3
        ; - 433MHz China Frequency band operating mode #3: 128
        ;
-       ; - 915MHz US Frequency band Long Range operating mode: 129
-       ; - 433MHz China Frequency band Long Range operating mode: 130
-       ; - 863MHz ETSI Frequency band Long Range operating mode: 132
+       ; - 915MHz US Frequency band Long Range operating mode #1: 129
+       ; - 433MHz China Frequency band Long Range operating mode #1: 130
+       ; - 863MHz ETSI Frequency band Long Range operating mode #1: 131
+       ;
+       ; - 915MHz US Frequency band operating mode # 3: 132
+       ; - 863MHz ETSI Frequency band operating mode #2: 133
        config-phy-id = 1
+       
+       ; Minimum MAC Backoff Exponent
+       config-min-backoff = 3
+       
+       ; Maximum MAC Backoff Exponent
+       config-max-backoff = 5
+       
+       ; Maximum CSMA Backoff
+       config-max-csma-backoff = 4
+
+       ; Maximum Frame Retries
+       config-max-retries = 3
+
+       ; Reporting Interval - in milliseconds to be set on connected devices using
+       ; configuration request messages
+       config-reporting-interval = 90000
+
+       ; Polling interval in milliseconds to be set on connected devices using
+       ; configuration request messages. Must be greater than or equal to default
+       ; polling interval set on sensor devices
+       config-polling-interval = 6000
+
+       ; Time interval in ms between tracking message intervals
+       config-tracking-delay-time = 60000
 
        ; The exponent used in the scan duration calculation.
        config-scan-duration = 5
        ; the allowed values are between 18, 23, 25, 26 and 27dBm.
        ; When the nodes in the network are close to each other
        ; lowering this value will help reduce saturation.
-       config-tx-power = 14
+       config-tx-power = 2
 
        ; The maximum trickle timer window for PAN Advertisement
        ; and PAN Configuration frame transmissions.
        ; Recommended value is half of the PAS/CS MIN timer.
-       config-trickle-max-clk-duration = 960000
+       config-trickle-max-clk-duration = 6000
 
        ; The minimum trickle timer window for PAN Advertisement,
        ; and PAN Configuration frame transmissions.
-       config-trickle-min-clk-duration =  30000
-
-       config-reporting-interval = 5000
-       config-polling-interval = 6000
+       config-trickle-min-clk-duration =  3000
 
        ; MAC API debug configuration file
        ; msg-dbg-data = apimac-msgs.cfg
-
-
-
index 3cb4f3fd57f66fceef9a18c6d202098e51844473..046f0bb512a32d1a1df1fae89ef22acda79665b4 100644 (file)
@@ -5,7 +5,7 @@
  @brief TIMAC 2.0 Collector Example Application Header
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -41,7 +41,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 #ifndef COLLECTOR_H
 #define COLLECTOR_H
@@ -70,6 +70,8 @@ extern "C"
 #define COLLECTOR_TRACKING_TIMEOUT_EVT 0x0002
 /*! Event ID - Generate Configs Event */
 #define COLLECTOR_CONFIG_EVT 0x0004
+/*! Event ID - Broadcast Timeout Event */
+#define COLLECTOR_BROADCAST_TIMEOUT_EVT 0x0008
 
 /*! Collector Status Values */
 typedef enum
@@ -140,6 +142,8 @@ typedef struct
     uint32_t txTransactionExpired;
     /* Total transaction Overflow error */
     uint32_t txTransactionOverflow;
+    /* Total broadcast messages sent */
+    uint16_t broadcastMsgSentCnt;
 } Collector_statistics_t;
 
 /******************************************************************************
@@ -190,16 +194,6 @@ extern Collector_status_t Collector_sendConfigRequest(ApiMac_sAddr_t *pDstAddr,
                 uint32_t reportingInterval,
                 uint32_t pollingInterval);
 
-/*!
- * @brief Find if device exists.
- *
- * @param pAddr - Address of device
- *
- * @return Collector_status_success
- *         or Collector_status_deviceNotFound
- */
-extern Collector_status_t Collector_findDevice(ApiMac_sAddr_t *pAddr);
-
 /*!
  * @brief Update the collector statistics
  */
@@ -237,7 +231,7 @@ extern Collector_status_t Collector_sendFwVersionRequest(
                 ApiMac_sAddr_t *pDstAddr);
 
 /*!
- * @brief .Check a device exists
+ * @brief Check if a device exists
  *
  * @param pAddr - destination address of the device
  *
@@ -257,6 +251,17 @@ extern Collector_status_t Collector_findDevice(
  */
 extern Collector_status_t Collector_startFwUpdate(ApiMac_sAddr_t *pDstAddr, uint32_t oad_file_id);
 
+/*!
+ * @brief Build and send the toggle led message to a device.
+ *
+ * @param pDstAddr - destination address of the device to send the message
+ *
+ * @return Collector_status_success, Collector_status_invalid_state
+ *         or Collector_status_deviceNotFound
+ */
+extern Collector_status_t Collector_sendBuzzerCtrlRequest(
+    ApiMac_sAddr_t *pDstAddr);
+
 #ifdef __cplusplus
 }
 #endif
index 450000c6ba0d809290ef707d2e9e428565c7548c..b7a4520ad2e7944e9df91f115a66320f8c3e8dfe 100644 (file)
@@ -5,7 +5,7 @@
  @brief Sub1G Over the Air Download Protocol Module
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -41,7 +41,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 /***** Includes *****/
index b1a120ee56435c2b3d0c150963be60c5c2a6726c..a43bb9e9d2a235a7bd60dc1c5248e5c9e9c8d0be 100644 (file)
@@ -5,7 +5,7 @@
  @brief OAD Protocol Header
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -41,7 +41,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 /*!*****************************************************************************
  *  @file       oad_protocol.h
 
 #define OADProtocol_PKT_CMDID_OFFSET   0   ///< Offset to packet type files in packet header
 
+#define OADProtocol_IMAGE_ID_LEN 16
+
 /*!
  * Req/Rsp Packet Types
  */
index fb4dbc98f1da9fb119ff28e154ea0126b56b838d..98e096ccc86595a7836a80df52daa117fc7f82b8 100644 (file)
@@ -5,7 +5,7 @@
  @brief OAD Target Header
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -41,7 +41,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 #ifndef OAD_TARGET_H
 #define OAD_TARGET_H
@@ -81,6 +81,10 @@ extern "C"
 #define OAD_BLOCK_SIZE         128
 #endif //OAD_BLOCK_SIZE
 
+#if (OAD_BLOCK_SIZE % 16)
+#error "OAD_BLOCK_SIZE must be a multiple of 16"
+#endif
+
 #define OAD_BLOCKS_PER_PAGE    (HAL_FLASH_PAGE_SIZE / OAD_BLOCK_SIZE)
 #define OAD_BLOCK_MAX          (OAD_BLOCKS_PER_PAGE * OAD_IMG_D_AREA)
 
diff --git a/example/collector/common/util/board_gpio.h b/example/collector/common/util/board_gpio.h
new file mode 100644 (file)
index 0000000..d6d1959
--- /dev/null
@@ -0,0 +1,116 @@
+/******************************************************************************
+
+ @file board_gpio.h
+
+ @brief This file contains the RF GPIO Service definitions and prototypes.
+
+ Group: WCS LPC
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
+
+ ******************************************************************************
+ $License: BSD3 2016 $
+  
+   Copyright (c) 2015, 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.
+ ******************************************************************************
+ $Release Name: TI-15.4Stack Linux x64 SDK$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
+ *****************************************************************************/
+#ifndef BOARD_GPIO_H
+#define BOARD_GPIO_H
+
+/******************************************************************************
+ Includes
+ *****************************************************************************/
+#if !defined(COPROCESSOR)
+#include "config.h"
+#endif
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/*!
+ \defgroup BoardGPIO Board GPIO Functions
+ <BR>
+ This module is a collection of functions to control GPIOs.
+ <BR>
+ */
+
+/******************************************************************************
+ Typedefs
+ *****************************************************************************/
+
+/*!
+ * \ingroup Board GPIOs
+ * @{
+ */
+
+/*! GPIO Identifications */
+typedef enum
+{
+#if defined(CC13XX_LAUNCHXL) || defined(CC13X2R1_LAUNCHXL)
+    board_rfSwitch_select,
+#if defined(CC13XX_LAUNCHXL) && !defined(COPROCESSOR)
+#if (CONFIG_RANGE_EXT_MODE == APIMAC_NO_EXTENDER)
+    board_rfSwitch_pwr,
+#endif
+#endif
+#endif
+    NO_OF_GPIOS
+} board_gpio_type;
+
+/******************************************************************************
+ API Functions
+ *****************************************************************************/
+
+/*!
+ * @brief   Initialize GPIO System
+ */
+void Board_Gpio_initialize(void);
+
+/*!
+ * @brief   Control the state of an GPIO
+ *
+ * @param   gpio - Which GPIO
+ * @param   state - set to ON or OFF,
+ *
+ */
+void Board_Gpio_control(board_gpio_type gpio, uint32_t value);
+
+/*! @} end group BoardGPIO */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BOARD_LED_H */
index 453a4d4e2296f76932d908a980c628cba91f5038..9556ebfa5b1af03838f638e023670a804f3b1efd 100644 (file)
@@ -5,7 +5,7 @@
  @brief This file contains the LCD Service definitions and prototypes.
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -41,7 +41,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 #ifndef BOARD_LCD_H
 #define BOARD_LCD_H
@@ -72,6 +72,10 @@ extern "C"
  * @{
  */
 
+#if defined(BOARD_DISPLAY_USE_LCD) && defined(BOARD_DISPLAY_USE_UART)
+#error "can't enable both BOARD_DISPLAY_USE_LCD and BOARD_DISPLAY_USE_UART"
+#endif
+
 /*! LCD macros */
 #if defined(BOARD_DISPLAY_USE_LCD) || defined(BOARD_DISPLAY_USE_UART)
 /*! Macro definition to write a string to the LCD */
index b70f08bdd7a7bf0b7f6635b5dc888543c4e4fd3e..9c52a5ea2edc45555555ee6b3d67da54e9683483 100644 (file)
@@ -5,7 +5,7 @@
  @brief TI-15.4 Stack configuration parameters for Collector applications
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -41,7 +41,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 #ifndef CONFIG_H
 #define CONFIG_H
@@ -49,6 +49,7 @@
 /******************************************************************************
  Includes
  *****************************************************************************/
+#include "api_mac.h"
 
 #ifdef __cplusplus
 extern "C"
@@ -63,10 +64,10 @@ extern "C"
 /*
    NOTE ABOUT CONFIGURATION PARAMTERS
    ----------------------------------
-   In the embedded device, these are hard coded configuration items
-   In the Linux impimentation the are configurable in 2 ways.
+   In the embedded device, these are hard coded configuration items.
+   In the Linux impimentation they are configurable in 2 ways:
    Method #1 via hard coding with the _DEFAULT value.
-   Method #2 via the "appsrv.cfg" configuration file.
+   Method #2 via the "*.cfg" configuration file.
    This "extern bool" hidden via the macro exists to facilitate
    the linux configuration scheme.
  */
@@ -97,15 +98,6 @@ extern bool linux_CONFIG_FH_ENABLE;
 
 /*! maximum beacons possibly received */
 #define CONFIG_MAX_BEACONS_RECD      200
-/*! link quality */
-extern uint8_t linux_CONFIG_LINKQUALITY;
-#define CONFIG_LINKQUALITY           linux_CONFIG_LINKQUALITY
-#define CONFIG_LINKQUALITY_DEFAULT  1
-
-/*! percent filter */
-extern uint8_t linux_CONFIG_PERCENTFILTER;
-#define CONFIG_PERCENTFILTER         linux_CONFIG_PERCENTFILTER
-#define CONFIG_PERCENTFILTER_DEFAULT 0xFF
 
 /*! maximum devices in association table */
 #define CONFIG_MAX_DEVICES           50
@@ -143,10 +135,78 @@ extern int linux_CONFIG_CHANNEL_PAGE;
 #error "PHY ID is wrong."
 #endif
 
-/*! Scan duration */
+/*! MAC Parameter */
+/*! Min BE - Minimum Backoff Exponent */
+extern int linux_CONFIG_MIN_BE;
+#define CONFIG_MIN_BE linux_CONFIG_MIN_BE
+#define CONFIG_MIN_BE_DEFAULT 3
+
+/*! Max BE - Maximum Backoff Exponent */
+extern int linux_CONFIG_MAX_BE;
+#define CONFIG_MAX_BE linux_CONFIG_MAX_BE
+#define CONFIG_MAX_BE_DEFAULT 5
+
+/*! MAC MAX CSMA Backoffs */ 
+extern int linux_CONFIG_MAC_MAX_CSMA_BACKOFFS;
+#define CONFIG_MAC_MAX_CSMA_BACKOFFS linux_CONFIG_MAC_MAX_CSMA_BACKOFFS
+#define CONFIG_MAC_MAX_CSMA_BACKOFFS_DEFAULT 4
+
+/*! macMaxFrameRetries - Maximum Frame Retries */
+extern int linux_CONFIG_MAX_RETRIES;
+#define CONFIG_MAX_RETRIES linux_CONFIG_MAX_RETRIES
+#define CONFIG_MAX_RETRIES_DEFAULT 3
+
+/* Linux variable names for Applciation traffic profile */
+extern int linux_CONFIG_REPORTING_INTERVAL;
+#define CONFIG_REPORTING_INTERVAL         linux_CONFIG_REPORTING_INTERVAL
+
+extern int linux_CONFIG_POLLING_INTERVAL;
+#define CONFIG_POLLING_INTERVAL         linux_CONFIG_POLLING_INTERVAL
+
+extern int linux_TRACKING_DELAY_TIME;
+#define TRACKING_DELAY_TIME         linux_TRACKING_DELAY_TIME
+
+/*! Application traffic profile */
+#if (((CONFIG_PHY_ID >= APIMAC_MRFSK_STD_PHY_ID_BEGIN) && (CONFIG_PHY_ID <= APIMAC_MRFSK_GENERIC_PHY_ID_BEGIN)) || \
+    ((CONFIG_PHY_ID >= APIMAC_GENERIC_US_915_PHY_132) && (CONFIG_PHY_ID <= APIMAC_GENERIC_ETSI_863_PHY_133)))
+/*!
+ Reporting Interval - in milliseconds to be set on connected devices using
+ configuration request messages
+ */
+#define CONFIG_REPORTING_INTERVAL_DEFAULT 90000
+
+/*!
+ Polling interval in milliseconds to be set on connected devices using
+ configuration request messages. Must be greater than or equal to default
+ polling interval set on sensor devices
+ */
+#define CONFIG_POLLING_INTERVAL_DEFAULT 6000
+
+/*!
+ Time interval in ms between tracking message intervals
+ */
+#define TRACKING_DELAY_TIME_DEFAULT 60000
+#else
+/*!
+ Reporting Interval - in milliseconds to be set on connected devices using
+ configuration request messages
+ */
+#define CONFIG_REPORTING_INTERVAL_DEFAULT 300000
+/*!
+ Polling interval in milliseconds to be set on connected devices using
+ configuration request messages. Must be greater than or equal to default
+ polling interval set on sensor devices
+ */
+#define CONFIG_POLLING_INTERVAL_DEFAULT 60000
+/*!
+ Time interval in ms between tracking message intervals
+ */
+#define TRACKING_DELAY_TIME_DEFAULT 300000
+#endif
+
 extern uint8_t linux_CONFIG_SCAN_DURATION;
 #define CONFIG_SCAN_DURATION         linux_CONFIG_SCAN_DURATION
-
+/*! scan duration in seconds */
 #define CONFIG_SCAN_DURATION_DEFAULT 5
 
 extern int linux_CONFIG_RANGE_EXT_MODE;
@@ -217,23 +277,23 @@ extern uint8_t linux_FH_ASYNC_CHANNEL_MASK[APIMAC_154G_CHANNEL_BITMAP_SIZ];
 
 /* FH related config variables */
 /*!
- The number of non sleepy end devices to be supported.
- It is to be noted that the total number of devices supported (sleepy/
non sleepy) must be less than 50. Stack will allocate memory proportional
+ The number of non sleepy channel hopping end devices to be supported.
+ It is to be noted that the total number of non sleepy devices supported
+  must be less than 50. Stack will allocate memory proportional
  to the number of end devices requested.
  */
-extern int linux_FH_NUM_NON_SLEEPY_NEIGHBORS;
-#define FH_NUM_NON_SLEEPY_NEIGHBORS  linux_FH_NUM_NON_SLEEPY_NEIGHBORS
-#define FH_NUM_NON_SLEEPY_NEIGHBORS_DEFAULT 0
+extern int linux_FH_NUM_NON_SLEEPY_HOPPING_NEIGHBORS;
+#define FH_NUM_NON_SLEEPY_HOPPING_NEIGHBORS  linux_FH_NUM_NON_SLEEPY_HOPPING_NEIGHBORS
+#define FH_NUM_NON_SLEEPY_HOPPING_NEIGHBORS_DEFAULT 5
 /*!
- The number of sleepy end devices to be supported.
- It is to be noted that the total number of devices supported (sleepy/
non sleepy) must be less than 50. Stack will allocate memory proportional
+ The number of non sleepy fixed channel end devices to be supported.
+ It is to be noted that the total number of non sleepy devices supported
+  must be less than 50. Stack will allocate memory proportional
  to the number of end devices requested.
  */
-extern int linux_FH_NUM_SLEEPY_NEIGHBORS;
-#define FH_NUM_SLEEPY_NEIGHBORS  linux_FH_NUM_SLEEPY_NEIGHBORS
-#define FH_NUM_SLEEPY_NEIGHBORS_DEFAULT 50
+extern int linux_FH_NUM_NON_SLEEPY_FIXED_CHANNEL_NEIGHBORS;
+#define FH_NUM_NON_SLEEPY_FIXED_CHANNEL_NEIGHBORS  linux_FH_NUM_NON_SLEEPY_FIXED_CHANNEL_NEIGHBORS
+#define FH_NUM_NON_SLEEPY_FIXED_CHANNEL_NEIGHBORS_DEFAULT 5
 
 /*!
  Dwell time: The duration for which the collector will
@@ -243,6 +303,19 @@ extern int linux_CONFIG_DWELL_TIME;
 #define CONFIG_DWELL_TIME            linux_CONFIG_DWELL_TIME
 #define CONFIG_DWELL_TIME_DEFAULT    250
 
+/*!
+ FH Application Broadcast Msg generation interval in ms.
+ Value should be set at least greater than 200 ms,
+ */
+extern int linux_FH_BROADCAST_INTERVAL;
+#define FH_BROADCAST_INTERVAL            linux_FH_BROADCAST_INTERVAL
+#define FH_BROADCAST_INTERVAL_DEFAULT    10000
+
+/*! FH Broadcast dwell time */
+extern int linux_FH_BROADCAST_DWELL_TIME;
+#define FH_BROADCAST_DWELL_TIME            linux_FH_BROADCAST_DWELL_TIME
+#define FH_BROADCAST_DWELL_TIME_DEFAULT    100
+
 /*!
  The minimum trickle timer window for PAN Advertisement,
  and PAN Configuration frame transmissions.
@@ -258,7 +331,9 @@ extern int linux_CONFIG_TRICKLE_MIN_CLK_DURATION;
 extern int linux_CONFIG_TRICKLE_MAX_CLK_DURATION;
 #define CONFIG_TRICKLE_MAX_CLK_DURATION    linux_CONFIG_TRICKLE_MAX_CLK_DURATION
 
-#if ((CONFIG_PHY_ID_DEFAULT >= APIMAC_MRFSK_STD_PHY_ID_BEGIN) && (CONFIG_PHY_ID_DEFAULT <= APIMAC_MRFSK_GENERIC_PHY_ID_BEGIN))
+#if (((CONFIG_PHY_ID_DEFAULT >= APIMAC_MRFSK_STD_PHY_ID_BEGIN) && (CONFIG_PHY_ID_DEFAULT <= APIMAC_MRFSK_GENERIC_PHY_ID_BEGIN)) || \
+    ((CONFIG_PHY_ID_DEFAULT >= APIMAC_GENERIC_US_915_PHY_132) && (CONFIG_PHY_ID_DEFAULT <= APIMAC_GENERIC_ETSI_863_PHY_133)))
+
 #define CONFIG_TRICKLE_MIN_CLK_DURATION_DEFAULT 3000
 #define CONFIG_TRICKLE_MAX_CLK_DURATION_DEFAULT 6000
 #else
@@ -275,11 +350,6 @@ extern int linux_CONFIG_TRICKLE_MAX_CLK_DURATION;
 #define CONFIG_TRICKLE_MAX_CLK_DURATION_DEFAULT 60000
 #endif
 
-/* default value for PAN Size PIB */
-extern int linux_CONFIG_FH_PAN_SIZE;
-#define CONFIG_FH_PAN_SIZE             linux_CONFIG_FH_PAN_SIZE
-#define CONFIG_FH_PAN_SIZE_DEFAULT     0x0032
-
 /*!
  To enable Doubling of PA/PC trickle time,
  useful when network has non sleepy nodes and
index de41b98155abe7e126e853d3b41d3006e06a916e..401e019862e7ba4c52a619d6048cac417cbd6227 100644 (file)
@@ -5,7 +5,7 @@
  @brief Collector Specific Functions API
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -41,7 +41,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 #ifndef CSF_H
 #define CSF_H
@@ -247,6 +247,18 @@ extern void Csf_initializeTrackingClock(void);
  */
 extern void Csf_setTrackingClock(uint32_t trackingTime);
 
+/*!
+ * @brief       Initialize the broadcast clock.
+ */
+extern void Csf_initializeBroadcastClock(void);
+
+/*!
+ * @brief       set the broadcast cmd clock.
+ *
+ * @param       broadcast time - set timer this value (in msec)
+ */
+extern void Csf_setBroadcastClock(uint32_t trackingTime);
+
 /*!
  * @brief       Initialize the trickle timer clock
  */
@@ -300,6 +312,16 @@ extern uint16_t Csf_getNumDeviceListEntries(void);
  */
 extern uint16_t Csf_getDeviceShort(ApiMac_sAddrExt_t *pExtAddr);
 
+/*!
+ * @brief       Find the extended address froma given short address
+ *
+ * @param       shortAddr - short address used to find the device
+ * @param       pExtAddr - Memory location to copy the found extended address to.
+ *
+ * @return      true if found and extended address is copied to pExtAddr, false if not
+ */
+bool Csf_getDeviceExtended(uint16_t shortAddr, ApiMac_sAddrExt_t *pExtAddr);
+
 /*!
  * @brief       Find entry in device list from an address
  *
@@ -406,6 +428,18 @@ extern bool Csf_isConfigTimerActive(void);
  */
 extern bool Csf_isTrackingTimerActive(void);
 
+#ifdef PROCESS_JS
+/*!
+ * @brief       The application calls this function to indicate that a device
+ *              has reported raw sensor data.
+ *
+ *              The information will be saved.
+ *
+ * @param       pDataInd - raw inbound data
+ */
+extern void Csf_deviceRawDataUpdate(ApiMac_mcpsDataInd_t *pDataInd);
+#endif
+
 #ifdef __cplusplus
 }
 #endif
index 4a96130f3835b5e8cd8d582f413296d7ce33efd1..70ed13f1f03a557d8876f0694548cc9eddbd31ac 100644 (file)
@@ -5,7 +5,7 @@
  @brief Collector Specific Functions
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -41,7 +41,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #if (defined(_MSC_VER) || defined(__linux__))
@@ -59,7 +59,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <stdint.h>
-/* #include <unistd.h> */
+#include <unistd.h>
 #include "nvintf.h"
 #include "nv_linux.h"
 
 #define CSF_MAX_BLACKLIST_ENTRIES 10
 
 /* Maximum number of device list entries */
-#define CSF_MAX_DEVICELIST_ENTRIES 50
+#define CSF_MAX_DEVICELIST_ENTRIES CONFIG_MAX_DEVICES
 
 /*
  Maximum sub ID for a blacklist item, this is failsafe.  This is
  not the maximum number of items in the list
  */
-#define CSF_MAX_BLACKLIST_IDS 100
+#define CSF_MAX_BLACKLIST_IDS (2*CONFIG_MAX_DEVICES)
 
 /*
  Maximum sub ID for a device list item, this is failsafe.  This is
  not the maximum number of items in the list
  */
-#define CSF_MAX_DEVICELIST_IDS 100
+#define CSF_MAX_DEVICELIST_IDS (2*CONFIG_MAX_DEVICES)
 
 /* timeout value for trickle timer initialization */
 #define TRICKLE_TIMEOUT_VALUE       20
@@ -220,9 +220,10 @@ static intptr_t tricklePAClkHandle;
 static intptr_t tricklePCClkHandle;
 /* handle for join permit timeout */
 static intptr_t joinClkHandle;
-
 /* handle for config request delay */
 static intptr_t configClkHandle;
+/* handle for broadcast interval */
+static intptr_t broadcastClkHandle;
 
 extern intptr_t semaphore0;
 /* Non-volatile function pointers */
@@ -235,7 +236,7 @@ NVINTF_nvFuncts_t nvFps;
 extern mac_Config_t Main_user1Cfg;
 #endif
 
-#endif /* IS_HLOS */
+#endif //IS_HLOS
 
 /******************************************************************************
  Local variables
@@ -251,6 +252,9 @@ static ICall_Semaphore collectorSem;
 static Clock_Struct trackingClkStruct;
 static Clock_Handle trackingClkHandle;
 
+static Clock_Struct broadcastClkStruct;
+static Clock_Handle broadcastClkHandle;
+
 /* Clock/timer resources for CLLC */
 /* trickle timer */
 STATIC Clock_Struct tricklePAClkStruct;
@@ -319,6 +323,7 @@ static void processPATrickleTimeoutCallback_WRAPPER(intptr_t thandle, intptr_t c
 static void processPCTrickleTimeoutCallback_WRAPPER(intptr_t thandle, intptr_t cookie);
 static void processJoinTimeoutCallback_WRAPPER(intptr_t thandle, intptr_t cookie);
 static void processConfigTimeoutCallback_WRAPPER(intptr_t thandle, intptr_t cookie);
+static void processBroadcastTimeoutCallback_WRAPPER(intptr_t thandle, intptr_t cookie);
 
 #ifndef IS_HEADLESS
 char* getConsoleCmd(void);
@@ -328,6 +333,7 @@ void initConsoleCmd(void);
 #endif
 
 static void processTackingTimeoutCallback(UArg a0);
+static void processBroadcastTimeoutCallback(UArg a0);
 static void processKeyChangeCallback(uint8_t keysPressed);
 static void processPATrickleTimeoutCallback(UArg a0);
 static void processPCTrickleTimeoutCallback(UArg a0);
@@ -382,6 +388,10 @@ void Csf_init(void *sem)
 #endif //!IS_HEADLESS
 
 #if IS_HLOS
+    LOG_printf(LOG_APPSRV_MSG_CONTENT, "TI Collector");
+#if !defined(AUTO_START)
+    LOG_printf(LOG_APPSRV_MSG_CONTENT, "Nwk: Starting\n");
+#endif /* AUTO_START */
 
 #ifndef IS_HEADLESS
     initConsoleCmd();
@@ -419,6 +429,7 @@ void Csf_init(void *sem)
         Csf_clearAllNVItems();
     }
 
+
 #ifndef IS_HEADLESS
     /* Initialize the LCD */
     Board_LCD_open();
@@ -430,6 +441,7 @@ void Csf_init(void *sem)
 
     Board_Led_initialize();
 
+
 #if defined(MT_CSF)
     {
         uint8_t resetReseason = 0;
@@ -465,7 +477,7 @@ void Csf_init(void *sem)
         }
     }
 #endif
-#endif /* IS_HLOS */
+#endif //IS_HLOS
 }
 
 /*!
@@ -497,12 +509,14 @@ void Csf_processEvents(void)
                 permitJoining = false;
                 duration = 0;
                 Board_Lcd_printf(DisplayLine_info, "Info: PermitJoin-OFF");
+                LOG_printf(LOG_APPSRV_MSG_CONTENT, "Info: PermitJoin-OFF\n");
             }
             else
             {
                 permitJoining = true;
                 duration = 0xFFFFFFFF;
                 Board_Lcd_printf(DisplayLine_info, "Info: PermitJoin-ON ");
+                LOG_printf(LOG_APPSRV_MSG_CONTENT, "Info: PermitJoin-ON\n");
             }
 
             /* Set permit joining */
@@ -517,6 +531,7 @@ void Csf_processEvents(void)
             }
 
             Board_Lcd_printf(DisplayLine_info, "Info: Selected device 0x%04x", selected_device);
+            LOG_printf(LOG_APPSRV_MSG_CONTENT, "Info: Selected device 0x%04x\n", selected_device);
         }
 
         if(Csf_keys == KEY_FW_VER_REQ)
@@ -524,6 +539,7 @@ void Csf_processEvents(void)
             ApiMac_sAddr_t sAddr;
 
             Board_Lcd_printf(DisplayLine_info, "Info: Sending 0x%04x FW version req", selected_device);
+            LOG_printf(LOG_APPSRV_MSG_CONTENT, "Info: Sending 0x%04x FW version req\n", selected_device);
 
             sAddr.addr.shortAddr = selected_device;
             sAddr.addrMode = ApiMac_addrType_short;
@@ -536,6 +552,7 @@ void Csf_processEvents(void)
             Collector_status_t status;
 
             Board_Lcd_printf(DisplayLine_info, "Info: Sending 0x%04x FW Update Req", selected_device);
+            LOG_printf(LOG_APPSRV_MSG_CONTENT, "Info: Sending 0x%04x FW Update Req\n", selected_device);
 
             sAddr.addr.shortAddr = selected_device;
             sAddr.addrMode = ApiMac_addrType_short;
@@ -544,23 +561,46 @@ void Csf_processEvents(void)
             if(status == Collector_status_invalid_file)
             {
                 Board_Lcd_printf(DisplayLine_info, "Info: Update req file not found ID:%d", selected_oad_file_id);
+                LOG_printf(LOG_APPSRV_MSG_CONTENT, "Info: Update req file not found ID:%d\n", selected_oad_file_id);
             }
             else if(status != Collector_status_success)
             {
                 Board_Lcd_printf(DisplayLine_info, "Info: Update req failed");
+                LOG_printf(LOG_APPSRV_MSG_CONTENT, "Info: Update req failed\n");
             }
         }
 
         if(Csf_keys == KEY_GET_OAD_FILE)
         {
             static char new_oad_file[256] = DEFUALT_OAD_FILE;
+            char temp_oad_file[256] = "";
 
-            if(sscanf(cmdBuff, "f %s", new_oad_file))
+            sscanf(cmdBuff, "f %s", temp_oad_file);
+
+            if(strlen(temp_oad_file) > 0)
             {
-                selected_oad_file_id = Collector_updateFwList(new_oad_file);
-            }
+                // Verify file exists and we have read permissions
+                if(access(temp_oad_file, F_OK | R_OK) != -1)
+                {
+                    // If file exists, then copy to the static filename and call updateFwList
+                    strncpy(new_oad_file, temp_oad_file, strlen(temp_oad_file) + 1);
+                    selected_oad_file_id = Collector_updateFwList(new_oad_file);
 
-            Board_Lcd_printf(DisplayLine_info, "Info: OAD file %s", new_oad_file);
+                    Board_Lcd_printf(DisplayLine_info, "Info: OAD file %s", new_oad_file);
+                    LOG_printf(LOG_APPSRV_MSG_CONTENT, "Info: OAD file %s\n", new_oad_file);
+                }
+                else
+                {
+                    Board_Lcd_printf(DisplayLine_info, "Info: Can not read file %s", temp_oad_file);
+                    LOG_printf(LOG_APPSRV_MSG_CONTENT, "Info: Can not read file %s\n", temp_oad_file);
+                }
+            }
+            else
+            {
+                // User is asking what the current file is
+                Board_Lcd_printf(DisplayLine_info, "Info: OAD file %s", new_oad_file);
+                LOG_printf(LOG_APPSRV_MSG_CONTENT, "Info: OAD file %s\n", new_oad_file);
+            }
         }
 
         if(Csf_keys == KEY_TOGGLE_REQ)
@@ -569,6 +609,7 @@ void Csf_processEvents(void)
             Collector_status_t status;
 
             Board_Lcd_printf(DisplayLine_info, "Info: Sending 0x%04x LED toggle req", selected_device);
+            LOG_printf(LOG_APPSRV_MSG_CONTENT, "Info: Sending 0x%04x LED toggle req\n", selected_device);
 
             sAddr.addr.shortAddr = selected_device;
             sAddr.addrMode = ApiMac_addrType_short;
@@ -577,17 +618,20 @@ void Csf_processEvents(void)
             if(status == Collector_status_deviceNotFound)
             {
                 Board_Lcd_printf(DisplayLine_info, "Info: Toggle Req device 0x%04x not found", selected_device);
+                LOG_printf(LOG_APPSRV_MSG_CONTENT, "Info: Toggle Req device 0x%04x not found\n", selected_device);
             }
             else if(status != Collector_status_success)
             {
                 Board_Lcd_printf(DisplayLine_info, "Info: Update Req failed");
+                LOG_printf(LOG_APPSRV_MSG_CONTENT, "Info: Update Req failed\n");
             }
         }
 
         if(Csf_keys == KEY_LIST_DEVICES)
         {
             ApiMac_sAddr_t sAddr;
-            uint32_t devIdx;
+            uint16_t devIdx;
+            ApiMac_sAddrExt_t pExtAddr;
 
             for(devIdx = 1; devIdx < CONFIG_MAX_DEVICES; devIdx++)
             {
@@ -596,7 +640,31 @@ void Csf_processEvents(void)
 
                 if(Collector_findDevice(&sAddr) == Collector_status_success)
                 {
-                    Board_Lcd_printf(DisplayLine_info, "Info: Device 0x%04x found", devIdx);
+                    if(Csf_getDeviceExtended(devIdx, &pExtAddr)) {
+                        Board_Lcd_printf(DisplayLine_info,
+                            "Short: 0x%04x Extended: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
+                            devIdx,
+                            pExtAddr[7],
+                            pExtAddr[6],
+                            pExtAddr[5],
+                            pExtAddr[4],
+                            pExtAddr[3],
+                            pExtAddr[2],
+                            pExtAddr[1],
+                            pExtAddr[0]);
+
+                        LOG_printf(LOG_DBG_COLLECTOR,"Short: 0x%04x Extended: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
+                            devIdx,
+                            pExtAddr[7],
+                            pExtAddr[6],
+                            pExtAddr[5],
+                            pExtAddr[4],
+                            pExtAddr[3],
+                            pExtAddr[2],
+                            pExtAddr[1],
+                            pExtAddr[0]);
+                    }
                 }
             }
         }
@@ -606,6 +674,7 @@ void Csf_processEvents(void)
             ApiMac_sAddr_t sAddr;
 
             Board_Lcd_printf(DisplayLine_info, "Info: Sending 0x%04x disassociation req", selected_device);
+            LOG_printf(LOG_APPSRV_MSG_CONTENT, "Info: Sending 0x%04x disassociation req\n", selected_device);
 
             sAddr.addr.shortAddr = selected_device;
             sAddr.addrMode = ApiMac_addrType_short;
@@ -613,6 +682,7 @@ void Csf_processEvents(void)
             if(!removeDevice(sAddr))
             {
                 Board_Lcd_printf(DisplayLine_info, "Info: disassociation req device 0x%04x not found", selected_device);
+                LOG_printf(LOG_APPSRV_MSG_CONTENT, "Info: disassociation req device 0x%04x not found\n", selected_device);
             }
         }
 
@@ -670,8 +740,8 @@ char* getConsoleCmd(void)
             cmd[cmdIdx] = ch;
         }
 
-        Board_Lcd_printf(DisplayLine_cmd, "cmd: %s", cmd)
-        //cmdIdx will wrap arounf for the 256Byte buffer
+        Board_Lcd_printf(DisplayLine_cmd, "cmd: %s", cmd);
+        /* cmdIdx will wrap around for the 256Byte buffer */
         if(cmd[cmdIdx] == 0xa)
         {
             cmdComplete = true;
@@ -684,6 +754,9 @@ char* getConsoleCmd(void)
 
     if(cmdComplete)
     {
+        Board_Lcd_printf(DisplayLine_cmd, "CMD: %s", cmd);
+        LOG_printf(LOG_APPSRV_MSG_CONTENT, "CMD: %s\n", cmd);
+        
         return cmd;
     }
     else
@@ -750,29 +823,29 @@ void Csf_networkUpdate(bool restored, Llc_netInfo_t *pNetworkInfo)
         {
              appsrv_networkUpdate(restored, pNetworkInfo);
         }
-#endif /* IS_HLOS */
+#endif //IS_HLOS
 
         started = true;
 
 #ifndef IS_HEADLESS
-        if(restored == false)
-        {
-            Board_Lcd_printf(DisplayLine_nwk, "Nwk: Started");
-        }
-        else
-        {
-            Board_Lcd_printf(DisplayLine_nwk, "Nwk: Started");
-        }
+        Board_Lcd_printf(DisplayLine_nwk, "Nwk: Started");
+#endif //IS_HEADLESS
+        LOG_printf(LOG_APPSRV_MSG_CONTENT, "Nwk: Started");
 
         if(pNetworkInfo->fh == false)
         {
+#ifndef IS_HEADLESS
             Board_Lcd_printf(DisplayLine_info, "Info: Channel %d", pNetworkInfo->channel);
+#endif //IS_HEADLESS
+            LOG_printf(LOG_APPSRV_MSG_CONTENT, "Info: Channel %d", pNetworkInfo->channel);
         }
         else
         {
+#ifndef IS_HEADLESS
             Board_Lcd_printf(DisplayLine_info, "Info: Freq. Hopping");
+#endif //IS_HEADLESS
+            LOG_printf(LOG_APPSRV_MSG_CONTENT, "Info: Freq. Hopping");
         }
-#endif //!IS_HEADLESS
 
         Board_Led_control(board_led_type_LED1, board_led_state_ON);
 
@@ -812,7 +885,7 @@ ApiMac_assocStatus_t Csf_deviceUpdate(ApiMac_deviceDescriptor_t *pDevInfo,
         LOG_printf(LOG_APPSRV_MSG_CONTENT,
                    "Denied: 0x%04x\n",
                    pDevInfo->shortAddress);
-#endif /* IS_HLOS */
+#endif //IS_HLOS
 
 #ifndef IS_HEADLESS
         Board_Lcd_printf(DisplayLine_info, "Info: Denied 0x%04x", pDevInfo->shortAddress);
@@ -834,7 +907,7 @@ ApiMac_assocStatus_t Csf_deviceUpdate(ApiMac_deviceDescriptor_t *pDevInfo,
 
 #if IS_HLOS
             LOG_printf(LOG_ERROR,"Failed: 0x%04x\n", pDevInfo->shortAddress);
-#endif /* IS_HLOS */
+#endif //IS_HLOS
 
 #ifndef IS_HEADLESS
             Board_Lcd_printf(DisplayLine_info, "Info: Join Failed 0x%04x", pDevInfo->shortAddress);
@@ -842,9 +915,19 @@ ApiMac_assocStatus_t Csf_deviceUpdate(ApiMac_deviceDescriptor_t *pDevInfo,
 
 #else /* NV_RESTORE */
         status = ApiMac_assocStatus_success;
+
 #if IS_HLOS
-        LOG_printf(LOG_ERROR,"Joined: 0x%04x\n", pDevInfo->shortAddress);
-#endif /* IS_HLOS */
+        LOG_printf(LOG_DBG_COLLECTOR_RAW, "Joined: Short: 0x%04x Extended: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
+            pDevInfo->shortAddress,
+            extAddr.addr.extAddr[7],
+            extAddr.addr.extAddr[6],
+            extAddr.addr.extAddr[5],
+            extAddr.addr.extAddr[4],
+            extAddr.addr.extAddr[3],
+            extAddr.addr.extAddr[2],
+            extAddr.addr.extAddr[1],
+            extAddr.addr.extAddr[0]);
+#endif //IS_HLOS
 
 #ifndef IS_HEADLESS
         Board_Lcd_printf(DisplayLine_info, "Info: Joined 0x%04x", pDevInfo->shortAddress);
@@ -857,9 +940,20 @@ ApiMac_assocStatus_t Csf_deviceUpdate(ApiMac_deviceDescriptor_t *pDevInfo,
 #if IS_HLOS
          /* Send update to the appClient */
             LOG_printf(LOG_APPSRV_MSG_CONTENT,
-                       "sending device update info to appsrv \n");
+                       "sending device update info to appsrv\n");
             appsrv_deviceUpdate(&dev);
-#endif /* IS_HLOS */
+
+            LOG_printf(LOG_DBG_COLLECTOR_RAW, "Joined: Short: 0x%04x Extended: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
+                pDevInfo->shortAddress,
+                extAddr.addr.extAddr[7],
+                extAddr.addr.extAddr[6],
+                extAddr.addr.extAddr[5],
+                extAddr.addr.extAddr[4],
+                extAddr.addr.extAddr[3],
+                extAddr.addr.extAddr[2],
+                extAddr.addr.extAddr[1],
+                extAddr.addr.extAddr[0]);
+#endif //IS_HLOS
 
 #ifndef IS_HEADLESS
             Board_Lcd_printf(DisplayLine_info, "Info: Joined 0x%04x", pDevInfo->shortAddress);
@@ -890,8 +984,10 @@ bool timeout)
     LOG_printf(LOG_APPSRV_MSG_CONTENT,
                "!Responding: 0x%04x\n",
                pDevInfo->shortAddress);
+
     appsrv_deviceNotActiveUpdate(pDevInfo, timeout);
-    LOG_printf( LOG_DBG_API_MAC_datastats,
+
+    LOG_printf(LOG_DBG_COLLECTOR,
                 "inactive: pan: 0x%04x short: 0x%04x ext: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
                 pDevInfo->panID,
                 pDevInfo->shortAddress,
@@ -903,7 +999,7 @@ bool timeout)
                 pDevInfo->extAddress[5],
                 pDevInfo->extAddress[6],
                 pDevInfo->extAddress[7]);
-#endif /* IS_HLOS */
+#endif //IS_HLOS
 
 #ifndef IS_HEADLESS
     Board_Lcd_printf(DisplayLine_info, "Info: No response 0x%04x", pDevInfo->shortAddress);
@@ -927,10 +1023,8 @@ void Csf_deviceConfigUpdate(ApiMac_sAddr_t *pSrcAddr, int8_t rssi,
 #if IS_HLOS
     /* send update to the appClient */
     appsrv_deviceConfigUpdate(pSrcAddr,rssi,pMsg);
-    LOG_printf(LOG_APPSRV_MSG_CONTENT,
-               "ConfigRsp: 0x%04x\n",
-               pSrcAddr->addr.shortAddr);
-#endif /* IS_HLOS */
+    LOG_printf(LOG_APPSRV_MSG_CONTENT, "ConfigRsp: 0x%04x\n", pSrcAddr->addr.shortAddr);
+#endif //IS_HLOS
 
 #ifndef IS_HEADLESS
     Board_Lcd_printf(DisplayLine_info, "Info: ConfigRsp 0x%04x", pSrcAddr->addr.shortAddr);
@@ -968,12 +1062,10 @@ void Csf_deviceSensorDataUpdate(ApiMac_sAddr_t *pSrcAddr, int8_t rssi,
 
 #if IS_HLOS
     /* send data to the appClient */
-    LOG_printf(LOG_APPSRV_MSG_CONTENT,
-               "Sensor 0x%04x\n",
-               pSrcAddr->addr.shortAddr);
+    LOG_printf(LOG_APPSRV_MSG_CONTENT, "Sensor 0x%04x\n", pSrcAddr->addr.shortAddr);
 
     appsrv_deviceSensorDataUpdate(pSrcAddr, rssi, pMsg);
-#endif /* IS_HLOS */
+#endif //IS_HLOS
 
     Board_Led_toggle(board_led_type_LED2);
 
@@ -990,20 +1082,39 @@ void Csf_deviceSensorDataUpdate(ApiMac_sAddr_t *pSrcAddr, int8_t rssi,
  */
 void Csf_deviceDisassocUpdate( ApiMac_sAddr_t *pSrcAddr )
 {
-#ifndef IS_HEADLESS
     if(pSrcAddr->addrMode == ApiMac_addrType_extended)
     {
+#ifndef IS_HEADLESS
         Board_Lcd_printf(DisplayLine_info, "Info: Disassociate ind from %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
                             pSrcAddr->addr.extAddr[7], pSrcAddr->addr.extAddr[6],
                             pSrcAddr->addr.extAddr[5], pSrcAddr->addr.extAddr[4],
                             pSrcAddr->addr.extAddr[3], pSrcAddr->addr.extAddr[2],
                             pSrcAddr->addr.extAddr[1], pSrcAddr->addr.extAddr[0]);
+#endif
+
+#if IS_HLOS
+        LOG_printf(LOG_DBG_COLLECTOR,
+                    "Info: Disassociate ind from %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
+                     pSrcAddr->addr.extAddr[0],
+                     pSrcAddr->addr.extAddr[1],
+                     pSrcAddr->addr.extAddr[2],
+                     pSrcAddr->addr.extAddr[3],
+                     pSrcAddr->addr.extAddr[4],
+                     pSrcAddr->addr.extAddr[5],
+                     pSrcAddr->addr.extAddr[6],
+                     pSrcAddr->addr.extAddr[7]);
+#endif
     }
-    else //assume short addr
+    else // Use Short address
     {
+#ifndef IS_HEADLESS
         Board_Lcd_printf(DisplayLine_info, "Info: Disassociate ind from 0x%04x", pSrcAddr->addr.shortAddr);
-    }
 #endif //!IS_HEADLESS
+
+#if IS_HLOS
+        LOG_printf(LOG_DBG_COLLECTOR, "Info: Disassociate ind from 0x%04x\n", pSrcAddr->addr.shortAddr);
+#endif
+    }
 }
 
 /*!
@@ -1028,6 +1139,11 @@ void Csf_deviceSensorFwVerUpdate( uint16_t srcAddr, char *fwVerStr)
                         srcAddr, fwVerStr);
     }
 #endif //!IS_HEADLESS
+
+#if IS_HLOS
+        LOG_printf(LOG_APPSRV_MSG_CONTENT, "Sensor 0x%04x: FW Ver %s\n",
+                        srcAddr, fwVerStr);
+#endif
 }
 
 /*!
@@ -1039,10 +1155,9 @@ void Csf_deviceSensorFwVerUpdate( uint16_t srcAddr, char *fwVerStr)
 void Csf_deviceSensorOadUpdate( uint16_t srcAddr, uint16_t imgId, uint16_t blockNum, uint16_t NumBlocks)
 {
     Board_Led_toggle(board_led_type_LED2);
-
 #ifndef IS_HEADLESS
     uint8_t displayLine = 0;
-    
+
     if((DisplayLine_sensorStart + (srcAddr - 1)) < DisplayLine_sensorEnd)
     {
         displayLine = (DisplayLine_sensorStart + (srcAddr - 1));
@@ -1051,18 +1166,33 @@ void Csf_deviceSensorOadUpdate( uint16_t srcAddr, uint16_t imgId, uint16_t block
     {
         displayLine = DisplayLine_sensorEnd;
     }
-    
+#endif
     if((blockNum + 1) == NumBlocks)
     {
-        Board_Lcd_printf(displayLine, "Sensor 0x%04x: OAD completed, booting new image...", 
+#ifndef IS_HEADLESS
+
+        Board_Lcd_printf(displayLine, "Sensor 0x%04x: OAD completed, booting new image...",
+                        srcAddr);
+#endif
+
+#if IS_HLOS
+        LOG_printf(LOG_APPSRV_MSG_CONTENT, "Sensor 0x%04x: OAD completed, booting new image...\n",
                         srcAddr);
+#endif
     }
     else
     {
+#ifndef IS_HEADLESS
         Board_Lcd_printf(displayLine, "Sensor 0x%04x: OAD image %d, block %d of %d",
                 srcAddr, imgId, blockNum + 1, NumBlocks);
+
+#endif
+
+#if IS_HLOS
+        LOG_printf(LOG_APPSRV_MSG_CONTENT, "Sensor 0x%04x: OAD image %d, block %d of %d\n",
+                srcAddr, imgId, blockNum + 1, NumBlocks);
+#endif
     }
-#endif //!IS_HEADLESS
 }
 
 /*!
@@ -1077,7 +1207,9 @@ void Csf_toggleResponseReceived(ApiMac_sAddr_t *pSrcAddr, bool ledState)
     uint16_t shortAddr = 0xFFFF;
 
     Board_Lcd_printf(DisplayLine_info, "Info: Device 0x%04x LED toggle rsp received", selected_device);
-
+#if IS_HLOS
+        LOG_printf(LOG_APPSRV_MSG_CONTENT, "Info: Device 0x%04x LED toggle rsp received\n", selected_device);
+#endif
     if(pSrcAddr)
     {
         if(pSrcAddr->addrMode == ApiMac_addrType_short)
@@ -1129,7 +1261,7 @@ void Csf_stateChangeUpdate(Cllc_states_t state)
                "stateChangeUpdate, newstate: (%d) %s\n",
                (int)(state), CSF_cllc_statename(state));
     appsrv_stateChangeUpdate(state);
-#endif /* IS_HLOS */
+#endif //IS_HLOS
 }
 
 /* Wrappers for Callbacks*/
@@ -1176,6 +1308,15 @@ static void processTackingTimeoutCallback_WRAPPER(intptr_t timer_handle,
     processTackingTimeoutCallback(0);
 }
 
+/* Wrap HLOS to embedded callback */
+static void processBroadcastTimeoutCallback_WRAPPER(intptr_t timer_handle,
+                                                  intptr_t cookie)
+{
+    (void)timer_handle;
+    (void)cookie;
+    processBroadcastTimeoutCallback(0);
+}
+
 #endif
 
 /*!
@@ -1202,6 +1343,30 @@ void Csf_initializeTrackingClock(void)
 #endif
 }
 
+/*!
+ Initialize the broadcast cmd clock.
+
+ Public function defined in csf.h
+ */
+void Csf_initializeBroadcastClock(void)
+{
+#if IS_HLOS
+    broadcastClkHandle = TIMER_CB_create("broadcastTimer",
+        processBroadcastTimeoutCallback_WRAPPER,
+        0,
+        TRACKING_INIT_TIMEOUT_VALUE,
+        false);
+#else
+    /* Initialize the timer needed for the broadcast clock */
+    broadcastClkHandle = Timer_construct(&broadcastClkStruct,
+                                        processBroadcastTimeoutCallback,
+                                        TRACKING_INIT_TIMEOUT_VALUE,
+                                        0,
+                                        false,
+                                        0);
+#endif
+}
+
 /*!
  Initialize the trickle clock.
 
@@ -1337,6 +1502,47 @@ void Csf_setTrackingClock(uint32_t trackingTime)
 #endif
 }
 
+
+/*!
+ Set the broadcast clock.
+
+ Public function defined in csf.h
+ */
+void Csf_setBroadcastClock(uint32_t broadcastTime)
+{
+#if IS_HLOS
+    /* Stop the Broadcast timer */
+    TIMER_CB_destroy(broadcastClkHandle);
+    broadcastClkHandle = 0;
+
+    /* Setup timer */
+    if(broadcastTime != 0)
+    {
+        broadcastClkHandle =
+            TIMER_CB_create(
+                "broadcastTimer",
+                processBroadcastTimeoutCallback_WRAPPER,
+                0,
+                broadcastTime,
+                false);
+    }
+#else
+    /* Stop the Broadcast timer */
+    if(Timer_isActive(&broadcastClkStruct) == true)
+    {
+        Timer_stop(&broadcastClkStruct);
+    }
+
+    if(broadcastTime)
+    {
+        /* Setup timer */
+        Timer_setTimeout(broadcastClkHandle, broadcastTime);
+        Timer_start(&broadcastClkStruct);
+    }
+#endif
+}
+
+
 /*!
  Set the trickle clock.
 
@@ -1545,6 +1751,30 @@ uint16_t Csf_getDeviceShort(ApiMac_sAddrExt_t *pExtAddr)
     return(shortAddr);
 }
 
+/*!
+ Find the extended address from a given short address
+
+ Public function defined in csf.h
+ */
+bool Csf_getDeviceExtended(uint16_t shortAddr, ApiMac_sAddrExt_t *pExtAddr)
+{
+    Llc_deviceListItem_t item;
+    ApiMac_sAddr_t devAddr;
+    bool ret = false;
+
+    devAddr.addrMode = ApiMac_addrType_short;
+    devAddr.addr.shortAddr = shortAddr;
+
+    if(Csf_getDevice(&devAddr,&item))
+    {
+        /* Copy found extended address */
+        memcpy(pExtAddr, &item.devInfo.extAddress, sizeof(ApiMac_sAddrExt_t));
+        ret = true;
+    }
+
+    return(ret);
+}
+
 /*!
  Find entry in device list
 
@@ -2029,6 +2259,21 @@ static void processTackingTimeoutCallback(UArg a0)
     Semaphore_post(collectorSem);
 }
 
+/*!
+ * @brief       Broadcast timeout handler function.
+ *
+ * @param       a0 - ignored
+ */
+static void processBroadcastTimeoutCallback(UArg a0)
+{
+    (void)a0; /* Parameter is not used */
+
+    Util_setEvent(&Collector_events, COLLECTOR_BROADCAST_TIMEOUT_EVT);
+
+    /* Wake up the application thread when it waits for clock event */
+    Semaphore_post(collectorSem);
+}
+
 /*!
  * @brief       Join permit timeout handler function.
  *
@@ -2777,6 +3022,18 @@ extern uint8_t Csf_sendToggleLedRequest(
     return Collector_sendToggleLedRequest(pDstAddr);
 }
 
+/*!
+ The appsrv module calls this function to send a buzzer ctrl request
+ to a device over the air
+
+ Public function defined in csf_linux.h
+ */
+extern uint8_t Csf_sendBuzzerCtrlRequest(
+    ApiMac_sAddr_t *pDstAddr)
+{
+    return Collector_sendBuzzerCtrlRequest(pDstAddr);
+}
+
 /*
  * Public function in csf_linux.h
  * Gateway front end uses this to get the current state.
@@ -2786,6 +3043,24 @@ Cllc_states_t Csf_getCllcState(void)
     return savedCllcState;
 }
 
+#ifdef PROCESS_JS
+/*!
+ The application calls this function to indicate that a device
+ has reported raw data.
+
+ Public function defined in csf.h
+ */
+void Csf_deviceRawDataUpdate(ApiMac_mcpsDataInd_t *pDataInd)
+{
+#if IS_HLOS
+    /* send data to the appClient */
+    appsrv_deviceRawDataUpdate(pDataInd);
+#endif /* IS_HLOS */
+
+    Board_Led_toggle(board_led_type_LED2);
+}
+#endif
+
 /*
  *  ========================================
  *  Texas Instruments Micro Controller Style
index 4e6603ba4d3c0d57b2270f034c771dfb21553325..568b0919e97df86e6d15d7e9ec1901964b82ed47 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API Collector specific (linux) function definitions
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #if !defined(CSF_LINUX_H)
@@ -187,6 +187,17 @@ extern uint8_t Csf_sendConfigRequest( ApiMac_sAddr_t *pDstAddr,
 extern uint8_t Csf_sendToggleLedRequest(
                 ApiMac_sAddr_t *pDstAddr);
 
+/*!
+ * @brief Build and send the toggle led message to a device.
+ *
+ * @param pDstAddr - destination address of the device to send the message
+ *
+ * @return Collector_status_success, Collector_status_invalid_state
+ *         or Collector_status_deviceNotFound
+ */
+extern uint8_t Csf_sendBuzzerCtrlRequest(
+    ApiMac_sAddr_t *pDstAddr);
+
 #endif
 
 /*
index 853aeade183354d64565ce83cb028da854a34952..0c26887c664c0f92b91a07aa57393cfc49fa01d1 100644 (file)
@@ -4,7 +4,7 @@
  @brief TIMAC 2.0 API this is the "main" file for the linux collector app
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -40,7 +40,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 #include "compiler.h"
@@ -66,8 +66,8 @@
 #include "config.h"
 
 
-int linux_FH_NUM_NON_SLEEPY_NEIGHBORS = FH_NUM_NON_SLEEPY_NEIGHBORS_DEFAULT;
-int linux_FH_NUM_SLEEPY_NEIGHBORS = FH_NUM_SLEEPY_NEIGHBORS_DEFAULT;
+int linux_FH_NUM_NON_SLEEPY_HOPPING_NEIGHBORS = FH_NUM_NON_SLEEPY_HOPPING_NEIGHBORS_DEFAULT;
+int linux_FH_NUM_NON_SLEEPY_FIXED_CHANNEL_NEIGHBORS = FH_NUM_NON_SLEEPY_FIXED_CHANNEL_NEIGHBORS_DEFAULT;
 
 int linux_CONFIG_TRANSMIT_POWER = CONFIG_TRANSMIT_POWER_DEFAULT;
 int linux_CERTIFICATION_TEST_MODE = CERTIFICATION_TEST_MODE_DEFAULT;
@@ -77,15 +77,16 @@ int linux_CONFIG_CHANNEL_PAGE = CONFIG_CHANNEL_PAGE_DEFAULT;
 uint8_t linux_CONFIG_FH_CHANNEL_MASK[APIMAC_154G_CHANNEL_BITMAP_SIZ]= CONFIG_FH_CHANNEL_MASK_DEFAULT;
 uint8_t linux_CONFIG_CHANNEL_MASK[APIMAC_154G_CHANNEL_BITMAP_SIZ] = CONFIG_CHANNEL_MASK_DEFAULT;
 uint8_t linux_FH_ASYNC_CHANNEL_MASK[APIMAC_154G_CHANNEL_BITMAP_SIZ] = FH_ASYNC_CHANNEL_MASK_DEFAULT;
-
-uint8_t linux_CONFIG_LINKQUALITY   = CONFIG_LINKQUALITY_DEFAULT;
-uint8_t linux_CONFIG_PERCENTFILTER = CONFIG_PERCENTFILTER_DEFAULT;
+int linux_CONFIG_REPORTING_INTERVAL = CONFIG_REPORTING_INTERVAL_DEFAULT;
+int linux_CONFIG_POLLING_INTERVAL = CONFIG_POLLING_INTERVAL_DEFAULT;
+int linux_TRACKING_DELAY_TIME = TRACKING_DELAY_TIME_DEFAULT;
 uint8_t linux_CONFIG_SCAN_DURATION = CONFIG_SCAN_DURATION_DEFAULT;
 char linux_CONFIG_FH_NETNAME[32] = CONFIG_FH_NETNAME_DEFAULT;
 int linux_CONFIG_DWELL_TIME = CONFIG_DWELL_TIME_DEFAULT;
+int linux_FH_BROADCAST_INTERVAL = FH_BROADCAST_INTERVAL_DEFAULT;
+int linux_FH_BROADCAST_DWELL_TIME = FH_BROADCAST_DWELL_TIME_DEFAULT;
 int linux_CONFIG_TRICKLE_MIN_CLK_DURATION = CONFIG_TRICKLE_MIN_CLK_DURATION_DEFAULT;
 int linux_CONFIG_TRICKLE_MAX_CLK_DURATION = CONFIG_TRICKLE_MAX_CLK_DURATION_DEFAULT;
-int linux_CONFIG_FH_PAN_SIZE = CONFIG_FH_PAN_SIZE_DEFAULT;
 bool linux_CONFIG_DOUBLE_TRICKLE_TIMER = CONFIG_DOUBLE_TRICKLE_TIMER_DEFAULT;
 bool linux_CONFIG_AUTO_START = CONFIG_AUTO_START_DEFAULT;
 bool linux_CONFIG_SECURE = CONFIG_SECURE_DEFAULT;
@@ -94,6 +95,10 @@ bool linux_CONFIG_FH_ENABLE = CONFIG_FH_ENABLE_DEFAULT;
 int  linux_CONFIG_COORD_SHORT_ADDR = CONFIG_COORD_SHORT_ADDR_DEFAULT;
 int  linux_CONFIG_MAC_BEACON_ORDER = CONFIG_MAC_BEACON_ORDER_DEFAULT;
 int  linux_CONFIG_MAC_SUPERFRAME_ORDER = CONFIG_MAC_SUPERFRAME_ORDER_DEFAULT;
+int linux_CONFIG_MIN_BE = CONFIG_MIN_BE_DEFAULT;
+int linux_CONFIG_MAX_BE = CONFIG_MAX_BE_DEFAULT;
+int linux_CONFIG_MAC_MAX_CSMA_BACKOFFS = CONFIG_MAC_MAX_CSMA_BACKOFFS_DEFAULT;
+int linux_CONFIG_MAX_RETRIES = CONFIG_MAX_RETRIES_DEFAULT;
 
 /*!
  * Called from the linux config file parser as each channel mask is parsed
@@ -301,34 +306,19 @@ static int my_APP_settings(struct ini_parser *pINI, bool *handled)
         return 0;
     }
 
-    if( INI_itemMatches(pINI, NULL, "fh-num-non-sleepy-neighbors" ) )
-    {
-        linux_FH_NUM_NON_SLEEPY_NEIGHBORS = INI_valueAsInt(pINI);
-        *handled = true;
-        return 0;
-    }
-
-
-    if( INI_itemMatches(pINI, NULL, "fh-num-sleepy-neighbors" ) )
-    {
-        linux_FH_NUM_SLEEPY_NEIGHBORS = INI_valueAsInt(pINI);
-        *handled = true;
-        return 0;
-    }
-
-    if( INI_itemMatches(pINI, NULL, "config-polling-interval" ) ){
+    if(INI_itemMatches(pINI, NULL, "config-polling-interval")){
         linux_CONFIG_POLLING_INTERVAL = INI_valueAsInt(pINI);
         *handled = true;
         return 0;
     }
 
-    if( INI_itemMatches(pINI, NULL, "config-reporting-interval" ) ){
+    if(INI_itemMatches(pINI, NULL, "config-reporting-interval")){
         linux_CONFIG_REPORTING_INTERVAL = INI_valueAsInt(pINI);
         *handled = true;
         return 0;
     }
 
-    if( INI_itemMatches(pINI,NULL, "config-tx-power" ) ){
+    if(INI_itemMatches(pINI,NULL, "config-tx-power")){
         linux_CONFIG_TRANSMIT_POWER = INI_valueAsInt(pINI);
         *handled = true;
 
@@ -352,23 +342,58 @@ static int my_APP_settings(struct ini_parser *pINI, bool *handled)
         return 0;
     }
 
-    if(INI_itemMatches(pINI, NULL, "config-linkquality"))
+       if(INI_itemMatches(pINI, NULL, "config-min-backoff"))
+       {
+               linux_CONFIG_MIN_BE = INI_valueAsInt(pINI);
+               *handled = true;
+               return 0;
+       }
+
+       if(INI_itemMatches(pINI, NULL, "config-max-backoff"))
+       {
+               linux_CONFIG_MAX_BE = INI_valueAsInt(pINI);
+               *handled = true;
+               return 0;
+       }
+    
+       if(INI_itemMatches(pINI, NULL, "config-max-csma-backoff"))
+       {
+               linux_CONFIG_MAC_MAX_CSMA_BACKOFFS = INI_valueAsInt(pINI);
+               *handled = true;
+               return 0;
+       }
+
+       if(INI_itemMatches(pINI, NULL, "config-max-retries"))
+       {
+               linux_CONFIG_MAX_RETRIES = INI_valueAsInt(pINI);
+               *handled = true;
+               return 0;
+       }
+
+       if(INI_itemMatches(pINI, NULL, "config-reporting-interval "))
+    {
+        linux_CONFIG_REPORTING_INTERVAL = INI_valueAsInt(pINI);
+        *handled = true;
+        return 0;
+    }
+
+    if(INI_itemMatches(pINI, NULL, "config-polling-interval"))
     {
-        linux_CONFIG_LINKQUALITY = (uint8_t)INI_valueAsInt(pINI);
+        linux_CONFIG_POLLING_INTERVAL = INI_valueAsInt(pINI);
         *handled = true;
         return 0;
     }
 
-    if(INI_itemMatches(pINI, NULL, "config-scan-duration"))
+    if(INI_itemMatches(pINI, NULL, "config-tracking-delay-time"))
     {
-        linux_CONFIG_SCAN_DURATION = (uint8_t)INI_valueAsInt(pINI);
+        linux_TRACKING_DELAY_TIME = INI_valueAsInt(pINI);
         *handled = true;
         return 0;
     }
 
-    if(INI_itemMatches(pINI, NULL, "config-percentfilter"))
+    if(INI_itemMatches(pINI, NULL, "config-scan-duration"))
     {
-        linux_CONFIG_PERCENTFILTER = (uint8_t)INI_valueAsInt(pINI);
+        linux_CONFIG_SCAN_DURATION = (uint8_t)INI_valueAsInt(pINI);
         *handled = true;
         return 0;
     }
@@ -402,6 +427,35 @@ static int my_APP_settings(struct ini_parser *pINI, bool *handled)
         return 0;
     }
 
+    if(INI_itemMatches(pINI, NULL, "config-broadcast-interval"))
+    {
+        linux_FH_BROADCAST_INTERVAL = INI_valueAsInt(pINI);
+        *handled = true;
+        return 0;
+    }
+
+
+    if(INI_itemMatches(pINI, NULL, "config-fh-num-non-sleepy-hopping-neighbors"))
+    {
+        linux_FH_NUM_NON_SLEEPY_HOPPING_NEIGHBORS = INI_valueAsInt(pINI);
+        *handled = true;
+        return 0;
+    }
+
+    if(INI_itemMatches(pINI, NULL, "config-fh-num-sleepy-non-sleepy-fixed-channel-neighbors"))
+    {
+        linux_FH_NUM_NON_SLEEPY_FIXED_CHANNEL_NEIGHBORS = INI_valueAsInt(pINI);
+        *handled = true;
+        return 0;
+    }
+
+    if(INI_itemMatches(pINI, NULL, "config-fh-broadcast-dwell-time"))
+    {
+        linux_FH_BROADCAST_DWELL_TIME = INI_valueAsInt(pINI);
+        *handled = true;
+        return 0;
+    }
+
     if(INI_itemMatches(pINI,NULL, "config-trickle-min-clk-duration"))
     {
         linux_CONFIG_TRICKLE_MIN_CLK_DURATION = INI_valueAsInt(pINI);
@@ -409,13 +463,13 @@ static int my_APP_settings(struct ini_parser *pINI, bool *handled)
         return 0;
     }
 
-    if( INI_itemMatches(pINI,NULL, "config-trickle-max-clk-duration") ){
+    if(INI_itemMatches(pINI,NULL, "config-trickle-max-clk-duration") ){
         linux_CONFIG_TRICKLE_MAX_CLK_DURATION = INI_valueAsInt(pINI);
         *handled = true;
         return 0;
     }
 
-    if( INI_itemMatches(pINI, NULL, "config-double-trickle-timer" ) ){
+    if(INI_itemMatches(pINI, NULL, "config-double-trickle-timer") ){
         linux_CONFIG_DOUBLE_TRICKLE_TIMER = INI_valueAsBool(pINI);
         *handled = true;
         return 0;
@@ -442,13 +496,6 @@ static int my_APP_settings(struct ini_parser *pINI, bool *handled)
         return 0;
     }
 
-    if(INI_itemMatches(pINI, NULL, "config-fh-pan-size"))
-    {
-        linux_CONFIG_FH_PAN_SIZE = INI_valueAsInt(pINI);
-        *handled = true;
-        return 0;
-    }
-
     if(INI_itemMatches(pINI, NULL, "config-coord-short-addr"))
     {
         linux_CONFIG_COORD_SHORT_ADDR = INI_valueAsInt(pINI);
@@ -456,14 +503,14 @@ static int my_APP_settings(struct ini_parser *pINI, bool *handled)
         return 0;
     }
 
-    if( INI_itemMatches( pINI, NULL, "config-mac-beacon-order"))
+    if(INI_itemMatches( pINI, NULL, "config-mac-beacon-order"))
     {
         linux_CONFIG_MAC_BEACON_ORDER = INI_valueAsInt(pINI);
         *handled = true;
         return 0;
     }
 
-    if( INI_itemMatches( pINI, NULL, "config-mac-superframe-order" ))
+    if(INI_itemMatches( pINI, NULL, "config-mac-superframe-order"))
     {
         linux_CONFIG_MAC_SUPERFRAME_ORDER = INI_valueAsInt(pINI);
         *handled = true;
@@ -549,7 +596,7 @@ static int cfg_callback(struct ini_parser *pINI, bool *handled)
     return 0;
 }
 
-/* Our main... */
+/* Our main */
 int main(int argc, char **argv)
 {
     int r;
@@ -558,7 +605,7 @@ int main(int argc, char **argv)
 
     if( argc == 1 )
     {
-        /* use default config filename */
+        /* Use default config filename */
         cfg_filenames[0] = argv[0];
         cfg_filenames[1] = "collector.cfg";
         cfg_filenames[2] = NULL;
@@ -572,7 +619,8 @@ int main(int argc, char **argv)
     STREAM_init();
     TIMER_init();
     LOG_init("/dev/stderr");
-    /* we want these logs to begin with */
+
+    /* We want these logs to begin with */
     log_cfg.log_flags = LOG_FATAL | LOG_WARN | LOG_ERROR;
 
     APP_defaults();
@@ -586,7 +634,7 @@ int main(int argc, char **argv)
         }
     }
 
-    /* And away we go! */
+    /* Begin application */
     APP_main();
 
     exit(0);
index ce70fbb111de352c1c61187813e61c3b398a6652..95d2c5d893f53da4869153303f79540195d8f08f 100644 (file)
@@ -5,7 +5,7 @@
  @brief Logical Link Controller shared definitions
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -41,7 +41,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 #ifndef LLC_H
 #define LLC_H
diff --git a/example/collector/oad_image_header.h b/example/collector/oad_image_header.h
new file mode 100644 (file)
index 0000000..5783fd1
--- /dev/null
@@ -0,0 +1,235 @@
+/******************************************************************************
+
+ @file  oad_image_preamble.h
+
+ @brief This file contains the image preable information.
+
+ Group: WCS, BTS
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
+
+ ******************************************************************************
+ $License: BSD3 2016 $
+  
+   Copyright (c) 2015, 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.
+ ******************************************************************************
+ $Release Name: TI-15.4Stack Linux x64 SDK$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
+ ******************************************************************************/
+
+#ifndef _OAD_IMAGE_PREAMBLE_H
+#define _OAD_IMAGE_PREAMBLE_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/*******************************************************************************
+ * INCLUDES
+ ******************************************************************************/
+
+/*******************************************************************************
+ * CONSTANTS
+ ******************************************************************************/
+
+/*
+ * BIM Varible Address
+ * The bim_var is a variable stored in RAM that is used to control switching
+ * between persistent and user application in the BIM
+ * On 26xx platforms RAM is retained between resets and this is possible
+ *
+ * Warning! placement of the BIM variable must respect the following
+ * reserved RAM regions ( Valid for CC2640R2):
+ *    - TI-RTOS in ROM reserved region: 0x20000100-0x20000280
+ *    - BLE Stack memory: < ICALL_RAM0_START
+ *    - Vector Table in RAM: 0x20000000-0x200000C8
+ * Failing to respect either of the above boundaries will result in a
+ * linker error
+ */
+#ifdef OAD_ONCHIP
+  #define BIM_VAR_ADDR  0x20000400
+  extern uint32_t _bim_var;
+#endif // OAD_ONCHIP
+
+/*
+ * NV Page Setting:
+ * This define is used ensure the stack is built with a compatible NV setting
+ * Note: this restriction does not apply to the stack library configuration
+ * for off-chip OAD
+ */
+#define OAD_NUM_NV_PGS  1
+
+#ifdef OSAL_SNV
+  #if OSAL_SNV != OAD_NUM_NV_PGS
+    #error "Incompatible NV settings detected. OAD supports 1 NV page"
+  #endif //OSAL_SNV != OAD_NUM_NV_PGS
+#endif //OSAL_SNV
+
+// Image types
+#define OAD_IMG_TYPE_PERSISTENT_APP       0
+#define OAD_IMG_TYPE_APP                  1
+#define OAD_IMG_TYPE_STACK                2
+#define OAD_IMG_TYPE_APP_STACK            3
+#define OAD_IMG_TYPE_NP                   4
+#define OAD_IMG_TYPE_FACTORY              5
+#define OAD_IMG_TYPE_BIM                  6
+#define OAD_IMG_TYPE_APPSTACKLIB          7
+#define OAD_IMG_TYPE_USR_BEGIN            16
+#define OAD_IMG_TYPE_USR_END              31
+#define OAD_IMG_TYPE_HOST_BEGIN           32
+#define OAD_IMG_TYPE_HOST_END             63
+#define OAD_IMG_TYPE_RSVD_BEGIN           64
+#define OAD_IMG_TYPE_RSVD_END             255
+
+//!< Wireless Technology Types
+#define OAD_WIRELESS_TECH_BLE             0xFFFE
+#define OAD_WIRELESS_TECH_TIMAC_SUBG      0xFFFD
+#define OAD_WIRELESS_TECH_TIMAC_2_4G      0xFFFB
+#define OAD_WIRELESS_TECH_ZIGBEE          0xFFF7
+#define OAD_WIRELESS_TECH_RF4CE           0xFFEF
+#define OAD_WIRELESS_TECH_THREAD          0xFFDF
+#define OAD_WIRELESS_TECH_EASYLINK        0xFFBF
+
+/*
+ * These values are modified from source/ti/common/26xx/oad/oad_image_header.h
+ * Any device specific #ifdef's had to be removed and modified to seperate #define
+ * statements since the linux collector has no knowledge of device type
+ */
+#define CC26X2_OAD_IMG_ID_VAL             "CC26x2R1"
+#define CC13X2_OAD_IMG_ID_VAL             "CC13x2R1"
+#define OAD_IMG_ID_VAL                    "OAD IMG "
+
+// External flash metadata identification value
+#define OAD_EXTFL_ID_VAL                  "OAD NVM1"
+
+#define OAD_IMG_ID_LEN               8                                       /* OAD image identification bytes length */
+#define OAD_SW_VER_LEN               4                                       /* OAD software version length in bytes */
+#define OAD_IMG_HDR_LEN              sizeof(imgFixedHdr_t)                   /* The length of just the OAD Header */
+#define CRC_OFFSET                   offsetof(imgHdr_t, fixedHdr.crc32)      /* Supported metadata version */
+#define BIM_VER_OFFSET               offsetof(imgHdr_t, fixedHdr.bimVer)     /* BIM metadata version offset */
+#define IMG_DATA_OFFSET              BIM_VER_OFFSET                          /* Start of data after CRC bytes */
+#define IMG_INFO_OFFSET              offsetof(imgHdr_t, fixedHdr.imgCpStat)  /* ImageInfo Bytes offset */
+#define IMG_COPY_STAT_OFFSET         IMG_INFO_OFFSET                         /* Image copy status */
+#define CRC_STAT_OFFSET              offsetof(imgHdr_t, fixedHdr.crcStat)    /* Offset to CRC status byte */
+#define IMG_TYPE_OFFSET              offsetof(imgHdr_t, fixedHdr.imgType)    /* Offset to CRC status byte */
+#define BOUNDARY_SEG_OFFSET          offsetof(imgHdr_t, fixedHdr.segTypeBd)  /* Offset into image header for boundary */
+
+#define SEG_LEN_OFFSET               4                                    /* Offset from seg header to seg len */
+#define SEG_HDR_LEN                  12                                   /* Length of the segment header bytes */
+
+#define IMG_PAYLOAD_SEG_ID           1                                    /* Id of the image payload segment */
+#define IMG_BOUNDARY_SEG_ID          0                                    /* Id of RAM/stack boundary segment */
+#define IMG_NONCOUNT_SEG_ID          2                                    /* Id of non contigouous image segment */
+#define IMG_SECURITY_SEG_ID          3                                    /* Id of security segment */
+
+#define BIM_VER                      0x3                                  /* Supported BIM version */
+#define META_VER                     0x1                                  /* Supported metadata version */
+#define DEFAULT_STATE                0xFF                                 /* default status */
+#define CRC_VALID                    0xFE
+#define CRC_INVALID                  0xFC
+#define NEED_COPY                    0xFE                                  /* Image to be copied on on-chip flash at location indicated in the image */
+#define COPY_DONE                    0xFC                                  /* Image already copied */
+
+#define EFL_MATADATA_HDR_LEN         OAD_IMG_HDR_LEN + 8                   /* External flash meta-data header length */
+
+#define INVALID_ADDR                 0xFFFFFFFF
+#define INVALID_LEN                  INVALID_ADDR
+#define DEFAULT_CRC                  0xFFFFFFFF
+
+/*******************************************************************************
+ * Typedefs
+ */
+#if defined (__IAR_SYSTEMS_ICC__)
+  #define TYPEDEF_STRUCT_PACKED        __packed typedef struct
+#elif defined __TI_COMPILER_VERSION || defined __TI_COMPILER_VERSION__
+  #define TYPEDEF_STRUCT_PACKED        typedef struct __attribute__((packed))
+#elif defined (__GNUC__)
+  #define TYPEDEF_STRUCT_PACKED        typedef struct __attribute__((__packed__))
+#endif
+  
+/* Image Preamble */
+TYPEDEF_STRUCT_PACKED
+{
+  uint8_t   imgID[8];       //!< User-defined Image Identification bytes. */
+  uint32_t  crc32;          //!< Image's crc32 value */
+  uint8_t   bimVer;         //!< BIM version */
+  uint8_t   metaVer;        //!< Metadata version */
+  uint16_t  techType;       //!< Wireless protocol type BLE/TI-MAC/ZIGBEE etc. */
+  uint8_t   imgCpStat;      //!< Image copy status */
+  uint8_t   crcStat;        //!< CRC status */
+  uint8_t   imgType;        //!< Image Type */
+  uint8_t   imgNo;          //!< Image number of 'image type' */
+  uint32_t  imgVld;         //!< In indicates if the current image in valid 0xff - valid, 0x00 invalid image */
+  uint32_t  len;            //!< Image length in bytes. */
+  uint32_t  prgEntry;       //!< Program entry address */
+  uint8_t   softVer[4];     //!< Software version of the image */
+  uint32_t  imgEndAddr;     //!< Address of the last byte of a contiguous image */
+  uint16_t  hdrLen;         //!< Total length of the image header */
+  uint16_t  rfu;            //!< Reserved bytes */
+} imgFixedHdr_t;
+
+/* Image payload segment */
+TYPEDEF_STRUCT_PACKED
+{
+  uint8_t   segTypeImg;     //!< Segment type - for Contiguous image payload */
+  uint16_t  wirelessTech;   //!< Wireless technology type */
+  uint8_t   rfu;            //!< Reserved byte */
+  uint32_t  imgSegLen;      //!< Payload segment length */
+  uint32_t  startAddr;      //!< Start address of image on internal flash */
+} imgPayloadSeg_t;
+
+/* Image boundary segment */
+TYPEDEF_STRUCT_PACKED
+{
+  uint8_t   segTypeBd;      //!< Segment type - for boundary segment */
+  uint16_t  wirelessTech;   //!< Wireless technology type */
+  uint8_t   rfu;            //!< Reserved byte */
+  uint32_t  boundarySegLen; //!< Boundary segment length */
+  uint32_t  stackStartAddr; //!< Start address of stack image on internal flash */
+  uint32_t  stackEntryAddr; //!< Stack start address */
+  uint32_t  ram0StartAddr;  //!< RAM entry start address */
+  uint32_t  ram0EndAddr;    //!< RAM entry end address */
+} boundarySeg_t;
+
+/* Complete Image Header */
+TYPEDEF_STRUCT_PACKED
+{
+   imgFixedHdr_t         fixedHdr;
+#if (!defined(STACK_LIBRARY) && (defined(SPLIT_APP_STACK_IMAGE)))
+   boundarySeg_t         boundarySeg;
+#endif
+   imgPayloadSeg_t       imgPayload;
+} imgHdr_t;
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _OAD_IMAGE_PREAMBLE_H */
index b4033cea231b74d3ef3df250ee55dc019bdd881e..4b41bb3d91cfbbc4a08aa410fb9a765fce6f8bfd 100644 (file)
@@ -5,7 +5,7 @@
  @brief Sub1G Over the Air Download Protocol Module
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -41,7 +41,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 
 /***** Includes *****/
@@ -191,7 +191,8 @@ OADProtocol_Status_t OADProtocol_sendImgIdentifyReq(void* pDstAddress, uint8_t i
 
     pOadImgIdentifyReqPacket[OADProtocol_PKT_CMDID_OFFSET] = OADProtocol_PACKET_TYPE_OAD_IMG_IDENTIFY_REQ;
     pOadImgIdentifyReqPacket[OADProtocol_IMG_IDENTIFY_REQ_IMG_ID_OFFSET] = imgId;
-    memcpy(&(pOadImgIdentifyReqPacket[OADProtocol_IMG_IDENTIFY_REQ_IMG_HDR_OFFSET]), pImgInfoData, 16);
+    //copy considering cc13x2 largeer header, cc13x0 will ignore unused bytes
+    memcpy(&(pOadImgIdentifyReqPacket[OADProtocol_IMG_IDENTIFY_REQ_IMG_HDR_OFFSET]), pImgInfoData, OADProtocol_AGAMA_IMAGE_HDR_LEN);
 
     if(OADProtocol_params.pRadioAccessFxns->pfnRadioAccessPacketSend)
     {
index b1a120ee56435c2b3d0c150963be60c5c2a6726c..798c8384d3b299778a7dc8cb02c688a1173eb745 100644 (file)
@@ -5,7 +5,7 @@
  @brief OAD Protocol Header
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
@@ -41,7 +41,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 /*!*****************************************************************************
  *  @file       oad_protocol.h
 
 #define OADProtocol_PKT_CMDID_OFFSET   0   ///< Offset to packet type files in packet header
 
+#define OADProtocol_AGAMA_IMAGE_ID_LEN 22
+#define OADProtocol_AGAMA_IMAGE_HDR_LEN 0x50
+
+#define OADProtocol_IMAGE_ID_LEN 16
+#define OADProtocol_IMAGE_HDR_LEN 16
+
 /*!
  * Req/Rsp Packet Types
  */
 #define OADProtocol_VER_RSP_VERSIONSTRING_OFFSET    1   ///< Offset to version string in FW Ver Response
 
 #define OADProtocol_PACKET_TYPE_OAD_IMG_IDENTIFY_REQ                0x02 ///< OAD update image identify request
-#define OADProtocol_PACKET_TYPE_OAD_IMG_IDENTIFY_REQ_LEN            1 + 1 + 16 ///< OAD update image identify request
+#define OADProtocol_PACKET_TYPE_OAD_IMG_IDENTIFY_REQ_LEN            1 + 1 + OADProtocol_AGAMA_IMAGE_HDR_LEN ///< Assume larger header (cc13x0 OAD will ignore additional bytes)
 #define OADProtocol_IMG_IDENTIFY_REQ_IMG_ID_OFFSET    1   ///< Offset to status in Image Identify Response
 #define OADProtocol_IMG_IDENTIFY_REQ_IMG_HDR_OFFSET   2   ///< Offset to status in Image Identify Response
 
diff --git a/example/collector/oad_storage.h b/example/collector/oad_storage.h
new file mode 100644 (file)
index 0000000..1354c8e
--- /dev/null
@@ -0,0 +1,216 @@
+/******************************************************************************
+
+ @file oad_storage.h
+
+ @brief OAD Storage Header
+
+ Group: WCS LPC
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
+
+ ******************************************************************************
+ $License: BSD3 2016 $
+  
+   Copyright (c) 2015, 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.
+ ******************************************************************************
+ $Release Name: TI-15.4Stack Linux x64 SDK$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
+ *****************************************************************************/
+#ifndef OADStorage_H
+#define OADStorage_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/*********************************************************************
+ * INCLUDES
+ */
+#include <stdint.h>
+#include <stdbool.h>
+
+#include "oad_image_header.h"
+
+/*********************************************************************
+ * CONSTANTS
+ */
+// OAD payload overheads
+#define OAD_ATT_OVERHEAD                    3
+#define OAD_BLK_NUM_HDR_SZ                  4
+
+#define OAD_DEFAULT_BLOCK_SIZE              128
+
+#define BIM_START                           0x1F000
+
+ /// OADStorage_Status_t status codes
+typedef enum {
+    OADStorage_Status_Success, ///< Success
+    OADStorage_Failed,         ///< Fail
+    OADStorage_CrcError,       ///< Acknowledgment or Response Timed out
+    OADStorage_FlashError,     ///< flash access error
+    OADStorage_Aborted,        ///< Canceled by application
+    OADStorage_Rejected,       ///< OAD request rejected by application
+} OADStorage_Status_t;
+
+/* Image Identify Payload */
+typedef struct __attribute__((packed))
+{
+    uint8_t   imgID[8];       //!< User-defined Image Identification bytes. */
+    uint8_t   bimVer;         //!< BIM version */
+    uint8_t   metaVer;        //!< Metadata version */
+    uint8_t   imgCpStat;      //!< Image copy status bytes */
+    uint8_t   crcStat;        //!< CRC status */
+    uint8_t   imgType;        //!< Image Type */
+    uint8_t   imgNo;          //!< Image number of 'image type' */
+    uint32_t  len;            //!< Image length in octets
+    uint8_t   softVer[4];     //!< Software version of the image */
+} OADStorage_imgIdentifyPld_t;
+
+/*********************************************************************
+ * MACROS
+ */
+
+/*********************************************************************
+ * TYPEDEFS
+ */
+
+/*********************************************************************
+ * EXTERNAL VARIABLES
+ */
+
+
+/*********************************************************************
+ * FUNCTIONS
+ */
+
+/*********************************************************************
+ * @fn      OADStorage_init
+ *
+ * @brief   Initialise the OAD Target Profile.
+ *
+ * @param   None.
+ *
+ * @return  None.
+ */
+extern void OADStorage_init(void);
+
+#if NOT_PORTED
+/*********************************************************************
+ * @fn      OADStorage_imgIdentifyRead
+ *
+ * @brief   Read Image header and return number of blocks.
+ *
+ * @param   imageType   - image type indicating which image to read
+ * @param   pImgHdr     - pointer to image header data
+ *
+ * @return  Total Blocks if image accepted, 0 if Image invalid
+ */
+uint16_t OADStorage_imgIdentifyRead(uint8_t imageType, OADTarget_ImgHdr_t *pImgHdr);
+#endif
+
+/*********************************************************************
+ * @fn      OADStorage_imgIdentifyWrite
+ *
+ * @brief   Process the Image Identify Write.  Determine from the received OAD
+ *          Image Header if the Downloaded Image should be acquired.
+ *
+ * @param   pValue     - pointer to data to be written
+ *
+  * @return  Total Blocks if image accepted, 0 if Image rejected
+ */
+extern uint16_t OADStorage_imgIdentifyWrite(uint8_t *pValue);
+
+/*********************************************************************
+ * @fn      OADStorage_imgBlockRead
+ *
+ * @brief   Read Image Block.
+ *
+ * @param   blockNum   - block number to be written
+ * @param   pBlockData - pointer for data to be read
+ *
+ * @return  none
+ */
+extern void OADStorage_imgBlockRead(uint16_t blockNum, uint8_t *pBlockData);
+
+/*********************************************************************
+ * @fn      OADStorage_imgInfoRead
+ *
+ * @brief   Read an Image info.
+ *
+ * @param   pimgInfo - pointer for data to be read
+ *
+ * @return  none
+ */
+extern void OADStorage_imgInfoRead(uint8_t *pimgInfo);
+
+/*********************************************************************
+ * @fn      OADStorage_imgBlockWrite
+ *
+ * @brief   Write Image Block.
+ *
+ * @param   blockNum   - block number to be written
+ * @param   pBlockData - pointer to data to be written
+ * @param   len        - length fo block
+ *
+ * @return  status
+ */
+extern uint8_t OADStorage_imgBlockWrite(uint32_t blockNum, uint8_t *pBlockData, uint8_t len);
+
+/*********************************************************************
+ * @fn      OADStorage_imgFinalise
+ *
+ * @brief   Process the Image Block Write.
+ *
+ * @param  none
+ *
+ * @return  status
+ */
+extern OADStorage_Status_t OADStorage_imgFinalise(void);
+
+/*********************************************************************
+ * @fn      OADStorage_close
+ *
+ * @brief   Releases the resource required for OAD stoarage.
+ *
+ * @param  none
+ *
+ * @return none
+ */
+extern void OADStorage_close(void);
+
+/*********************************************************************
+*********************************************************************/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* OADStorage_H */
index 1de979b8da4e496740edf4c74e900ad47dfcae57..0b0dc924728077bfb99a43dc5b35b44b508e1ef8 100755 (executable)
@@ -5,29 +5,29 @@
 # @brief TIMAC 2.0 run_collector.sh, used by run_demo.sh to launch collector
 #
 # Group: WCS LPC
-# $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+# $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 #
 #############################################################
 # $License: BSD3 2016 $
-#
+#  
 #   Copyright (c) 2015, 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
 #   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #############################################################
 # $Release Name: TI-15.4Stack Linux x64 SDK$
-# $Release Date: Jun 28, 2017 (2.02.00.03)$
+# $Release Date: Sept 27, 2017 (2.04.00.13)$
 #############################################################
 
 # Because this is a "quick demo" we hard code
 # the device name in this check. For a production
 # application, a better check is suggested.
-#
+# 
 if [ ! -c /dev/ttyACM0 ]
 then
     echo ""
     echo "The Launchpad (/dev/ttyACM0) does not seem to be present"
     echo ""
-    exit 2
+    exit 1
 fi
 
-# This test is simple...
+# This test is simple... 
 arch=`uname -m`
 
 if [ "x${arch}x" == 'xx86_64x' ]
@@ -84,13 +84,13 @@ fi
 if [ "x${exe}x" == "xx" ]
 then
     echo "Cannot find Collector App exe: $exe"
-    exit 3
+    exit 1
 fi
 
 if [ ! -x $exe ]
 then
     echo "Cannot find EXE $exe"
-    exit 4
+    exit 1
 fi
 
 PID=`pidof $exe`
@@ -112,7 +112,7 @@ then
     exit 0
 else
     echo "Error starting collector application"
-    exit 5
+    exit 1
 fi
 
 
index 755ef50a6f44b8c4d347bf1e565f4c0c9cd1d0da..8bbe856b1694f2b5999affcfbec5265fb5ff6871 100644 (file)
@@ -5,29 +5,29 @@
  @brief Data Structures for the sensor messages sent over the air.
 
  Group: WCS LPC
- $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
+ $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
 
  ******************************************************************************
  $License: BSD3 2016 $
-
+  
    Copyright (c) 2015, 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
@@ -41,7 +41,7 @@
    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ******************************************************************************
  $Release Name: TI-15.4Stack Linux x64 SDK$
- $Release Date: Jun 28, 2017 (2.02.00.03)$
+ $Release Date: Sept 27, 2017 (2.04.00.13)$
  *****************************************************************************/
 #ifndef SMGSS_H
 #define SMGSS_H
@@ -175,6 +175,8 @@ extern "C"
 #define SMSGS_TRACKING_REQUEST_MSG_LENGTH 1
 /*! Tracking Response message length (over-the-air length) */
 #define SMSGS_TRACKING_RESPONSE_MSG_LENGTH 1
+/*! Broadcast Command message length (over-the-air-length) */
+#define SMSGS_BROADCAST_CMD_LENGTH  3
 
 /*! Length of a sensor data message with no configured data fields */
 #define SMSGS_BASIC_SENSOR_LEN (3 + SMGS_SENSOR_EXTADDR_LEN)
@@ -184,6 +186,14 @@ extern "C"
 #define SMSGS_SENSOR_LIGHT_LEN 2
 /*! Length of the humiditySensor portion of the sensor data message */
 #define SMSGS_SENSOR_HUMIDITY_LEN 4
+/*! Length of the messageStatistics portion of the sensor data message */
+#define SMSGS_SENSOR_MSG_STATS_LEN 40
+/*! Length of the configSettings portion of the sensor data message */
+#define SMSGS_SENSOR_CONFIG_SETTINGS_LEN 8
+/*! Toggle Led Request message length (over-the-air length) */
+#define SMSGS_TOGGLE_LED_REQUEST_MSG_LEN 1
+/*! Toggle Led Request message length (over-the-air length) */
+#define SMSGS_TOGGLE_LED_RESPONSE_MSG_LEN 2
 /*! Length of the pressureSensor portion of the sensor data message */
 #define SMSGS_SENSOR_PRESSURE_LEN 8
 /*! Length of the motionSensor portion of the sensor data message */
@@ -191,33 +201,30 @@ extern "C"
 /*! Length of the batteryVoltageSensor portion of the sensor data message */
 #define SMSGS_SENSOR_BATTERY_LEN 4
 /*! Length of the hallEffectSensor portion of the sensor data message */
-#define SMSGS_SENSOR_HALL_EFFECT_LEN   2
+#define SMSGS_SENSOR_HALL_EFFECT_LEN 2
 /*! Length of the fanSensor portion of the sensor data message */
 #define SMSGS_SENSOR_FAN_LEN 1
 /*! Length of the doorLockSensor portion of the sensor data message */
 #define SMSGS_SENSOR_DOORLOCK_LEN 1
-/*! Length of the messageStatistics portion of the sensor data message */
-#define SMSGS_SENSOR_MSG_STATS_LEN 36
-/*! Length of the configSettings portion of the sensor data message */
-#define SMSGS_SENSOR_CONFIG_SETTINGS_LEN 8
-/*! Toggle Led Request message length (over-the-air length) */
-#define SMSGS_TOGGLE_LED_REQUEST_MSG_LEN 1
-/*! Toggle Led Request message length (over-the-air length) */
-#define SMSGS_TOGGLE_LED_RESPONSE_MSG_LEN 2
+/*! Length of the waterleakSensor portion of the sensor data message */
+#define SMSGS_SENSOR_WATERLEAK_LEN 2
+/*! Control Buzzer Request message length (over-the-air length) */
+#define SMSGS_BUZZER_CTRL_REQUEST_MSG_LEN 1
+/*! Control Buzzer Response message length (over-the-air length) */
+#define SMSGS_BUZZER_CTRL_RESPONSE_MSG_LEN 1
 
 /*!
  Message IDs for Sensor data messages.  When sent over-the-air in a message,
  this field is one byte.
  */
- typedef enum
- {
+typedef enum {
     /*! Configuration message, sent from the collector to the sensor */
     Smsgs_cmdIds_configReq = 1,
     /*! Configuration Response message, sent from the sensor to the collector */
     Smsgs_cmdIds_configRsp = 2,
     /*! Tracking request message, sent from the the collector to the sensor */
     Smsgs_cmdIds_trackingReq = 3,
-     /*! Tracking response message, sent from the sensor to the collector */
+    /*! Tracking response message, sent from the sensor to the collector */
     Smsgs_cmdIds_trackingRsp = 4,
     /*! Sensor data message, sent from the sensor to the collector */
     Smsgs_cmdIds_sensorData = 5,
@@ -225,15 +232,21 @@ extern "C"
     Smsgs_cmdIds_toggleLedReq = 6,
     /* Toggle LED response msg, sent from the sensor to the collector */
     Smsgs_cmdIds_toggleLedRsp = 7,
-    /* new data type for ramp sensor data */
+    /* new data type for ramp data */
     Smsgs_cmdIds_rampdata = 8,
     /*! OAD mesages, sent/received from both collector and sensor */
     Smsgs_cmdIds_oad = 9,
+    /* Broadcast control msg, sent from the collector to the sensor */
+    Smgs_cmdIds_broadcastCtrlMsg = 10,
     /*! Fan speed control command */
-    Smsgs_cmdIds_fanSpeedChg = 10,
+    Smsgs_cmdIds_fanSpeedChg = 110,
     /*! Door lock command */
-    Smsgs_cmdIds_doorlockChg = 11
- } Smsgs_cmdIds_t;
+    Smsgs_cmdIds_doorlockChg = 111,
+    /* Control the Buzzer, sent from the collector to the sensor */
+    Smsgs_cmdIds_buzzerCtrlReq = 112,
+    /* Control the Buzzer response msg, sent from the sensor to the collector */
+    Smsgs_cmdIds_buzzerCtrlRsp = 113
+} Smsgs_cmdIds_t;
 
 /*!
  Frame Control field states what data fields are included in reported
@@ -241,8 +254,7 @@ extern "C"
  (OR'd together) in a control field.
  When sent over-the-air in a message this field is 2 bytes.
  */
-typedef enum
-{
+typedef enum {
     /*! Temperature Sensor */
     Smsgs_dataFields_tempSensor = 0x0001,
     /*! Light Sensor */
@@ -264,7 +276,9 @@ typedef enum
     /*! Fan Sensor */
     Smsgs_dataFields_fanSensor = 0x0200,
     /*! Door Lock Sensor */
-    Smsgs_dataFields_doorLockSensor = 0x0400
+    Smsgs_dataFields_doorLockSensor = 0x0400,
+    /*! Water Leak Sensor */
+    Smsgs_dataFields_waterleakSensor = 0x0800,
 } Smsgs_dataFields_t;
 
 /*!
@@ -361,6 +375,27 @@ typedef struct _Smsgs_toggleledrspmsg_t
     uint8_t ledState;
 } Smsgs_toggleLedRspMsg_t;
 
+/*!
+ Buzzer Ctrl Request message: sent from controller to the sensor.
+ */
+typedef struct _Smsgs_buzzerctrlreqmsg_t
+{
+    /*! Command ID - 1 byte */
+    Smsgs_cmdIds_t cmdId;
+} Smsgs_buzzerCtrlReqMsg_t;
+
+/*!
+  Buzzer Ctrl Response message: sent from the sensor to the collector
+  in response to the Buzzer Ctrl Request message.
+  */
+typedef struct _Smsgs_buzzerctrlrspmsg_t
+{
+    /*! Command ID - 1 byte */
+    Smsgs_cmdIds_t cmdId;
+    /*! LED State - 0 is off, 1 is on - 1 byte */
+    uint8_t buzzerState;
+} Smsgs_buzzerCtrlRspMsg_t;
+
 /*!
  Temp Sensor Field
  */
@@ -398,6 +433,15 @@ typedef struct _Smsgs_humiditysensorfield_t
     uint16_t humidity;
 } Smsgs_humiditySensorField_t;