8 "PUS-A header not correct size (size != 6 bytes)");
20 static_cast<std::uint8_t
>(
m_version & 0x7),
37 "PUS-B header not correct size (size != 8 bytes)");
49 static_cast<std::uint8_t
>(
m_version & 0x7),
53 static_cast<std::uint8_t
>(
m_eventID >> 8 & 0xFF),
54 static_cast<std::uint8_t
>(
m_eventID & 0xFF),
69 "PUS-C header not correct size (size <= 6 bytes)");
74 m_dataLength = data[data.size()-2] << 8 | data[data.size()-1];
75 if (data.size() > 6) {
76 m_timeCode.assign(data.begin() + 4, data.end()-2);
82 std::vector<std::uint8_t> data;
84 data.push_back(
static_cast<std::uint8_t
>(
m_version & 0x7));
92 data.insert(data.end(), p, p + n);
107 std::uint8_t version = 0;
108 std::uint8_t serviceType = 0;
109 std::uint8_t serviceSubType = 0;
110 std::uint8_t sourceId = 0;
131 std::uint8_t version = 0;
132 std::uint8_t serviceType = 0;
133 std::uint8_t serviceSubType = 0;
134 std::uint8_t sourceId = 0;
135 std::uint8_t eventId = 0;
159 std::uint8_t version = 0;
160 std::uint8_t serviceType = 0;
161 std::uint8_t serviceSubType = 0;
162 std::uint8_t sourceId = 0;
163 std::vector<std::uint8_t> timeCode{};
#define RET_IF_ERR_MSG(condition, errorCode, message)
Macro to return an error with an error message if a condition is met.
#define ASSIGN_OR_PRINT(var, result)
Macro to assign a result value or print an error message.
Represents the data field of a CCSDS packet.
std::uint16_t getApplicationDataBytesSize() const
Retrieves the size of the application data stored in the data field.
Encapsulates a result that can hold either a value or an Error.
Parses and stores config values from custom file format.
bool isKey(const std::string &key) const
CCSDS::Result< T > get(const std::string &key) const
Get value by key and type.
std::uint8_t m_serviceType
std::uint8_t m_serviceSubType
std::vector< std::uint8_t > serialize() const override
Retrieves the serialized representation of the header.
void update(CCSDS::DataField *dataField) override
Defines how the packet secondary header is updated using the data field as reference.
const std::uint16_t m_size
CCSDS::ResultBool loadFromConfig(const ::Config &cfg) override
CCSDS::ResultBool deserialize(const std::vector< std::uint8_t > &data) override
takes a buffer if data (vector std::uint8) and creates the header
std::uint16_t m_dataLength
std::uint8_t m_serviceSubType
CCSDS::ResultBool deserialize(const std::vector< std::uint8_t > &data) override
takes a buffer if data (vector std::uint8) and creates the header
std::vector< std::uint8_t > serialize() const override
Retrieves the serialized representation of the header.
std::uint8_t m_serviceType
std::uint16_t m_dataLength
const std::uint16_t m_size
void update(CCSDS::DataField *dataField) override
Defines how the packet secondary header is updated using the data field as reference.
CCSDS::ResultBool loadFromConfig(const ::Config &cfg) override
const std::uint16_t m_size
CCSDS::ResultBool deserialize(const std::vector< std::uint8_t > &data) override
takes a buffer if data (vector std::uint8) and creates the header
std::vector< std::uint8_t > m_timeCode
std::uint8_t m_serviceType
std::vector< std::uint8_t > serialize() const override
Retrieves the serialized representation of the header.
CCSDS::ResultBool loadFromConfig(const ::Config &cfg) override
std::uint16_t m_dataLength
std::uint8_t m_serviceSubType
void update(CCSDS::DataField *dataField) override
Defines how the packet secondary header is updated using the data field as reference.
@ CONFIG_FILE_ERROR
Configuration file error.
@ INVALID_SECONDARY_HEADER_DATA
Secondary header data is invalid.