diff --git a/fsfw b/fsfw index 2fa76d36..cfca2754 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 2fa76d366325372e92a2188f71f143a485e652fc +Subproject commit cfca27542a3cabf58f9b7cab238c89ab9ad9beea diff --git a/mission/devices/ScexDeviceHandler.cpp b/mission/devices/ScexDeviceHandler.cpp index 675d6093..9a5ebf11 100644 --- a/mission/devices/ScexDeviceHandler.cpp +++ b/mission/devices/ScexDeviceHandler.cpp @@ -95,6 +95,7 @@ ReturnValue_t ScexDeviceHandler::buildCommandFromCommand(DeviceCommandId_t devic prepareScexCmd(cmdTyped, {cmdBuf.data(), cmdBuf.size()}, rawPacketLen, {commandData + 1, commandDataLen - 1}, tempCheck); updatePeriodicReply(true, deviceCommand); + actionHelper.finish(true, getCommanderQueueId(deviceCommand), deviceCommand, OK); break; } case (ONE_CELL): { @@ -104,6 +105,7 @@ ReturnValue_t ScexDeviceHandler::buildCommandFromCommand(DeviceCommandId_t devic prepareScexCmd(cmdTyped, {cmdBuf.data(), cmdBuf.size()}, rawPacketLen, {commandData + 1, commandDataLen - 1}, tempCheck); updatePeriodicReply(true, deviceCommand); + actionHelper.finish(true, getCommanderQueueId(deviceCommand), deviceCommand, OK); break; } case (ALL_CELLS_CMD): { @@ -112,6 +114,7 @@ ReturnValue_t ScexDeviceHandler::buildCommandFromCommand(DeviceCommandId_t devic finishCountdown.resetTimer(); prepareScexCmd(cmdTyped, {cmdBuf.data(), cmdBuf.size()}, rawPacketLen, {commandData + 1, commandDataLen - 1}, tempCheck); + actionHelper.finish(true, getCommanderQueueId(deviceCommand), deviceCommand, OK); updatePeriodicReply(true, deviceCommand); break; } @@ -151,15 +154,6 @@ ReturnValue_t ScexDeviceHandler::scanForReply(const uint8_t* start, size_t remai } else { result = handleValidReply(remainingSize, foundId, foundLen); } - uint32_t remainingMillis = finishCountdown.getRemainingMillis(); - if (commandActive and finishCountdown.hasTimedOut()) { - triggerEvent(scex::EXPERIMENT_TIMEDOUT, currCmd, 0); - reader.finish(); - sif::warning << "ScexDeviceHandler::scanForReply: Reader timeout; RemMillis: " - << remainingMillis << std::endl; - fileNameSet = false; - commandActive = false; - } return result; } @@ -176,17 +170,14 @@ ReturnValue_t ScexDeviceHandler::handleValidReply(size_t remSize, DeviceCommandI sif::info << "ScexDeviceHandler::handleValidReply: RemMillis: " << remainingMillis << std::endl; } - actionHelper.finish(true, getCommanderQueueId(FRAM), FRAM, result); result = APERIODIC_REPLY; break; } case (ONE_CELL): { - actionHelper.finish(true, getCommanderQueueId(ONE_CELL), ONE_CELL, result); result = APERIODIC_REPLY; break; } case (ALL_CELLS_CMD): { - actionHelper.finish(true, getCommanderQueueId(ALL_CELLS_CMD), ALL_CELLS_CMD, result); result = APERIODIC_REPLY; break; } @@ -295,7 +286,17 @@ ReturnValue_t ScexDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, cons return status; } -void ScexDeviceHandler::performOperationHook() {} +void ScexDeviceHandler::performOperationHook() { + uint32_t remainingMillis = finishCountdown.getRemainingMillis(); + if (commandActive and finishCountdown.hasTimedOut()) { + triggerEvent(scex::EXPERIMENT_TIMEDOUT, currCmd, 0); + reader.finish(); + sif::warning << "ScexDeviceHandler::scanForReply: Reader timeout; RemMillis: " + << remainingMillis << std::endl; + fileNameSet = false; + commandActive = false; + } +} uint32_t ScexDeviceHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return OK; }