The dynamic BLE-Zigbee Template example demonstrates the usage of the dynamic multiprotocol method. This example is a merge of a simplified version of BLE Peripheral Template and the simple Zigbee application.
The nRF52840 device operates simultaneously on Zigbee and BLE. It joins the Zigbee network as a Zigbee Router device. It also acts as a BLE Peripheral device sending BLE connectable advertisements.
The Zigbee part of the application implements the Zigbee Range Extender functionality. It is a Zigbee device which basically provides no other functionality except extending the range of the Zigbee network. It is populated by the two Zigbee ZCL clusters: Basic and Identify.
Setup
You can find the source code in the following folder: <InstallFolder>\examples\multiprotocol\experimental\ble_zigbee_dynamic_template
LED and button assignments
LED assignments:
- BSP_LED_0: BLE Network state:
- Blinking – BLE advertising.
- Solid – Connected over BLE.
- BSP_LED_2: Zigbee Network state:
- Off – Not commissioned.
- On – Commissioned.
Button assignments:
- BSP_BUTTON_0: Wake up from BLE sleep mode.
Testing
- Precondition
- To test the example, prepare at least one nRF52840 Development Kit and an Android smartphone.
- On the smartphone, install nRF Connect for Mobile.
- Compile and program the SoftDevice and the application. Observe that the BSP_INDICATE_ADVERTISING state is indicated.
- Connect to the device from nRF Connect (the device is advertising as 'Nordic_Template'). Observe that the BSP_INDICATE_CONNECTED state is indicated.
- Disconnect the device in nRF Connect and observe that the BSP_INDICATE_ADVERTISING state is indicated.
- Prepare the Zigbee coordinator using the Zigbee CLI agent. Refer to Zigbee CLI Reference for complete reference of the Zigbee Command Line Interface.
- Run the
role
command to set the role of the CLI device in the Zigbee network and then start it: > bdb role zc
Coordinator set
Done
> bdb start
Started coordinator
Done
- Check that the device with the the Basic and Identify Clusters is present in the network.
> zdo match_desc ffff ffff 0104 2 0 3 0
src_addr=D9D2 ep=7
Done
- Note
- The short address of the device returned by the Match Descriptor Request may differ in your case.