CAF: Bluetooth LE bond module
The Bluetooth® LE bond module of the Common Application Framework (CAF) allows to introduce Bluetooth LE bonding to the application. The module also allows to delete bonds for the default Bluetooth local identity.
Configuration
Before using the module make sure that the following Kconfig options are enabled:
The device must be Bluetooth bondable and bonds must be stored in the non-volatile memory (settings). The CAF: Settings loader module is used to load content of the settings area during boot.
The Bluetooth LE bond module is enabled using CONFIG_CAF_BLE_BOND
.
This Kconfig option selects CONFIG_CAF_BLE_BOND_SUPPORTED
option to indicate that the Bluetooth LE bond module is implemented in the application.
Enabling bond erase
The Bluetooth LE bond module can erase bonds for the default Bluetooth local identity when a predefined button click is detected.
The module subscribes for click_event
to detect the button clicks.
Complete the following steps to enable bond erase:
Set the
CONFIG_CAF_BLE_BOND_PEER_ERASE_CLICK
to enable the bond erase when a predefined button click is detected.Set
CONFIG_CAF_BLE_BOND_PEER_ERASE_CLICK_KEY_ID
to define the key ID of the button used to erase bonds.Select one of the following Kconfig options to specify the click type (
click
) that triggers the bond erase:By default, detection of the specific click for a specific button always triggers the bond erase. Set
CONFIG_CAF_BLE_BOND_PEER_ERASE_CLICK_TIMEOUT
to specify the waiting time for detecting the button click after boot. The timeout is specified in milliseconds. The button click is ignored if it occurs after the timeout.
Implementation details
The Bluetooth LE bond module can be used as a default implementation of Bluetooth LE bond functionality for simple applications.
The module does not broadcast information about performed Bluetooth LE peer operations using ble_peer_operation_event
.
The module assumes that only default Bluetooth local identity is used.
Note
If your application requires an application-specific Bluetooth LE bond and peer management, you must provide your own implementation of the Bluetooth LE bond module. See Bluetooth LE bond module for an example of implementation.