what is going on with that thing?
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good

This commit is contained in:
Robin Müller 2023-11-08 18:43:11 +01:00
parent d8e0f9ffce
commit 6ae9e12cf9

View File

@ -68,6 +68,10 @@ void PlocSupervisorHandler::performOperationHook() {
if (commandIsPending and cmdCd.hasTimedOut()) { if (commandIsPending and cmdCd.hasTimedOut()) {
// Event, FDIR, printout? Leads to spam though and normally should not happen.. // Event, FDIR, printout? Leads to spam though and normally should not happen..
commandIsPending = false; commandIsPending = false;
// if(iter->second.sendReplyTo != NO_COMMANDER) {
// actionHelper.finish(true, iter->second.sendReplyTo, iter->first, returnvalue::OK);
// }
disableAllReplies(); disableAllReplies();
} }
EventMessage event; EventMessage event;
@ -181,6 +185,7 @@ void PlocSupervisorHandler::doShutDown() {
nextReplyId = supv::NONE; nextReplyId = supv::NONE;
uartManager.stop(); uartManager.stop();
uartIsolatorSwitch.pullLow(); uartIsolatorSwitch.pullLow();
disableAllReplies();
supv::SUPV_ON = false; supv::SUPV_ON = false;
startupState = StartupState::OFF; startupState = StartupState::OFF;
} }
@ -348,6 +353,7 @@ ReturnValue_t PlocSupervisorHandler::buildCommandFromCommand(DeviceCommandId_t d
break; break;
} }
commandIsPending = true; commandIsPending = true;
cmdCd.resetTimer();
return result; return result;
} }
@ -916,6 +922,7 @@ ReturnValue_t PlocSupervisorHandler::handleExecutionReport(const uint8_t* data)
} else if (tmReader.getServiceId() == static_cast<uint8_t>(supv::tm::TmtcId::EXEC_NAK)) { } else if (tmReader.getServiceId() == static_cast<uint8_t>(supv::tm::TmtcId::EXEC_NAK)) {
handleExecutionFailureReport(report); handleExecutionFailureReport(report);
} }
commandIsPending = false;
nextReplyId = supv::NONE; nextReplyId = supv::NONE;
return result; return result;
} }
@ -1898,7 +1905,11 @@ ReturnValue_t PlocSupervisorHandler::eventSubscription() {
ReturnValue_t PlocSupervisorHandler::handleExecutionSuccessReport(ExecutionReport& report) { ReturnValue_t PlocSupervisorHandler::handleExecutionSuccessReport(ExecutionReport& report) {
DeviceCommandId_t commandId = getPendingCommand(); DeviceCommandId_t commandId = getPendingCommand();
ReturnValue_t result = OK; DeviceCommandMap::iterator iter = deviceCommandMap.find(commandId);
if (iter->second.sendReplyTo != NO_COMMANDER) {
actionHelper.finish(true, iter->second.sendReplyTo, iter->first, returnvalue::OK);
}
iter->second.isExecuting = false;
commandIsPending = false; commandIsPending = false;
switch (commandId) { switch (commandId) {
case supv::READ_GPIO: { case supv::READ_GPIO: {
@ -1907,13 +1918,12 @@ ReturnValue_t PlocSupervisorHandler::handleExecutionSuccessReport(ExecutionRepor
#if OBSW_DEBUG_PLOC_SUPERVISOR == 1 #if OBSW_DEBUG_PLOC_SUPERVISOR == 1
sif::info << "PlocSupervisorHandler: Read GPIO TM, State: " << gpioState << std::endl; sif::info << "PlocSupervisorHandler: Read GPIO TM, State: " << gpioState << std::endl;
#endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */ #endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */
DeviceCommandMap::iterator iter = deviceCommandMap.find(commandId);
if (iter->second.sendReplyTo == NO_COMMAND_ID) { if (iter->second.sendReplyTo == NO_COMMAND_ID) {
return returnvalue::OK; return returnvalue::OK;
} }
uint8_t data[sizeof(gpioState)]; uint8_t data[sizeof(gpioState)];
size_t size = 0; size_t size = 0;
result = SerializeAdapter::serialize(&gpioState, data, &size, sizeof(gpioState), ReturnValue_t result = SerializeAdapter::serialize(&gpioState, data, &size, sizeof(gpioState),
SerializeIF::Endianness::BIG); SerializeIF::Endianness::BIG);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
sif::debug << "PlocSupervisorHandler: Failed to deserialize GPIO state" << std::endl; sif::debug << "PlocSupervisorHandler: Failed to deserialize GPIO state" << std::endl;