MAC Sensor

Introduction

This document discusses how to use the MAC Sensor App and the different parts that compose it. The MAC Sensor App is an examples that exercises different features of the TI MAC device implementation.

Software Prerequisites

Functional Description

Peripherals Exercised

To trigger various events, buttons can be used.

Software Overview

This section describes the software components and the corresponding source files.

Application Files

Configuration With SysConfig

SysConfig is a GUI configuration tool that allows for TI driver and stack configurations.

To configure using SysConfig, import the SysConfig-enabled project into CCS. Double click the *.syscfg file from the CCS project explorer, where * is the name of the example project. The SysConfig GUI window will appear, where Zigbee stack and TI driver configurations can be adjusted. These settings will be reflected in the generated files.

The example project comes with working default settings for SysConfig. For the purposes of this README, it is not recommended to change the default driver settings, as any changes may impact the functionality of the example. The Zigbee stack settings may be changed as required for your use case.

Note that some Zigbee settings are stored in non-volatile storage, and Zigbee prioritizes stored settings over SysConfig settings. To guarantee SysConfig settings are applied, perform a factory reset of the device to clear non-volatile storage.

Additional Configuration Settings

There are additional configurations that the user can set in sensor_mac_config_settings.h. This allows you to configure application behavior such as setting various clock intervals or channel(s) to scan on.

Example Usage

This example project implements a sensor end device: one of potentially many network devices in a PAN. This end device reads sensor information and sends it to the PAN-coordinator at a configured interval. This example assumes a second LPF2 Launchpad is running the default 15.4-Stack Collector application code to act as the PAN-coordinator. There is no UI to view any example output.

Example Application Dataflow

The sensor application has two processing loops each handling a different set of events. These are as follows:

The two processing loops handle specialized tasks to service sensor functionality.

An overview of the sensor jdllc states and state transitions is as follows:

               Jdllc_states_initWaiting
                          | SENSOR_START_EVT, initiated upon startup,
                          |
                          |
         Existing         |          New
         Network          |          Network
            +-------------+-------------+
            |                           |
            V                           V
  +--> Jdllc_states_                Jdllc_states_
  |    initRestoring                joining
  |         |                           |
  |         V                           V
  |    Jdllc_states_                Jdllc_states_
  |    rejoined                     joined
  |         |                           |
  |         +-------------+-------------+
  |                       | MAC reports sync loss (BCN mode, not implemented yet) or
  |                       | CONFIG_MAX_DATA_FAILURES consecutive data frames
  |                       | fail to be ACK'ed by collector
  | Orphan scan +         |
  | Coord realign         V
  +----------------- Jdllc_states_
                     orphan

Callbacks for Incoming Data Packets

The translation layer (specified in translate.h and translate.c) will process all incoming messages from the MAC layer and calls the corresponding callback in either the sensor application layer or jdllc layer. For incoming data packets, one of these two callbacks will be triggered: