fsfw/tmtcservices/PusVerificationReport.h

80 lines
2.1 KiB
C
Raw Normal View History

2020-09-29 13:54:08 +02:00
#ifndef FSFW_TMTCSERVICES_PUSVERIFICATIONREPORT_H_
#define FSFW_TMTCSERVICES_PUSVERIFICATIONREPORT_H_
#include "VerificationCodes.h"
2020-08-28 18:33:29 +02:00
#include "../ipc/MessageQueueMessage.h"
#include "../tmtcpacket/pus/TcPacketBase.h"
2020-09-29 13:54:08 +02:00
#include "../returnvalues/HasReturnvaluesIF.h"
2020-08-28 18:33:29 +02:00
class PusVerificationMessage: public MessageQueueMessage {
private:
struct verifciationMessageContent {
uint8_t reportId;
uint8_t ackFlags;
uint8_t packetId_0;
uint8_t packetId_1;
uint8_t tcSequenceControl_0;
uint8_t tcSequenceControl_1;
uint8_t step;
uint8_t error_code_0;
uint8_t error_code_1;
uint8_t parameter1_0;
uint8_t parameter1_1;
uint8_t parameter1_2;
uint8_t parameter1_3;
uint8_t parameter2_0;
uint8_t parameter2_1;
uint8_t parameter2_2;
uint8_t parameter2_3;
};
verifciationMessageContent* getContent();
public:
static const uint8_t VERIFICATION_MIN_SIZE = 6;
PusVerificationMessage();
2020-09-29 13:54:08 +02:00
2020-08-28 18:33:29 +02:00
PusVerificationMessage(uint8_t set_report_id, uint8_t ackFlags,
uint16_t tcPacketId, uint16_t tcSequenceControl,
ReturnValue_t set_error_code = 0, uint8_t set_step = 0,
uint32_t parameter1 = 0, uint32_t parameter2 = 0);
uint8_t getReportId();
uint8_t getAckFlags();
uint16_t getTcPacketId();
uint16_t getTcSequenceControl();
ReturnValue_t getErrorCode();
uint8_t getStep();
uint32_t getParameter1();
uint32_t getParameter2();
};
class PusSuccessReport {
private:
static const uint16_t MAX_SIZE = 7;
uint8_t reportBuffer[MAX_SIZE];
size_t reportSize;
uint8_t * pBuffer;
public:
PusSuccessReport(uint16_t setPacketId, uint16_t setSequenceControl,
uint8_t set_step = 0);
~PusSuccessReport();
uint32_t getSize();
uint8_t* getReport();
};
class PusFailureReport {
private:
static const uint16_t MAX_SIZE = 16;
uint8_t reportBuffer[MAX_SIZE];
size_t reportSize;
uint8_t * pBuffer;
public:
PusFailureReport(uint16_t setPacketId, uint16_t setSequenceControl,
ReturnValue_t setErrorCode, uint8_t setStep = 0,
uint32_t parameter1 = 0, uint32_t parameter2 = 0);
~PusFailureReport();
size_t getSize();
uint8_t* getReport();
};
2020-09-29 13:54:08 +02:00
#endif /* FSFW_TMTCSERVICES_PUSVERIFICATIONREPORT_H_ */