1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-15 00:02:49 +03:00

Re-enable old behaviour if passphrase string is empty

An empty passphrase string should enable AUTH_OPEN mode of softAP.
This was the behaviour before commit 293e55c.
Additionally make the type of checking for empty strings consistent.
This commit is contained in:
Frank Sautter
2016-04-08 10:26:11 +02:00
parent 2301f2975d
commit 4684e44902

View File

@ -89,13 +89,13 @@ bool ESP8266WiFiAPClass::softAP(const char* ssid, const char* passphrase, int ch
return false; return false;
} }
if(!ssid || *ssid == 0 || strlen(ssid) > 31) { if(!ssid || strlen(ssid) == 0 || strlen(ssid) > 31) {
// fail SSID too long or missing! // fail SSID too long or missing!
DEBUG_WIFI("[AP] SSID too long or missing!\n"); DEBUG_WIFI("[AP] SSID too long or missing!\n");
return false; return false;
} }
if(passphrase && (strlen(passphrase) > 63 || strlen(passphrase) < 8)) { if(passphrase && strlen(passphrase) > 0 && (strlen(passphrase) > 63 || strlen(passphrase) < 8)) {
// fail passphrase to long or short! // fail passphrase to long or short!
DEBUG_WIFI("[AP] fail passphrase to long or short!\n"); DEBUG_WIFI("[AP] fail passphrase to long or short!\n");
return false; return false;