robustness changes
EIVE/eive-obsw/pipeline/pr-main This commit looks good Details

This commit is contained in:
Robin Müller 2023-11-08 18:49:57 +01:00
parent 6ae9e12cf9
commit 5be3af3515
1 changed files with 12 additions and 4 deletions

View File

@ -1586,6 +1586,9 @@ void PlocSupervisorHandler::disableAllReplies() {
void PlocSupervisorHandler::disableReply(DeviceCommandId_t replyId) {
DeviceReplyMap::iterator iter = deviceReplyMap.find(replyId);
if (iter == deviceReplyMap.end()) {
return;
}
DeviceReplyInfo* info = &(iter->second);
info->delayCycles = 0;
info->active = false;
@ -1616,6 +1619,9 @@ void PlocSupervisorHandler::sendFailureReport(DeviceCommandId_t replyId, ReturnV
void PlocSupervisorHandler::disableExeReportReply() {
DeviceReplyIter iter = deviceReplyMap.find(supv::EXE_REPORT);
if (iter == deviceReplyMap.end()) {
return;
}
DeviceReplyInfo* info = &(iter->second);
info->delayCycles = 0;
info->command = deviceCommandMap.end();
@ -1638,7 +1644,9 @@ ReturnValue_t PlocSupervisorHandler::handleMramDumpPacket(DeviceCommandId_t id)
result = handleMramDumpFile(id);
if (result != returnvalue::OK) {
DeviceCommandMap::iterator iter = deviceCommandMap.find(id);
actionHelper.finish(false, iter->second.sendReplyTo, id, result);
if (iter != deviceCommandMap.end()) {
actionHelper.finish(false, iter->second.sendReplyTo, id, result);
}
disableAllReplies();
nextReplyId = supv::NONE;
return result;
@ -1906,10 +1914,10 @@ ReturnValue_t PlocSupervisorHandler::eventSubscription() {
ReturnValue_t PlocSupervisorHandler::handleExecutionSuccessReport(ExecutionReport& report) {
DeviceCommandId_t commandId = getPendingCommand();
DeviceCommandMap::iterator iter = deviceCommandMap.find(commandId);
if (iter->second.sendReplyTo != NO_COMMANDER) {
if (iter != deviceCommandMap.end() and iter->second.sendReplyTo != NO_COMMANDER) {
actionHelper.finish(true, iter->second.sendReplyTo, iter->first, returnvalue::OK);
iter->second.isExecuting = false;
}
iter->second.isExecuting = false;
commandIsPending = false;
switch (commandId) {
case supv::READ_GPIO: {
@ -1918,7 +1926,7 @@ ReturnValue_t PlocSupervisorHandler::handleExecutionSuccessReport(ExecutionRepor
#if OBSW_DEBUG_PLOC_SUPERVISOR == 1
sif::info << "PlocSupervisorHandler: Read GPIO TM, State: " << gpioState << std::endl;
#endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */
if (iter->second.sendReplyTo == NO_COMMAND_ID) {
if (iter != deviceCommandMap.end() and iter->second.sendReplyTo == NO_COMMAND_ID) {
return returnvalue::OK;
}
uint8_t data[sizeof(gpioState)];