mirror of https://github.com/arendst/Tasmota.git
Fix webserver enhanced wifi scan
This commit is contained in:
parent
3751a3ff07
commit
22fcf5061d
|
@ -1822,11 +1822,12 @@ void HandleWifiConfiguration(void) {
|
|||
DEBUG_CORE_LOG(PSTR(D_LOG_WIFI D_SSID " %s, " D_BSSID " %s, " D_CHANNEL " %d, " D_RSSI " %d"),
|
||||
ssid.c_str(), WiFi.BSSIDstr(indices[i]).c_str(), WiFi.channel(indices[i]), rssi);
|
||||
|
||||
String ssid_copy = ssid;
|
||||
if (!ssid_copy.length()) { ssid_copy = F("no_name"); }
|
||||
// Print SSID
|
||||
if (!limitScannedNetworks) {
|
||||
WSContentSend_P(PSTR("<div><a href='#p' onclick='c(this)'>%s</a><br>"), HtmlEscape(ssid).c_str());
|
||||
WSContentSend_P(PSTR("<div><a href='#p' onclick='c(this)'>%s</a><br>"), HtmlEscape(ssid_copy).c_str());
|
||||
}
|
||||
|
||||
skipduplicated = false;
|
||||
String nextSSID = "";
|
||||
// Handle all APs with the same SSID
|
||||
|
@ -1838,29 +1839,22 @@ void HandleWifiConfiguration(void) {
|
|||
uint32_t rssi_as_quality = WifiGetRssiAsQuality(rssi);
|
||||
uint32_t num_bars = changeUIntScale(rssi_as_quality, 0, 100, 0, 4);
|
||||
|
||||
WSContentSend_P(PSTR("<div title='%d dBm (%d%%)'>"), rssi, rssi_as_quality);
|
||||
if (limitScannedNetworks) {
|
||||
// Print SSID and item
|
||||
WSContentSend_P(PSTR("<div title='%d dBm (%d%%)'><a href='#p' onclick='c(this)'>%s</a><span class='q'><div class='si'>"), rssi, rssi_as_quality, HtmlEscape(ssid).c_str());
|
||||
// Print signal strength indicator
|
||||
for (uint32_t k = 0; k < 4; ++k) {
|
||||
WSContentSend_P(PSTR("<i class='b%d%s'></i>"), k, (num_bars < k) ? PSTR(" o30") : PSTR(""));
|
||||
}
|
||||
WSContentSend_P(PSTR("</span></div>"));
|
||||
WSContentSend_P(PSTR("<a href='#p' onclick='c(this)'>%s</a><span class='q'><div class='si'>"), HtmlEscape(ssid_copy).c_str());
|
||||
ssid_showed++;
|
||||
skipduplicated = true; // For the simplified page, just show 1 SSID if there are many Networks with the same
|
||||
} else {
|
||||
// Print item
|
||||
WSContentSend_P(PSTR("<div title='%d dBm (%d%%)'>%s<span class='q'>(%d) <div class='si'>"),
|
||||
rssi, rssi_as_quality,
|
||||
WiFi.BSSIDstr(indices[j]).c_str(),
|
||||
WiFi.channel(indices[j])
|
||||
WSContentSend_P(PSTR("%s<span class='q'>(%d) <div class='si'>"), WiFi.BSSIDstr(indices[j]).c_str(), WiFi.channel(indices[j])
|
||||
);
|
||||
// Print signal strength indicator
|
||||
for (uint32_t k = 0; k < 4; ++k) {
|
||||
WSContentSend_P(PSTR("<i class='b%d%s'></i>"), k, (num_bars < k) ? PSTR(" o30") : PSTR(""));
|
||||
}
|
||||
WSContentSend_P(PSTR("</span></div></div>"));
|
||||
}
|
||||
// Print signal strength indicator
|
||||
for (uint32_t k = 0; k < 4; ++k) {
|
||||
WSContentSend_P(PSTR("<i class='b%d%s'></i>"), k, (num_bars < k) ? PSTR(" o30") : PSTR(""));
|
||||
}
|
||||
WSContentSend_P(PSTR("</span></div></div>"));
|
||||
} else {
|
||||
if (ssid_showed <= networksToShow ) { networksToShow++; }
|
||||
}
|
||||
|
@ -1868,7 +1862,9 @@ void HandleWifiConfiguration(void) {
|
|||
}
|
||||
delay(0);
|
||||
}
|
||||
WSContentSend_P(PSTR("</div>"));
|
||||
if (!limitScannedNetworks) {
|
||||
WSContentSend_P(PSTR("</div>"));
|
||||
}
|
||||
}
|
||||
}
|
||||
#else // No USE_ENHANCED_GUI_WIFI_SCAN
|
||||
|
@ -1892,18 +1888,10 @@ void HandleWifiConfiguration(void) {
|
|||
DEBUG_CORE_LOG(PSTR(D_LOG_WIFI D_SSID " %s, " D_BSSID " %s, " D_CHANNEL " %d, " D_RSSI " %d"),
|
||||
WiFi.SSID(indices[i]).c_str(), WiFi.BSSIDstr(indices[i]).c_str(), WiFi.channel(indices[i]), rssi);
|
||||
int quality = WifiGetRssiAsQuality(rssi);
|
||||
/*
|
||||
int auth = WiFi.encryptionType(indices[i]);
|
||||
char encryption[20];
|
||||
WSContentSend_P(PSTR("<div><a href='#p' onclick='c(this)'>%s</a> (%d) <span class='q'>%s %d%% (%d dBm)</span></div>"),
|
||||
HtmlEscape(WiFi.SSID(indices[i])).c_str(),
|
||||
WiFi.channel(indices[i]),
|
||||
GetTextIndexed(encryption, sizeof(encryption), auth +1, kEncryptionType),
|
||||
quality, rssi
|
||||
);
|
||||
*/
|
||||
String ssid_copy = WiFi.SSID(indices[i]);
|
||||
if (!ssid_copy.length()) { ssid_copy = F("no_name"); }
|
||||
WSContentSend_P(PSTR("<div><a href='#p' onclick='c(this)'>%s</a> (%d) <span class='q'>%d%% (%d dBm)</span></div>"),
|
||||
HtmlEscape(WiFi.SSID(indices[i])).c_str(),
|
||||
HtmlEscape(ssid_copy).c_str(),
|
||||
WiFi.channel(indices[i]),
|
||||
quality, rssi
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue