diff --git a/fsfw b/fsfw index 41d67bff..0021aa29 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 41d67bff639192afa2e18a23db6801c75b4fea88 +Subproject commit 0021aa29f54838a21658dbbaca98fe0e54318d8a diff --git a/linux/payload/FreshSupvHandler.cpp b/linux/payload/FreshSupvHandler.cpp index 640c5535..b97d1e8a 100644 --- a/linux/payload/FreshSupvHandler.cpp +++ b/linux/payload/FreshSupvHandler.cpp @@ -74,7 +74,8 @@ void FreshSupvHandler::performDeviceOperation(uint8_t opCode) { } } else { // I think the SUPV is not able to process multiple commands consecutively, so only send - // normal command if no other command is pending. + // normal command if no other command is pending. We handle the action queue first, which + // should ensure that these commands take precendence. if (mode == MODE_NORMAL and not isCommandPending()) { auto cmdIter = activeActionCmds.find( buildActiveCmdKey(Apid::HK, static_cast(tc::HkId::GET_REPORT))); @@ -101,6 +102,15 @@ void FreshSupvHandler::performDeviceOperation(uint8_t opCode) { } } +ReturnValue_t FreshSupvHandler::performDeviceOperationPreQueueHandling(uint8_t opCode) { + if (opCode != OpCode::DEFAULT_OPERATION) { + return returnvalue::OK; + } + // We parse for TM packets shortly before handling the queue, this might complete some packets, + // which then allows the handling of new action commands. + return parseTmPackets(); +} + ReturnValue_t FreshSupvHandler::handleCommandMessage(CommandMessage* message) { // No custom messages. return returnvalue::FAILED; @@ -254,6 +264,7 @@ ReturnValue_t FreshSupvHandler::executeAction(ActionId_t actionId, MessageQueueI return HasActionsIF::IS_BUSY; } spParams.buf = commandBuffer.data(); + this->commandedByCached = commandedBy; switch (actionId) { case GET_HK_REPORT: { sendEmptyCmd(supv::GET_HK_REPORT, Apid::HK, static_cast(tc::HkId::GET_REPORT), true); @@ -395,9 +406,6 @@ ReturnValue_t FreshSupvHandler::executeAction(ActionId_t actionId, MessageQueueI result = DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; break; } - if (result == returnvalue::OK) { - this->commandedByCached = commandedBy; - } return result; } diff --git a/linux/payload/FreshSupvHandler.h b/linux/payload/FreshSupvHandler.h index f938a771..259b70b6 100644 --- a/linux/payload/FreshSupvHandler.h +++ b/linux/payload/FreshSupvHandler.h @@ -57,6 +57,7 @@ class FreshSupvHandler : public FreshDeviceHandlerBase { */ void startTransition(Mode_t newMode, Submode_t submode) override; + ReturnValue_t performDeviceOperationPreQueueHandling(uint8_t opCode) override; void handleTransitionToOn(); void handleTransitionToOff();