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);
122 U8 segmentationControl = 0;
123 segmentationControl =
124 static_cast<U8>(segmentationControl |
static_cast<U8>((this->m_closureRequested & 0x01U) << 6));
125 segmentationControl =
static_cast<U8>(segmentationControl | (
static_cast<U8>(this->m_checksumType) & 0x0FU));
139 U8 sourceFilenameLength =
static_cast<U8>(this->m_sourceFilename.
length());
146 status = serialBuffer.
serializeFrom(reinterpret_cast<const U8*>(this->m_sourceFilename.
toChar()),
153 U8 destFilenameLength =
static_cast<U8>(this->m_destFilename.
length());
160 status = serialBuffer.
serializeFrom(reinterpret_cast<const U8*>(this->m_destFilename.
toChar()), destFilenameLength,
175 U8 segmentationControl;
181 this->m_closureRequested = (segmentationControl >> 6) & 0x01;
182 U8 checksumTypeVal = segmentationControl & 0x0F;
183 this->m_checksumType =
static_cast<ChecksumType>(checksumTypeVal);
192 U8 sourceFilenameLength;
204 if (sourceFilenameLength == 0) {
210 FwSizeType actualLength = sourceFilenameLength;
216 sourceFilenameBuffer[sourceFilenameLength] =
'\0';
217 this->m_sourceFilename =
reinterpret_cast<const CHAR*
>(sourceFilenameBuffer);
220 U8 destFilenameLength;
232 if (destFilenameLength == 0) {
238 actualLength = destFilenameLength;
244 destFilenameBuffer[destFilenameLength] =
'\0';
245 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.