Merge branch 'ploc_mpsoc_update_2' into ploc_mpsoc_dir_content_report_2
Some checks failed
EIVE/eive-obsw/pipeline/pr-v2.1.0-dev There was a failure building this commit

This commit is contained in:
2023-05-12 11:48:43 +02:00
8 changed files with 48 additions and 14 deletions

View File

@@ -207,9 +207,13 @@ void PlocMPSoCHandler::doShutDown() {
#endif
}
ReturnValue_t PlocMPSoCHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
*id = mpsoc::TC_GET_HK_REPORT;
return buildCommandFromCommand(*id, nullptr, 0);
if(getPendingCommand() == DeviceHandlerIF::NO_COMMAND_ID) {
*id = mpsoc::TC_GET_HK_REPORT;
return buildCommandFromCommand(*id, nullptr, 0);
}
return NOTHING_TO_SEND;
}
ReturnValue_t PlocMPSoCHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
@@ -330,7 +334,7 @@ void PlocMPSoCHandler::fillCommandAndReplyMap() {
this->insertInReplyMap(mpsoc::ACK_REPORT, 3, nullptr, mpsoc::SIZE_ACK_REPORT);
this->insertInReplyMap(mpsoc::EXE_REPORT, 3, nullptr, mpsoc::SIZE_EXE_REPORT);
this->insertInReplyMap(mpsoc::TM_MEMORY_READ_REPORT, 2, nullptr, mpsoc::SIZE_TM_MEM_READ_REPORT);
this->insertInReplyMap(mpsoc::TM_GET_HK_REPORT, 2, nullptr, mpsoc::SIZE_TM_HK_REPORT);
this->insertInReplyMap(mpsoc::TM_GET_HK_REPORT, 5, nullptr, mpsoc::SIZE_TM_HK_REPORT);
this->insertInReplyMap(mpsoc::TM_CAM_CMD_RPT, 2, nullptr, mpsoc::SP_MAX_SIZE);
this->insertInReplyMap(mpsoc::TM_FLASH_DIRECTORY_CONTENT, 2, nullptr, 0);
}
@@ -338,6 +342,7 @@ void PlocMPSoCHandler::fillCommandAndReplyMap() {
ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remainingSize,
DeviceCommandId_t* foundId, size_t* foundLen) {
ReturnValue_t result = returnvalue::OK;
sif::debug << "remaining size: " << remainingSize << std::endl;
SpacePacketReader spacePacket;
spacePacket.setReadOnlyData(start, remainingSize);
@@ -357,6 +362,7 @@ ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remain
};
switch (apid) {
case (mpsoc::apid::ACK_SUCCESS):
sif::debug << "recv ack success" << std::endl;
*foundLen = mpsoc::SIZE_ACK_REPORT;
*foundId = mpsoc::ACK_REPORT;
break;
@@ -380,6 +386,7 @@ ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remain
break;
}
case (mpsoc::apid::EXE_SUCCESS):
sif::debug << "recv exe success" << std::endl;
*foundLen = mpsoc::SIZE_EXE_REPORT;
*foundId = mpsoc::EXE_REPORT;
break;
@@ -596,13 +603,12 @@ ReturnValue_t PlocMPSoCHandler::prepareTcDownlinkPwrOff() {
}
ReturnValue_t PlocMPSoCHandler::prepareTcGetHkReport() {
ReturnValue_t result = returnvalue::OK;
mpsoc::TcGetHkReport tcDownlinkPwrOff(spParams, sequenceCount);
result = tcDownlinkPwrOff.buildPacket();
mpsoc::TcGetHkReport tcGetHkReport(spParams, sequenceCount);
ReturnValue_t result = tcGetHkReport.buildPacket();
if (result != returnvalue::OK) {
return result;
}
finishTcPrep(tcDownlinkPwrOff.getFullPacketLen());
finishTcPrep(tcGetHkReport.getFullPacketLen());
return returnvalue::OK;
}
@@ -1144,6 +1150,10 @@ void PlocMPSoCHandler::setNextReplyId() {
case mpsoc::TC_MEM_READ:
nextReplyId = mpsoc::TM_MEMORY_READ_REPORT;
break;
case mpsoc::TC_GET_HK_REPORT: {
nextReplyId = mpsoc::TM_GET_HK_REPORT;
break;
}
default:
/* If no telemetry is expected the next reply is always the execution report */
nextReplyId = mpsoc::EXE_REPORT;
@@ -1180,6 +1190,7 @@ size_t PlocMPSoCHandler::getNextReplyLength(DeviceCommandId_t commandId) {
replyLen = mpsoc::SP_MAX_SIZE;
break;
default: {
sif::debug << "reply length " << iter->second.replyLen << std::endl;
replyLen = iter->second.replyLen;
break;
}