24 class PusA final : public CCSDS::SecondaryHeaderAbstract {
36 explicit PusA(
const std::uint8_t version,
const std::uint8_t serviceType,
const std::uint8_t serviceSubtype,
37 const std::uint8_t sourceID,
const std::uint32_t dataLength) : m_version(version & 0x7),
38 m_serviceType(serviceType),
39 m_serviceSubType(serviceSubtype),
40 m_sourceID(sourceID), m_dataLength(dataLength) {
43 [[nodiscard]] std::uint8_t
getVersion()
const {
return m_version; }
46 [[nodiscard]] std::uint8_t
getSourceID()
const {
return m_sourceID; }
47 [[nodiscard]] std::uint16_t
getDataLength()
const {
return m_dataLength; }
48 [[nodiscard]] std::uint16_t
getSize()
const override {
return m_size; }
49 [[nodiscard]] std::string
getType()
const override {
return m_type; }
51 [[nodiscard]] std::vector<std::uint8_t> serialize()
const override;
52 [[nodiscard]]
CCSDS::ResultBool deserialize(
const std::vector<std::uint8_t> &data )
override;
61 std::uint8_t m_version{};
62 std::uint8_t m_serviceType{};
63 std::uint8_t m_serviceSubType{};
64 std::uint8_t m_sourceID{};
65 std::uint16_t m_dataLength{};
67 const std::string m_type =
"PusA";
68 const std::uint16_t m_size = 6;
97 explicit PusB(
const std::uint8_t version,
const std::uint8_t serviceType,
const std::uint8_t serviceSubtype,
98 const std::uint8_t sourceID,
const std::uint8_t eventID,
const std::uint16_t dataLength) :
m_version(version & 0x7),
112 [[nodiscard]] std::vector<std::uint8_t>
serialize()
const override;
158 explicit PusC(
const std::uint8_t version,
const std::uint8_t serviceType,
const std::uint8_t serviceSubtype,
159 const std::uint8_t sourceID,
const std::vector<std::uint8_t>& timeCode,
175 [[nodiscard]] std::vector<std::uint8_t>
serialize()
const override;
Represents the data field of a CCSDS packet.
Encapsulates a result that can hold either a value or an Error.
std::uint16_t getSize() const override
Gets the size of the header in bytes.
std::uint16_t getDataLength() const
std::uint8_t getServiceSubtype() const
std::uint8_t getSourceID() const
std::uint8_t getServiceType() const
std::uint8_t getVersion() const
PusA(const std::uint8_t version, const std::uint8_t serviceType, const std::uint8_t serviceSubtype, const std::uint8_t sourceID, const std::uint32_t dataLength)
Constructs a PusA object with all fields explicitly set.
std::string getType() const override
Retrieves the name of the packet.
Represents a PUS Type B (Event Reporting) header.
PusB(const std::uint8_t version, const std::uint8_t serviceType, const std::uint8_t serviceSubtype, const std::uint8_t sourceID, const std::uint8_t eventID, const std::uint16_t dataLength)
Constructs a PusB object with all fields explicitly set.
std::uint8_t getSourceID() const
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 getEventID() const
std::uint8_t getServiceSubtype() const
std::uint16_t m_dataLength
std::string getType() const override
Retrieves the name of the packet.
std::uint8_t getVersion() const
std::uint8_t getServiceType() const
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.
std::uint16_t getSize() const override
Gets the size of the header in bytes.
CCSDS::ResultBool loadFromConfig(const ::Config &cfg) override
std::uint16_t getDataLength() const
Represents a PUS Type C (Time Code) header.
std::uint16_t getSize() const override
Gets the size of the header in bytes.
std::uint8_t getVersion() const
std::uint16_t getDataLength() const
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
PusC(const std::uint8_t version, const std::uint8_t serviceType, const std::uint8_t serviceSubtype, const std::uint8_t sourceID, const std::vector< std::uint8_t > &timeCode, const std::uint16_t dataLength)
Constructs a PusC object with all fields explicitly set.
std::vector< std::uint8_t > serialize() const override
Retrieves the serialized representation of the header.
CCSDS::ResultBool loadFromConfig(const ::Config &cfg) override
std::vector< std::uint8_t > getTimeCode() const
std::uint8_t getSourceID() const
std::string getType() const override
Retrieves the name of the packet.
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.
std::uint8_t getServiceSubtype() const
std::uint8_t getServiceType() const