From f4f6d1ed819f69a0291092584029fb6956a1467a Mon Sep 17 00:00:00 2001 From: meggert Date: Mon, 13 Feb 2023 10:33:08 +0100 Subject: [PATCH] added InternalState SET_SPEED to enable setting RW Speed from ACS Ctrl --- mission/devices/RwHandler.cpp | 7 ++++++- mission/devices/RwHandler.h | 10 ++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/mission/devices/RwHandler.cpp b/mission/devices/RwHandler.cpp index 7a8b52f3..88857b68 100644 --- a/mission/devices/RwHandler.cpp +++ b/mission/devices/RwHandler.cpp @@ -53,7 +53,11 @@ ReturnValue_t RwHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { break; case InternalState::GET_RW_SATUS: *id = RwDefinitions::GET_RW_STATUS; - internalState = InternalState::GET_RESET_STATUS; + internalState = InternalState::SET_SPEED; + break; + case InternalState::SET_SPEED: + *id = RwDefinitions::SET_SPEED; + internalState = InternalState::CLEAR_RESET_STATUS; break; case InternalState::CLEAR_RESET_STATUS: *id = RwDefinitions::CLEAR_LAST_RESET_STATUS; @@ -98,6 +102,7 @@ ReturnValue_t RwHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand return returnvalue::OK; } case (RwDefinitions::SET_SPEED): { + sif::debug << "hello" << std::endl; if (commandData != nullptr && commandDataLen != 6) { sif::error << "RwHandler::buildCommandFromCommand: Received set speed command with" << " invalid length" << std::endl; diff --git a/mission/devices/RwHandler.h b/mission/devices/RwHandler.h index af59caa1..148a6359 100644 --- a/mission/devices/RwHandler.h +++ b/mission/devices/RwHandler.h @@ -9,7 +9,7 @@ #include "events/subsystemIdRanges.h" #include "returnvalues/classIds.h" -static constexpr bool ACTUATION_WIRETAPPING = false; +static constexpr bool ACTUATION_WIRETAPPING = true; class GpioIF; @@ -102,7 +102,13 @@ class RwHandler : public DeviceHandlerBase { PoolEntry rwSpeed = PoolEntry(0, false); PoolEntry rampTime = PoolEntry(10, false); - enum class InternalState { GET_RESET_STATUS, CLEAR_RESET_STATUS, READ_TEMPERATURE, GET_RW_SATUS }; + enum class InternalState { + GET_RESET_STATUS, + CLEAR_RESET_STATUS, + READ_TEMPERATURE, + SET_SPEED, + GET_RW_SATUS + }; InternalState internalState = InternalState::GET_RESET_STATUS;