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

Converts between Ieee80211DsssPhyHeader and binary network byte order IEEE 802.11 DSSS PHY header. More...

#include <Ieee80211PhyHeaderSerializer.h>

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

Public Member Functions

 Ieee80211DsssPhyHeaderSerializer ()
 
- 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
 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 Ieee80211DsssPhyHeader and binary network byte order IEEE 802.11 DSSS PHY header.

Constructor & Destructor Documentation

◆ Ieee80211DsssPhyHeaderSerializer()

inet::physicallayer::Ieee80211DsssPhyHeaderSerializer::Ieee80211DsssPhyHeaderSerializer ( )
inline
53 : FieldsChunkSerializer() {}

Member Function Documentation

◆ deserialize()

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

77 {
78  auto dsssPhyHeader = makeShared<Ieee80211DsssPhyHeader>();
79  stream.readUint16Be();
80  dsssPhyHeader->setSignal(stream.readByte());
81  dsssPhyHeader->setService(stream.readByte());
82  dsssPhyHeader->setLengthField(B(stream.readUint16Be()));
83  dsssPhyHeader->setCrcMode(CRC_COMPUTED);
84  return dsssPhyHeader;
85 }

◆ serialize()

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

DSSS.

Implements inet::FieldsChunkSerializer.

68 {
69  auto dsssPhyHeader = dynamicPtrCast<const Ieee80211DsssPhyHeader>(chunk);
70  stream.writeUint16Be(0);
71  stream.writeByte(dsssPhyHeader->getSignal());
72  stream.writeByte(dsssPhyHeader->getService());
73  stream.writeUint16Be(B(dsssPhyHeader->getLengthField()).get());
74 }

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