![]() |
nRF5 SDK
v14.1.0
|
Choose documentation: | nRF5 SDK | S112 SoftDevice API | S132 SoftDevice API | S140 SoftDevice API | S212 SoftDevice API | S332 SoftDevice API |
Important: Before you run this example, make sure to program the SoftDevice.
The BLE LE Secure Connections Multirole Example demonstrates how to use LE Secure Connections (LESC) to enforce GAP Security Mode 1, Level 4. This security mode requires pairing or bonding using LESC with man-in-the-middle (MITM) protection. The application includes the Peer Manager module, which supports LESC in both the Central and the Peripheral role.
The application can act either as a Peripheral or as a Central, depending on how the connection is set up. The application both advertises and scans at startup and after disconnection, and the role that is established first is selected for the next connection.
If you want the application to act as a Peripheral, connect to it from nRF Connect or from another board that runs the same application. If you want the application to act as a Central, provide a Peripheral that is advertising with the Heart Rate Service UUID in its advertising data. The Peripheral can either be nRF Connect or another board that runs the same application.
The application includes the Heart Rate Service both as a server and as a client:
Security for the Client Characteristic Configuration Descriptor (CCCD) in the Heart Rate Measurement characteristic is set at Security Mode 1 Level 4, which requires LESC with MITM. This means that whenever the collector tries to enable notifications, it must first secure the connection.
The example uses the Cryptography library. By default, the example project for nRF52832 (PCA10040) uses the Software backend (micro-ecc) of the library. The example project for nRF52840 (PCA10056) uses the Hardware-accelerated backend (CryptoCell). See Selecting the backend for instructions about how to change the default backend, for example, to compare the performance of the different backends.
Note that the software backend of the Cryptography library requires an external library, micro-ecc, that must be installed separately before you can compile the example. When using micro-ecc, you must ensure compliance with the license of the library as stated in the LICENSE.txt file.
You can find the source code and the project file of the example in the following folder: <InstallFolder>\examples\ble_central_and_peripheral\experimental\ble_app_multirole_lesc
LED assignments:
You can test the application in two different ways:
Test the BLE LESC Multirole Example application by performing the following steps:
lv4
set to 1.