perform finish in command builder
All checks were successful
EIVE/eive-obsw/pipeline/pr-irini This commit looks good

This commit is contained in:
Robin Müller 2022-08-31 16:37:15 +02:00
parent c3fb285f35
commit da7cedc910
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 15 additions and 14 deletions

2
fsfw

@ -1 +1 @@
Subproject commit 2fa76d366325372e92a2188f71f143a485e652fc
Subproject commit cfca27542a3cabf58f9b7cab238c89ab9ad9beea

View File

@ -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; }