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// Copyright 2025-2026 ExoSpaceLabs
2// SPDX-License-Identifier: Apache-2.0
3
6#ifndef CCSDS_VALIDATOR_H
7#define CCSDS_VALIDATOR_H
8
9#include "CCSDSPacket.h"
10
11namespace CCSDS {
17 class Validator {
18 public:
20 Validator() = default;
21
23 ~Validator() = default;
24
29 explicit Validator(const Packet &templatePacket) : m_templatePacket(templatePacket) {
30 };
31
36 void setTemplatePacket(const Packet &templatePacket) { m_templatePacket = templatePacket; }
37
44 void configure(bool validatePacketCoherence, bool validateSequenceCount, bool validateAgainstTemplate);
45
51 bool validate(const Packet &packet);
52
67 [[nodiscard]] std::vector<bool> getReport() const { return m_report; }
68
73 void clear();
74
75 private:
80 std::uint16_t m_sequenceCounter{1};
81 std::vector<bool> m_report{};
82 size_t m_reportSize{6};
84 };
85} // namespace CCSDS
86
87#endif // CCSDS_VALIDATOR_H
Represents a CCSDS (Consultative Committee for Space Data Systems) packet.
Definition CCSDSPacket.h:62
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).
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.
std::uint16_t m_sequenceCounter
Counter for segmented Packets.
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:38