fixed ack reply handling
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
This commit is contained in:
@ -924,54 +924,38 @@ ReturnValue_t PlocSupervisorHandler::handleAckReport(const uint8_t* data) {
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
|
||||
tmReader.setData(data, SIZE_ACK_REPORT);
|
||||
if(tmReader.checkCrc() != returnvalue::OK) {
|
||||
sif::error << "PlocSupervisorHandler::handleAckReport: CRC failure" << std::endl;
|
||||
nextReplyId = supv::NONE;
|
||||
replyRawReplyIfnotWiretapped(data, supv::SIZE_ACK_REPORT);
|
||||
triggerEvent(SUPV_CRC_FAILURE_EVENT);
|
||||
sendFailureReport(supv::ACK_REPORT, result::CRC_FAILURE);
|
||||
disableAllReplies();
|
||||
return returnvalue::OK;
|
||||
if (tmReader.checkCrc() != returnvalue::OK) {
|
||||
sif::error << "PlocSupervisorHandler::handleAckReport: CRC failure" << std::endl;
|
||||
nextReplyId = supv::NONE;
|
||||
replyRawReplyIfnotWiretapped(data, supv::SIZE_ACK_REPORT);
|
||||
triggerEvent(SUPV_CRC_FAILURE_EVENT);
|
||||
sendFailureReport(supv::ACK_REPORT, result::CRC_FAILURE);
|
||||
disableAllReplies();
|
||||
return returnvalue::OK;
|
||||
}
|
||||
AcknowledgmentReport ack(tmReader);
|
||||
result = ack.parse();
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
nextReplyId = supv::NONE;
|
||||
replyRawReplyIfnotWiretapped(data, supv::SIZE_ACK_REPORT);
|
||||
triggerEvent(SUPV_CRC_FAILURE_EVENT);
|
||||
sendFailureReport(supv::ACK_REPORT, result);
|
||||
disableAllReplies();
|
||||
return result;
|
||||
}
|
||||
if (tmReader.getServiceId() == static_cast<uint8_t>(supv::tm::TmtcId::NAK)) {
|
||||
DeviceCommandId_t commandId = getPendingCommand();
|
||||
if (commandId != DeviceHandlerIF::NO_COMMAND_ID) {
|
||||
triggerEvent(SUPV_ACK_FAILURE, commandId, static_cast<uint32_t>(ack.getStatusCode()));
|
||||
}
|
||||
printAckFailureInfo(ack.getStatusCode(), commandId);
|
||||
sendFailureReport(supv::ACK_REPORT, result::RECEIVED_ACK_FAILURE);
|
||||
disableAllReplies();
|
||||
nextReplyId = supv::NONE;
|
||||
result = IGNORE_REPLY_DATA;
|
||||
} else if (tmReader.getServiceId() == static_cast<uint8_t>(supv::tm::TmtcId::ACK)) {
|
||||
setNextReplyId();
|
||||
}
|
||||
// TODO: Fix
|
||||
// result = ack.checkApid();
|
||||
//
|
||||
// switch (result) {
|
||||
// case SupvReturnValuesIF::RECEIVED_ACK_FAILURE: {
|
||||
// DeviceCommandId_t commandId = getPendingCommand();
|
||||
// if (commandId != DeviceHandlerIF::NO_COMMAND_ID) {
|
||||
// triggerEvent(SUPV_ACK_FAILURE, commandId, static_cast<uint32_t>(ack.getStatusCode()));
|
||||
// }
|
||||
// printAckFailureInfo(ack.getStatusCode(), commandId);
|
||||
// sendFailureReport(supv::ACK_REPORT, SupvReturnValuesIF::RECEIVED_ACK_FAILURE);
|
||||
// disableAllReplies();
|
||||
// nextReplyId = supv::NONE;
|
||||
// result = IGNORE_REPLY_DATA;
|
||||
// break;
|
||||
// }
|
||||
// case returnvalue::OK: {
|
||||
// setNextReplyId();
|
||||
// break;
|
||||
// }
|
||||
// case SupvReturnValuesIF::INVALID_APID:
|
||||
// sif::warning << "PlocSupervisorHandler::handleAckReport: Invalid APID in Ack report"
|
||||
// << std::endl;
|
||||
// sendFailureReport(supv::ACK_REPORT, result);
|
||||
// disableAllReplies();
|
||||
// nextReplyId = supv::NONE;
|
||||
// result = IGNORE_REPLY_DATA;
|
||||
// break;
|
||||
// default: {
|
||||
// sif::error << "PlocSupervisorHandler::handleAckReport: APID parsing failed" << std::endl;
|
||||
// result = returnvalue::FAILED;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user