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

Converts between Ieee80211HrDsssPhyHeader and binary network byte order IEEE 802.11 HR/DSSS PHY header. More...

#include <Ieee80211PhyHeaderSerializer.h>

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

Public Member Functions

 Ieee80211HrDsssPhyHeaderSerializer ()
 
- 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
 HR/DSSS. 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 Ieee80211HrDsssPhyHeader and binary network byte order IEEE 802.11 HR/DSSS PHY header.

Constructor & Destructor Documentation

◆ Ieee80211HrDsssPhyHeaderSerializer()

inet::physicallayer::Ieee80211HrDsssPhyHeaderSerializer::Ieee80211HrDsssPhyHeaderSerializer ( )
inline
66 : FieldsChunkSerializer() {}

Member Function Documentation

◆ deserialize()

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

100 {
101  auto hrDsssPhyHeader = makeShared<Ieee80211HrDsssPhyHeader>();
102  stream.readUint16Be();
103  hrDsssPhyHeader->setSignal(stream.readByte());
104  hrDsssPhyHeader->setService(stream.readByte());
105  hrDsssPhyHeader->setLengthField(B(stream.readUint16Be()));
106  hrDsssPhyHeader->setCrcMode(CRC_COMPUTED);
107  return hrDsssPhyHeader;
108 }

◆ serialize()

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

HR/DSSS.

Implements inet::FieldsChunkSerializer.

91 {
92  auto hrDsssPhyHeader = dynamicPtrCast<const Ieee80211HrDsssPhyHeader>(chunk);
93  stream.writeUint16Be(0);
94  stream.writeByte(hrDsssPhyHeader->getSignal());
95  stream.writeByte(hrDsssPhyHeader->getService());
96  stream.writeUint16Be(B(hrDsssPhyHeader->getLengthField()).get());
97 }

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