Skip to content

Commit

Permalink
nimble/host: Preempt GAP operations before removing entry from RL
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzej-kaczmarek committed Sep 23, 2024
1 parent a633169 commit ccb640b
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions nimble/host/src/ble_hs_pvcy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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)
{
Expand Down

0 comments on commit ccb640b

Please sign in to comment.