187 [[nodiscard]]
ResultBool load(
const std::vector<Packet>& packets);
194 [[nodiscard]]
ResultBool load(
const std::vector<uint8_t>& packetsBuffer);
Defines the Validator class for CCSDS packet validation.
Manages CCSDS packets and their templates.
bool m_templateIsSet
Boolean to indicate if Template has been set or not.
ResultBool setPacketTemplate(Packet packet)
Sets a new packet template.
std::vector< Packet > getPackets()
Retrieves all stored packets.
ResultBuffer getPacketTemplate()
Retrieves the packet template in serialized form.
std::vector< uint8_t > getPacketsBuffer() const
Retrieves a buffer containing all the stored packets sequentially.
void setDatFieldSize(uint16_t size)
Sets the size of the data field.
void setSyncPatternEnable(bool enable)
enable sync pattern utilization both in serialization, deserialization, read and write.
ResultBool setApplicationData(const std::vector< uint8_t > &data)
Sets the application data for the packet.
std::vector< Packet > m_packets
Collection of stored packets.
bool m_validateEnable
bool indicating whether automatic validation is enabled (default: true).
ResultBool readTemplate(const std::string &filename)
Load a template packet from a binary or configuration file.
std::vector< Packet > & getPacketsReference()
Returns a reference to the packets vector.
ResultBool load(const std::vector< Packet > &packets)
Load a vector of packets.
ResultBool addPacket(Packet packet)
Adds a new packet to the list.
uint32_t getSyncPattern() const
returns the currently set sync pattern.
bool m_syncPattEnable
bool indicating whether automatic sync pattern insertion is enabled (default: false).
uint16_t getTotalPackets() const
Retrieves the total number of packets managed.
Packet getTemplate()
Retrieves the packet template.
ResultBuffer getApplicationDataBuffer()
Retrieves the application data from the packets.
void setSyncPattern(uint32_t syncPattern)
set sync pattern that should indicate the start of a CCSDS packet.
ResultBuffer getApplicationDataBufferAtIndex(uint16_t index)
Retrieves the application data from a packet at the given index.
ResultBool read(const std::string &binaryFile)
Load a packet or a series of packets from a binary file.
void clearPackets()
Clears the packets and sets the counter to 0.
Packet m_templatePacket
The template packet used for generating new packets.
void setAutoUpdateEnable(bool enable)
Enables or disables automatic updates for packets.
Manager(Packet packet)
Constructs a Manager with a given packet template.
bool getSyncPatternEnable() const
returns the current settings of the sync pattern enable
bool getAutoUpdateEnable() const
Checks if automatic updates are enabled.
void clear()
Clears the manager, removes all packets and template.
bool m_updateEnable
bool indicating whether automatic updates are enabled (default: true).
ResultBool addPacketFromBuffer(const std::vector< uint8_t > &packetBuffer)
Adds a new packet to the list.
void setAutoValidateEnable(bool enable)
Enables or disables automatic validation of packets.
Validator & getValidatorReference()
Returns a reverence to the manager's Validator.
ResultBool write(const std::string &binaryFile) const
Write a packet or a series of packets to a binary file.
Manager()=default
Default constructor.
ResultBuffer getPacketBufferAtIndex(uint16_t index)
Retrieves a packet at the specified index.
Represents a CCSDS (Consultative Committee for Space Data Systems) packet.
Encapsulates a result that can hold either a value or an Error.
Handles validation of CCSDS packets.
void configure(bool validatePacketCoherence, bool validateSequenceCount, bool validateAgainstTemplate)
Configures validation options.
void setTemplatePacket(const Packet &templatePacket)
Sets the template packet for validation.
Contains definitions and classes for handling CCSDS headers.