INET Framework for OMNeT++/OMNEST
inet::ieee80211::Ieee80211MpduSubframeHeaderSerializer Class Reference

Converts between Ieee80211MpduSubframeHeader and binary network byte order IEEE 802.11 Mpdu header. More...

#include <Ieee80211MacHeaderSerializer.h>

Inheritance diagram for inet::ieee80211::Ieee80211MpduSubframeHeaderSerializer:
inet::FieldsChunkSerializer inet::ChunkSerializer

Public Member Functions

 Ieee80211MpduSubframeHeaderSerializer ()
 
- Public Member Functions inherited from inet::FieldsChunkSerializer
virtual void serialize (MemoryOutputStream &stream, const Ptr< const Chunk > &chunk, b offset, b length) const override
 Serializes a chunk into a stream by writing the bytes representing the chunk at the end of the stream. More...
 
virtual const Ptr< Chunkdeserialize (MemoryInputStream &stream, const std::type_info &typeInfo) const override
 Deserializes a chunk from a stream by reading the bytes at the current position of the stream. More...
 

Protected Member Functions

virtual void serialize (MemoryOutputStream &stream, const Ptr< const Chunk > &chunk) const override
 Serializes a chunk into a stream by writing all bytes representing the chunk at the end of the stream. More...
 
virtual const Ptr< Chunkdeserialize (MemoryInputStream &stream) const override
 Deserializes a chunk from a stream by reading the bytes at the current position of the stream. More...
 

Additional Inherited Members

- Static Public Attributes inherited from inet::ChunkSerializer
static b totalSerializedLength = b(0)
 
static b totalDeserializedLength = b(0)
 

Detailed Description

Converts between Ieee80211MpduSubframeHeader and binary network byte order IEEE 802.11 Mpdu header.

Constructor & Destructor Documentation

◆ Ieee80211MpduSubframeHeaderSerializer()

inet::ieee80211::Ieee80211MpduSubframeHeaderSerializer::Ieee80211MpduSubframeHeaderSerializer ( )
inline
64 : FieldsChunkSerializer() {}

Member Function Documentation

◆ deserialize()

const Ptr< Chunk > inet::ieee80211::Ieee80211MpduSubframeHeaderSerializer::deserialize ( MemoryInputStream stream) const
overrideprotectedvirtual

Deserializes a chunk from a stream by reading the bytes at the current position of the stream.

The current stream position is updated according to the length of the returned chunk.

Implements inet::FieldsChunkSerializer.

120 {
121  auto mpduSubframe = makeShared<Ieee80211MpduSubframeHeader>();
122  stream.readUint4();
123  mpduSubframe->setLength(stream.readUint4() >> 8);
124  mpduSubframe->setLength(stream.readUint8());
125  stream.readByte();
126  stream.readByte();
127  return mpduSubframe;
128 }

◆ serialize()

void inet::ieee80211::Ieee80211MpduSubframeHeaderSerializer::serialize ( MemoryOutputStream stream,
const Ptr< const Chunk > &  chunk 
) const
overrideprotectedvirtual

Serializes a chunk into a stream by writing all bytes representing the chunk at the end of the stream.

Implements inet::FieldsChunkSerializer.

110 {
111  auto mpduSubframe = dynamicPtrCast<const Ieee80211MpduSubframeHeader>(chunk);
112  stream.writeUint4(0);
113  stream.writeUint4(mpduSubframe->getLength() >> 8);
114  stream.writeUint8(mpduSubframe->getLength() & 0xFF);
115  stream.writeByte(0);
116  stream.writeByte(0x4E);
117 }

The documentation for this class was generated from the following files: