Skip to content

Commit d095c73

Browse files
committed
[BREAKING] - Refactor NimBLEScan
* General code cleanup * `NimBLEScan::start` will no longer clear cache or results if scanning is already in progress. * `NimBLEScan::clearResults` will now reset the vector capacity to 0. * `NimBLEScan::stop` will no longer call the `onScanEnd` callback as the caller should know its been stopped when this is called. * `NimBLEScan::clearDuplicateCache` has been removed as it was problematic and only for the esp32. Stop and start the scanner for the same effect. * `NimBLEScan::start` takes a new bool parameter `restart`, default `true`, that will restart an already in progress scan and clear the duplicate filter so all devices will be discovered again. * Scan response data that is received without advertisement first will now create the device and send a callback.
1 parent b719a39 commit d095c73

File tree

3 files changed

+163
-233
lines changed

3 files changed

+163
-233
lines changed

src/NimBLEDevice.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -723,15 +723,7 @@ void NimBLEDevice::onReset(int reason) {
723723

724724
m_synced = false;
725725

726-
NIMBLE_LOGE(LOG_TAG, "Resetting state; reason=%d, %s", reason, NimBLEUtils::returnCodeToString(reason));
727-
728-
# if defined(CONFIG_BT_NIMBLE_ROLE_OBSERVER)
729-
if (m_initialized) {
730-
if (m_pScan != nullptr) {
731-
m_pScan->onHostReset();
732-
}
733-
}
734-
# endif
726+
NIMBLE_LOGE(LOG_TAG, "Host reset; reason=%d, %s", reason, NimBLEUtils::returnCodeToString(reason));
735727
} // onReset
736728

737729
/**

0 commit comments

Comments
 (0)