CCSDSPack
C++ Library for CCSDS Space Packet manipulation. i.e. generation, extraction, analisys and more
Loading...
Searching...
No Matches
CCSDSValidator.h
Go to the documentation of this file.
1
3#ifndef CCSDS_VALIDATOR_H
4#define CCSDS_VALIDATOR_H
5
6#include "CCSDSPacket.h"
7
8namespace CCSDS {
14 class Validator {
15 public:
17 Validator() = default;
18
20 ~Validator() = default;
21
26 explicit Validator(const Packet &templatePacket) : m_templatePacket(templatePacket) {
27 };
28
33 void setTemplatePacket(const Packet &templatePacket) { m_templatePacket = templatePacket; }
34
41 void configure(bool validatePacketCoherence, bool validateSequenceCount, bool validateAgainstTemplate);
42
48 bool validate(const Packet &packet);
49
64 [[nodiscard]] std::vector<bool> getReport() const { return m_report; }
65
70 void clear();
71
72 private:
77 uint16_t m_sequenceCounter{1};
78 std::vector<bool> m_report{};
79 size_t m_reportSize{6};
81 };
82} // namespace CCSDS
83
84#endif // CCSDS_VALIDATOR_H
Represents a CCSDS (Consultative Committee for Space Data Systems) packet.
Definition CCSDSPacket.h:60
Handles validation of CCSDS packets.
void clear()
Clears the validator, resets counter.
bool m_validatePacketCoherence
Whether to validate packet length and CRC (default is true).
CRC16Config m_CRCConfig
bool m_validateAgainstTemplate
Whether to validate against the template packet (default is false).
uint16_t m_sequenceCounter
Counter for segmented Packets.
std::vector< bool > getReport() const
Returns a report of performed validation checks.
Validator(const Packet &templatePacket)
Constructs a Validator with a template packet.
Packet m_templatePacket
Template packet used for validation.
size_t m_reportSize
Expected size of the validation report.
void configure(bool validatePacketCoherence, bool validateSequenceCount, bool validateAgainstTemplate)
Configures validation options.
std::vector< bool > m_report
List of boolean results representing performed checks.
~Validator()=default
Default destructor.
Validator()=default
Default constructor.
bool m_validateSegmentedCount
Whether to validate the count of segmented packets.
void setTemplatePacket(const Packet &templatePacket)
Sets the template packet for validation.
bool validate(const Packet &packet)
Validates a given packet.
Contains definitions and classes for handling CCSDS headers.
Configuration structure for CRC16 calculation parameters.
Definition CCSDSPacket.h:36