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 Thingy:52 devices. After a power-on, the device initializes the BLE stack and the Zigbee stack, and starts scanning. Simultaneously, the application tries to connect to the Zigbee network and the Thingy:52 devices. For every connected Thingy, 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 the 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 at <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 the two endpoints. If you want to use a light switch to control the Thingy:52 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.
MATCH_DESC_REQ_ROLE
, change ZB_NWK_BROADCAST_RX_ON_WHEN_IDLE
to ZB_NWK_BROADCAST_ALL_DEVICES
in main.c
to enable the light switch to work also with sleepy end devices:<InstallFolder>\examples\zigbee\light_control\light_switch
.<InstallFolder>\examples\zigbee\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 Thingy:52 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 Thingy:52 LEDs. At this point, you can: