Developing with ZBOSS for Zigbee
NCP Host light sample

This light sample demonstrates a basic Zigbee network. It provides a minimal implementation of the following devices:

  • Light coordinator - Demonstrates the Zigbee Coordinator role.
  • Light control - Demonstrates the Zigbee End Device role.
  • Dimmable light device - Demonstrates the Zigbee Router role, implementing the Dimmable Light profile.

Light coordinator

The light coordinator establishes the network and commissions the dimmable light device and the light control. If the hardware supports LEDs, LED1 indicates the program start.

Light control

Once the light control is successfully commissioned, it sends a broadcast message to find any device with implemented Level Control and On/Off clusters. It remembers the device network address from the first response. Once the dimmable light device is discovered, the light control starts sending a periodical On/Off commands with a 15-sec period.

Dimmable light device

The dimmable light device joins the Zigbee network and waits for a light control to join the network.

Both On/Off and Level Control clusters are supported. The device state and brightness level are stored in non-volatile memory, so the the device's parameters are restored after each power-cycle.

If the hardware supports LEDs:

  • LED1 indicates the program start.
  • LED2 indicates commissioning status (ON when joined the network).
  • LED3 indicates the bulb state. Level Control commands are reflected on this LED's brightness level. This LED is connected to the PWM channel.

Testing the sample

To test this sample:

  1. Program each device with the NCP firmware individually.
  2. Start the light coordinator application.
  3. Start the light control application.
  4. Start the dimmable light device application.

Application file structure

  • dimmable_light
    • bulb.c
    • bulb.h
    • bulb_hal.h
    • zb_ha_bulb.h
    • Makefile
  • light_control
    • light_control.c
    • light_control.h
    • light_control_hal.h
    • Makefile
  • light_cordinator
    • light_zc.c
    • light_zc.h
    • light_zc_hal.h
    • Makefile
  • Makefile
  • - This file