fsfw/src/fsfw/tmtcservices/VerificationReporter.h

51 lines
1.9 KiB
C
Raw Normal View History

2020-09-29 13:34:27 +02:00
#ifndef FSFW_TMTCSERVICES_VERIFICATIONREPORTER_H_
#define FSFW_TMTCSERVICES_VERIFICATIONREPORTER_H_
2020-08-13 20:53:35 +02:00
#include "PusVerificationReport.h"
2021-07-13 20:58:45 +02:00
#include "fsfw/objectmanager/ObjectManagerIF.h"
2022-07-19 18:13:25 +02:00
#include "fsfw/tmtcpacket/pus/tc/PusTcCreator.h"
2022-02-02 10:29:30 +01:00
namespace Factory {
void setStaticFrameworkObjectIds();
}
2020-09-29 13:34:27 +02:00
/**
* @brief This helper object is used to forward verification messages
* which are generated by the Flight Software Framework.
* @details
* The messages can be relayed to an arbitrary object, for example a dedicated
* Verification Reporter. The destination is set by setting the static framework
* Id VerificationReporter::messageReceiver. The default verification reporter
* will be the PUS service 1, which sends verification messages according
* to the PUS standard.
*
*/
class VerificationReporter {
2022-02-02 10:29:30 +01:00
friend void(Factory::setStaticFrameworkObjectIds)();
public:
VerificationReporter();
virtual ~VerificationReporter();
2022-07-21 13:48:58 +02:00
// TODO: The API is a little bit bloated. It might be better to group all the parameters
// into a dedicated struct
2022-07-20 22:21:15 +02:00
void sendSuccessReport(uint8_t set_report_id, PusTcReader* correspondingTc, uint8_t set_step = 0);
2022-02-02 10:29:30 +01:00
void sendSuccessReport(uint8_t set_report_id, uint8_t ackFlags, uint16_t tcPacketId,
uint16_t tcSequenceControl, uint8_t set_step = 0);
2022-07-20 22:21:15 +02:00
void sendFailureReport(uint8_t report_id, PusTcReader* correspondingTc,
2022-07-21 13:48:58 +02:00
ReturnValue_t errorCode = 0, uint8_t step = 0, uint32_t parameter1 = 0,
2022-02-02 10:29:30 +01:00
uint32_t parameter2 = 0);
void sendFailureReport(uint8_t report_id, uint8_t ackFlags, uint16_t tcPacketId,
2022-07-21 13:48:58 +02:00
uint16_t tcSequenceControl, ReturnValue_t errorCode = 0, uint8_t step = 0,
2022-02-02 10:29:30 +01:00
uint32_t parameter1 = 0, uint32_t parameter2 = 0);
void initialize();
private:
static object_id_t messageReceiver;
MessageQueueId_t acknowledgeQueue;
};
2020-09-29 13:34:27 +02:00
#endif /* FSFW_TMTCSERVICES_VERIFICATIONREPORTER_H_ */