![]() |
nRF5 SDK for Thread and Zigbee v4.0.0
|
Important: Before you run this example, make sure to program the SoftDevice.
The BLE Proximity and Thread CoAP Server Example example is provided in two configurations:
For more information about multiprotocol support, see Multiprotocol support with BLE/Bluetooth.
If native USB CDC connectivity is used on Windows XP/7 hosts, you must manually install the nordic_cdc_acm.inf
driver located at <InstallFolder>\examples\usb_drivers
. Hosts running on Windows 8 (and later) will automatically pick the correct driver (usbser.sys).
This BLE-Thread dynamic multiprotocol example requires you to run on the second board any complementary example that contains Thread CoAP Server functionality, for example:
This example application is based on the Proximity Application example available in nRF5 SDK. It has been extended to support dynamic switching between two connection modes, BLE and Thread, at the same time (concurrently). Thread operates on the 802.15.4 radio during Bluetooth low energy radio's inactive time (using Timeslot API). Depending on the Bluetooth low energy connection interval, nRF52840 SoC can spend up to 99% of the radio time on Thread protocol.
This example also supports the Thread CoAP Server role as described in Simple CoAP Server example.
The application works similarly to ble_app_proximity
, using BLE Proximity and BLE Find Me Profiles. When the device is in BLE connection, it can trigger a sound alarm on BLE Central node (for example, a smartphone) by using Button 1. Similarly, BLE Central can trigger LED3 by setting a proper characteristic (for example, by tapping te Find Me button on smartphone application). When not using BLE, nRF52840 SoC acts as a Thread CoAP Server controlling LED4.
You can find the source code and the makefile in the following folder: <InstallFolder>\examples\multiprotocol\ble_thread\ble_thread_dyn_proximity
The example uses LED assignments as described in Thread BSP LED and button reference for the following LEDs:
The following LEDs reserved for user application purposes are assigned in this example on the multiprotocol node:
The following buttons reserved for user application purposes are assigned in this example on the multiprotocol node:
The following buttons reserved for user application purposes are assigned in this example on the client node:
The following testing procedure uses the nRF52840 device.
simple_coap_client
example to one of the boards: state
command to check the state of the device in the Thread network: router
or child
.You can now also control the LED4 on the server node by pressing Button 1 on the client node.