From f5fc4ae9ddbf42f8d6ac3df8c56644ceef12d9d3 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 27 May 2019 15:08:11 +0200 Subject: [PATCH] Update HandleWifiConfiguration Update HandleWifiConfiguration --- sonoff/xdrv_01_webserver.ino | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sonoff/xdrv_01_webserver.ino b/sonoff/xdrv_01_webserver.ino index af4156f57..28250adf1 100644 --- a/sonoff/xdrv_01_webserver.ino +++ b/sonoff/xdrv_01_webserver.ino @@ -1313,6 +1313,9 @@ String HtmlEscape(const String unescaped) { return result; } +// Indexed by enum wl_enc_type in file wl_definitions.h starting from -1 +const char kEncryptionType[] PROGMEM = "|||" D_WPA_PSK "||" D_WPA2_PSK "|" D_WEP "||" D_NONE "|" D_AUTO; + void HandleWifiConfiguration(void) { if (!HttpCheckPriviledgedAccess(!WifiIsInManagerMode())) { return; } @@ -1379,11 +1382,12 @@ void HandleWifiConfiguration(void) int quality = WifiGetRssiAsQuality(WiFi.RSSI(indices[i])); if (minimum_signal_quality == -1 || minimum_signal_quality < quality) { - uint8_t auth = WiFi.encryptionType(indices[i]); + int auth = WiFi.encryptionType(indices[i]); + char encryption[20]; WSContentSend_P(PSTR("
%s (%d) %s %d%%
"), HtmlEscape(WiFi.SSID(indices[i])).c_str(), WiFi.channel(indices[i]), - (ENC_TYPE_WEP == auth) ? D_WEP : (ENC_TYPE_TKIP == auth) ? D_WPA_PSK : (ENC_TYPE_CCMP == auth) ? D_WPA2_PSK : (ENC_TYPE_AUTO == auth) ? D_AUTO : "", + GetTextIndexed(encryption, sizeof(encryption), auth +1, kEncryptionType), quality ); delay(0);