From 495eb67049ba47d3bbad52c19baa2a30ed0ea06f Mon Sep 17 00:00:00 2001 From: Luc <8822552+luc-github@users.noreply.github.com> Date: Sat, 23 Jul 2022 17:02:30 +0800 Subject: [PATCH] Change status of stream pause to be meaningful Add flag to ESP701 CLEAR_ERROR, to clear last error code --- esp3d/src/core/espcmd/ESP701.cpp | 6 +++++- esp3d/src/modules/gcode_host/gcode_host.h | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/esp3d/src/core/espcmd/ESP701.cpp b/esp3d/src/core/espcmd/ESP701.cpp index 9b931d78..b4a77fd7 100644 --- a/esp3d/src/core/espcmd/ESP701.cpp +++ b/esp3d/src/core/espcmd/ESP701.cpp @@ -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"); diff --git a/esp3d/src/modules/gcode_host/gcode_host.h b/esp3d/src/modules/gcode_host/gcode_host.h index f1fbdfaf..66c5230d 100644 --- a/esp3d/src/modules/gcode_host/gcode_host.h +++ b/esp3d/src/modules/gcode_host/gcode_host.h @@ -91,6 +91,11 @@ public: return _error; } + void setErrorNum(uint8_t error) + { + _error = error; + } + uint8_t getStatus() { return _step;