important bugfix for verif reporter

This commit is contained in:
Robin Müller 2022-08-18 11:19:42 +02:00
parent 34c714eb17
commit 7881f5bab8
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 3 additions and 7 deletions

View File

@ -105,14 +105,13 @@ ReturnValue_t PusDistributor::callbackAfterSending(ReturnValue_t queueStatus) {
tcStatus = queueStatus; tcStatus = queueStatus;
} }
if (tcStatus != RETURN_OK) { if (tcStatus != RETURN_OK) {
verifyChannel->sendFailureReport( verifyChannel->sendFailureReport({tcverif::ACCEPTANCE_FAILURE, reader, tcStatus});
VerifFailureParams(tcverif::ACCEPTANCE_FAILURE, reader, tcStatus));
// A failed packet is deleted immediately after reporting, // A failed packet is deleted immediately after reporting,
// otherwise it will block memory. // otherwise it will block memory.
store->deleteData(currentMessage.getStorageId()); store->deleteData(currentMessage.getStorageId());
return RETURN_FAILED; return RETURN_FAILED;
} else { } else {
verifyChannel->sendSuccessReport(VerifSuccessParams(tcverif::ACCEPTANCE_SUCCESS, reader)); verifyChannel->sendSuccessReport({tcverif::ACCEPTANCE_SUCCESS, reader});
return RETURN_OK; return RETURN_OK;
} }
} }

View File

@ -33,10 +33,7 @@ class VerificationReporter : public SystemObject, public VerificationReporterIF
void setReceiver(AcceptsVerifyMessageIF& receiver); void setReceiver(AcceptsVerifyMessageIF& receiver);
// TODO: The API is a little bit bloated. It might be better to group all the parameters
// into a dedicated struct
ReturnValue_t sendSuccessReport(VerifSuccessParams params) override; ReturnValue_t sendSuccessReport(VerifSuccessParams params) override;
ReturnValue_t sendFailureReport(VerifFailureParams params) override; ReturnValue_t sendFailureReport(VerifFailureParams params) override;
static object_id_t DEFAULT_REPORTER; static object_id_t DEFAULT_REPORTER;
@ -44,7 +41,7 @@ class VerificationReporter : public SystemObject, public VerificationReporterIF
ReturnValue_t initialize() override; ReturnValue_t initialize() override;
private: private:
MessageQueueId_t acknowledgeQueue; MessageQueueId_t acknowledgeQueue = MessageQueueIF::NO_QUEUE;
}; };
#endif /* FSFW_TMTCSERVICES_VERIFICATIONREPORTER_H_ */ #endif /* FSFW_TMTCSERVICES_VERIFICATIONREPORTER_H_ */