10 #include <config/CfdpCfg.hpp> 25 U8 closureRequested) {
28 this->m_fileSize = fileSize;
33 this->m_sourceFilename = sourceFilename;
38 this->m_destFilename = destFilename;
40 this->m_checksumType = checksumType;
41 this->m_closureRequested = closureRequested;
50 size +=
static_cast<U32
>(
sizeof(
U8) +
sizeof(
U8) +
sizeof(
FileSize));
53 size += 1 +
static_cast<U32
>(this->m_sourceFilename.
length());
56 size += 1 +
static_cast<U32
>(this->m_destFilename.
length());
62 return this->toSerialBuffer(buffer);
91 return this->fromSerialBuffer(buffer);
121 U8 segmentationControl = 0;
122 segmentationControl =
123 static_cast<U8>(segmentationControl |
static_cast<U8>((this->m_closureRequested & 0x01U) << 7));
124 segmentationControl =
static_cast<U8>(segmentationControl | (
static_cast<U8>(this->m_checksumType) & 0x0FU));
138 U8 sourceFilenameLength =
static_cast<U8>(this->m_sourceFilename.
length());
145 status = serialBuffer.
serializeFrom(reinterpret_cast<const U8*>(this->m_sourceFilename.
toChar()),
152 U8 destFilenameLength =
static_cast<U8>(this->m_destFilename.
length());
159 status = serialBuffer.
serializeFrom(reinterpret_cast<const U8*>(this->m_destFilename.
toChar()), destFilenameLength,
174 U8 segmentationControl;
180 this->m_closureRequested = (segmentationControl >> 7) & 0x01;
181 U8 checksumTypeVal = segmentationControl & 0x0F;
182 this->m_checksumType =
static_cast<ChecksumType>(checksumTypeVal);
191 U8 sourceFilenameLength;
203 if (sourceFilenameLength == 0) {
209 FwSizeType actualLength = sourceFilenameLength;
215 sourceFilenameBuffer[sourceFilenameLength] =
'\0';
216 this->m_sourceFilename =
reinterpret_cast<const CHAR*
>(sourceFilenameBuffer);
219 U8 destFilenameLength;
231 if (destFilenameLength == 0) {
237 actualLength = destFilenameLength;
243 destFilenameBuffer[destFilenameLength] =
'\0';
244 this->m_destFilename =
reinterpret_cast<const CHAR*
>(destFilenameBuffer);
Serialization/Deserialization operation was successful.
PlatformSizeType FwSizeType
U32 EntityId
Entity id size.
virtual SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG)=0
Serialize an 8-bit unsigned integer value.
SerializeStatus
forward declaration for string
virtual SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG)=0
Deserialize an 8-bit unsigned integer value.
U32 TransactionSeq
transaction sequence number size
Omit length from serialization.
Data was left in the buffer, but not enough to deserialize.
Deserialized type ID didn't match.
const char * toChar() const
Convert to a C-style char*.
PduHeader m_header
The PDU header (common to all PDUs)
U32 FileSize
File size and offset type.
uint8_t U8
8-bit unsigned integer
RateGroupDivider component implementation.
virtual SizeType length() const
Get the length of the string.