A Discrete-Event Network Simulator
API
TestPhyListener Class Reference

Test Phy Listener. More...

+ Inheritance diagram for TestPhyListener:
+ Collaboration diagram for TestPhyListener:

Public Member Functions

 TestPhyListener ()=default
 Create a test PhyListener. More...
 
 ~TestPhyListener () override=default
 
void NotifyCcaBusyStart (Time duration, WifiChannelListType channelType, const std::vector< Time > &) override
 
void NotifyOff () override
 Notify listeners that we went to switch off. More...
 
void NotifyOn () override
 Notify listeners that we went to switch on. More...
 
void NotifyRxEndError () override
 We have received the last bit of a packet for which NotifyRxStart was invoked first and, the packet has not been successfully received. More...
 
void NotifyRxEndOk () override
 We have received the last bit of a packet for which NotifyRxStart was invoked first and, the packet has been successfully received. More...
 
void NotifyRxStart (Time duration) override
 
void NotifySleep () override
 Notify listeners that we went to sleep. More...
 
void NotifySwitchingStart (Time duration) override
 
void NotifyTxStart (Time duration, double txPowerDbm) override
 
void NotifyWakeup () override
 Notify listeners that we woke up. More...
 
void Reset ()
 Reset function. More...
 
- Public Member Functions inherited from ns3::WifiPhyListener
virtual ~WifiPhyListener ()
 

Public Attributes

Time m_ccaBusyEnd {0}
 CCA_BUSY end time. More...
 
Time m_ccaBusyStart {0}
 CCA_BUSY start time. More...
 
uint32_t m_notifyMaybeCcaBusyStart {0}
 notify maybe CCA busy start More...
 
uint32_t m_notifyRxEndError {0}
 notify receive end error More...
 
uint32_t m_notifyRxEndOk {0}
 notify receive end OK More...
 
uint32_t m_notifyRxStart {0}
 notify receive start More...
 

Detailed Description

Test Phy Listener.

Definition at line 264 of file spectrum-wifi-phy-test.cc.

Constructor & Destructor Documentation

◆ TestPhyListener()

TestPhyListener::TestPhyListener ( )
default

Create a test PhyListener.

◆ ~TestPhyListener()

TestPhyListener::~TestPhyListener ( )
overridedefault

Member Function Documentation

◆ NotifyCcaBusyStart()

void TestPhyListener::NotifyCcaBusyStart ( Time  duration,
WifiChannelListType  channelType,
const std::vector< Time > &  per20MhzDurations 
)
inlineoverridevirtual
Parameters
durationthe expected busy duration.
channelTypethe channel type for which the CCA busy state is reported.
per20MhzDurationsvector that indicates for how long each 20 MHz subchannel (corresponding to the index of the element in the vector) is busy and where a zero duration indicates that the subchannel is idle. The vector is non-empty if the PHY supports 802.11ax or later and if the operational channel width is larger than 20 MHz.

This method does not really report a real state change as opposed to the other methods in this class. It merely reports that, unless the medium is reported busy through NotifyTxStart or NotifyRxStart/End, it will be busy as defined by the currently selected CCA mode.

Typical client code which wants to have a clear picture of the CCA state will need to keep track of the time at which the last NotifyCcaBusyStart method is called and what duration it reported.

Implements ns3::WifiPhyListener.

Definition at line 296 of file spectrum-wifi-phy-test.cc.

References ns3::Time::IsStrictlyPositive(), m_ccaBusyEnd, m_ccaBusyStart, m_notifyMaybeCcaBusyStart, max, ns3::Now(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ NotifyOff()

void TestPhyListener::NotifyOff ( )
inlineoverridevirtual

Notify listeners that we went to switch off.

Implements ns3::WifiPhyListener.

Definition at line 320 of file spectrum-wifi-phy-test.cc.

◆ NotifyOn()

void TestPhyListener::NotifyOn ( )
inlineoverridevirtual

Notify listeners that we went to switch on.

Implements ns3::WifiPhyListener.

Definition at line 328 of file spectrum-wifi-phy-test.cc.

◆ NotifyRxEndError()

void TestPhyListener::NotifyRxEndError ( )
inlineoverridevirtual

We have received the last bit of a packet for which NotifyRxStart was invoked first and, the packet has not been successfully received.

Implements ns3::WifiPhyListener.

Definition at line 285 of file spectrum-wifi-phy-test.cc.

References m_notifyRxEndError, and NS_LOG_FUNCTION.

◆ NotifyRxEndOk()

void TestPhyListener::NotifyRxEndOk ( )
inlineoverridevirtual

We have received the last bit of a packet for which NotifyRxStart was invoked first and, the packet has been successfully received.

Implements ns3::WifiPhyListener.

Definition at line 279 of file spectrum-wifi-phy-test.cc.

References m_notifyRxEndOk, and NS_LOG_FUNCTION.

◆ NotifyRxStart()

void TestPhyListener::NotifyRxStart ( Time  duration)
inlineoverridevirtual
Parameters
durationthe expected duration of the packet reception.

We have received the first bit of a packet. We decided that we could synchronize on this packet. It does not mean we will be able to successfully receive completely the whole packet. It means that we will report a BUSY status until one of the following happens:

  • NotifyRxEndOk
  • NotifyRxEndError
  • NotifyTxStart

Implements ns3::WifiPhyListener.

Definition at line 273 of file spectrum-wifi-phy-test.cc.

References m_notifyRxStart, and NS_LOG_FUNCTION.

◆ NotifySleep()

void TestPhyListener::NotifySleep ( )
inlineoverridevirtual

Notify listeners that we went to sleep.

Implements ns3::WifiPhyListener.

Definition at line 316 of file spectrum-wifi-phy-test.cc.

◆ NotifySwitchingStart()

void TestPhyListener::NotifySwitchingStart ( Time  duration)
inlineoverridevirtual
Parameters
durationthe expected channel switching duration.

We do not send any event to notify the end of channel switching. Listeners should assume that the channel implicitly reverts to the idle or busy states.

Implements ns3::WifiPhyListener.

Definition at line 312 of file spectrum-wifi-phy-test.cc.

◆ NotifyTxStart()

void TestPhyListener::NotifyTxStart ( Time  duration,
double  txPowerDbm 
)
inlineoverridevirtual
Parameters
durationthe expected transmission duration.
txPowerDbmthe nominal TX power in dBm

We are about to send the first bit of the packet. We do not send any event to notify the end of transmission. Listeners should assume that the channel implicitly reverts to the idle state unless they have received a CCA busy report.

Implements ns3::WifiPhyListener.

Definition at line 291 of file spectrum-wifi-phy-test.cc.

References NS_LOG_FUNCTION.

◆ NotifyWakeup()

void TestPhyListener::NotifyWakeup ( )
inlineoverridevirtual

Notify listeners that we woke up.

Implements ns3::WifiPhyListener.

Definition at line 324 of file spectrum-wifi-phy-test.cc.

◆ Reset()

void TestPhyListener::Reset ( )
inline

Reset function.

Definition at line 335 of file spectrum-wifi-phy-test.cc.

References m_ccaBusyEnd, m_ccaBusyStart, m_notifyMaybeCcaBusyStart, m_notifyRxEndError, m_notifyRxEndOk, m_notifyRxStart, NS_LOG_FUNCTION, and ns3::Seconds().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_ccaBusyEnd

Time TestPhyListener::m_ccaBusyEnd {0}

CCA_BUSY end time.

Definition at line 351 of file spectrum-wifi-phy-test.cc.

Referenced by NotifyCcaBusyStart(), and Reset().

◆ m_ccaBusyStart

Time TestPhyListener::m_ccaBusyStart {0}

CCA_BUSY start time.

Definition at line 350 of file spectrum-wifi-phy-test.cc.

Referenced by NotifyCcaBusyStart(), and Reset().

◆ m_notifyMaybeCcaBusyStart

uint32_t TestPhyListener::m_notifyMaybeCcaBusyStart {0}

notify maybe CCA busy start

Definition at line 349 of file spectrum-wifi-phy-test.cc.

Referenced by NotifyCcaBusyStart(), and Reset().

◆ m_notifyRxEndError

uint32_t TestPhyListener::m_notifyRxEndError {0}

notify receive end error

Definition at line 348 of file spectrum-wifi-phy-test.cc.

Referenced by NotifyRxEndError(), and Reset().

◆ m_notifyRxEndOk

uint32_t TestPhyListener::m_notifyRxEndOk {0}

notify receive end OK

Definition at line 347 of file spectrum-wifi-phy-test.cc.

Referenced by NotifyRxEndOk(), and Reset().

◆ m_notifyRxStart

uint32_t TestPhyListener::m_notifyRxStart {0}

notify receive start

Definition at line 346 of file spectrum-wifi-phy-test.cc.

Referenced by NotifyRxStart(), and Reset().


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