Skip to content

Commit 9ab0473

Browse files
authored
Merge pull request #11838 from vlastahajek/fix/wifi-scan-stealing
Fix (WiFi): Do not steal scan results
2 parents e9df04c + 8f44cec commit 9ab0473

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libraries/WiFi/src/WiFiScan.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ int16_t
113113
* @param status STATUS
114114
*/
115115
void WiFiScanClass::_scanDone() {
116+
if (!(WiFiGenericClass::getStatusBits() & WIFI_SCANNING_BIT)) {
117+
return; //Ignore if not scanning, scan was started by other
118+
}
116119
esp_wifi_scan_get_ap_num(&(WiFiScanClass::_scanCount));
117120
if (WiFiScanClass::_scanResult) {
118121
free(WiFiScanClass::_scanResult);

0 commit comments

Comments
 (0)