Listener for PHY events. More...
Public Member Functions | |
PhyListener (ns3::ChannelAccessManager *cam) | |
Create a PhyListener for the given ChannelAccessManager. | |
~PhyListener () override | |
bool | IsActive () const |
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 (const WifiTxVector &txVector) override |
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, dBm_u txPower) override |
void | NotifyWakeup () override |
Notify listeners that we woke up. | |
void | SetActive (bool active) |
Set this listener to be active or not. | |
![]() | |
virtual | ~WifiPhyListener () |
Private Attributes | |
bool | m_active |
whether this PHY listener is active | |
ns3::ChannelAccessManager * | m_cam |
ChannelAccessManager to forward events to. | |
Listener for PHY events.
Forwards to ChannelAccessManager. The ChannelAccessManager may handle multiple PHY listeners connected to distinct PHYs, but only one listener at a time can be active. Notifications from inactive listeners are ignored by the ChannelAccessManager, except for the channel switch notification. Inactive PHY listeners are typically configured by 11be EMLSR clients.
Definition at line 41 of file channel-access-manager.cc.
|
inline |
Create a PhyListener for the given ChannelAccessManager.
cam | the ChannelAccessManager |
Definition at line 49 of file channel-access-manager.cc.
|
inlineoverride |
Definition at line 55 of file channel-access-manager.cc.
|
inline |
Definition at line 72 of file channel-access-manager.cc.
References m_active.
|
inlineoverridevirtual |
duration | the expected busy duration. |
channelType | the channel type for which the CCA busy state is reported. |
per20MhzDurations | vector 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 109 of file channel-access-manager.cc.
References m_active, m_cam, and ns3::ChannelAccessManager::NotifyCcaBusyStartNow().
|
inlineoverridevirtual |
Notify listeners that we went to switch off.
Implements ns3::WifiPhyListener.
Definition at line 132 of file channel-access-manager.cc.
References m_active, m_cam, and ns3::ChannelAccessManager::NotifyOffNow().
|
inlineoverridevirtual |
Notify listeners that we went to switch on.
Implements ns3::WifiPhyListener.
Definition at line 148 of file channel-access-manager.cc.
References m_active, m_cam, and ns3::ChannelAccessManager::NotifyOnNow().
|
inlineoverridevirtual |
txVector | the TXVECTOR used for transmission |
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 93 of file channel-access-manager.cc.
References m_active, m_cam, and ns3::ChannelAccessManager::NotifyRxEndErrorNow().
|
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 85 of file channel-access-manager.cc.
References m_active, m_cam, and ns3::ChannelAccessManager::NotifyRxEndOkNow().
|
inlineoverridevirtual |
duration | the 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:
Implements ns3::WifiPhyListener.
Definition at line 77 of file channel-access-manager.cc.
References m_active, m_cam, and ns3::ChannelAccessManager::NotifyRxStartNow().
|
inlineoverridevirtual |
Notify listeners that we went to sleep.
Implements ns3::WifiPhyListener.
Definition at line 124 of file channel-access-manager.cc.
References m_active, m_cam, and ns3::ChannelAccessManager::NotifySleepNow().
|
inlineoverridevirtual |
duration | the 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 119 of file channel-access-manager.cc.
References m_cam, and ns3::ChannelAccessManager::NotifySwitchingStartNow().
duration | the expected transmission duration. |
txPower | the nominal TX power |
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 101 of file channel-access-manager.cc.
References m_active, m_cam, and ns3::ChannelAccessManager::NotifyTxStartNow().
|
inlineoverridevirtual |
Notify listeners that we woke up.
Implements ns3::WifiPhyListener.
Definition at line 140 of file channel-access-manager.cc.
References m_active, m_cam, and ns3::ChannelAccessManager::NotifyWakeupNow().
|
inline |
Set this listener to be active or not.
active | whether this listener is active or not |
Definition at line 64 of file channel-access-manager.cc.
References m_active.
|
private |
whether this PHY listener is active
Definition at line 158 of file channel-access-manager.cc.
Referenced by IsActive(), NotifyCcaBusyStart(), NotifyOff(), NotifyOn(), NotifyRxEndError(), NotifyRxEndOk(), NotifyRxStart(), NotifySleep(), NotifyTxStart(), NotifyWakeup(), and SetActive().
|
private |
ChannelAccessManager to forward events to.
Definition at line 157 of file channel-access-manager.cc.
Referenced by NotifyCcaBusyStart(), NotifyOff(), NotifyOn(), NotifyRxEndError(), NotifyRxEndOk(), NotifyRxStart(), NotifySleep(), NotifySwitchingStart(), NotifyTxStart(), and NotifyWakeup().