Skip to content

Commit 0dd951c

Browse files
services: add ble_bms
Add bond management service. Signed-off-by: Eivind Jølsgard <[email protected]>
1 parent 33a457e commit 0dd951c

File tree

14 files changed

+1913
-0
lines changed

14 files changed

+1913
-0
lines changed

doc/nrf-bm/api/api.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,15 @@ Battery Service
162162
:inner:
163163
:members:
164164

165+
.. _api_ble_bms:
166+
167+
Bond Management Service
168+
=======================
169+
170+
.. doxygengroup:: ble_bms
171+
:inner:
172+
:members:
173+
165174
.. _api_ble_cgms:
166175

167176
Continuous Glucose Monitoring Service
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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 BAS 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+
60+
Dependencies
61+
************
62+
63+
This library uses the following |BMshort| libraries:
64+
65+
* SoftDevice - :kconfig:option:`CONFIG_SOFTDEVICE`
66+
* SoftDevice handler - :kconfig:option:`CONFIG_NRF_SDH`
67+
68+
API documentation
69+
*****************
70+
71+
| Header file: :file:`include/bluetooth/services/ble_bms.h`
72+
| Source files: :file:`subsys/bluetooth/services/ble_bms/`
73+
74+
:ref:`Battery Service API reference <api_ble_bms>`

0 commit comments

Comments
 (0)