From 58578796123513cc547e82c90872e37435b94610 Mon Sep 17 00:00:00 2001 From: h2zero Date: Sun, 12 Jul 2020 20:35:10 -0600 Subject: [PATCH] Fix calling scan ended callback when scan was already stopped. --- src/NimBLEScan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NimBLEScan.cpp b/src/NimBLEScan.cpp index 7e16260..b3187ce 100644 --- a/src/NimBLEScan.cpp +++ b/src/NimBLEScan.cpp @@ -343,7 +343,7 @@ bool NimBLEScan::stop() { m_stopped = true; - if (m_scanCompleteCB != nullptr) { + if (rc != BLE_HS_EALREADY && m_scanCompleteCB != nullptr) { m_scanCompleteCB(m_scanResults); }