mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-09-01 18:32:37 +02:00
Merge pull request #174 from luc-github/Devt
fix empty password not saved and generated error
This commit is contained in:
@@ -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");
|
||||
@@ -940,11 +940,12 @@ bool COMMANDS::execute_internal_command (int cmd, String cmd_params, level_authe
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
int8_t vi;
|
||||
|
||||
espresponse->print("{\"EEPROM\":[");
|
||||
if(espresponse->client() != CLIENT_WEBUI)espresponse->println("");
|
||||
prefs.begin(NAMESPACE, true);
|
||||
#ifdef ENABLE_WIFI
|
||||
int8_t vi;
|
||||
//1 - Hostname
|
||||
espresponse->print ("{\"F\":\"network\",\"P\":\"");
|
||||
espresponse->print (HOSTNAME_ENTRY);
|
||||
@@ -1223,7 +1224,11 @@ 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)
|
||||
#if defined (ENABLE_WIFI)
|
||||
&& !((spos==AP_PWD_ENTRY) || (spos==STA_PWD_ENTRY))
|
||||
#endif
|
||||
){
|
||||
response = false;
|
||||
}
|
||||
|
||||
@@ -1281,7 +1286,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)
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
// Grbl versioning system
|
||||
#define GRBL_VERSION "1.1f"
|
||||
#define GRBL_VERSION_BUILD "20190616"
|
||||
#define GRBL_VERSION_BUILD "20190622"
|
||||
|
||||
//#include <sdkconfig.h>
|
||||
#include <Arduino.h>
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user