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

Converts between Ieee80211IrPhyHeader and binary network byte order IEEE 802.11 IR PHY header. More...

#include <Ieee80211PhyHeaderSerializer.h>

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

Public Member Functions

 Ieee80211IrPhyHeaderSerializer ()
 
- 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
 IR. 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 Ieee80211IrPhyHeader and binary network byte order IEEE 802.11 IR PHY header.

Constructor & Destructor Documentation

◆ Ieee80211IrPhyHeaderSerializer()

inet::physicallayer::Ieee80211IrPhyHeaderSerializer::Ieee80211IrPhyHeaderSerializer ( )
inline
40 : FieldsChunkSerializer() {}

Member Function Documentation

◆ deserialize()

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

57 {
58  auto irPhyHeader = makeShared<Ieee80211IrPhyHeader>();
59  irPhyHeader->setCrc(stream.readUint16Be());
60  irPhyHeader->setCrcMode(CRC_COMPUTED);
61  return irPhyHeader;
62 }

◆ serialize()

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

IR.

Implements inet::FieldsChunkSerializer.

51 {
52  auto irPhyHeader = dynamicPtrCast<const Ieee80211IrPhyHeader>(chunk);
53  stream.writeUint16Be(irPhyHeader->getCrc());
54 }

The documentation for this class was generated from the following files:
inet::CRC_COMPUTED
@ CRC_COMPUTED
Definition: CrcMode_m.h:59