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

Converts between Ieee80211FhssPhyHeader and binary network byte order IEEE 802.11 FHSS PHY header. More...

#include <Ieee80211PhyHeaderSerializer.h>

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

Public Member Functions

 Ieee80211FhssPhyHeaderSerializer ()
 
- 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
 FHSS. 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 Ieee80211FhssPhyHeader and binary network byte order IEEE 802.11 FHSS PHY header.

Constructor & Destructor Documentation

◆ Ieee80211FhssPhyHeaderSerializer()

inet::physicallayer::Ieee80211FhssPhyHeaderSerializer::Ieee80211FhssPhyHeaderSerializer ( )
inline
27 : FieldsChunkSerializer() {}

Member Function Documentation

◆ deserialize()

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

38 {
39  auto fhssPhyHeader = makeShared<Ieee80211FhssPhyHeader>();
40  fhssPhyHeader->setPlw(stream.readNBitsToUint64Be(12));
41  fhssPhyHeader->setPsf(stream.readUint4());
42  fhssPhyHeader->setCrc(stream.readUint16Be());
43  fhssPhyHeader->setCrcMode(CRC_COMPUTED);
44  return fhssPhyHeader;
45 }

◆ serialize()

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

FHSS.

Implements inet::FieldsChunkSerializer.

30 {
31  auto fhssPhyHeader = dynamicPtrCast<const Ieee80211FhssPhyHeader>(chunk);
32  stream.writeNBitsOfUint64Be(fhssPhyHeader->getPlw(), 12);
33  stream.writeUint4(fhssPhyHeader->getPsf());
34  stream.writeUint16Be(fhssPhyHeader->getCrc());
35 }

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