fsfw/src/fsfw/cfdp/pdu/FileDirectiveCreator.h

35 lines
1.2 KiB
C
Raw Normal View History

#ifndef FSFW_SRC_FSFW_CFDP_PDU_FILEDIRECTIVESERIALIZER_H_
#define FSFW_SRC_FSFW_CFDP_PDU_FILEDIRECTIVESERIALIZER_H_
2022-08-03 15:22:39 +02:00
#include "fsfw/cfdp/pdu/HeaderCreator.h"
2022-08-03 16:00:48 +02:00
class FileDirectiveCreator : public HeaderCreator {
2022-02-02 10:29:30 +01:00
public:
2022-09-15 18:41:15 +02:00
FileDirectiveCreator(PduConfig& pduConf, cfdp::FileDirective directiveCode,
2022-08-03 16:00:48 +02:00
size_t directiveParamFieldLen);
2022-09-15 18:41:15 +02:00
[[nodiscard]] cfdp::FileDirective getDirectiveCode() const;
2022-09-05 14:20:01 +02:00
2022-02-02 10:29:30 +01:00
/**
* This only returns the size of the PDU header + 1 for the directive code octet.
2022-08-03 16:00:48 +02:00
* Use FileDirectiveCreator::getWholePduSize to get the full packet length, assuming
2022-02-02 10:29:30 +01:00
* the length fields was set correctly
* @return
*/
2022-08-03 16:00:48 +02:00
[[nodiscard]] size_t getSerializedSize() const override;
2022-09-05 11:03:25 +02:00
[[nodiscard]] ReturnValue_t serialize(uint8_t* buffer, size_t& serLen, size_t maxSize) const {
return SerializeIF::serialize(buffer, serLen, maxSize, SerializeIF::Endianness::NETWORK);
}
2022-02-02 10:29:30 +01:00
ReturnValue_t serialize(uint8_t** buffer, size_t* size, size_t maxSize,
Endianness streamEndianness) const override;
2022-02-02 10:29:30 +01:00
void setDirectiveDataFieldLen(size_t len);
2022-02-02 10:29:30 +01:00
private:
2022-09-15 18:41:15 +02:00
cfdp::FileDirective directiveCode = cfdp::FileDirective::INVALID_DIRECTIVE;
};
#endif /* FSFW_SRC_FSFW_CFDP_PDU_FILEDIRECTIVESERIALIZER_H_ */