various fixes and improvements
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
2022-11-28 16:24:18 +01:00
parent 003d37c490
commit 2c223712ff
5 changed files with 41 additions and 12 deletions

View File

@ -411,6 +411,7 @@ void PlocSupervisorHandler::fillCommandAndReplyMap() {
insertInCommandMap(SET_GPIO);
insertInCommandMap(READ_GPIO);
insertInCommandMap(FACTORY_RESET);
insertInCommandMap(MEMORY_CHECK);
insertInCommandMap(SET_SHUTDOWN_TIMEOUT);
insertInCommandMap(FACTORY_FLASH);
insertInCommandMap(SET_ADC_ENABLED_CHANNELS);
@ -421,6 +422,7 @@ void PlocSupervisorHandler::fillCommandAndReplyMap() {
// ACK replies, use countdown for them
insertInReplyMap(ACK_REPORT, 0, nullptr, SIZE_ACK_REPORT, false, &acknowledgementReportTimeout);
insertInReplyMap(EXE_REPORT, 0, nullptr, SIZE_EXE_REPORT, false, &executionReportTimeout);
insertInReplyMap(MEMORY_CHECK, 5, nullptr, 0, false);
// TM replies
insertInReplyMap(HK_REPORT, 3, &hkset, SIZE_HK_REPORT);
@ -507,6 +509,16 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite
}
break;
}
case MEMORY_CHECK: {
enabledReplies = 3;
result =
DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, MEMORY_CHECK);
if (result != returnvalue::OK) {
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << MEMORY_CHECK
<< " not in replyMap" << std::endl;
}
break;
}
case START_MPSOC:
case SHUTDOWN_MPSOC:
case SEL_MPSOC_BOOT_IMAGE:
@ -625,10 +637,7 @@ ReturnValue_t PlocSupervisorHandler::scanForReply(const uint8_t* start, size_t r
static_cast<uint8_t>(supv::tm::MemManId::UPDATE_STATUS_REPORT)) {
*foundLen = tmReader.getFullPacketLen();
*foundId = ReplyId::UPDATE_STATUS_REPORT;
// TODO: I think this will be handled by the uart manager?
// Actually, this is a bit tricky. Maybe the lower level will have two separate ring
// buffers, one for internally handled packets and one for packets which are handled
// here?
return OK;
}
}
}
@ -667,6 +676,10 @@ ReturnValue_t PlocSupervisorHandler::interpretDeviceReply(DeviceCommandId_t id,
result = handleExecutionReport(packet);
break;
}
case (UPDATE_STATUS_REPORT): {
// TODO: handle status report here
break;
}
default: {
sif::debug << "PlocSupervisorHandler::interpretDeviceReply: Unknown device reply id"
<< std::endl;