CAF: Bluetooth LE state extension module
The Bluetooth® LE state extension module extends the CAF Bluetooth LE state module with functionality that is not yet available in the used nRF Connect SDK release.
Configuration
The module is enabled by the CONFIG_CAF_BLE_STATE_EXTENSION Kconfig option.
The option depends on CONFIG_CAF_BLE_STATE and is enabled by default if prerequisites are met.
When Shorter Connection Intervals (SCI) is used, the CONFIG_CAF_BLE_SCI_CONN_RATE_EVENTS option is also required.
The option is enabled by default if prerequisites are met.
See the CAF extension Kconfig options page for the complete list of CAF extension Kconfig options.
See Configuring and building for information about how to permanently or temporarily change the configuration.
For the API reference, see CAF extension event.
Implementation details
The module is used by both Bluetooth Peripheral and Bluetooth Central devices.
It extends the CAF Bluetooth LE state module by adding additional Application Event Manager events.
Connection parameter change
Connection parameter changes are handled differently depending on whether Shorter Connection Intervals (SCI) are used for a given Bluetooth LE connection.
SCI support is controlled by the CONFIG_BT_SHORTER_CONNECTION_INTERVALS Kconfig option.
The peer must also support SCI for it to be used on a connection.
Shorter Connection Intervals unused
The Bluetooth LE state module handles Zephyr’s callbacks for Bluetooth LE connections.
The module submits a ble_peer_conn_params_event to inform other application modules about connection parameter update requests and connection parameter updates.
The Bluetooth LE state module rejects the connection parameter update request in Zephyr’s callback and submits the ble_peer_conn_params_event to inform other application modules about connection parameter update request.
The event is handled by the Bluetooth LE connection parameters module, which updates the connection parameters.
Shorter Connection Intervals used
If you are using SCI, update the connection parameters with the bt_conn_le_conn_rate_request() function.
The CAF Bluetooth LE state extension module submits a ble_peer_sci_conn_rate_event to inform other application modules about connection rate changes.
The event is also emitted when a connection rate update request fails.
In this case, it contains the status code of the failed request.
No event is emitted when a connection rate update request is received, because the Bluetooth stack does not provide a callback for this when SCI is enabled.
A Bluetooth LE Central can use the bt_conn_le_conn_rate_set_defaults() function to limit the accepted connection rate range.
Note
When the CONFIG_BT_SHORTER_CONNECTION_INTERVALS Kconfig option is enabled, the non-SCI callbacks remain available.
They are called if you use the non-SCI (connection parameter update) API to update the connection parameters.
However, do not use the non-SCI API if both the device and peer support SCI.