horrible
All checks were successful
EIVE/eive-obsw/pipeline/pr-v2.1.0-dev This commit looks good

This commit is contained in:
Robin Müller 2023-05-12 11:06:26 +02:00
parent f079818c42
commit 1820dae3d4
Signed by: muellerr
GPG Key ID: A649FB78196E3849
2 changed files with 23 additions and 10 deletions

View File

@ -209,9 +209,12 @@ void PlocMPSoCHandler::doShutDown() {
ReturnValue_t PlocMPSoCHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { ReturnValue_t PlocMPSoCHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
if(getPendingCommand() == DeviceHandlerIF::NO_COMMAND_ID) {
*id = mpsoc::TC_GET_HK_REPORT; *id = mpsoc::TC_GET_HK_REPORT;
return buildCommandFromCommand(*id, nullptr, 0); return buildCommandFromCommand(*id, nullptr, 0);
} }
return NOTHING_TO_SEND;
}
ReturnValue_t PlocMPSoCHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) { ReturnValue_t PlocMPSoCHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
return NOTHING_TO_SEND; return NOTHING_TO_SEND;
@ -256,6 +259,7 @@ ReturnValue_t PlocMPSoCHandler::buildCommandFromCommand(DeviceCommandId_t device
break; break;
} }
case (mpsoc::TC_GET_HK_REPORT): { case (mpsoc::TC_GET_HK_REPORT): {
sif::debug << "getting HK report" << std::endl;
result = prepareTcGetHkReport(); result = prepareTcGetHkReport();
break; break;
} }
@ -326,13 +330,14 @@ void PlocMPSoCHandler::fillCommandAndReplyMap() {
this->insertInReplyMap(mpsoc::ACK_REPORT, 3, nullptr, mpsoc::SIZE_ACK_REPORT); 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::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_MEMORY_READ_REPORT, 2, nullptr, mpsoc::SIZE_TM_MEM_READ_REPORT);
this->insertInReplyMap(mpsoc::TM_GET_HK_REPORT, 2, nullptr, 0); 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_CAM_CMD_RPT, 2, nullptr, mpsoc::SP_MAX_SIZE);
} }
ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remainingSize, ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remainingSize,
DeviceCommandId_t* foundId, size_t* foundLen) { DeviceCommandId_t* foundId, size_t* foundLen) {
ReturnValue_t result = returnvalue::OK; ReturnValue_t result = returnvalue::OK;
sif::debug << "remaining size: " << remainingSize << std::endl;
SpacePacketReader spacePacket; SpacePacketReader spacePacket;
spacePacket.setReadOnlyData(start, remainingSize); spacePacket.setReadOnlyData(start, remainingSize);
@ -347,6 +352,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 success" << std::endl;
*foundLen = mpsoc::SIZE_ACK_REPORT; *foundLen = mpsoc::SIZE_ACK_REPORT;
*foundId = mpsoc::ACK_REPORT; *foundId = mpsoc::ACK_REPORT;
break; break;
@ -364,12 +370,14 @@ ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remain
*foundId = mpsoc::TM_CAM_CMD_RPT; *foundId = 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;
*foundLen = spacePacket.getFullPacketLen(); *foundLen = spacePacket.getFullPacketLen();
foundPacketLen = *foundLen; foundPacketLen = *foundLen;
*foundId = mpsoc::TM_GET_HK_REPORT; *foundId = mpsoc::TM_GET_HK_REPORT;
break; break;
} }
case (mpsoc::apid::EXE_SUCCESS): case (mpsoc::apid::EXE_SUCCESS):
sif::debug << "recv exe success" << std::endl;
*foundLen = mpsoc::SIZE_EXE_REPORT; *foundLen = mpsoc::SIZE_EXE_REPORT;
*foundId = mpsoc::EXE_REPORT; *foundId = mpsoc::EXE_REPORT;
break; break;
@ -427,7 +435,9 @@ ReturnValue_t PlocMPSoCHandler::interpretDeviceReply(DeviceCommandId_t id, const
return result; return result;
} }
void PlocMPSoCHandler::setNormalDatapoolEntriesInvalid() {} void PlocMPSoCHandler::setNormalDatapoolEntriesInvalid() {
hkReport.setValidity(false, true);
}
uint32_t PlocMPSoCHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 5000; } uint32_t PlocMPSoCHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 5000; }
@ -572,12 +582,12 @@ ReturnValue_t PlocMPSoCHandler::prepareTcDownlinkPwrOff() {
ReturnValue_t PlocMPSoCHandler::prepareTcGetHkReport() { ReturnValue_t PlocMPSoCHandler::prepareTcGetHkReport() {
ReturnValue_t result = returnvalue::OK; ReturnValue_t result = returnvalue::OK;
mpsoc::TcGetHkReport tcDownlinkPwrOff(spParams, sequenceCount); mpsoc::TcGetHkReport tcGetHkReport(spParams, sequenceCount);
result = tcDownlinkPwrOff.buildPacket(); result = tcGetHkReport.buildPacket();
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
return result; return result;
} }
finishTcPrep(tcDownlinkPwrOff.getFullPacketLen()); finishTcPrep(tcGetHkReport.getFullPacketLen());
return returnvalue::OK; return returnvalue::OK;
} }
@ -1105,12 +1115,17 @@ void PlocMPSoCHandler::setNextReplyId() {
case mpsoc::TC_MEM_READ: case mpsoc::TC_MEM_READ:
nextReplyId = mpsoc::TM_MEMORY_READ_REPORT; nextReplyId = mpsoc::TM_MEMORY_READ_REPORT;
break; break;
case mpsoc::TC_GET_HK_REPORT: {
nextReplyId = mpsoc::TM_GET_HK_REPORT;
break;
}
default: default:
/* If no telemetry is expected the next reply is always the execution report */ /* If no telemetry is expected the next reply is always the execution report */
nextReplyId = mpsoc::EXE_REPORT; nextReplyId = mpsoc::EXE_REPORT;
break; break;
} }
} }
size_t PlocMPSoCHandler::getNextReplyLength(DeviceCommandId_t commandId) { size_t PlocMPSoCHandler::getNextReplyLength(DeviceCommandId_t commandId) {
size_t replyLen = 0; size_t replyLen = 0;
@ -1136,6 +1151,7 @@ size_t PlocMPSoCHandler::getNextReplyLength(DeviceCommandId_t commandId) {
replyLen = mpsoc::SP_MAX_SIZE; replyLen = mpsoc::SP_MAX_SIZE;
break; break;
default: { default: {
sif::debug << "reply length " << iter->second.replyLen << std::endl;
replyLen = iter->second.replyLen; replyLen = iter->second.replyLen;
break; break;
} }

View File

@ -608,9 +608,6 @@ class TcDownlinkPwrOn : public TcBase {
} }
}; };
/**
* @brief Class to build replay stop space packet.
*/
class TcGetHkReport : public TcBase { class TcGetHkReport : public TcBase {
public: public:
TcGetHkReport(ploc::SpTcParams params, uint16_t sequenceCount) TcGetHkReport(ploc::SpTcParams params, uint16_t sequenceCount)