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;
85 U8 eidSize =
getValueEncodedSize(this->m_sourceEid > this->m_destEid ? this->m_sourceEid : this->m_destEid);
99 U8 eidSize =
getValueEncodedSize(this->m_sourceEid > this->m_destEid ? this->m_sourceEid : this->m_destEid);
110 flags =
static_cast<U8>(flags |
static_cast<U8>((this->m_version & 0x07U) << 5));
111 flags =
static_cast<U8>(flags |
static_cast<U8>((
static_cast<U8>(this->m_pduType) & 0x01U) << 4));
112 flags =
static_cast<U8>(flags |
static_cast<U8>((
static_cast<U8>(this->m_direction) & 0x01U) << 3));
113 flags =
static_cast<U8>(flags |
static_cast<U8>((this->m_class & 0x01U) << 2));
114 flags =
static_cast<U8>(flags |
static_cast<U8>((
static_cast<U8>(this->m_crcFlag) & 0x01U) << 1));
115 flags =
static_cast<U8>(flags | (
static_cast<U8>(this->m_largeFileFlag) & 0x01U));
123 status = serialBuffer.
serializeFrom(static_cast<U16>(this->m_pduDataLength));
133 U8 eidTsnLengths = 0;
134 eidTsnLengths =
static_cast<U8>(eidTsnLengths |
static_cast<U8>((this->m_segmentationControl & 0x01U) << 7));
135 eidTsnLengths =
static_cast<U8>(eidTsnLengths |
static_cast<U8>(((eidSize - 1U) & 0x07U) << 4));
136 eidTsnLengths =
static_cast<U8>(eidTsnLengths |
static_cast<U8>((this->m_segmentMetadataFlag & 0x01U) << 3));
137 eidTsnLengths =
static_cast<U8>(eidTsnLengths | ((tsnSize - 1U) & 0x07U));
173 this->m_version = (flags >> 5) & 0x07;
174 this->m_pduType =
static_cast<PduType>((flags >> 4) & 0x01);
175 this->m_direction =
static_cast<PduDirection>((flags >> 3) & 0x01);
177 this->m_crcFlag =
static_cast<CrcFlag>((flags >> 1) & 0x01);
178 this->m_largeFileFlag =
static_cast<LargeFileFlag>(flags & 0x01);
193 this->m_segmentationControl = (eidTsnLengths >> 7) & 0x01;
194 U8 eidSize =
static_cast<U8>(((eidTsnLengths >> 4) & 0x07) + 1);
195 this->m_segmentMetadataFlag = (eidTsnLengths >> 3) & 0x01;
196 U8 tsnSize =
static_cast<U8>((eidTsnLengths & 0x07) + 1);
199 FW_ASSERT(eidSize >= 1 && eidSize <= 8, static_cast<FwAssertArgType>(eidSize));
200 FW_ASSERT(tsnSize >= 1 && tsnSize <= 8, static_cast<FwAssertArgType>(tsnSize));
248 U8 eidTsnLengths = data[3];
249 U8 eidSize =
static_cast<U8>(((eidTsnLengths >> 4) & 0x07) + 1);
250 U8 tsnSize =
static_cast<U8>((eidTsnLengths & 0x07) + 1);
253 U32 directiveCodeOffset = 4 + (2 * eidSize) + tsnSize;
256 if (directiveCodeOffset < buffer.
getSize()) {
258 U8 directiveCode = data[directiveCodeOffset];
261 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 encodeIntegerInSize(Fw::SerialBufferBase &serialBuffer, U64 value, U8 encodeSize)
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
uint8_t U8
8-bit unsigned integer
FwSizeType getSize() const
PduTypeEnum::T peekPduType(const Fw::Buffer &buffer)
RateGroupDivider component implementation.