This is an automated email from the ASF dual-hosted git repository.
janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
The following commit(s) were added to refs/heads/master by this push:
new 4a994636e nimble/host: Add API to retrieve the size of the
controller's white list
4a994636e is described below
commit 4a994636ede6d48ac664462e4de70107920bc81d
Author: Rahul Tank <[email protected]>
AuthorDate: Mon May 6 15:59:10 2024 +0530
nimble/host: Add API to retrieve the size of the controller's white list
---
nimble/host/include/host/ble_gap.h | 9 +++++++++
nimble/host/src/ble_gap.c | 17 +++++++++++++++++
2 files changed, 26 insertions(+)
diff --git a/nimble/host/include/host/ble_gap.h
b/nimble/host/include/host/ble_gap.h
index 86e589c18..e842ae29a 100644
--- a/nimble/host/include/host/ble_gap.h
+++ b/nimble/host/include/host/ble_gap.h
@@ -2239,6 +2239,15 @@ int ble_gap_terminate(uint16_t conn_handle, uint8_t
hci_reason);
*/
int ble_gap_wl_set(const ble_addr_t *addrs, uint8_t white_list_count);
+/**
+ * Retrieves the size of whitelist supported by controller
+ *
+ * @param size On success, this holds the size of controller
accept list
+ *
+ * @return 0 on success; nonzero on failure
+ */
+int ble_gap_wl_read_size(uint8_t *size);
+
/**
* Initiates a connection parameter update procedure.
*
diff --git a/nimble/host/src/ble_gap.c b/nimble/host/src/ble_gap.c
index 44d57707a..fe54fca8b 100644
--- a/nimble/host/src/ble_gap.c
+++ b/nimble/host/src/ble_gap.c
@@ -2398,6 +2398,23 @@ 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