Peers the stack is bonded with, identified by their identity address.
More...
Peers the stack is bonded with, identified by their identity address.
The stack keeps its bonds, with their keys and Client Characteristic Configuration Descriptor states, in the NimBLE store. They can be read and deleted with the stack stopped as well.
Changes are reported on KernelMain through pbl_bt_cb_bond_added(), pbl_bt_cb_bond_changed() and pbl_bt_cb_bond_deleted(), after the store has them.
◆ pbl_bt_bond_info
| Data Fields |
|
struct pbl_bt_device_internal |
addr |
Identity address of the peer. |
|
struct pbl_bt_sm_key |
irk |
Identity Resolving Key of the peer, valid if irk_valid. |
|
bool |
irk_valid |
True if the peer distributed its Identity Resolving Key. |
◆ pbl_bt_bond_keys
The keys of a bond, to copy it to or from other storage.
| Data Fields |
|
uint8_t |
flags |
PBL_BT_BOND_FLAG_* values. |
|
struct pbl_bt_sm_pairing_info |
info |
Keys and identity exchanged during pairing. |
◆ PBL_BT_BOND_FLAG_AUTHENTICATED
| #define PBL_BT_BOND_FLAG_AUTHENTICATED 0x02U |
Bond flag: the pairing was authenticated (MITM protected).
◆ PBL_BT_BOND_FLAG_SECURE_CONNECTIONS
| #define PBL_BT_BOND_FLAG_SECURE_CONNECTIONS 0x01U |
Bond flag: paired with Secure Connections.
◆ pbl_bt_bond_cb_t
| typedef void(* pbl_bt_bond_cb_t) (const struct pbl_bt_bond_info *info, void *user_data) |
◆ pbl_bt_bond_count()
| size_t pbl_bt_bond_count |
( |
void |
| ) |
|
Count the bonds.
- Returns
- Number of bonds.
◆ pbl_bt_bond_get()
Get a bond.
- Parameters
-
| addr | Identity address of the peer. |
| [out] | info | The bond. May be NULL. |
- Return values
-
| 0 | Success. |
| -ENOENT | Not bonded with addr. |
◆ pbl_bt_bond_get_keys()
Get the keys of a bond.
- Parameters
-
| addr | Identity address of the peer. |
| [out] | keys | The keys. |
- Return values
-
| 0 | Success. |
| -ENOENT | Not bonded with addr. |
◆ pbl_bt_bond_set_keys()
Add a bond from its keys, or replace the keys of the one with the same peer.
For bonds made elsewhere, before the stack starts. Nothing is written if the store has the same keys, and no callback is called.
- Parameters
-
- Return values
-
| 0 | Success. |
| -EIO | The store could not take them. |
◆ pbl_bt_cb_bond_added()
Called after bonding with a new peer.
Implemented by the firmware. Runs on KernelMain.
- Parameters
-
◆ pbl_bt_cb_bond_changed()
Called after the keys of a bond changed, for example when its peer paired again.
Implemented by the firmware. Runs on KernelMain.
- Parameters
-
◆ pbl_bt_cb_bond_deleted()
Called after a bond was deleted.
Implemented by the firmware. Runs on KernelMain.
- Parameters
-
| addr | Identity address of the peer. |
◆ pbl_bt_foreach_bond()
Iterate over the bonds.
- Parameters
-
| func | Called for each bond. It must not add or delete bonds. |
| user_data | Passed to func. |
◆ pbl_bt_unpair()
Delete a bond, with its Client Characteristic Configuration Descriptor states.
A connection to the peer is left as it is.
- Parameters
-
| addr | Identity address of the peer, or NULL for all bonds. |
- Return values
-
| 0 | Success. |
| -ENOENT | Not bonded with addr. |
| -EIO | Store error. |