Skip to content

Commit 68a357e

Browse files
Thalleyjhedberg
authored andcommitted
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 <[email protected]>
1 parent 27f6bf1 commit 68a357e

File tree

1 file changed

+7
-0
lines changed
  • subsys/bluetooth/shell

1 file changed

+7
-0
lines changed

subsys/bluetooth/shell/bt.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,6 +1399,13 @@ static void per_adv_sync_terminated_cb(
13991399
{
14001400
char le_addr[BT_ADDR_LE_STR_LEN];
14011401

1402+
for (int i = 0; i < ARRAY_SIZE(per_adv_syncs); i++) {
1403+
if (per_adv_syncs[i] == sync) {
1404+
per_adv_syncs[i] = NULL;
1405+
break;
1406+
}
1407+
}
1408+
14021409
bt_addr_le_to_str(info->addr, le_addr, sizeof(le_addr));
14031410
shell_print(ctx_shell, "PER_ADV_SYNC[%u]: [DEVICE]: %s sync terminated",
14041411
bt_le_per_adv_sync_get_index(sync), le_addr);

0 commit comments

Comments
 (0)