PLOC MPSoC dir content report #634

Merged
meggert merged 54 commits from ploc_mpsoc_dir_content_report_2 into v2.1.0-dev 2023-05-15 09:40:03 +02:00
Showing only changes of commit 4887dc9e6b - Show all commits

View File

@ -360,7 +360,6 @@ ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remain
DeviceCommandId_t* foundId, size_t* foundLen) { DeviceCommandId_t* foundId, size_t* foundLen) {
ReturnValue_t result = returnvalue::OK; ReturnValue_t result = returnvalue::OK;
sif::debug << "remainingSize: " << remainingSize << std::endl;
SpacePacketReader spacePacket; SpacePacketReader spacePacket;
spacePacket.setReadOnlyData(start, remainingSize); spacePacket.setReadOnlyData(start, remainingSize);
if (spacePacket.isNull()) { if (spacePacket.isNull()) {
@ -379,6 +378,7 @@ ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remain
}; };
switch (apid) { switch (apid) {
case (mpsoc::apid::ACK_SUCCESS): case (mpsoc::apid::ACK_SUCCESS):
sif::debug << "recv ack" << std::endl;
*foundLen = mpsoc::SIZE_ACK_REPORT; *foundLen = mpsoc::SIZE_ACK_REPORT;
*foundId = mpsoc::ACK_REPORT; *foundId = mpsoc::ACK_REPORT;
break; break;
@ -394,6 +394,7 @@ ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remain
handleDedicatedReply(mpsoc::TM_CAM_CMD_RPT); handleDedicatedReply(mpsoc::TM_CAM_CMD_RPT);
break; break;
case (mpsoc::apid::TM_HK_GET_REPORT): { case (mpsoc::apid::TM_HK_GET_REPORT): {
sif::debug << "recv hk report" << std::endl;
handleDedicatedReply(mpsoc::TM_GET_HK_REPORT); handleDedicatedReply(mpsoc::TM_GET_HK_REPORT);
break; break;
} }
@ -402,6 +403,7 @@ ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remain
break; break;
} }
case (mpsoc::apid::EXE_SUCCESS): case (mpsoc::apid::EXE_SUCCESS):
sif::debug << "recv exe" << std::endl;
*foundLen = mpsoc::SIZE_EXE_REPORT; *foundLen = mpsoc::SIZE_EXE_REPORT;
*foundId = mpsoc::EXE_REPORT; *foundId = mpsoc::EXE_REPORT;
break; break;
@ -802,17 +804,22 @@ ReturnValue_t PlocMPSoCHandler::handleExecutionReport(const uint8_t* data) {
uint16_t apid = (*(data) << 8 | *(data + 1)) & APID_MASK; uint16_t apid = (*(data) << 8 | *(data + 1)) & APID_MASK;
switch (apid) { auto cmdDoneHandler = [&]() {
case (mpsoc::apid::EXE_SUCCESS): {
if (normalCmdPending) { if (normalCmdPending) {
normalCmdPending = false; normalCmdPending = false;
} }
auto commandIter = deviceCommandMap.find(getPendingCommand());
if (commandIter != deviceCommandMap.end()) {
commandIter->second.isExecuting = false;
}
disableAllReplies();
};
switch (apid) {
case (mpsoc::apid::EXE_SUCCESS): {
cmdDoneHandler();
break; break;
} }
case (mpsoc::apid::EXE_FAILURE): { case (mpsoc::apid::EXE_FAILURE): {
if (normalCmdPending) {
normalCmdPending = false;
}
// TODO: Interpretation of status field in execution report // TODO: Interpretation of status field in execution report
sif::warning << "PlocMPSoCHandler::handleExecutionReport: Received execution failure report" sif::warning << "PlocMPSoCHandler::handleExecutionReport: Received execution failure report"
<< std::endl; << std::endl;
@ -825,8 +832,8 @@ ReturnValue_t PlocMPSoCHandler::handleExecutionReport(const uint8_t* data) {
} }
printStatus(data); printStatus(data);
sendFailureReport(mpsoc::EXE_REPORT, MPSoCReturnValuesIF::RECEIVED_EXE_FAILURE); sendFailureReport(mpsoc::EXE_REPORT, MPSoCReturnValuesIF::RECEIVED_EXE_FAILURE);
disableExeReportReply();
result = IGNORE_REPLY_DATA; result = IGNORE_REPLY_DATA;
cmdDoneHandler();
break; break;
} }
default: { default: {