This is an automated email from the ASF dual-hosted git repository.
andk 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 bd7391292 nimble/host: Preempt GAP operations before removing entry
from RL
bd7391292 is described below
commit bd739129210b6c6b3653dd058271ed3f831eeb3e
Author: Andrzej Kaczmarek <[email protected]>
AuthorDate: Wed Sep 18 00:36:37 2024 +0200
nimble/host: Preempt GAP operations before removing entry from RL
---
nimble/host/src/ble_hs_pvcy.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/nimble/host/src/ble_hs_pvcy.c b/nimble/host/src/ble_hs_pvcy.c
index dc09b51ba..f7cf090c0 100644
--- a/nimble/host/src/ble_hs_pvcy.c
+++ b/nimble/host/src/ble_hs_pvcy.c
@@ -59,8 +59,8 @@ ble_hs_pvcy_set_resolve_enabled(int enable)
&cmd, sizeof(cmd), NULL, 0);
}
-int
-ble_hs_pvcy_remove_entry(uint8_t addr_type, const uint8_t *addr)
+static int
+ble_hs_pvcy_remove_entry_hci(uint8_t addr_type, const uint8_t *addr)
{
struct ble_hci_le_rmv_resolve_list_cp cmd;
@@ -76,6 +76,21 @@ ble_hs_pvcy_remove_entry(uint8_t addr_type, const uint8_t
*addr)
&cmd, sizeof(cmd), NULL, 0);
}
+int
+ble_hs_pvcy_remove_entry(uint8_t addr_type, const uint8_t *addr)
+{
+ int rc;
+
+ /* Need to preempt all GAP procedures (advertising, pending connections)
+ * before modifying resolving list in the controller
+ */
+ ble_gap_preempt();
+ rc = ble_hs_pvcy_remove_entry_hci(addr_type, addr);
+ ble_gap_preempt_done();
+
+ return rc;
+}
+
static int
ble_hs_pvcy_clear_entries(void)
{