diff --git a/src/main.cpp b/src/main.cpp index d8520bc..fd83f2f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -313,9 +313,10 @@ void ProcessRequestMsg(const mp::RequestMsg &rq) { case mp::RequestMsgCodes::Unload: PlanCommand(rq); break; - // case mp::RequestMsgCodes::SetVar: //@@TODO - this is where e.g. printer's fsensor gets updated - // SetVar(rq); - // break; + case mp::RequestMsgCodes::FilamentSensor: // set filament sensor state in the printer + mfs::fsensor.ProcessMessage(rq.value != 0); + ReportCommandAccepted(rq, mp::ResponseMsgParamCodes::Accepted); + break; default: // respond with an error message break; diff --git a/src/modules/protocol.h b/src/modules/protocol.h index 5c1527c..b4c0670 100644 --- a/src/modules/protocol.h +++ b/src/modules/protocol.h @@ -23,7 +23,8 @@ enum class RequestMsgCodes : uint8_t { Button = 'B', Eject = 'E', Wait = 'W', - Cut = 'K' + Cut = 'K', + FilamentSensor = 'F' }; /// Definition of response message parameter codes