diff --git a/src/wifi/test/wifi-phy-ofdma-test.cc b/src/wifi/test/wifi-phy-ofdma-test.cc index 7a3a38b61..255e29c6c 100644 --- a/src/wifi/test/wifi-phy-ofdma-test.cc +++ b/src/wifi/test/wifi-phy-ofdma-test.cc @@ -18,6 +18,7 @@ * Author: Sébastien Deronne */ +#include #include "ns3/log.h" #include "ns3/test.h" #include "ns3/node.h" @@ -45,6 +46,7 @@ #include "ns3/ctrl-headers.h" #include "ns3/threshold-preamble-detection-model.h" #include "ns3/he-phy.h" +#include "ns3/wifi-phy-listener.h" #include "ns3/waveform-generator.h" #include "ns3/non-communicating-net-device.h" #include "ns3/spectrum-wifi-helper.h" @@ -1670,6 +1672,140 @@ TestMultipleHeTbPreambles::DoRun (void) Simulator::Destroy (); } + +/** + * \ingroup wifi-test + * \ingroup tests + * + * \brief PHY listener for OFDMA tests + */ +class OfdmaTestPhyListener : public ns3::WifiPhyListener +{ +public: + OfdmaTestPhyListener (void) = default; + + void NotifyRxStart (Time duration) override + { + NS_LOG_FUNCTION (this << duration); + m_lastRxStart = Simulator::Now (); + ++m_notifyRxStart; + m_lastRxSuccess = false; + } + + void NotifyRxEndOk (void) override + { + NS_LOG_FUNCTION (this); + m_lastRxEnd = Simulator::Now (); + ++m_notifyRxEnd; + m_lastRxSuccess = true; + } + + void NotifyRxEndError (void) override + { + NS_LOG_FUNCTION (this); + m_lastRxEnd = Simulator::Now (); + ++m_notifyRxEnd; + m_lastRxSuccess = false; + } + + void NotifyTxStart (Time duration, double txPowerDbm) override + { + NS_LOG_FUNCTION (this << duration << txPowerDbm); + } + + void NotifyCcaBusyStart (Time duration, WifiChannelListType channelType, + const std::vector