Change status of stream pause to be meaningful

Add flag to ESP701 CLEAR_ERROR, to clear last error code
This commit is contained in:
Luc 2022-07-23 17:02:30 +08:00
parent 8af8e8dfa7
commit 495eb67049
2 changed files with 10 additions and 1 deletions

View File

@ -69,6 +69,10 @@ bool Commands::ESP701(const char* cmd_params, level_authenticate_type auth_type,
response = format_response(COMMANDID, json, false, "No stream to abort");
noError = false;
}
}
if (parameter.equalsIgnoreCase("CLEAR_ERROR")) {
esp3d_gcode_host.setErrorNum(ERROR_NO_ERROR);
response = format_response(COMMANDID, json, true, "Error cleared");
} else {
response = format_response(COMMANDID, json, false, "Unknown action");
noError = false;
@ -96,7 +100,7 @@ bool Commands::ESP701(const char* cmd_params, level_authenticate_type auth_type,
response = format_response(COMMANDID, json, true, resp.c_str());
break;
case HOST_PAUSE_STREAM:
response = format_response(COMMANDID, json, true, "pause stream");
response = format_response(COMMANDID, json, true, "pause");
break;
case HOST_RESUME_STREAM:
response = format_response(COMMANDID, json, true, "resume stream");

View File

@ -91,6 +91,11 @@ public:
return _error;
}
void setErrorNum(uint8_t error)
{
_error = error;
}
uint8_t getStatus()
{
return _step;