feat(nimble): Added API to retrieve the size of the controller's white list

This commit is contained in:
darshan
2024-02-20 12:22:49 +05:30
committed by Abhinav Kudnar
parent 2227941edb
commit 0d2c053f42
2 changed files with 24 additions and 0 deletions
+9
View File
@@ -77,6 +77,15 @@ int ble_gap_wl_tx_rmv(const ble_addr_t *addrs);
*/
int ble_gap_wl_tx_clear(void);
/**
* Retrieves the size of the controller's white list.
*
* @param size On success, total size of whitelist will be stored here.
*
* @return 0 on success; nonzero on failure.
*/
int ble_gap_wl_read_size(uint8_t *size);
#if MYNEWT_VAL(BLE_POWER_CONTROL)
#if MYNEWT_VAL(BLE_HCI_VS)
+15
View File
@@ -2501,6 +2501,21 @@ ble_gap_wl_tx_clear(void)
BLE_HCI_OCF_LE_CLEAR_WHITE_LIST),
NULL, 0, NULL, 0 );
}
int ble_gap_wl_read_size(uint8_t *size) {
struct ble_hci_le_rd_white_list_rp rsp;
int rc;
rc = ble_hs_hci_cmd_tx(BLE_HCI_OP(BLE_HCI_OGF_LE,
BLE_HCI_OCF_LE_RD_WHITE_LIST_SIZE),
NULL, 0, &rsp, sizeof(rsp));
if (rc == 0) {
*size = rsp.size;
}
return rc;
}
#endif
int