Functions/APIs implemented and exposed by this module.
More...
- Parameters
-
[in] | p_init | This contains information needed to initialize this module. |
- Returns
- NRF_SUCCESS on successful initialization, otherwise an error code.
void ble_bondmngr_on_ble_evt |
( |
ble_evt_t * |
p_ble_evt | ) |
|
- Parameters
-
[in] | p_ble_evt | The event received from the BLE stack. |
- Returns
- NRF_SUCCESS if all operations went successfully, NRF_ERROR_NO_MEM if the maximum number of bonded masters has been reached. Other error codes in other situations.
uint32_t ble_bondmngr_bonded_masters_store |
( |
void |
| ) |
|
If the data to be written is different from the existing data, this function erases the flash pages before writing to flash.
- Warning
- This function could prevent the radio from running. Therefore it MUST be called ONLY when the application knows that the Bluetooth radio is not active. An example of such a state is when the application has received the Disconnected event and has not yet started advertising. If it is called in any other state, or if it is not called at all, the behavior is undefined.
- Returns
- NRF_SUCCESS on success, an error_code otherwise.
uint32_t ble_bondmngr_bonded_masters_delete |
( |
void |
| ) |
|
After calling this function you should call ble_bondmngr_init() to re-initialize the RAM database.
- Returns
- NRF_SUCCESS on success, an error_code otherwise.
This function populates the whitelist with either the IRKs or the public adresses of all bonded masters.
- Parameters
-
[out] | p_whitelist | Whitelist structure with all bonded masters. |
- Returns
- NRF_SUCCESS on success, an error_code otherwise.
uint32_t ble_bondmngr_master_addr_get |
( |
int8_t |
master_handle, |
|
|
ble_gap_addr_t * |
p_master_addr |
|
) |
| |
- Note
- This function returns NRF_ERROR_INVALID_PARAM if the given master has a private address.
- Parameters
-
[in] | master_handle | Master's handle. |
[out] | p_master_addr | Pointer to the master's address which can be used for directed advertising. |
uint32_t ble_bondmngr_sys_attr_store |
( |
void |
| ) |
|
This function fetches the System Attributes of the current master from the stack, adds it to the database in memory, and also stores it in the flash (without erasing any flash page). This function is intended to facilitate the storage of System Attributes when connected to new master (whose System Attributes are NOT yet stored in flash) even in connected state without affecting radio link. This function can, for example, be called after the CCCD is written by a master. The function will succeed if the master is a new master. See HID Keyboard Application or HID Mouse Application for sample usage.
- Returns
- NRF_SUCCESS on success, otherwise an error code. NRF_ERROR_INVALID_STATE is returned if the System Attributes of the current master is already present in the flash because it is a previously known master.
uint32_t ble_bondmngr_master_ids_get |
( |
uint16_t * |
p_master_ids, |
|
|
uint16_t * |
p_length |
|
) |
| |
This function fetches the identifiers of the masters that are currently in the database, or in other words, known to the bond manager.
- Parameters
-
[out] | p_master_ids | Pointer to the array of master identifiers. It is recommended that the length of this array be equal to MAX_NUMBER_OF_BONDED_MASTERS * 2 bytes. If value of this pointer is NULL, only the number of masters in the database will be filled in p_length. This can be used to find out the required size of the array pointed to by p_master_ids in a subsequent call. |
[in,out] | p_length | Pointer to the length of p_master_ids array provided as input. On return, this function will write the number of master identifiers found to p_length |
- Returns
- NRF_SUCCESS on success. NRF_ERROR_NULL if the input parameter p_length is NULL. NRF_ERROR_INVALID_STATE is returned if the bond manager was not initialized. NRF_ERROR_DATA_SIZE is returned if the length of the input parameter p_master_ids provided is not enough to fit in all the master identifiers in the database.
uint32_t ble_bondmngr_bonded_master_delete |
( |
uint16_t |
master_id | ) |
|
This function deletes the Bonding Information and System Attributes of a single master from the flash. The application can use the ble_bondmngr_master_ids_get function to fetch the identifiers of masters present in the database and then call this function.
- Warning
- This function could prevent the radio from running. Therefore it MUST be called ONLY when the application knows that the Bluetooth radio is not active. An example of such a state could be when the application is not in a connected state AND is also not advertising. If it is called in any other state, the behavior is undefined.
- Parameters
-
[in] | master_id | Identifier of the master to be deleted. |
- Returns
- NRF_SUCCESS on success. NRF_ERROR_INVALID_STATE is returned if the bond manager was not initialized. NRF_ERROR_NOT_FOUND if the master with the given identifier is not found in the database.
uint32_t ble_bondmngr_is_link_encrypted |
( |
bool * |
status | ) |
|
This function provides status of encrption of the link with a bonded master. Its is recommended that the application can use the ble_bondmngr_master_ids_get function to verify if the master is in the database and then call this function.
- Warning
- Currently the master id paramater is unused and is added only for future extension. As, today only one link is permitted for the peripheral device, status of current link is provided. In future, with more possibilities in the topology, master_id will be needed to identify the master.
- Parameters
-
[out] | status | Status of encryption, true implies link encrypted. |
- Returns
- NRF_SUCCESS on success. NRF_ERROR_INVALID_STATE is returned if the bond manager was not initialized.