Skip to content

Commit f184255

Browse files
services: add ble_bms
Add bond management service. Signed-off-by: Eivind Jølsgard <eivind.jolsgard@nordicsemi.no>
1 parent 779e37a commit f184255

20 files changed

Lines changed: 2751 additions & 2 deletions

File tree

doc/nrf-bm/api/api.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,15 @@ Battery Service
191191
:inner:
192192
:members:
193193

194+
.. _api_ble_bms:
195+
196+
Bond Management Service
197+
=======================
198+
199+
.. doxygengroup:: ble_bms
200+
:inner:
201+
:members:
202+
194203
.. _api_ble_cgms:
195204

196205
Continuous Glucose Monitoring Service
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
.. _lib_ble_service_bms:
2+
3+
Bond Management Service (BMS)
4+
#############################
5+
6+
.. contents::
7+
:local:
8+
:depth: 2
9+
10+
Overview
11+
********
12+
13+
This library implements the Bond Management Service with the corresponding set of characteristics defined in the `Bond Management Service Specification`_.
14+
15+
You can configure the service to support your desired feature set of bond management operations.
16+
All the BMS features in the "LE transport only" mode are supported:
17+
18+
* Delete the bond of the requesting device.
19+
* Delete all bonds on the server.
20+
* Delete all bonds on the server except the one of the requesting device.
21+
22+
You can enable each feature when initializing the library.
23+
24+
Authorization
25+
=============
26+
27+
You can require authorization to access each BMS feature.
28+
29+
When required, the client's request to execute a bond management operation must contain the authorization code.
30+
The server compares the code with its local version and accepts the request only if the codes match.
31+
32+
If you use at least one BMS feature that requires authorization, you need to provide a callback with comparison logic for the authorization codes.
33+
You can set this callback when initializing the library.
34+
35+
Deleting the bonds
36+
==================
37+
38+
The server deletes bonding information on client's request right away when there is no active Bluetooth® Low Energy connection associated with a bond.
39+
Otherwise, the server removes the bond for a given peer when it disconnects.
40+
41+
Configuration
42+
*************
43+
44+
Set the :kconfig:option:`CONFIG_BLE_BMS` Kconfig option to enable the service.
45+
46+
Initialization
47+
==============
48+
49+
The service instance is declared using the :c:macro:`BLE_BMS_DEF` macro, specifying the name of the instance.
50+
The service is initialized by calling the :c:func:`ble_bms_init` function.
51+
See the :c:struct:`ble_bms_config` struct for configuration details, in addition to the BMS specification.
52+
53+
Usage
54+
*****
55+
56+
Events from the service are forwarded through the event handler specified during initialization.
57+
For a full list of events see the :c:enum:`ble_bms_evt_type` enum.
58+
59+
Dependencies
60+
************
61+
62+
This library uses the following |BMshort| libraries:
63+
64+
* SoftDevice - :kconfig:option:`CONFIG_SOFTDEVICE`
65+
* SoftDevice handler - :kconfig:option:`CONFIG_NRF_SDH`
66+
67+
API documentation
68+
*****************
69+
70+
| Header file: :file:`include/bluetooth/services/ble_bms.h`
71+
| Source files: :file:`subsys/bluetooth/services/ble_bms/`
72+
73+
:ref:`Bond Management Service API reference <api_ble_bms>`

include/bm/bluetooth/ble_qwr.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,7 @@ uint32_t ble_qwr_attr_register(struct ble_qwr *qwr, uint16_t attr_handle);
225225
* @retval NRF_ERROR_NULL If @p qwr, @p mem or @p len is @c NULL.
226226
* @retval NRF_ERROR_INVALID_STATE If the given @p qwr instance has not been initialized.
227227
*/
228-
uint32_t ble_qwr_value_get(
229-
struct ble_qwr *qwr, uint16_t attr_handle, uint8_t *mem, uint16_t *len);
228+
uint32_t ble_qwr_value_get(struct ble_qwr *qwr, uint16_t attr_handle, uint8_t *mem, uint16_t *len);
230229
#endif /* (CONFIG_BLE_QWR_MAX_ATTR > 0) */
231230

232231
#ifdef __cplusplus

0 commit comments

Comments
 (0)