19 #include "ns3/spectrum-phy.h" 21 #include "ns3/spectrum-wifi-helper.h" 22 #include "ns3/wifi-spectrum-value-helper.h" 23 #include "ns3/spectrum-wifi-phy.h" 24 #include "ns3/nist-error-rate-model.h" 25 #include "ns3/wifi-mac-header.h" 26 #include "ns3/wifi-spectrum-signal-parameters.h" 27 #include "ns3/wifi-phy-listener.h" 29 #include "ns3/wifi-psdu.h" 30 #include "ns3/wifi-ppdu.h" 60 virtual void DoSetup (
void);
72 void SendSignal (
double txPowerWatts);
89 virtual void DoRun (
void);
93 :
TestCase (
"SpectrumWifiPhy test case receives one packet"),
123 txParams->
psd = txPowerSpectrum;
126 txParams->
ppdu = ppdu;
161 m_phy = CreateObject<SpectrumWifiPhy> ();
175 double txPowerWatts = 0.010;
184 Simulator::Destroy ();
271 virtual void DoRun (
void);
295 double txPowerWatts = 0.010;
304 Simulator::Destroy ();
321 :
TestSuite (
"wifi-spectrum-wifi-phy", UNIT)
static SpectrumWifiPhyTestSuite spectrumWifiPhyTestSuite
the test suite
uint32_t m_notifyMaybeCcaBusyStart
notify maybe CCA busy start
Simulation virtual time values and global simulation resolution.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
HT PHY for the 5 GHz band (clause 20)
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Ptr< WifiPpdu > ppdu
The PPDU being transmitted.
void StartRx(Ptr< SpectrumSignalParameters > rxParams)
Input method for delivering a signal from the spectrum channel and low-level PHY interface to this Sp...
virtual void DoSetup(void)
Implementation to do any local setup required for this TestCase.
virtual void NotifySleep(void)
Notify listeners that we went to sleep.
uint32_t m_notifyRxEndError
notify receive end error
void SetReceiveErrorCallback(RxErrorCallback callback)
virtual ~SpectrumWifiPhyListenerTest()
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
static const uint32_t FREQUENCY
static const uint16_t CHANNEL_WIDTH
virtual void NotifyMaybeCcaBusyStart(Time duration)
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual void SetChannelNumber(uint8_t id)
Set channel number.
void SpectrumWifiPhyRxSuccess(Ptr< WifiPsdu > psdu, double snr, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
Spectrum wifi receive success function.
uint32_t GetSize(void) const
Return the size of the PSDU in bytes.
virtual ~TestPhyListener()
Spectrum Wifi Phy Basic Test.
static Time CalculateTxDuration(uint32_t size, WifiTxVector txVector, uint16_t frequency)
uint32_t m_notifyRxEndOk
notify receive end OK
void SendSignal(double txPowerWatts)
Send signal function.
virtual void NotifyWakeup(void)
Notify listeners that we woke up.
virtual void ConfigureStandard(WifiPhyStandard standard)
Configure the PHY-level parameters for different Wi-Fi standard.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
receive notifications about PHY events.
SpectrumWifiPhyBasicTest()
Ptr< SpectrumSignalParameters > MakeSignal(double txPowerWatts)
Make signal function.
virtual void NotifySwitchingStart(Time duration)
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
SpectrumWifiPhyTestSuite()
virtual void NotifyRxStart(Time duration)
Ptr< SpectrumPhy > txPhy
The SpectrumPhy instance that is making the transmission.
virtual void DoSetup(void)
Implementation to do any local setup required for this TestCase.
TestPhyListener * m_listener
listener
virtual ~SpectrumWifiPhyBasicTest()
virtual void NotifyRxEndError(void)
We have received the last bit of a packet for which NotifyRxStart was invoked first and...
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual void NotifyRxEndOk(void)
We have received the last bit of a packet for which NotifyRxStart was invoked first and...
virtual void SetFrequency(uint16_t freq)
void SetErrorRateModel(const Ptr< ErrorRateModel > rate)
Sets the error rate model.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint16_t GetFrequency(void) const
Ptr< SpectrumWifiPhy > m_phy
Phy.
virtual void NotifyOn(void)
Notify listeners that we went to switch on.
Spectrum Wifi Phy Test Suite.
void SetReceiveOkCallback(RxOkCallback callback)
void RegisterListener(WifiPhyListener *listener)
Ptr< SpectrumValue > psd
The Power Spectral Density of the waveform, in linear units.
virtual void NotifyOff(void)
Notify listeners that we went to switch off.
Time Seconds(double value)
Construct a Time in the indicated unit.
SpectrumWifiPhyListenerTest()
TestPhyListener(void)
Create a test PhyListener.
Time duration
The duration of the packet transmission.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Spectrum Wifi Phy Listener Test.
void SpectrumWifiPhyRxFailure(Ptr< WifiPsdu > psdu)
Spectrum wifi receive failure function
static const uint16_t GUARD_WIDTH
virtual void NotifyTxStart(Time duration, double txPowerDbm)
uint32_t m_notifyRxStart
notify receive start
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
static const uint8_t CHANNEL_NUMBER