diff --git a/Sming/Components/Network/Arch/Esp32/Platform/StationImpl.cpp b/Sming/Components/Network/Arch/Esp32/Platform/StationImpl.cpp index 1c4af61451..bbaddc46c9 100644 --- a/Sming/Components/Network/Arch/Esp32/Platform/StationImpl.cpp +++ b/Sming/Components/Network/Arch/Esp32/Platform/StationImpl.cpp @@ -418,12 +418,12 @@ void StationImpl::staticScanCompleted(wifi_event_sta_scan_done_t* event, uint8_t if(station.scanCompletedCallback) { uint16_t number = event->number; wifi_ap_record_t ap_info[number]; - uint16_t ap_count{0}; + memset(ap_info, 0, sizeof(ap_info)); ESP_ERROR_CHECK(esp_wifi_scan_get_ap_records(&number, ap_info)); - ESP_ERROR_CHECK(esp_wifi_scan_get_ap_num(&ap_count)); + // TODO: Handle hidden APs - for(unsigned i = 0; (i < event->number) && (i < ap_count); i++) { + for(unsigned i = 0; i < number; i++) { list.addElement(new BssInfoImpl(&ap_info[i])); } station.scanCompletedCallback(true, list);