20 const U32 sequenceIndex,
27 this->m_byteOffset = byteOffset;
28 this->m_dataSize = dataSize;
35 return static_cast<U32
>(
36 this->m_header.bufferSize() +
37 sizeof(this->m_byteOffset) +
38 sizeof(this->m_dataSize) +
49 return this->toSerialBuffer(serialBuffer);
63 status = serialBuffer.
deserialize(this->m_dataSize);
68 if (serialBuffer.
getBuffLeft() != this->m_dataSize) {
73 this->m_data = &addr[this->fixedLengthSize()];
79 U32 FilePacket::DataPacket ::
80 fixedLengthSize()
const
82 return static_cast<U32
>(
83 this->m_header.bufferSize() +
84 sizeof(this->m_byteOffset) +
85 sizeof(this->m_dataSize));
89 toSerialBuffer(SerialBuffer& serialBuffer)
const
96 status = this->m_header.toSerialBuffer(serialBuffer);
101 status = serialBuffer.serialize(this->m_byteOffset);
106 status = serialBuffer.serialize(this->m_dataSize);
111 status = serialBuffer.pushBytes(this->m_data, this->m_dataSize);
uint8_t U8
8-bit unsigned integer
SerializeStatus toBuffer(Buffer &buffer) const
Convert this DataPacket to a Buffer.
void initialize(const U32 sequenceIndex, const U32 byteOffset, const U16 dataSize, const U8 *const data)
Initialize a data packet.
U32 bufferSize() const
Compute the buffer size needed to hold this DataPacket.
A variable-length serializable buffer.
U8 * getBuffAddr()
gets buffer address for data filling
Serializable::SizeType getBuffLeft() const
returns how much deserialization buffer is left
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
@ FW_DESERIALIZE_SIZE_MISMATCH
Data was left in the buffer, but not enough to deserialize.