# ZNP Examples

READ ME FIRST

Author:
  Derek Smith

## Introduction

The Zigbee Network Processor allows you to easily create Zigbee applications without having to make extensive changes to the Zigbee Stack. This page is a general overview of the examples we've provided to interface with the Zigbee Network Processor. See documentation on each file for more infomation. Methods are commented in the .c files. Header files list public (externally accessible) methods only.

The examples included demonstrate basic functionality to help you get up and running quickly. There are four categories of examples:

## Hardware Drivers

This section contains basic hardware examples for the board

- Button Blink: blinks the LED when the button is pressed. Good way to verify that the MSP430 is programmed correctly.
- Hello World: Outputs "Hello World" to the console. Good way to verify that the Debug console is configured correctly.
- Read Light Sensor: Reads light sensor and outputs measured value to the console.
- Read Accelerometer: Reads accelerometer and outputs measured value to the console.
- Accelerometer Interrupt: Configures the Accelerometer to generate an interrupt to the MSP430 upon motion. LED is toggled when interrupt received by MSP430.

## MSP430 to ZNP Interface

This section contains examples on how to interface to the ZNP.

- Reset Radio: Resets the radio, displays parsed response to the console.
- Get ZNP Version: Demonstrates how to use the SYS_VERSION command, displays parsed response to the console.
- Get MAC Address: Demonstrates how to use the ZB_GET_DEVICE_INFO command to get the 64-bit IEEE Address (MAC Address)
- RF Tester: This is a handy little application that uses the SYS_TEST_RF command to have the CC2530 output a continuous test tone on its RF interface. Useful for RF testing or compliance testing.
- Read NV Items: Reads the user-accessible non-volatile memory items using SYS_OSAL_NV_READ and displays contents of each to console.
- Write NV Items: Prompts the user for which non-volatile memory item to write and uses SYS_OSAL_NV_WRITE to write data to this item.
- Read Radio GPIO pins - Uses SYS_GPIO to read value of GPIO1-4 and outputs to console
- Write Radio GPIO pins - Uses SYS_GPIO to write values to GPIO1-4.

## Communications

This section demonstrates how to communicate over Zigbee using the ZNP.

- Basic Communications: Demonstrates how to configure one device as a coordinator and another as a router and send a message from the router to the coordinator.
- Basic Communications with Security: Demonstrates how to send data using encryption. Both pre-configured keys and key distribution by coordinator are supported.
- Find Device on network: Since Zigbee uses short-addressing, this example shows how to get a device's 64-bit IEEE MAC Address (long address) for a given short address.
- Packet Error Rate Tester: Sends 1000 packets and counts how many were received.

## Simple Applications

This section demonstrates how to create simple applications to send and receive Zigbee data.

- Basic Application Framework: use a state machine to startup the coordinator & router and send/receive data.
- End Device on Timer/Motion: Periodically send messages or when a movement interrupt occurs; otherwise sleep.
- Router: Periodically send messages on timer

Note: these simple applications do NOT work with Sensor Monitor.

All Data Structures Files Functions Variables Defines