9#ifndef ADVANCED_EMLSR_MANAGER_H
10#define ADVANCED_EMLSR_MANAGER_H
14#include "ns3/channel-access-manager.h"
33 friend class ::EmlsrSwitchMainPhyBackTest;
128 std::optional<WifiExpectedAccessReason> stopReason);
177 std::shared_ptr<WifiPhyListener>
190 static constexpr std::string_view
m_name =
"TxopNotGainedOnAuxPhyLink";
193 std::optional<WifiExpectedAccessReason>
207 std::optional<WifiExpectedAccessReason> reason,
Switch main PHY back timer test.
AdvancedEmlsrManager is an advanced EMLSR manager.
void SwitchMainPhyBackDelayExpired(uint8_t linkId, std::optional< WifiExpectedAccessReason > stopReason)
This method is called when the switch main PHY back timer (which is started when the main PHY switche...
std::pair< bool, Time > DoGetDelayUntilAccessRequest(uint8_t linkId) override
Subclasses have to provide an implementation for this method, that is called by the base class when t...
void InterruptSwitchMainPhyBackTimerIfNeeded()
This method is called by the PHY listener attached to the main PHY when a switch main PHY back timer ...
void DoNotifyDlTxopStart(uint8_t linkId) override
Notify the subclass of the reception of an initial Control frame on the given link.
std::pair< bool, Time > GetDelayUnlessMainPhyTakesOverUlTxop(uint8_t linkId) override
Subclasses have to provide an implementation for this method, that is called by the base class when t...
bool m_useAuxPhyCca
whether the CCA performed in the last PIFS interval by a non-TX capable aux PHY should be used when t...
~AdvancedEmlsrManager() override
bool RequestMainPhyToSwitch(uint8_t linkId, AcIndex aci, const Time &delay)
Determine whether the main PHY shall be requested to switch to the link of an aux PHY that is expecte...
void UnregisterListener()
Disconnect the PHY listener from the PHY it is connected to (if any)
void RegisterListener(Ptr< WifiPhy > phy)
Register a PHY listener so that this EMLSR Manager is notified of PHY events generated by the given P...
void SwitchMainPhyIfTxopToBeGainedByAuxPhy(uint8_t linkId, AcIndex aci, const Time &delay)
This method is called when the given AC of the EMLSR client is expected to get channel access in the ...
bool m_allowUlTxopInRx
whether a (main or aux) PHY is allowed to start an UL TXOP if another PHY is receiving a PPDU
void CheckNavAndCcaLastPifs(Ptr< WifiPhy > phy, uint8_t linkId, Ptr< QosTxop > edca)
Use information from NAV and CCA performed by the given PHY on the given link in the last PIFS interv...
Ptr< WifiPhy > m_auxPhyWithListener
aux PHY which a PHY listener is connected to
std::optional< WifiIcfDrop > CheckMainPhyTakesOverDlTxop(uint8_t linkId) const override
This method is called when an aux PHY has completed reception of an ICF to determine whether there is...
void NotifyEmlsrModeChanged() override
Notify subclass that EMLSR mode changed.
static TypeId GetTypeId()
Get the type ID.
void SwitchMainPhyBackToPreferredLink(uint8_t linkId, EmlsrMainPhySwitchTrace &&traceInfo) override
This method can only be called when aux PHYs do not switch link.
void DoNotifyUlTxopStart(uint8_t linkId) override
Notify the subclass of the start of an UL TXOP on the given link.
std::shared_ptr< WifiPhyListener > m_phyListener
PHY listener connected to an aux PHY (that is not TX capable and does not switch link) while the main...
Time m_switchMainPhyBackDelay
duration of the timer started in case of non-TX capable aux PHY when medium is sensed busy during the...
void DoDispose() override
Destructor implementation.
EventId m_switchMainPhyBackEvent
event scheduled in case of non-TX capable aux PHY when medium is sensed busy during the PIFS interval...
void DoNotifyTxopEnd(uint8_t linkId, Ptr< QosTxop > edca) override
Notify the subclass of the end of a TXOP on the given link.
AcIndex m_minAcToSkipCheckAccess
if m_checkAccessOnMainPhyLink is set to false, indicate the minimum priority AC for which it is allow...
void SwitchMainPhyIfTxopGainedByAuxPhy(uint8_t linkId, AcIndex aci) override
Subclasses have to provide an implementation for this method, that is called by the base class when t...
void DoSetWifiMac(Ptr< StaWifiMac > mac) override
Allow subclasses to take actions when the MAC is set.
bool m_keepMainPhyAfterDlTxop
whether the main PHY must stay, for a switch main PHY back delay, on an aux PHY link after a DL TXOP,...
void ReceivedMacHdr(Ptr< WifiPhy > phy, const WifiMacHeader &macHdr, const WifiTxVector &txVector, Time psduDuration)
Possibly take actions when notified of the MAC header of the MPDU being received by the given PHY.
EventId m_ccaLastPifs
event scheduled in case of non-TX capable aux PHY to determine whether TX can be started based on whe...
bool m_interruptSwitching
whether a main PHY switching can be interrupted to start switching to another link
bool m_checkAccessOnMainPhyLink
in case aux PHYs are not TX capable and an Access Category, say it AC X, is about to gain channel acc...
DefaultEmlsrManager is the default EMLSR manager.
An identifier for simulation events.
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Base struct for EMLSR Main PHY switch traces.
Implementation for the EMLSR Main PHY switch trace base struct.
Struct to trace that main PHY switched to leave a link on which an aux PHY was expected to gain a TXO...
std::optional< WifiExpectedAccessReason > earlySwitchReason
the reason why the main PHY switches back before the expiration of the switch main PHY back timer
Time elapsed
the time elapsed since the switch main PHY back timer started
EmlsrSwitchMainPhyBackTrace(Time time, std::optional< WifiExpectedAccessReason > reason, bool switching)
Constructor provided because this struct is not an aggregate (it has a base struct),...
static constexpr std::string_view m_name
trace name
bool isSwitching
whether the main PHY is switching while it is requested to switch back