The BLE Proximity and Thread CoAP Server Example example is provided in two configurations - UART and USB. The former one uses UART communication and SEGGER J-Link as a UART-USB converter. The latter one uses the USB peripheral that is available in nRF52840 and communicates as a native USB CDC device. If native USB CDC connectivity is used on Windows XP/7 hosts, you must manually install the driver that is located in the <InstallFolder>\examples\usb_drivers:
nordic_cdc_acm.inf Windows 8 (and later) hosts will pick the correct driver (usbser.sys) automatically.
This BLE-Thread dynamic multiprotocol example requires you to run any complementary example on the second board, i.e. an example containing Thread CoAP Client functionality, for example:
This example application is based on the ble_app_proximity 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 may 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
, utilizing BLE Proximity and BLE Find Me Profiles. When the device is in BLE connection, it may trigger a sound alarm on BLE Central node (e.g. a smartphone) by using BSP_BUTTON_0. Similarly, BLE Central may trigger BSP_LED_2 by setting a proper characteristic (e.g. by tapping te Find Me button on smartphone application). When not using BLE, nRF52840 SoC acts as a Thread CoAP Server controlling BSP_LED_3.
LED assignments:
Button assignments:
You can find the source code and the makefile in the following folder: <InstallFolder>\examples\multiprotocol\ble_thread\ble_thread_dyn_proximity
simple_coap_client
example to one of the boards and switch it on. LED 1 will start blinking (attaching to a Thread network) and, after a few seconds, it will turn solid (attached to a Thread network or Thread network created): state
command to check the state of the device in the Thread network: