1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-09-01 18:32:37 +02:00

fix empty password not saved and generated error

Need for open network
This commit is contained in:
Luc
2019-06-22 17:23:15 +02:00
parent dc941833f5
commit ef43759420
3 changed files with 6 additions and 6 deletions

View File

@@ -326,7 +326,7 @@ bool COMMANDS::execute_internal_command (int cmd, String cmd_params, level_authe
}
Preferences prefs;
prefs.begin(NAMESPACE, false);
if (prefs.putString(AP_PWD_ENTRY, parameter) == 0){
if (prefs.putString(AP_PWD_ENTRY, parameter) != parameter.length()){
response = false;
if(espresponse)espresponse->println ("Error: Set failed!");
} else if(espresponse)espresponse->println ("ok");
@@ -1223,7 +1223,7 @@ bool COMMANDS::execute_internal_command (int cmd, String cmd_params, level_authe
if (! (styp == "B" || styp == "S" || styp == "A" || styp == "I" || styp == "F") ) {
response = false;
}
if (sval.length() == 0) {
if ((sval.length() == 0) && !((spos==AP_PWD_ENTRY) || (spos==STA_PWD_ENTRY))){
response = false;
}
@@ -1281,7 +1281,7 @@ bool COMMANDS::execute_internal_command (int cmd, String cmd_params, level_authe
}
//String value
if (styp == "S") {
if (prefs.putString(spos.c_str(), sval) == 0) {
if (prefs.putString(spos.c_str(), sval) != sval.length()) {
response = false;
} else {
#if defined (ENABLE_WIFI)

View File

@@ -20,7 +20,7 @@
// Grbl versioning system
#define GRBL_VERSION "1.1f"
#define GRBL_VERSION_BUILD "20190518"
#define GRBL_VERSION_BUILD "20190622"
//#include <sdkconfig.h>
#include <Arduino.h>

View File

@@ -475,7 +475,7 @@ void WiFiConfig::reset_settings(){
error = true;
}
sval = DEFAULT_STA_PWD;
if (prefs.putString(STA_PWD_ENTRY, sval) == 0){
if (prefs.putString(STA_PWD_ENTRY, sval) != sval.length()){
error = true;
}
sval = DEFAULT_AP_SSID;
@@ -483,7 +483,7 @@ void WiFiConfig::reset_settings(){
error = true;
}
sval = DEFAULT_AP_PWD;
if (prefs.putString(AP_PWD_ENTRY, sval) == 0){
if (prefs.putString(AP_PWD_ENTRY, sval) != sval.length()){
error = true;
}