mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2025-07-29 18:07:14 +02:00
Only ignore scan discovery events when scan is stopped.
This commit is contained in:
@ -54,14 +54,14 @@ int NimBLEScan::handleGapEvent(ble_gap_event* event, void* arg) {
|
||||
(void)arg;
|
||||
NimBLEScan* pScan = NimBLEDevice::getScan();
|
||||
|
||||
if (!pScan->isScanning()) {
|
||||
NIMBLE_LOGI(LOG_TAG, "Scan stopped, ignoring event");
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (event->type) {
|
||||
case BLE_GAP_EVENT_EXT_DISC:
|
||||
case BLE_GAP_EVENT_DISC: {
|
||||
if (!pScan->isScanning()) {
|
||||
NIMBLE_LOGI(LOG_TAG, "Scan stopped, ignoring event");
|
||||
return 0;
|
||||
}
|
||||
|
||||
# if CONFIG_BT_NIMBLE_EXT_ADV
|
||||
const auto& disc = event->ext_disc;
|
||||
const bool isLegacyAdv = disc.props & BLE_HCI_ADV_LEGACY_MASK;
|
||||
@ -488,11 +488,11 @@ void NimBLEScan::clearResults() {
|
||||
* @brief Dump the scan results to the log.
|
||||
*/
|
||||
void NimBLEScanResults::dump() const {
|
||||
#if CONFIG_NIMBLE_CPP_LOG_LEVEL >=3
|
||||
# if CONFIG_NIMBLE_CPP_LOG_LEVEL >= 3
|
||||
for (const auto& dev : m_deviceVec) {
|
||||
NIMBLE_LOGI(LOG_TAG, "- %s", dev->toString().c_str());
|
||||
}
|
||||
#endif
|
||||
# endif
|
||||
} // dump
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user