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

Listener for PHY events. More...

+ Inheritance diagram for ns3::PhyListener:
+ Collaboration diagram for ns3::PhyListener:

Public Member Functions

 PhyListener (ns3::ChannelAccessManager *cam)
 Create a PhyListener for the given ChannelAccessManager. More...
 
virtual ~PhyListener ()
 
void NotifyCcaBusyStart (Time duration, WifiChannelListType channelType, const std::vector< Time > &per20MhzDurations)
 
void NotifyOff (void)
 Notify listeners that we went to switch off. More...
 
void NotifyOn (void)
 Notify listeners that we went to switch on. More...
 
void NotifyRxEndError (void)
 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 (void)
 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)
 
void NotifySleep (void)
 Notify listeners that we went to sleep. More...
 
void NotifySwitchingStart (Time duration)
 
void NotifyTxStart (Time duration, double txPowerDbm)
 
void NotifyWakeup (void)
 Notify listeners that we woke up. More...
 
- 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 (void)=0
 Notify listeners that we went to switch off. More...
 
virtual void NotifyOn (void)=0
 Notify listeners that we went to switch on. More...
 
virtual void NotifyRxEndError (void)=0
 We have received the last bit of a packet for which NotifyRxStart was invoked first and, the packet has not been successfully received. More...
 
virtual void NotifyRxEndOk (void)=0
 We have received the last bit of a packet for which NotifyRxStart was invoked first and, the packet has been successfully received. More...
 
virtual void NotifyRxStart (Time duration)=0
 
virtual void NotifySleep (void)=0
 Notify listeners that we went to sleep. More...
 
virtual void NotifySwitchingStart (Time duration)=0
 
virtual void NotifyTxStart (Time duration, double txPowerDbm)=0
 
virtual void NotifyWakeup (void)=0
 Notify listeners that we woke up. More...
 

Private Attributes

ns3::ChannelAccessManagerm_cam
 ChannelAccessManager to forward events to. More...
 

Detailed Description

Listener for PHY events.

Forwards to ChannelAccessManager

Definition at line 39 of file channel-access-manager.cc.

Constructor & Destructor Documentation

◆ PhyListener()

ns3::PhyListener::PhyListener ( ns3::ChannelAccessManager cam)
inline

Create a PhyListener for the given ChannelAccessManager.

Parameters
camthe ChannelAccessManager

Definition at line 47 of file channel-access-manager.cc.

◆ ~PhyListener()

virtual ns3::PhyListener::~PhyListener ( )
inlinevirtual

Definition at line 51 of file channel-access-manager.cc.

Member Function Documentation

◆ NotifyCcaBusyStart()

void ns3::PhyListener::NotifyCcaBusyStart ( Time  duration,
WifiChannelListType  channelType,
const std::vector< Time > &  per20MhzDurations 
)
inlinevirtual
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 70 of file channel-access-manager.cc.

References m_cam, and ns3::ChannelAccessManager::NotifyCcaBusyStartNow().

+ Here is the call graph for this function:

◆ NotifyOff()

void ns3::PhyListener::NotifyOff ( void  )
inlinevirtual

Notify listeners that we went to switch off.

Implements ns3::WifiPhyListener.

Definition at line 83 of file channel-access-manager.cc.

References m_cam, and ns3::ChannelAccessManager::NotifyOffNow().

+ Here is the call graph for this function:

◆ NotifyOn()

void ns3::PhyListener::NotifyOn ( void  )
inlinevirtual

Notify listeners that we went to switch on.

Implements ns3::WifiPhyListener.

Definition at line 91 of file channel-access-manager.cc.

References m_cam, and ns3::ChannelAccessManager::NotifyOnNow().

+ Here is the call graph for this function:

◆ NotifyRxEndError()

void ns3::PhyListener::NotifyRxEndError ( void  )
inlinevirtual

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 62 of file channel-access-manager.cc.

References m_cam, and ns3::ChannelAccessManager::NotifyRxEndErrorNow().

+ Here is the call graph for this function:

◆ NotifyRxEndOk()

void ns3::PhyListener::NotifyRxEndOk ( void  )
inlinevirtual

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 58 of file channel-access-manager.cc.

References m_cam, and ns3::ChannelAccessManager::NotifyRxEndOkNow().

+ Here is the call graph for this function:

◆ NotifyRxStart()

void ns3::PhyListener::NotifyRxStart ( Time  duration)
inlinevirtual
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 54 of file channel-access-manager.cc.

References m_cam, and ns3::ChannelAccessManager::NotifyRxStartNow().

+ Here is the call graph for this function:

◆ NotifySleep()

void ns3::PhyListener::NotifySleep ( void  )
inlinevirtual

Notify listeners that we went to sleep.

Implements ns3::WifiPhyListener.

Definition at line 79 of file channel-access-manager.cc.

References m_cam, and ns3::ChannelAccessManager::NotifySleepNow().

+ Here is the call graph for this function:

◆ NotifySwitchingStart()

void ns3::PhyListener::NotifySwitchingStart ( Time  duration)
inlinevirtual
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 75 of file channel-access-manager.cc.

References m_cam, and ns3::ChannelAccessManager::NotifySwitchingStartNow().

+ Here is the call graph for this function:

◆ NotifyTxStart()

void ns3::PhyListener::NotifyTxStart ( Time  duration,
double  txPowerDbm 
)
inlinevirtual
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 66 of file channel-access-manager.cc.

References m_cam, and ns3::ChannelAccessManager::NotifyTxStartNow().

+ Here is the call graph for this function:

◆ NotifyWakeup()

void ns3::PhyListener::NotifyWakeup ( void  )
inlinevirtual

Notify listeners that we woke up.

Implements ns3::WifiPhyListener.

Definition at line 87 of file channel-access-manager.cc.

References m_cam, and ns3::ChannelAccessManager::NotifyWakeupNow().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_cam


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