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

@ -61,13 +61,17 @@ ReturnValue_t PlocSupervisorHandler::initialize() {
} }
void PlocSupervisorHandler::performOperationHook() { void PlocSupervisorHandler::performOperationHook() {
if(normalCommandIsPending and normalCmdCd.hasTimedOut()) { if (normalCommandIsPending and normalCmdCd.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..
normalCommandIsPending = false; normalCommandIsPending = false;
} }
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;
} }
@ -625,8 +631,8 @@ void PlocSupervisorHandler::handlePacketPrint() {
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
sif::warning << "PlocSupervisorHandler: Parsing ACK failed" << std::endl; sif::warning << "PlocSupervisorHandler: Parsing ACK failed" << std::endl;
} }
if (REDUCE_NORMAL_MODE_PRINTOUT and ack.getRefModuleApid() == (uint8_t) supv::Apid::HK and if (REDUCE_NORMAL_MODE_PRINTOUT and ack.getRefModuleApid() == (uint8_t)supv::Apid::HK and
ack.getRefServiceId() == (uint8_t) supv::tc::HkId::GET_REPORT) { ack.getRefServiceId() == (uint8_t)supv::tc::HkId::GET_REPORT) {
return; return;
} }
const char* printStr = "???"; const char* printStr = "???";
@ -648,8 +654,8 @@ void PlocSupervisorHandler::handlePacketPrint() {
sif::warning << "PlocSupervisorHandler: Parsing EXE failed" << std::endl; sif::warning << "PlocSupervisorHandler: Parsing EXE failed" << std::endl;
} }
const char* printStr = "???"; const char* printStr = "???";
if (REDUCE_NORMAL_MODE_PRINTOUT and exe.getRefModuleApid() == (uint8_t) supv::Apid::HK and if (REDUCE_NORMAL_MODE_PRINTOUT and exe.getRefModuleApid() == (uint8_t)supv::Apid::HK and
exe.getRefServiceId() == (uint8_t) supv::tc::HkId::GET_REPORT) { exe.getRefServiceId() == (uint8_t)supv::tc::HkId::GET_REPORT) {
return; return;
} }
if (tmReader.getServiceId() == static_cast<uint8_t>(supv::tm::TmtcId::EXEC_ACK)) { if (tmReader.getServiceId() == static_cast<uint8_t>(supv::tm::TmtcId::EXEC_ACK)) {
@ -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,14 +1918,13 @@ 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;
} }
@ -1991,8 +2001,8 @@ uint32_t PlocSupervisorHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t mod
} }
void PlocSupervisorHandler::disableCommand(DeviceCommandId_t cmd) { void PlocSupervisorHandler::disableCommand(DeviceCommandId_t cmd) {
auto commandIter = deviceCommandMap.find(GET_HK_REPORT); auto commandIter = deviceCommandMap.find(GET_HK_REPORT);
commandIter->second.isExecuting = false; commandIter->second.isExecuting = false;
} }
ReturnValue_t PlocSupervisorHandler::checkModeCommand(Mode_t commandedMode, ReturnValue_t PlocSupervisorHandler::checkModeCommand(Mode_t commandedMode,