27 class PusA final : public CCSDS::SecondaryHeaderAbstract {
39 explicit PusA(
const std::uint8_t version,
const std::uint8_t serviceType,
const std::uint8_t serviceSubtype,
40 const std::uint8_t sourceID,
const std::uint32_t dataLength) : m_version(version & 0x7),
41 m_serviceType(serviceType),
42 m_serviceSubType(serviceSubtype),
43 m_sourceID(sourceID), m_dataLength(dataLength) {
46 [[nodiscard]] std::uint8_t
getVersion()
const {
return m_version; }
49 [[nodiscard]] std::uint8_t
getSourceID()
const {
return m_sourceID; }
50 [[nodiscard]] std::uint16_t
getDataLength()
const {
return m_dataLength; }
51 [[nodiscard]] std::uint16_t
getSize()
const override {
return m_size; }
52 [[nodiscard]] std::string
getType()
const override {
return m_type; }
54 [[nodiscard]] std::vector<std::uint8_t> serialize()
const override;
55 [[nodiscard]]
CCSDS::ResultBool deserialize(
const std::vector<std::uint8_t> &data )
override;
64 std::uint8_t m_version{};
65 std::uint8_t m_serviceType{};
66 std::uint8_t m_serviceSubType{};
67 std::uint8_t m_sourceID{};
68 std::uint16_t m_dataLength{};
70 const std::string m_type =
"PusA";
71 const std::uint16_t m_size = 6;
100 explicit PusB(
const std::uint8_t version,
const std::uint8_t serviceType,
const std::uint8_t serviceSubtype,
101 const std::uint8_t sourceID,
const std::uint16_t eventID,
const std::uint16_t dataLength) :
m_version(version & 0x7),
115 [[nodiscard]] std::vector<std::uint8_t>
serialize()
const override;
161 explicit PusC(
const std::uint8_t version,
const std::uint8_t serviceType,
const std::uint8_t serviceSubtype,
162 const std::uint8_t sourceID,
const std::vector<std::uint8_t>& timeCode,
178 [[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.
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
PusB(const std::uint8_t version, const std::uint8_t serviceType, const std::uint8_t serviceSubtype, const std::uint8_t sourceID, const std::uint16_t eventID, const std::uint16_t dataLength)
Constructs a PusB object with all fields explicitly set.
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