GATT Bond Management Service (BMS)
This library implements the Bond Management Service with the corresponding set of characteristics defined in the Bond Management Service Specification.
You can configure the service to support your desired feature set of bond management operations. All the BMS features in the “LE transport only” mode are supported:
Delete the bond of the requesting device.
Delete all bonds on the Server.
Delete all bonds on the Server except the one of the requesting device.
You can enable each feature when initializing the library.
Deleting the bonds
The Server deletes bonding information on Client’s request right away when there is no active Bluetooth® Low Energy connection associated with a bond. Otherwise, the Server removes the bond for a given peer when it disconnects.
API documentation
include/bluetooth/services/bms.h
subsys/bluetooth/services/bms.c
- group bt_bms
API for the Bond Management Service (BMS).
Enums
-
enum bt_bms_op
BMS Control Point operation codes (LE transport).
Values:
-
enumerator BT_BMS_OP_DEL_REQ_BOND
Initiates the procedure to delete the bond of the requesting device.
-
enumerator BT_BMS_OP_DEL_ALL_BONDS
Initiates the procedure to delete all bonds on the device.
-
enumerator BT_BMS_OP_DEL_REST_BONDS
Initiates the procedure to delete all bonds except for the one of the requesting device.
-
enumerator BT_BMS_OP_DEL_REQ_BOND
Functions
-
int bt_bms_init(const struct bt_bms_init_params *init_params)
Initialize the BMS Service.
Initialize the BMS Service by specifying a list of supported operations. If any operation is configured as authorized, you need to provide authorize() callback.
- Parameters:
init_params – Initialization parameters.
- Return values:
0 – If the operation was successful. Otherwise, a (negative) error code is returned.
-
struct bt_bms_authorize_params
- #include <bms.h>
BMS authorization callback parameters.
-
struct bt_bms_cb
- #include <bms.h>
BMS server callback structure.
Public Members
-
bool (*authorize)(struct bt_conn *conn, struct bt_bms_authorize_params *params)
Operation authorization callback
If this callback is set, support for BMS Authorization Code functionality is enabled. This function is called whenever an authorized operation is requested by the client.
- Param conn:
Connection object.
- Param params:
Authorization parameters.
- Retval true:
If the authorization was successful.
- Retval false:
Otherwise.
-
bool (*authorize)(struct bt_conn *conn, struct bt_bms_authorize_params *params)
-
struct bt_bms_feature
- #include <bms.h>
Bitmask of supported features.
-
struct bt_bms_features
- #include <bms.h>
Bitmask set of supported features.
Public Members
-
struct bt_bms_feature delete_all
Support the operation to delete all bonds.
-
struct bt_bms_feature delete_requesting
Support the operation to delete the bonds of the requesting device.
-
struct bt_bms_feature delete_rest
Support the operation to delete all bonds except for the bond of the requesting device.
-
struct bt_bms_feature delete_all
-
struct bt_bms_init_params
- #include <bms.h>
BMS initialization parameters.
-
enum bt_bms_op