Skip to content

Commit 98d7adc

Browse files
andrzej-kaczmarekcarlescufi
authored andcommitted
Bluetooth: controller: Stop aux after connected
After slave connection is created only adv instance is stopped, we also need to stop aux separately if enabled. Signed-off-by: Andrzej Kaczmarek <[email protected]>
1 parent 88a8fc1 commit 98d7adc

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

subsys/bluetooth/controller/ll_sw/ull.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,15 @@ void ll_rx_dequeue(void)
798798
}
799799
}
800800

801+
#if defined(CONFIG_BT_CTLR_ADV_EXT)
802+
if (lll->aux) {
803+
struct ll_adv_aux_set *aux;
804+
805+
aux = (void *)HDR_LLL2EVT(lll->aux);
806+
aux->is_started = 0U;
807+
}
808+
#endif /* CONFIG_BT_CTLR_ADV_EXT */
809+
801810
adv->is_enabled = 0U;
802811
#else /* !CONFIG_BT_PERIPHERAL */
803812
ARG_UNUSED(cc);

subsys/bluetooth/controller/ll_sw/ull_slave.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,26 @@ void ull_slave_setup(memq_link_t *link, struct node_rx_hdr *rx,
310310
mayfly_enable(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_ULL_LOW, 0);
311311
#endif
312312

313+
#if defined(CONFIG_BT_CTLR_ADV_EXT) && (CONFIG_BT_CTLR_ADV_AUX_SET > 0)
314+
struct lll_adv_aux *lll_aux = adv->lll.aux;
315+
316+
if (lll_aux) {
317+
struct ll_adv_aux_set *aux;
318+
319+
aux = (void *)HDR_LLL2EVT(lll_aux);
320+
321+
ticker_id_adv = TICKER_ID_ADV_AUX_BASE +
322+
ull_adv_aux_handle_get(aux);
323+
ticker_status = ticker_stop(TICKER_INSTANCE_ID_CTLR,
324+
TICKER_USER_ID_ULL_HIGH,
325+
ticker_id_adv,
326+
ticker_op_stop_adv_cb, aux);
327+
ticker_op_stop_adv_cb(ticker_status, aux);
328+
329+
aux->is_started = 0U;
330+
}
331+
#endif
332+
313333
/* Stop Advertiser */
314334
ticker_id_adv = TICKER_ID_ADV_BASE + ull_adv_handle_get(adv);
315335
ticker_status = ticker_stop(TICKER_INSTANCE_ID_CTLR,

0 commit comments

Comments
 (0)