mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-23 10:19:59 +00:00
feat(nimble): Added API to retrieve the size of the controller's white list
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user