A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
CcaTestPhyListener Class Reference

PHY listener for CCA tests. More...

+ Inheritance diagram for CcaTestPhyListener:
+ Collaboration diagram for CcaTestPhyListener:

Public Member Functions

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

Public Attributes

Time m_endCcaBusy {Seconds(0)}
 End of the CCA-BUSY duration.
 
WifiChannelListType m_lastCcaBusyChannelType
 Channel type indication for the last CCA-BUSY notification.
 
std::vector< Timem_lastPer20MhzCcaBusyDurations {}
 End of the CCA-BUSY durations per 20 MHz.
 
std::size_t m_notifications {0}
 Number of CCA notifications.
 

Detailed Description

PHY listener for CCA tests.

Definition at line 597 of file wifi-phy-cca-test.cc.

Constructor & Destructor Documentation

◆ CcaTestPhyListener()

CcaTestPhyListener::CcaTestPhyListener ( )
default

Member Function Documentation

◆ NotifyCcaBusyStart()

void CcaTestPhyListener::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 622 of file wifi-phy-cca-test.cc.

References m_endCcaBusy, m_lastCcaBusyChannelType, m_lastPer20MhzCcaBusyDurations, m_notifications, ns3::Simulator::Now(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ NotifyOff()

void CcaTestPhyListener::NotifyOff ( )
inlineoverridevirtual

Notify listeners that we went to switch off.

Implements ns3::WifiPhyListener.

Definition at line 641 of file wifi-phy-cca-test.cc.

◆ NotifyOn()

void CcaTestPhyListener::NotifyOn ( )
inlineoverridevirtual

Notify listeners that we went to switch on.

Implements ns3::WifiPhyListener.

Definition at line 649 of file wifi-phy-cca-test.cc.

◆ NotifyRxEndError()

void CcaTestPhyListener::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 612 of file wifi-phy-cca-test.cc.

References NS_LOG_FUNCTION.

◆ NotifyRxEndOk()

void CcaTestPhyListener::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 607 of file wifi-phy-cca-test.cc.

References NS_LOG_FUNCTION.

◆ NotifyRxStart()

void CcaTestPhyListener::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 602 of file wifi-phy-cca-test.cc.

References NS_LOG_FUNCTION.

◆ NotifySleep()

void CcaTestPhyListener::NotifySleep ( )
inlineoverridevirtual

Notify listeners that we went to sleep.

Implements ns3::WifiPhyListener.

Definition at line 637 of file wifi-phy-cca-test.cc.

◆ NotifySwitchingStart()

void CcaTestPhyListener::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 633 of file wifi-phy-cca-test.cc.

◆ NotifyTxStart()

void CcaTestPhyListener::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 617 of file wifi-phy-cca-test.cc.

References NS_LOG_FUNCTION.

◆ NotifyWakeup()

void CcaTestPhyListener::NotifyWakeup ( )
inlineoverridevirtual

Notify listeners that we woke up.

Implements ns3::WifiPhyListener.

Definition at line 645 of file wifi-phy-cca-test.cc.

◆ Reset()

void CcaTestPhyListener::Reset ( )
inline

Reset function.

Definition at line 656 of file wifi-phy-cca-test.cc.

References m_endCcaBusy, m_lastCcaBusyChannelType, m_lastPer20MhzCcaBusyDurations, m_notifications, ns3::Seconds(), and ns3::WIFI_CHANLIST_PRIMARY.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_endCcaBusy

Time CcaTestPhyListener::m_endCcaBusy {Seconds(0)}

End of the CCA-BUSY duration.

Definition at line 665 of file wifi-phy-cca-test.cc.

Referenced by NotifyCcaBusyStart(), and Reset().

◆ m_lastCcaBusyChannelType

WifiChannelListType CcaTestPhyListener::m_lastCcaBusyChannelType
Initial value:
{
WIFI_CHANLIST_PRIMARY}

Channel type indication for the last CCA-BUSY notification.

Definition at line 666 of file wifi-phy-cca-test.cc.

Referenced by NotifyCcaBusyStart(), and Reset().

◆ m_lastPer20MhzCcaBusyDurations

std::vector<Time> CcaTestPhyListener::m_lastPer20MhzCcaBusyDurations {}

End of the CCA-BUSY durations per 20 MHz.

Definition at line 669 of file wifi-phy-cca-test.cc.

Referenced by NotifyCcaBusyStart(), and Reset().

◆ m_notifications

std::size_t CcaTestPhyListener::m_notifications {0}

Number of CCA notifications.

Definition at line 664 of file wifi-phy-cca-test.cc.

Referenced by NotifyCcaBusyStart(), and Reset().


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