2022-07-19 18:13:25 +02:00
|
|
|
#ifndef FSFW_TCDISTRIBUTION_TCPACKETCHECKPUS_H_
|
|
|
|
#define FSFW_TCDISTRIBUTION_TCPACKETCHECKPUS_H_
|
|
|
|
|
|
|
|
#include "fsfw/FSFW.h"
|
2022-08-22 16:23:36 +02:00
|
|
|
#include "fsfw/returnvalues/returnvalue.h"
|
2022-07-21 11:34:11 +02:00
|
|
|
#include "fsfw/tmtcpacket/pus/defs.h"
|
2022-07-19 18:13:25 +02:00
|
|
|
#include "fsfw/tmtcservices/PusVerificationReport.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This class performs a formal packet check for incoming PUS Telecommand Packets.
|
|
|
|
* Currently, it only checks if the APID and CRC are correct.
|
|
|
|
* @ingroup tc_distribution
|
|
|
|
*/
|
2022-07-27 17:00:43 +02:00
|
|
|
class PusPacketChecker {
|
2022-07-19 18:13:25 +02:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* The constructor only sets the APID attribute.
|
|
|
|
* @param set_apid The APID to set.
|
|
|
|
*/
|
2022-07-27 17:00:43 +02:00
|
|
|
explicit PusPacketChecker(uint16_t apid, ccsds::PacketType packetType,
|
|
|
|
ecss::PusVersion = ecss::PusVersion::PUS_C);
|
2022-07-19 18:13:25 +02:00
|
|
|
|
2022-07-27 17:00:43 +02:00
|
|
|
ReturnValue_t checkPacket(const PusTcReader& currentPacket, size_t packetLen);
|
2022-07-19 18:13:25 +02:00
|
|
|
|
|
|
|
[[nodiscard]] uint16_t getApid() const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
ecss::PusVersion pusVersion;
|
2022-07-27 17:00:43 +02:00
|
|
|
uint16_t apid;
|
2022-07-19 18:13:25 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* FSFW_TCDISTRIBUTION_TCPACKETCHECKPUS_H_ */
|