From c4a906c45bbda99644ee7c95be67e84754bbc6d1 Mon Sep 17 00:00:00 2001 From: Ryscho <43499659+Ryscho@users.noreply.github.com> Date: Sat, 22 Sep 2018 10:06:17 -0600 Subject: [PATCH] Update BLEScanner.cpp According to this post on the Nordic DevZone Forum (https://devzone.nordicsemi.com/f/nordic-q-a/14643/s130-permanent-advertising-scanning-during-operation), scanning automatically stops after receiving a BLE_GAP_EVT_TIMEOUT{BLE_GAP_TIMEOUT_SRC_SCAN} event. The _runnning [sic] flag should be set to false in this case. --- libraries/Bluefruit52Lib/src/BLEScanner.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/Bluefruit52Lib/src/BLEScanner.cpp b/libraries/Bluefruit52Lib/src/BLEScanner.cpp index a055326a..1dcc2832 100644 --- a/libraries/Bluefruit52Lib/src/BLEScanner.cpp +++ b/libraries/Bluefruit52Lib/src/BLEScanner.cpp @@ -387,6 +387,7 @@ void BLEScanner::_eventHandler(ble_evt_t* evt) case BLE_GAP_EVT_TIMEOUT: if (evt->evt.gap_evt.params.timeout.src == BLE_GAP_TIMEOUT_SRC_SCAN) { + _runnning = false; if (_stop_cb) ada_callback(NULL, _stop_cb); } break;