Bluetooth: Shell: PA sync terminate callback clears entry
The sync terminate callback did not set any entries in the PA sync array to NULL, thus not allowing the shell to reuse them in case that the sync was lost unexpectectly. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
parent
27f6bf19e8
commit
68a357e66d
1 changed files with 7 additions and 0 deletions
|
@ -1399,6 +1399,13 @@ static void per_adv_sync_terminated_cb(
|
|||
{
|
||||
char le_addr[BT_ADDR_LE_STR_LEN];
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(per_adv_syncs); i++) {
|
||||
if (per_adv_syncs[i] == sync) {
|
||||
per_adv_syncs[i] = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bt_addr_le_to_str(info->addr, le_addr, sizeof(le_addr));
|
||||
shell_print(ctx_shell, "PER_ADV_SYNC[%u]: [DEVICE]: %s sync terminated",
|
||||
bt_le_per_adv_sync_get_index(sync), le_addr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue