|
| 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