check TM before normal periodic OP
Some checks failed
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit

This commit is contained in:
Robin Müller 2023-11-21 17:37:26 +01:00
parent 1176c4397d
commit 73ed59928e
3 changed files with 14 additions and 5 deletions

2
fsfw

@ -1 +1 @@
Subproject commit 41d67bff639192afa2e18a23db6801c75b4fea88 Subproject commit 0021aa29f54838a21658dbbaca98fe0e54318d8a

View File

@ -74,7 +74,8 @@ void FreshSupvHandler::performDeviceOperation(uint8_t opCode) {
} }
} else { } else {
// I think the SUPV is not able to process multiple commands consecutively, so only send // 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()) { if (mode == MODE_NORMAL and not isCommandPending()) {
auto cmdIter = activeActionCmds.find( auto cmdIter = activeActionCmds.find(
buildActiveCmdKey(Apid::HK, static_cast<uint8_t>(tc::HkId::GET_REPORT))); buildActiveCmdKey(Apid::HK, static_cast<uint8_t>(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) { ReturnValue_t FreshSupvHandler::handleCommandMessage(CommandMessage* message) {
// No custom messages. // No custom messages.
return returnvalue::FAILED; return returnvalue::FAILED;
@ -254,6 +264,7 @@ ReturnValue_t FreshSupvHandler::executeAction(ActionId_t actionId, MessageQueueI
return HasActionsIF::IS_BUSY; return HasActionsIF::IS_BUSY;
} }
spParams.buf = commandBuffer.data(); spParams.buf = commandBuffer.data();
this->commandedByCached = commandedBy;
switch (actionId) { switch (actionId) {
case GET_HK_REPORT: { case GET_HK_REPORT: {
sendEmptyCmd(supv::GET_HK_REPORT, Apid::HK, static_cast<uint8_t>(tc::HkId::GET_REPORT), true); sendEmptyCmd(supv::GET_HK_REPORT, Apid::HK, static_cast<uint8_t>(tc::HkId::GET_REPORT), true);
@ -395,9 +406,6 @@ ReturnValue_t FreshSupvHandler::executeAction(ActionId_t actionId, MessageQueueI
result = DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; result = DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED;
break; break;
} }
if (result == returnvalue::OK) {
this->commandedByCached = commandedBy;
}
return result; return result;
} }

View File

@ -57,6 +57,7 @@ class FreshSupvHandler : public FreshDeviceHandlerBase {
*/ */
void startTransition(Mode_t newMode, Submode_t submode) override; void startTransition(Mode_t newMode, Submode_t submode) override;
ReturnValue_t performDeviceOperationPreQueueHandling(uint8_t opCode) override;
void handleTransitionToOn(); void handleTransitionToOn();
void handleTransitionToOff(); void handleTransitionToOff();