mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-09-02 19:02:35 +02:00
No more LATERs
This commit is contained in:
@@ -132,8 +132,7 @@ namespace Configuration {
|
|||||||
grbl_sendf(out_->client(), "$%s=%s\r\n", setting_, value.toString().c_str());
|
grbl_sendf(out_->client(), "$%s=%s\r\n", setting_, value.toString().c_str());
|
||||||
} else {
|
} else {
|
||||||
IPAddress ip;
|
IPAddress ip;
|
||||||
auto str = String(newValue_);
|
if (!ip.fromString(newValue_)) {
|
||||||
if (!ip.fromString(str)) {
|
|
||||||
Assert(false, "Expected an IP address like 192.168.0.100");
|
Assert(false, "Expected an IP address like 192.168.0.100");
|
||||||
}
|
}
|
||||||
value = ip;
|
value = ip;
|
||||||
|
@@ -147,13 +147,15 @@ namespace WebUI {
|
|||||||
void BTConfig::end() { SerialBT.end(); }
|
void BTConfig::end() { SerialBT.end(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reset ESP
|
* Reset Bluetooth settings
|
||||||
|
* XXX this is not called from anywhere
|
||||||
*/
|
*/
|
||||||
void BTConfig::reset_settings() {
|
void BTConfig::reset_settings() {
|
||||||
# ifdef LATER
|
auto bt = config->_comms->_bluetoothConfig;
|
||||||
// Implement this in YAML land
|
if (bt) {
|
||||||
// was wifi_radio_mode->setDefault();
|
delete bt;
|
||||||
# endif
|
config->_comms->_bluetoothConfig = nullptr;
|
||||||
|
}
|
||||||
info_all("BT reset done");
|
info_all("BT reset done");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include "../Settings.h"
|
#include "../Settings.h"
|
||||||
#include "../Machine/MachineConfig.h"
|
#include "../Machine/MachineConfig.h"
|
||||||
|
#include "../Machine/WifiSTAConfig.h"
|
||||||
#include "../Configuration/JsonGenerator.h"
|
#include "../Configuration/JsonGenerator.h"
|
||||||
#include "../Grbl.h" //GRBL_VERSION
|
#include "../Grbl.h" //GRBL_VERSION
|
||||||
#include "../Serial.h" // CLIENT_ALL
|
#include "../Serial.h" // CLIENT_ALL
|
||||||
@@ -939,19 +940,29 @@ namespace WebUI {
|
|||||||
char* netmask = get_param("MSK", false);
|
char* netmask = get_param("MSK", false);
|
||||||
char* ip = get_param("IP", false);
|
char* ip = get_param("IP", false);
|
||||||
|
|
||||||
# ifdef LATER
|
auto sta = config->_comms->_staConfig;
|
||||||
// Needs to be converted to YAML land
|
if (!sta) {
|
||||||
Error err = wifi_sta_ip->setStringValue(ip);
|
sta = config->_comms->_staConfig = new Machine::WifiSTAConfig();
|
||||||
if (err == Error::Ok) {
|
|
||||||
err = wifi_sta_netmask->setStringValue(netmask);
|
|
||||||
}
|
}
|
||||||
if (err == Error::Ok) {
|
|
||||||
err = wifi_sta_gateway->setStringValue(gateway);
|
IPAddress ipv;
|
||||||
|
|
||||||
|
if (!ipv.fromString(ip)) {
|
||||||
|
return Error::InvalidValue;
|
||||||
}
|
}
|
||||||
# else
|
sta->_ipAddress = ipv;
|
||||||
Error err = Error::SettingDisabled;
|
|
||||||
# endif
|
if (!ipv.fromString(netmask)) {
|
||||||
return err;
|
return Error::InvalidValue;
|
||||||
|
}
|
||||||
|
sta->_netmask = ipv;
|
||||||
|
|
||||||
|
if (!ipv.fromString(gateway)) {
|
||||||
|
return Error::InvalidValue;
|
||||||
|
}
|
||||||
|
sta->_gateway = ipv;
|
||||||
|
|
||||||
|
return Error::Ok;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -443,6 +443,8 @@ namespace WebUI {
|
|||||||
*/
|
*/
|
||||||
void WiFiConfig::reset_settings() {
|
void WiFiConfig::reset_settings() {
|
||||||
bool error = false;
|
bool error = false;
|
||||||
|
// XXX this is probably wrong for YAML land.
|
||||||
|
// We might want this function to go away.
|
||||||
for (Setting* s = Setting::List; s; s = s->next()) {
|
for (Setting* s = Setting::List; s; s = s->next()) {
|
||||||
if (s->getDescription()) {
|
if (s->getDescription()) {
|
||||||
s->setDefault();
|
s->setDefault();
|
||||||
|
Reference in New Issue
Block a user