![]() |
nRF5 SDK for Thread and Zigbee v1.0.0
|
Choose documentation: | nRF5 SDK | S112 SoftDevice API | S132 SoftDevice API | S140 SoftDevice API | S212 SoftDevice API |
Important: Before you run this example, make sure to program the SoftDevice.
This Zigbee dynamic multiprotocol example demonstrates how to control multiple BLE peripherals using a multiprotocol BLE Central/ZED device.
The device is combining two application roles:
In the application, both roles are connected to create a relationship between two Zigbee endpoints and two Thingy52 devices. After power on, the device initializes the BLE stack and Zigbee stack, and starts scanning. Simultaneously, the application tries to connect to the Zigbee network and Thingy52 devices. For every connected Thingy device, the application discovers characteristics, reads the current LED characteristic value and the battery level, and changes Thingy's LED from breathing blue color to constant red.
For every Zigbee endpoint in the relationship, incoming commands such as ON/OFF control, level control, or color control are processed. The commands control LED on the Thingy that is related with the endpoint. See the following chart for an example of a working application.
LED assignments:
This application does not use buttons.
You can find the source code and the makefiles in the following folder:
<InstallFolder>\examples\multiprotocol\experimental\ble_zigbee_dynamic_color_light_bulb_thingy
The light switch example (see Zigbee Light Control example) allows for testing only one of two endpoints. If you want to use a light switch to control the Thingy52 LED, make sure that there are no other light bulb devices in the network. There is no guarantee that using more than one light switch will let you control both endpoints, because every light switch can connect to the same endpoint.
<InstallFolder>\examples\zigbee\experimental\light_control\light_switch
.<InstallFolder>\examples\zigbee\experimental\light_control\light_coordinator
.When the Development Kit on which the application is running successfully joins the network, its BSP_LED_2 turns ON and the Thingy52 LED changes color from breathing blue to constant red to indicate the established connection. As soon as both BSP_LED_2 and BSP_LED_3 on the light switch turn ON, the light switch is ready to control one of the Thingy52 LEDs, and you can: