Bluetooth: Peripheral Bond Management Service (BMS)¶
The peripheral BMS sample demonstrates how to use the GATT Bond Management Service (BMS).
Overview¶
When connected, the sample waits for Client’s requests to perform any bond deleting operation.
It supports up to two simultaneous Client connections.
Requirements¶
The sample supports the following development kits:
Hardware platforms |
PCA |
Board name |
Build target |
---|---|---|---|
PCA10095 |
|
||
PCA10056 |
|
||
PCA10040 |
|
||
PCA10040 |
|
The sample also requires a Bluetooth Low Energy dongle and nRF Connect for Desktop.
User interface¶
- LED 1:
Blinks with a period of 2 seconds with the duty cycle set to 50% when the main loop is running and the device is advertising.
- LED 2:
On when connected.
Building and Running¶
This sample can be found under samples/bluetooth/peripheral_bms
in the nRF Connect SDK folder structure.
See Building and programming a sample application for information about how to build and program the application.
Testing¶
After programming the sample to your development kit, test it by performing the following steps:
Connect to the kit that runs this sample with a terminal emulator (for example, PuTTY). See How to connect with PuTTY for the required settings.
Reset the board.
Start nRF Connect for Desktop and select the connected device that is used for communication.
Connect to the device from nRF Connect. The device is advertising as “Nordic_BMS”.
Bond with the device:
Click the Settings button for the device in nRF Connect.
Select Pair.
Check Perform Bonding.
Click Pair.
Check the logs to verify that the connection security is updated.
Disconnect the device in nRF Connect.
Reconnect again and verify that the connection security is updated automatically.
Verify that the Feature Characteristic of the Bond Management Service displays
10 08 02
. This means that the following features are supported:Deletion of the bonds for the current connection of the requesting device.
Deletion of all bonds on the Server with the Authorization Code.
Deletion of all bonds on the Server except the ones of the requesting device with the Authorization Code.
Write
03
to the Bond Management Service Control Point Characteristic.03
is the command to delete the current bond.Disconnect the device to trigger the bond deletion procedures.
Reconnect the devices and verify that the connection security is not updated.
Bond both devices again.
Write
06 41 42 43 44
to the Bond Management Service Control Point Characteristic.06
is the command to delete all bonds on the Server, followed by the authorization code “ABCD”.Disconnect the device to trigger the bond deletion procedures.
Reconnect the devices again and verify that the connection security is not updated.
Dependencies¶
This sample uses the following nRF Connect SDK libraries:
In addition, it uses the following Zephyr libraries:
include/zephyr/types.h
lib/libc/minimal/include/errno.h
include/sys/printk.h
-
include/bluetooth/bluetooth.h
include/bluetooth/conn.h
include/bluetooth/uuid.h
include/bluetooth/gatt.h