Skip to content

Commit

Permalink
Bluetooth: Controller: Fix advertising disable on connection complete
Browse files Browse the repository at this point in the history
Fix advertising set's is_enabled flag to be reset when
connection complete is dequeued for connectable advertising
started using legacy advertising enable HCI commands. And
reset the is_enabled flag when advertising set terminated
is dequeued for connectable advertising enabled using
Extended Advertising HCI commands.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
  • Loading branch information
cvinayak authored and carlescufi committed Nov 14, 2022
1 parent 13c2994 commit b56a690
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion subsys/bluetooth/controller/ll_sw/ull.c
Original file line number Diff line number Diff line change
Expand Up @@ -1182,9 +1182,19 @@ void ll_rx_dequeue(void)
aux = HDR_LLL2ULL(lll->aux);
aux->is_started = 0U;
}
#endif /* CONFIG_BT_CTLR_ADV_EXT */

/* If Extended Advertising Commands used, reset
* is_enabled when advertising set terminated event is
* dequeued. Otherwise, legacy advertising commands used
* then reset is_enabled here.
*/
if (!lll->node_rx_adv_term) {
adv->is_enabled = 0U;
}
#else /* !CONFIG_BT_CTLR_ADV_EXT */
adv->is_enabled = 0U;
#endif /* !CONFIG_BT_CTLR_ADV_EXT */

#else /* !CONFIG_BT_PERIPHERAL */
ARG_UNUSED(cc);
#endif /* !CONFIG_BT_PERIPHERAL */
Expand Down

0 comments on commit b56a690

Please sign in to comment.