25 this->m_direction = direction;
26 this->m_class = txmMode;
29 this->m_segmentationControl = 0;
30 this->m_segmentMetadataFlag = 0;
31 this->m_pduDataLength = 0;
32 this->m_sourceEid = sourceEid;
33 this->m_transactionSeq = transactionSeq;
34 this->m_destEid = destEid;
42 for (minSize = 1; minSize < 8 && value >= limit; ++minSize) {
52 for (
U8 i = 0; i < encodeSize; ++i) {
53 U8 shift =
static_cast<U8>((encodeSize - 1 - i) * 8);
54 U8 byte =
static_cast<U8>((value >> shift) & 0xFF);
68 for (
U8 i = 0; i < decodeSize; ++i) {
74 value = (value << 8) | byte;
88 if (static_cast<U64>(static_cast<T>(value)) != value) {
91 field =
static_cast<T
>(value);
100 U8 eidSize =
getValueEncodedSize(this->m_sourceEid > this->m_destEid ? this->m_sourceEid : this->m_destEid);
114 U8 eidSize =
getValueEncodedSize(this->m_sourceEid > this->m_destEid ? this->m_sourceEid : this->m_destEid);
125 flags =
static_cast<U8>(flags |
static_cast<U8>((this->m_version & 0x07U) << 5));
126 flags =
static_cast<U8>(flags |
static_cast<U8>((
static_cast<U8>(this->m_pduType) & 0x01U) << 4));
127 flags =
static_cast<U8>(flags |
static_cast<U8>((
static_cast<U8>(this->m_direction) & 0x01U) << 3));
128 flags =
static_cast<U8>(flags |
static_cast<U8>((this->m_class & 0x01U) << 2));
129 flags =
static_cast<U8>(flags |
static_cast<U8>((
static_cast<U8>(this->m_crcFlag) & 0x01U) << 1));
130 flags =
static_cast<U8>(flags | (
static_cast<U8>(this->m_largeFileFlag) & 0x01U));
138 status = serialBuffer.
serializeFrom(static_cast<U16>(this->m_pduDataLength));
148 U8 eidTsnLengths = 0;
149 eidTsnLengths =
static_cast<U8>(eidTsnLengths |
static_cast<U8>((this->m_segmentationControl & 0x01U) << 7));
150 eidTsnLengths =
static_cast<U8>(eidTsnLengths |
static_cast<U8>(((eidSize - 1U) & 0x07U) << 4));
151 eidTsnLengths =
static_cast<U8>(eidTsnLengths |
static_cast<U8>((this->m_segmentMetadataFlag & 0x01U) << 3));
152 eidTsnLengths =
static_cast<U8>(eidTsnLengths | ((tsnSize - 1U) & 0x07U));
188 this->m_version = (flags >> 5) & 0x07;
189 this->m_pduType =
static_cast<PduType>((flags >> 4) & 0x01);
190 this->m_direction =
static_cast<PduDirection>((flags >> 3) & 0x01);
192 this->m_crcFlag =
static_cast<CrcFlag>((flags >> 1) & 0x01);
193 this->m_largeFileFlag =
static_cast<LargeFileFlag>(flags & 0x01);
215 this->m_segmentationControl = (eidTsnLengths >> 7) & 0x01;
216 U8 eidSize =
static_cast<U8>(((eidTsnLengths >> 4) & 0x07) + 1);
217 this->m_segmentMetadataFlag = (eidTsnLengths >> 3) & 0x01;
218 U8 tsnSize =
static_cast<U8>((eidTsnLengths & 0x07) + 1);
221 FW_ASSERT(eidSize >= 1 && eidSize <= 8, static_cast<FwAssertArgType>(eidSize));
222 FW_ASSERT(tsnSize >= 1 && tsnSize <= 8, static_cast<FwAssertArgType>(tsnSize));
271 U8 eidTsnLengths = data[3];
272 U8 eidSize =
static_cast<U8>(((eidTsnLengths >> 4) & 0x07) + 1);
273 U8 tsnSize =
static_cast<U8>((eidTsnLengths & 0x07) + 1);
276 U32 directiveCodeOffset = 4 + (2 * eidSize) + tsnSize;
279 if (directiveCodeOffset < buffer.
getSize()) {
281 U8 directiveCode = data[directiveCodeOffset];
284 switch (directiveCode) {
Serialization/Deserialization operation was successful.
Negative Acknowledgment PDU.
U32 EntityId
Entity id size.
static U64 decodeIntegerInSize(Fw::SerialBufferBase &serialBuffer, U8 decodeSize, Fw::SerializeStatus &status)
Invalid or unknown PDU type.
static Fw::SerializeStatus decodeFieldInSize(Fw::SerialBufferBase &serialBuffer, U8 decodeSize, T &field)
static Fw::SerializeStatus encodeIntegerInSize(Fw::SerialBufferBase &serialBuffer, U64 value, U8 encodeSize)
Deserialization data had incorrect values (unexpected data types)
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
U32 FileSize
File size and offset type.
uint8_t U8
8-bit unsigned integer
FwSizeType getSize() const
PduTypeEnum::T peekPduType(const Fw::Buffer &buffer)
RateGroupDivider component implementation.