A Discrete-Event Network Simulator
API
ns3::WifiSpectrumPhyInterface Class Reference

This class is an adaptor between class SpectrumWifiPhy (which inherits from WifiPhy) and class SpectrumChannel (which expects objects derived from class SpectrumPhy to be connected to it). More...

#include "wifi-spectrum-phy-interface.h"

+ Inheritance diagram for ns3::WifiSpectrumPhyInterface:
+ Collaboration diagram for ns3::WifiSpectrumPhyInterface:

Public Member Functions

 WifiSpectrumPhyInterface (FrequencyRange freqRange)
 Constructor. More...
 
Ptr< ObjectGetAntenna () const override
 Get the AntennaModel used by this SpectrumPhy instance for transmission and/or reception. More...
 
const WifiSpectrumBandsGetBands () const
 Get the vector of spectrum bands handled by this interface. More...
 
uint16_t GetCenterFrequency () const
 Get the center frequency in MHz of the the spectrum channel this interface is attached to. More...
 
Ptr< SpectrumChannelGetChannel () const
 Get the spectrum channel this interface is attached to. More...
 
uint16_t GetChannelWidth () const
 Get the channel width in MHz covered by the spectrum channel this interface is attached to. More...
 
Ptr< NetDeviceGetDevice () const override
 Get the associated NetDevice instance. More...
 
const FrequencyRangeGetFrequencyRange () const
 Get the frequency range covered by the spectrum channel this interface is attached to. More...
 
const HeRuBandsGetHeRuBands () const
 Get the HE RU spectrum bands handled by this interface. More...
 
Ptr< MobilityModelGetMobility () const override
 Get the associated MobilityModel instance. More...
 
Ptr< const SpectrumModelGetRxSpectrumModel () const override
 
Ptr< const SpectrumWifiPhyGetSpectrumWifiPhy () const
 Get SpectrumWifiPhy object. More...
 
void SetBands (WifiSpectrumBands &&bands)
 Set the vector of spectrum bands handled by this interface. More...
 
void SetChannel (const Ptr< SpectrumChannel > c) override
 Set the channel attached to this device. More...
 
void SetDevice (const Ptr< NetDevice > d) override
 Set the associated NetDevice instance. More...
 
void SetHeRuBands (HeRuBands &&heRuBands)
 Set the HE RU spectrum bands handled by this interface (if any) More...
 
void SetMobility (const Ptr< MobilityModel > m) override
 Set the mobility model associated with this device. More...
 
void SetRxSpectrumModel (uint32_t centerFrequency, uint16_t channelWidth, uint32_t bandBandwidth, uint16_t guardBandwidth)
 Set the RX spectrum model. More...
 
void SetSpectrumWifiPhy (const Ptr< SpectrumWifiPhy > phy)
 Connect SpectrumWifiPhy object. More...
 
void StartRx (Ptr< SpectrumSignalParameters > params) override
 Notify the SpectrumPhy instance of an incoming signal. More...
 
void StartTx (Ptr< SpectrumSignalParameters > params)
 Start transmission over the spectrum channel. More...
 
- Public Member Functions inherited from ns3::SpectrumPhy
 SpectrumPhy ()
 
 SpectrumPhy (const SpectrumPhy &)=delete
 
 ~SpectrumPhy () override
 
SpectrumPhyoperator= (const SpectrumPhy &)=delete
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
 ~Object () override
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose ()
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one. More...
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object. More...
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object. More...
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object. More...
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized () const
 Check if the object has been initialized. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o[[maybe_unused]])
 Copy constructor. More...
 
uint32_t GetReferenceCount () const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o[[maybe_unused]])
 Assignment operator. More...
 
void Ref () const
 Increment the reference count. More...
 
void Unref () const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::SpectrumPhy
static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID. More...
 

Private Member Functions

void DoDispose () override
 Destructor implementation. More...
 

Private Attributes

WifiSpectrumBands m_bands
 Store all the distinct spectrum bands associated with every channels widths. More...
 
uint16_t m_centerFrequency
 center frequency in MHz More...
 
Ptr< SpectrumChannelm_channel
 spectrum channel More...
 
uint16_t m_channelWidth
 channel width in MHz More...
 
FrequencyRange m_frequencyRange
 frequency range More...
 
HeRuBands m_heRuBands
 Store all the distinct spectrum bands associated with every RU. More...
 
Ptr< NetDevicem_netDevice
 the device More...
 
Ptr< const SpectrumModelm_rxSpectrumModel
 receive spectrum model More...
 
Ptr< SpectrumWifiPhym_spectrumWifiPhy
 spectrum PHY More...
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void DoInitialize ()
 Initialize() implementation. More...
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes. More...
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed. More...
 

Detailed Description

This class is an adaptor between class SpectrumWifiPhy (which inherits from WifiPhy) and class SpectrumChannel (which expects objects derived from class SpectrumPhy to be connected to it).

The adaptor is used only in the receive direction; in the transmit direction, the class SpectrumWifiPhy constructs signal parameters and directly accesses the SpectrumChannel

Definition at line 44 of file wifi-spectrum-phy-interface.h.

Constructor & Destructor Documentation

◆ WifiSpectrumPhyInterface()

ns3::WifiSpectrumPhyInterface::WifiSpectrumPhyInterface ( FrequencyRange  freqRange)

Constructor.

Parameters
freqRangethe frequency range covered by the interface

Definition at line 43 of file wifi-spectrum-phy-interface.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ DoDispose()

void ns3::WifiSpectrumPhyInterface::DoDispose ( void  )
overrideprivatevirtual

Destructor implementation.

This method is called by Dispose() or by the Object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.

It is safe to call GetObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 54 of file wifi-spectrum-phy-interface.cc.

References m_bands, m_channel, m_heRuBands, m_netDevice, m_rxSpectrumModel, m_spectrumWifiPhy, and NS_LOG_FUNCTION.

◆ GetAntenna()

Ptr< Object > ns3::WifiSpectrumPhyInterface::GetAntenna ( ) const
overridevirtual

Get the AntennaModel used by this SpectrumPhy instance for transmission and/or reception.

Note that in general and depending on each module design, there can be multiple SpectrumPhy instances per NetDevice.

Returns
a Ptr to the AntennaModel used by this SpectrumPhy instance for transmission and/or reception

Implements ns3::SpectrumPhy.

Definition at line 137 of file wifi-spectrum-phy-interface.cc.

References ns3::SpectrumWifiPhy::GetAntenna(), and m_spectrumWifiPhy.

+ Here is the call graph for this function:

◆ GetBands()

const WifiSpectrumBands & ns3::WifiSpectrumPhyInterface::GetBands ( ) const

Get the vector of spectrum bands handled by this interface.

Returns
the vector of spectrum bands

Definition at line 167 of file wifi-spectrum-phy-interface.cc.

References m_bands.

◆ GetCenterFrequency()

uint16_t ns3::WifiSpectrumPhyInterface::GetCenterFrequency ( ) const

Get the center frequency in MHz of the the spectrum channel this interface is attached to.

Returns
the center frequency in MHz of the the spectrum channel this interface is attached to to

Definition at line 149 of file wifi-spectrum-phy-interface.cc.

References m_centerFrequency.

◆ GetChannel()

Ptr< SpectrumChannel > ns3::WifiSpectrumPhyInterface::GetChannel ( ) const

Get the spectrum channel this interface is attached to.

Returns
the spectrum channel this interface is attached to

Definition at line 125 of file wifi-spectrum-phy-interface.cc.

References m_channel.

◆ GetChannelWidth()

uint16_t ns3::WifiSpectrumPhyInterface::GetChannelWidth ( ) const

Get the channel width in MHz covered by the spectrum channel this interface is attached to.

Returns
the channel width in MHz covered by the spectrum channel this interface is attached to to

Definition at line 155 of file wifi-spectrum-phy-interface.cc.

References m_channelWidth.

◆ GetDevice()

Ptr< NetDevice > ns3::WifiSpectrumPhyInterface::GetDevice ( ) const
overridevirtual

Get the associated NetDevice instance.

Returns
a Ptr to the associated NetDevice instance

Implements ns3::SpectrumPhy.

Definition at line 78 of file wifi-spectrum-phy-interface.cc.

References m_netDevice.

◆ GetFrequencyRange()

const FrequencyRange & ns3::WifiSpectrumPhyInterface::GetFrequencyRange ( ) const

Get the frequency range covered by the spectrum channel this interface is attached to.

Returns
the frequency range covered by the spectrum channel this interface is attached to

Definition at line 143 of file wifi-spectrum-phy-interface.cc.

References m_frequencyRange.

◆ GetHeRuBands()

const HeRuBands & ns3::WifiSpectrumPhyInterface::GetHeRuBands ( ) const

Get the HE RU spectrum bands handled by this interface.

Returns
the HE RU spectrum bands

Definition at line 179 of file wifi-spectrum-phy-interface.cc.

References m_heRuBands.

◆ GetMobility()

Ptr< MobilityModel > ns3::WifiSpectrumPhyInterface::GetMobility ( ) const
overridevirtual

Get the associated MobilityModel instance.

Returns
a Ptr to the associated MobilityModel instance

Implements ns3::SpectrumPhy.

Definition at line 84 of file wifi-spectrum-phy-interface.cc.

References ns3::WifiPhy::GetMobility(), and m_spectrumWifiPhy.

+ Here is the call graph for this function:

◆ GetRxSpectrumModel()

Ptr< const SpectrumModel > ns3::WifiSpectrumPhyInterface::GetRxSpectrumModel ( ) const
overridevirtual
Returns
returns the SpectrumModel that this SpectrumPhy expects to be used for all SpectrumValues that are passed to StartRx. If 0 is returned, it means that any model will be accepted.

Implements ns3::SpectrumPhy.

Definition at line 131 of file wifi-spectrum-phy-interface.cc.

References m_rxSpectrumModel.

◆ GetSpectrumWifiPhy()

Ptr< const SpectrumWifiPhy > ns3::WifiSpectrumPhyInterface::GetSpectrumWifiPhy ( ) const

Get SpectrumWifiPhy object.

Returns
Pointer to SpectrumWifiPhy object

Definition at line 72 of file wifi-spectrum-phy-interface.cc.

References m_spectrumWifiPhy.

◆ GetTypeId()

TypeId ns3::WifiSpectrumPhyInterface::GetTypeId ( void  )
static

Get the type ID.

Returns
the object TypeId

Definition at line 36 of file wifi-spectrum-phy-interface.cc.

References ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ SetBands()

void ns3::WifiSpectrumPhyInterface::SetBands ( WifiSpectrumBands &&  bands)

Set the vector of spectrum bands handled by this interface.

Parameters
bandsvector of spectrum bands

Definition at line 161 of file wifi-spectrum-phy-interface.cc.

References m_bands.

◆ SetChannel()

void ns3::WifiSpectrumPhyInterface::SetChannel ( const Ptr< SpectrumChannel c)
overridevirtual

Set the channel attached to this device.

Parameters
cthe channel

Implements ns3::SpectrumPhy.

Definition at line 102 of file wifi-spectrum-phy-interface.cc.

References m_channel, m_rxSpectrumModel, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

◆ SetDevice()

void ns3::WifiSpectrumPhyInterface::SetDevice ( const Ptr< NetDevice d)
overridevirtual

Set the associated NetDevice instance.

Parameters
dthe NetDevice instance

Implements ns3::SpectrumPhy.

Definition at line 90 of file wifi-spectrum-phy-interface.cc.

References m_netDevice.

◆ SetHeRuBands()

void ns3::WifiSpectrumPhyInterface::SetHeRuBands ( HeRuBands &&  heRuBands)

Set the HE RU spectrum bands handled by this interface (if any)

Parameters
heRuBandsthe HE RU spectrum bands

Definition at line 173 of file wifi-spectrum-phy-interface.cc.

References m_heRuBands.

◆ SetMobility()

void ns3::WifiSpectrumPhyInterface::SetMobility ( const Ptr< MobilityModel m)
overridevirtual

Set the mobility model associated with this device.

Parameters
mthe mobility model

Implements ns3::SpectrumPhy.

Definition at line 96 of file wifi-spectrum-phy-interface.cc.

References two-ray-to-three-gpp-ch-calibration::m, m_spectrumWifiPhy, and ns3::WifiPhy::SetMobility().

+ Here is the call graph for this function:

◆ SetRxSpectrumModel()

void ns3::WifiSpectrumPhyInterface::SetRxSpectrumModel ( uint32_t  centerFrequency,
uint16_t  channelWidth,
uint32_t  bandBandwidth,
uint16_t  guardBandwidth 
)

Set the RX spectrum model.

Parameters
centerFrequencythe center frequency in MHz
channelWidththe channel width in MHz
bandBandwidththe width of each band in Hz
guardBandwidththe width of the guard band in MHz

Definition at line 110 of file wifi-spectrum-phy-interface.cc.

References ns3::WifiSpectrumValueHelper::GetSpectrumModel(), m_centerFrequency, m_channelWidth, m_rxSpectrumModel, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ SetSpectrumWifiPhy()

void ns3::WifiSpectrumPhyInterface::SetSpectrumWifiPhy ( const Ptr< SpectrumWifiPhy phy)

Connect SpectrumWifiPhy object.

Parameters
phySpectrumWifiPhy object to be connected to this object

Definition at line 66 of file wifi-spectrum-phy-interface.cc.

References m_spectrumWifiPhy.

◆ StartRx()

void ns3::WifiSpectrumPhyInterface::StartRx ( Ptr< SpectrumSignalParameters params)
overridevirtual

Notify the SpectrumPhy instance of an incoming signal.

Parameters
paramsthe parameters of the signals being received

Implements ns3::SpectrumPhy.

Definition at line 185 of file wifi-spectrum-phy-interface.cc.

References m_spectrumWifiPhy, two-ray-to-three-gpp-ch-calibration::params, and ns3::SpectrumWifiPhy::StartRx().

+ Here is the call graph for this function:

◆ StartTx()

void ns3::WifiSpectrumPhyInterface::StartTx ( Ptr< SpectrumSignalParameters params)

Start transmission over the spectrum channel.

Parameters
paramsthe parameters of the signal to transmit

Definition at line 191 of file wifi-spectrum-phy-interface.cc.

References ns3::SpectrumWifiPhy::GetAntenna(), m_channel, m_spectrumWifiPhy, and two-ray-to-three-gpp-ch-calibration::params.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_bands

WifiSpectrumBands ns3::WifiSpectrumPhyInterface::m_bands
private

Store all the distinct spectrum bands associated with every channels widths.

Definition at line 167 of file wifi-spectrum-phy-interface.h.

Referenced by DoDispose(), GetBands(), and SetBands().

◆ m_centerFrequency

uint16_t ns3::WifiSpectrumPhyInterface::m_centerFrequency
private

center frequency in MHz

Definition at line 162 of file wifi-spectrum-phy-interface.h.

Referenced by GetCenterFrequency(), and SetRxSpectrumModel().

◆ m_channel

Ptr<SpectrumChannel> ns3::WifiSpectrumPhyInterface::m_channel
private

spectrum channel

Definition at line 161 of file wifi-spectrum-phy-interface.h.

Referenced by DoDispose(), GetChannel(), SetChannel(), and StartTx().

◆ m_channelWidth

uint16_t ns3::WifiSpectrumPhyInterface::m_channelWidth
private

channel width in MHz

Definition at line 163 of file wifi-spectrum-phy-interface.h.

Referenced by GetChannelWidth(), and SetRxSpectrumModel().

◆ m_frequencyRange

FrequencyRange ns3::WifiSpectrumPhyInterface::m_frequencyRange
private

frequency range

Definition at line 158 of file wifi-spectrum-phy-interface.h.

Referenced by GetFrequencyRange().

◆ m_heRuBands

HeRuBands ns3::WifiSpectrumPhyInterface::m_heRuBands
private

Store all the distinct spectrum bands associated with every RU.

Definition at line 168 of file wifi-spectrum-phy-interface.h.

Referenced by DoDispose(), GetHeRuBands(), and SetHeRuBands().

◆ m_netDevice

Ptr<NetDevice> ns3::WifiSpectrumPhyInterface::m_netDevice
private

the device

Definition at line 160 of file wifi-spectrum-phy-interface.h.

Referenced by DoDispose(), GetDevice(), and SetDevice().

◆ m_rxSpectrumModel

Ptr<const SpectrumModel> ns3::WifiSpectrumPhyInterface::m_rxSpectrumModel
private

receive spectrum model

Definition at line 164 of file wifi-spectrum-phy-interface.h.

Referenced by DoDispose(), GetRxSpectrumModel(), SetChannel(), and SetRxSpectrumModel().

◆ m_spectrumWifiPhy

Ptr<SpectrumWifiPhy> ns3::WifiSpectrumPhyInterface::m_spectrumWifiPhy
private

The documentation for this class was generated from the following files: