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-mac-trailer.h" 27 #include "ns3/wifi-phy-tag.h" 28 #include "ns3/wifi-spectrum-signal-parameters.h" 29 #include "ns3/wifi-phy-listener.h" 59 virtual void DoSetup (
void);
71 void SendSignal (
double txPowerWatts);
84 void SpectrumWifiPhyRxFailure (
Ptr<Packet> p,
double snr);
87 virtual void DoRun (
void);
91 :
TestCase (
"SpectrumWifiPhy test case receives one packet"),
117 hdr.SetDuration (txDuration);
125 txParams->
psd = txPowerSpectrum;
162 m_phy = CreateObject<SpectrumWifiPhy> ();
178 double txPowerWatts = 0.010;
187 Simulator::Destroy ();
274 virtual void DoRun (
void);
298 double txPowerWatts = 0.010;
307 Simulator::Destroy ();
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...
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
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.
void SpectrumWifiPhyRxFailure(Ptr< Packet > p, double snr)
Spectrum wifi receive failure function.
virtual void SetChannelNumber(uint8_t id)
Set channel number.
MpduType
The type of an MPDU.
virtual ~TestPhyListener()
Spectrum Wifi Phy Basic Test.
Time CalculateTxDuration(uint32_t size, WifiTxVector txVector, uint16_t frequency)
uint32_t m_notifyRxEndOk
notify receive end OK
The MPDU is not part of an A-MPDU.
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.
void SpectrumWifiPhyRxSuccess(Ptr< Packet > p, double snr, WifiTxVector txVector)
Spectrum wifi receive success function.
receive notifications about phy events.
SpectrumWifiPhyBasicTest()
Ptr< SpectrumSignalParameters > MakeSignal(double txPowerWatts)
Make signal function.
virtual void NotifySwitchingStart(Time duration)
uint32_t GetSerializedSize(void) const
#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.
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
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
void AddTrailer(const Trailer &trailer)
Add trailer to this packet.
void SetCcaMode1Threshold(double threshold)
Sets the CCA threshold (dBm).
Ptr< Packet > packet
The packet being transmitted with this signal.
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)
void AddPacketTag(const Tag &tag) const
Add a packet tag.
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.
Tag for WifiTxVector and WifiPreamble information to be embedded in outgoing transmissions as a Packe...
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.
static const uint16_t GUARD_WIDTH
virtual void NotifyTxStart(Time duration, double txPowerDbm)
uint32_t m_notifyRxStart
notify receive start
static const uint8_t CHANNEL_NUMBER
void AddHeader(const Header &header)
Add header to this packet.
Implements the IEEE 802.11 MAC trailer.