Ensure async wardrive

This commit is contained in:
Just Call Me Koko
2025-12-08 16:32:25 -05:00
parent be3971d081
commit 2910addb8a

View File

@@ -2499,6 +2499,7 @@ void WiFiScan::StopScan(uint8_t scan_mode)
#endif #endif
this->shutdownBLE(); this->shutdownBLE();
this->ble_scanning = false;
#endif #endif
} }
@@ -4426,7 +4427,12 @@ void WiFiScan::executeWarDrive() {
return; return;
} }
else if (scan_status == WIFI_SCAN_FAILED) { else if (scan_status == WIFI_SCAN_FAILED) {
Serial.println("WiFi scan failed to start"); Serial.println("WiFi scan failed to start. Restarting...");
this->wifi_initialized = true;
this->shutdownWiFi();
this->startWardriverWiFi();
this->wifi_initialized = true;
delay(100);
} }
/*#ifndef HAS_DUAL_BAND /*#ifndef HAS_DUAL_BAND
@@ -4507,15 +4513,15 @@ void WiFiScan::executeWarDrive() {
buffer_obj.append(wardrive_line); buffer_obj.append(wardrive_line);
} }
} }
// Free up that memory, you sexy devil
WiFi.scanDelete();
} }
/*#ifndef HAS_DUAL_BAND /*#ifndef HAS_DUAL_BAND
this->channelHop(); this->channelHop();
#endif*/ #endif*/
// Free up that memory, you sexy devil
WiFi.scanDelete();
if (!this->ble_scanning) if (!this->ble_scanning)
WiFi.scanNetworks(true, true, false, 80); WiFi.scanNetworks(true, true, false, 80);
} }