INET Framework for OMNeT++/OMNEST
inet::physicallayer::Ieee80211OfdmPhyHeaderSerializer Class Reference

Converts between Ieee80211OfdmPhyHeader and binary network byte order IEEE 802.11 OFDM PHY header. More...

#include <Ieee80211PhyHeaderSerializer.h>

Inheritance diagram for inet::physicallayer::Ieee80211OfdmPhyHeaderSerializer:
inet::FieldsChunkSerializer inet::ChunkSerializer

Public Member Functions

 Ieee80211OfdmPhyHeaderSerializer ()
 
- 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
 OFDM. 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 Ieee80211OfdmPhyHeader and binary network byte order IEEE 802.11 OFDM PHY header.

Constructor & Destructor Documentation

◆ Ieee80211OfdmPhyHeaderSerializer()

inet::physicallayer::Ieee80211OfdmPhyHeaderSerializer::Ieee80211OfdmPhyHeaderSerializer ( )
inline
79 : FieldsChunkSerializer() {}

Member Function Documentation

◆ deserialize()

const Ptr< Chunk > inet::physicallayer::Ieee80211OfdmPhyHeaderSerializer::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.

125 {
126  auto ofdmPhyHeader = makeShared<Ieee80211OfdmPhyHeader>();
127  ofdmPhyHeader->setRate(stream.readUint4());
128  ofdmPhyHeader->setReserved(stream.readBit());
129  ofdmPhyHeader->setLengthField(B(stream.readNBitsToUint64Be(12)));
130  ofdmPhyHeader->setParity(stream.readBit());
131  ofdmPhyHeader->setTail(stream.readNBitsToUint64Be(6));
132  ofdmPhyHeader->setService(stream.readUint16Be());
133  return ofdmPhyHeader;
134 }

◆ serialize()

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

OFDM.

Implements inet::FieldsChunkSerializer.

114 {
115  auto ofdmPhyHeader = dynamicPtrCast<const Ieee80211OfdmPhyHeader>(chunk);
116  stream.writeUint4(ofdmPhyHeader->getRate());
117  stream.writeBit(ofdmPhyHeader->getReserved());
118  stream.writeNBitsOfUint64Be(B(ofdmPhyHeader->getLengthField()).get(), 12);
119  stream.writeBit(ofdmPhyHeader->getParity());
120  stream.writeNBitsOfUint64Be(ofdmPhyHeader->getTail(), 6);
121  stream.writeUint16Be(ofdmPhyHeader->getService());
122 }

The documentation for this class was generated from the following files:
inet::units::units::B
intscale< b, 1, 8 > B
Definition: Units.h:1168