From bb650cc692b4c62b21a77dde10e37a56e7fb0875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Rymanowski?= Date: Wed, 12 Sep 2018 13:50:51 +0200 Subject: [PATCH] nimble/ll: Remove AUX from scheduler on scanner stop --- nimble/controller/src/ble_ll_scan.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nimble/controller/src/ble_ll_scan.c b/nimble/controller/src/ble_ll_scan.c index 16fea1eee..8b4849134 100644 --- a/nimble/controller/src/ble_ll_scan.c +++ b/nimble/controller/src/ble_ll_scan.c @@ -1109,7 +1109,13 @@ ble_ll_scan_window_chk(struct ble_ll_scan_sm *scansm, uint32_t cputime) return 0; } - +#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) +static void +ble_ll_scan_sched_remove(struct ble_ll_sched_item *sch) +{ + ble_ll_scan_aux_data_free(sch->cb_arg); +} +#endif /** * Stop the scanning state machine */ @@ -1132,6 +1138,8 @@ ble_ll_scan_sm_stop(int chk_disable) OS_ENTER_CRITICAL(sr); ble_ll_scan_clean_cur_aux_data(); OS_EXIT_CRITICAL(sr); + + ble_ll_sched_rmv_elem_type(BLE_LL_SCHED_TYPE_AUX_SCAN, ble_ll_scan_sched_remove); #endif /* Count # of times stopped */