diff --git a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h index c3223833..312f5c14 100644 --- a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +++ b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h @@ -1296,7 +1296,7 @@ class VerificationReport { if (not readerBase.crcIsOk()) { return result::CRC_FAILURE; } - if (readerBase.getApid() != Apid::TMTC_MAN) { + if (readerBase.getModuleApid() != Apid::TMTC_MAN) { return result::INVALID_APID; } if (readerBase.getBufSize() < MIN_TMTC_LEN + PAYLOAD_LEN or @@ -1477,7 +1477,7 @@ class VerificationReport { break; } default: { - codeHandled = true; + codeHandled = false; break; } } @@ -1525,7 +1525,7 @@ class VerificationReport { break; } default: { - codeHandled = true; + codeHandled = false; break; } } @@ -1565,7 +1565,51 @@ class VerificationReport { break; } default: { - codeHandled = true; + codeHandled = false; + break; + } + } + } else if (statusCode >= 0x600) { + TmtcManStatusCode code = static_cast(statusCode); + switch (code) { + case TmtcManStatusCode::BUF_FULL: { + sif::warning << prefix << "TMTC MAN: Buffer full" << std::endl; + break; + } + case TmtcManStatusCode::WRONG_APID: { + sif::warning << prefix << "TMTC MAN: Wrong APID" << std::endl; + break; + } + case TmtcManStatusCode::WRONG_SERVICE_ID: { + sif::warning << prefix << "TMTC MAN: Wrong Service ID" << std::endl; + break; + } + case TmtcManStatusCode::TC_DELIVERY_ACCEPTED: { + sif::warning << prefix << "TMTC MAN: TC accepted" << std::endl; + break; + } + case TmtcManStatusCode::TC_DELIVERY_REJECTED: { + sif::warning << prefix << "TMTC MAN: TC rejected" << std::endl; + break; + } + case TmtcManStatusCode::TC_PACKET_LEN_INCORRECT: { + sif::warning << prefix << "TMTC MAN: TC packet lenght incorrect" << std::endl; + break; + } + case TmtcManStatusCode::BAD_CRC: { + sif::warning << prefix << "TMTC MAN: Bad CRC" << std::endl; + break; + } + case TmtcManStatusCode::BAD_DEST: { + sif::warning << prefix << "TMTC MAN: Bad destination" << std::endl; + break; + } + case TmtcManStatusCode::BAD_SP_HEADER: { + sif::warning << prefix << "TMTC MAN: Bad SP header" << std::endl; + break; + } + default: { + codeHandled = false; break; } } diff --git a/linux/devices/ploc/PlocSupervisorHandler.cpp b/linux/devices/ploc/PlocSupervisorHandler.cpp index 8566b5b9..f7dd4fcd 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.cpp +++ b/linux/devices/ploc/PlocSupervisorHandler.cpp @@ -839,7 +839,7 @@ ReturnValue_t PlocSupervisorHandler::handleAckReport(const uint8_t* data) { using namespace supv; ReturnValue_t result = returnvalue::OK; - if (tmReader.checkCrc() != returnvalue::OK) { + if (not tmReader.verifyCrc()) { sif::error << "PlocSupervisorHandler::handleAckReport: CRC failure" << std::endl; nextReplyId = supv::NONE; replyRawReplyIfnotWiretapped(data, supv::SIZE_ACK_REPORT); @@ -878,7 +878,7 @@ ReturnValue_t PlocSupervisorHandler::handleExecutionReport(const uint8_t* data) using namespace supv; ReturnValue_t result = returnvalue::OK; - if (tmReader.checkCrc() != OK) { + if (not tmReader.verifyCrc()) { nextReplyId = supv::NONE; return result::CRC_FAILURE; } diff --git a/linux/devices/ploc/PlocSupvUartMan.cpp b/linux/devices/ploc/PlocSupvUartMan.cpp index b3ac004c..fc03cbd7 100644 --- a/linux/devices/ploc/PlocSupvUartMan.cpp +++ b/linux/devices/ploc/PlocSupvUartMan.cpp @@ -632,9 +632,10 @@ int PlocSupvUartManager::handleAckReception(supv::TcBase& tc, uint8_t serviceId, return 1; } else if (serviceId == static_cast(supv::tm::TmtcId::NAK)) { ackReport.printStatusInformation(); - triggerEvent(SUPV_ACK_FAILURE_REPORT, - buildApidServiceParam1(ackReport.getRefModuleApid(), ackReport.getRefServiceId()), - ackReport.getStatusCode()); + triggerEvent( + SUPV_ACK_FAILURE_REPORT, + buildApidServiceParam1(ackReport.getRefModuleApid(), ackReport.getRefServiceId()), + ackReport.getStatusCode()); return -1; } // Should never happen @@ -663,9 +664,10 @@ int PlocSupvUartManager::handleExeAckReception(supv::TcBase& tc, uint8_t service return 1; } else if (serviceId == static_cast(supv::tm::TmtcId::EXEC_NAK)) { exeReport.printStatusInformation(); - triggerEvent(SUPV_EXE_FAILURE_REPORT, - buildApidServiceParam1(exeReport.getRefModuleApid(), exeReport.getRefServiceId()), - exeReport.getStatusCode()); + triggerEvent( + SUPV_EXE_FAILURE_REPORT, + buildApidServiceParam1(exeReport.getRefModuleApid(), exeReport.getRefServiceId()), + exeReport.getStatusCode()); return -1; } // Should never happen