You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ry...@apache.org on 2018/11/03 13:21:28 UTC

[mynewt-nimble] 02/02: nimble/ll: Remove AUX from scheduler on scanner stop

This is an automated email from the ASF dual-hosted git repository.

rymek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git

commit bb650cc692b4c62b21a77dde10e37a56e7fb0875
Author: Ɓukasz Rymanowski <lu...@codecoup.pl>
AuthorDate: Wed Sep 12 13:50:51 2018 +0200

    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 16fea1e..8b48491 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 */