nimble/host: Preempt GAP operations before removing entry from RL

This commit is contained in:
Andrzej Kaczmarek
2024-09-23 15:22:41 +02:00
parent 4f75c0b3b4
commit bd73912921
+17 -2
View File
@@ -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)
{