240 [[nodiscard]]
ResultBool deserialize(
const std::vector<uint8_t> &data,
const std::string& headerType);
243 [[nodiscard]]
ResultBool deserialize(
const std::vector<uint8_t> &data, uint16_t headerDataSizeBytes);
246 [[nodiscard]]
ResultBool deserialize(
const std::vector<uint8_t> &headerData,
const std::vector<uint8_t> &data);
370 void setCrcConfig(
const uint16_t polynomial,
const uint16_t initialValue,
const uint16_t finalXorValue) {
m_CRC16Config = {polynomial, initialValue, finalXorValue};}
Represents the data field of a CCSDS packet.
Represents a CCSDS (Consultative Committee for Space Data Systems) packet.
uint16_t m_CRC16
Cyclic Redundancy check 16 bits.
ResultBool setSequenceCount(uint16_t count)
Sets the sequence count for the packet.
std::vector< uint8_t > serialize()
Retrieves the full packet as a vector of bytes.
bool m_updateStatus
When setting data thus value should be set to false.
ResultBool deserialize(const std::vector< uint8_t > &data)
Deserializes a vector of bytes into a CCSDS packet.
void update()
Updates Primary headers data field size.
ResultBool setApplicationData(const std::vector< uint8_t > &data)
Sets the application data for the packet.
void setUpdatePacketEnable(bool enable)
needs to be called as soon as possible, probably also from constructor.
void setCrcConfig(const uint16_t polynomial, const uint16_t initialValue, const uint16_t finalXorValue)
Sets the crc configuration of the crc calculation.
void setDataFieldSize(uint16_t size)
Sets the maximum data packet size for the CCSDS DataField.
bool getDataFieldHeaderFlag()
@ returns the data field header flag
void setDataFieldHeader(const std::shared_ptr< SecondaryHeaderAbstract > &header)
Sets the data field header using the provided SecondaryHeaderAbstract derived header.
Header m_primaryHeader
6 bytes / 48 bits / 12 hex
uint64_t getPrimaryHeader64bit()
Retrieves the primary header of the packet.
DataField m_dataField
variable
uint16_t getCRC()
Computes and retrieves the CRC-16 checksum of the packet.
void setSequenceFlags(ESequenceFlag flags)
Sets the sequence flags for the packet's primary header.
std::vector< uint8_t > getApplicationDataBytes()
Retrieves the application data from the data field.
std::vector< uint8_t > getFullDataFieldBytes()
Retrieves the full data field data.
void setPrimaryHeader(PrimaryHeader data)
Sets the primary header using the provided PrimaryHeader object.
std::vector< uint8_t > getCRCVectorBytes()
Retrieves the CRC-16 checksum as a vector of bytes.
uint16_t m_sequenceCounter
uint16_t getFullPacketLength()
Retrieves the current size of the CCSDS Packet.
CCSDS::Header & getPrimaryHeader()
returns the CCSDS packet's Primary Header.
uint16_t getDataFieldMaximumSize()
returns the maximum data field size
CCSDS::DataField & getDataField()
returns the CCSDS packet's DataField.
bool m_enableUpdatePacket
Enables primary header and secondary header update.
std::vector< uint8_t > getDataFieldHeaderBytes()
Retrieves the secondary header data from the data field.
std::vector< uint8_t > getPrimaryHeaderBytes()
Retrieves the primary header of the packet as a vector of bytes.
CRC16Config m_CRC16Config
structure holding configuration of crc calculation.
void setCrcConfig(const CRC16Config crcConfig)
Sets the crc configuration of the crc calculation.
Encapsulates a result that can hold either a value or an Error.
Contains definitions and classes for handling CCSDS headers.
ESequenceFlag
Represents the sequence flags used in CCSDS telemetry transfer frames.
Configuration structure for CRC16 calculation parameters.