mirror of https://github.com/arendst/Tasmota.git
Add size check
This commit is contained in:
parent
00012c7893
commit
ec3e8eb95a
|
@ -62,7 +62,7 @@ int WifiGetRssiAsQuality(int rssi) {
|
||||||
const char kWifiEncryptionTypes[] PROGMEM = "OPEN|WEP|WPA/PSK|WPA2/PSK|WPA/WPA2/PSK"
|
const char kWifiEncryptionTypes[] PROGMEM = "OPEN|WEP|WPA/PSK|WPA2/PSK|WPA/WPA2/PSK"
|
||||||
#ifdef ESP32
|
#ifdef ESP32
|
||||||
// 5 6 7 8
|
// 5 6 7 8
|
||||||
"|WPA2ENTERPRISE|WPA3/PSK|WPA2/WPA3/PSK|WAPI/PSK"
|
"|WPA2-Enterprise|WPA3/PSK|WPA2/WPA3/PSK|WAPI/PSK"
|
||||||
#endif // ESP32
|
#endif // ESP32
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -75,10 +75,11 @@ String WifiEncryptionType(uint32_t i) {
|
||||||
// 7 : ENC_TYPE_NONE - open network
|
// 7 : ENC_TYPE_NONE - open network
|
||||||
// 8 : ENC_TYPE_AUTO - WPA / WPA2 / PSK
|
// 8 : ENC_TYPE_AUTO - WPA / WPA2 / PSK
|
||||||
uint8_t typea[] = { 0,2,0,3,1,0,0,4 };
|
uint8_t typea[] = { 0,2,0,3,1,0,0,4 };
|
||||||
uint32_t type = typea[WiFi.encryptionType(i) -1 &7];
|
int type = typea[WiFi.encryptionType(i) -1 &7];
|
||||||
#else
|
#else
|
||||||
uint32_t type = WiFi.encryptionType(i);
|
int type = WiFi.encryptionType(i);
|
||||||
#endif
|
#endif
|
||||||
|
if ((type < 0) || (type > 8)) { type = 0; }
|
||||||
char stemp1[20];
|
char stemp1[20];
|
||||||
GetTextIndexed(stemp1, sizeof(stemp1), type, kWifiEncryptionTypes);
|
GetTextIndexed(stemp1, sizeof(stemp1), type, kWifiEncryptionTypes);
|
||||||
return stemp1;
|
return stemp1;
|
||||||
|
|
Loading…
Reference in New Issue