mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-08-16 03:24:15 +02:00
Added begin and end markers to data blocks
This commit is contained in:
@@ -50,9 +50,11 @@ namespace Configuration {
|
||||
} else {
|
||||
if (newValue_ == nullptr) {
|
||||
ClientStream ss(CLIENT_ALL);
|
||||
ss << dataBeginMarker;
|
||||
ss << setting_ << ":\n";
|
||||
Configuration::Generator generator(ss, 1);
|
||||
value->group(generator);
|
||||
ss << dataEndMarker;
|
||||
isHandled_ = true;
|
||||
} else {
|
||||
log_error("Can't set a value on a section");
|
||||
|
@@ -498,11 +498,13 @@ Error motor_disable(const char* value, WebUI::AuthenticationLevel auth_level, We
|
||||
}
|
||||
|
||||
Error dump_config(const char* value, WebUI::AuthenticationLevel auth_level, WebUI::ESPResponseStream* out) {
|
||||
grbl_send(CLIENT_ALL, dataBeginMarker);
|
||||
try {
|
||||
ClientStream ss(CLIENT_ALL);
|
||||
Configuration::Generator generator(ss);
|
||||
config->group(generator);
|
||||
} catch (std::exception& ex) { log_info("Config dump error: " << ex.what()); }
|
||||
grbl_send(CLIENT_ALL, dataEndMarker);
|
||||
return Error::Ok;
|
||||
}
|
||||
|
||||
|
@@ -897,3 +897,6 @@ float* get_wco() {
|
||||
}
|
||||
return wco;
|
||||
}
|
||||
|
||||
const char* dataBeginMarker = "[MSG: BeginData]\n";
|
||||
const char* dataEndMarker = "[MSG: EndData]\n";
|
||||
|
@@ -139,3 +139,6 @@ float* get_wco();
|
||||
void mpos_to_wpos(float* position);
|
||||
|
||||
void addPinReport(char* status, char pinLetter);
|
||||
|
||||
extern const char* dataBeginMarker;
|
||||
extern const char* dataEndMarker;
|
||||
|
@@ -293,6 +293,7 @@ namespace WebUI {
|
||||
if (!currentfile) {
|
||||
return Error::FsFailedOpenFile;
|
||||
}
|
||||
webPrint(dataBeginMarker);
|
||||
while (currentfile.available()) {
|
||||
// String currentline = currentfile.readStringUntil('\n');
|
||||
// if (currentline.length() > 0) {
|
||||
@@ -301,6 +302,7 @@ namespace WebUI {
|
||||
webPrintln(currentfile.readStringUntil('\n'));
|
||||
}
|
||||
currentfile.close();
|
||||
webPrint(dataEndMarker);
|
||||
return Error::Ok;
|
||||
}
|
||||
|
||||
@@ -661,6 +663,7 @@ namespace WebUI {
|
||||
if ((err = openSDFile(parameter)) != Error::Ok) {
|
||||
return err;
|
||||
}
|
||||
webPrint(dataBeginMarker);
|
||||
config->_sdCard->_client = (espresponse) ? espresponse->client() : CLIENT_ALL;
|
||||
char fileLine[255];
|
||||
Error res;
|
||||
@@ -670,8 +673,8 @@ namespace WebUI {
|
||||
if (res != Error::Eof) {
|
||||
webPrintln(errorString(res));
|
||||
}
|
||||
webPrintln("");
|
||||
config->_sdCard->closeFile();
|
||||
webPrint(dataEndMarker);
|
||||
return Error::Ok;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user