|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
23 #include "ns3/spectrum-wifi-helper.h"
24 #include "ns3/wifi-spectrum-value-helper.h"
25 #include "ns3/spectrum-wifi-phy.h"
26 #include "ns3/nist-error-rate-model.h"
27 #include "ns3/wifi-mac-header.h"
28 #include "ns3/wifi-spectrum-signal-parameters.h"
29 #include "ns3/wifi-utils.h"
30 #include "ns3/wifi-psdu.h"
31 #include "ns3/ofdm-ppdu.h"
32 #include "ns3/ofdm-phy.h"
80 virtual void SendSignal (
double txPowerWatts,
bool wifiSignal);
119 void DoSetup (
void)
override;
120 void DoTeardown (
void)
override;
130 m_idleStateCount (0),
131 m_ccabusyStateCount (0)
157 txParams->
psd = txPowerSpectrum;
160 txParams->
ppdu = ppdu;
169 txParams->
psd = txPowerSpectrum;
232 m_phy = CreateObject<SpectrumWifiPhy> ();
265 virtual void DoRun (
void);
280 double txPowerWatts =
DbmToW (-110);
285 Simulator::Destroy ();
305 virtual void DoRun (
void);
320 double txPowerWatts =
DbmToW (-90);
325 Simulator::Destroy ();
345 virtual void DoRun (
void);
360 double txPowerWatts =
DbmToW (-60);
365 Simulator::Destroy ();
389 virtual void DoRun (
void);
404 double txPowerWatts =
DbmToW (-60);
409 Simulator::Destroy ();
428 :
TestSuite (
"wifi-phy-thresholds", UNIT)
virtual void DoRun(void)
Implementation to actually run this TestCase.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Ptr< SpectrumValue > psd
The Power Spectral Density of the waveform, in linear units.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
static const uint8_t CHANNEL_NUMBER
void Dispose(void)
Dispose of this Object.
Wifi Phy Threshold Test base class.
uint32_t m_rxFailure
count number of unsuccessfully received packets
void DoTeardown(void) override
Implementation to do any local setup required for this TestCase.
Wifi Phy Threshold Weak Wifi Signal Test.
void StartRx(Ptr< SpectrumSignalParameters > rxParams)
Input method for delivering a signal from the spectrum channel and low-level PHY interface to this Sp...
void SetChannelNumber(uint8_t id) override
Set channel number.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
@ RX
The PHY layer is receiving a packet.
static Time CalculateTxDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, uint16_t staId=SU_STA_ID)
virtual ~WifiPhyThresholdsStrongForeignSignalTest()
virtual void PhyStateChanged(Time start, Time duration, WifiPhyState newState)
PHY state changed callback function.
@ IDLE
The PHY layer is IDLE.
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
void RxDropped(Ptr< const Packet > p, WifiPhyRxfailureReason reason)
PHY dropped packet callback function.
Ptr< SpectrumPhy > txPhy
The SpectrumPhy instance that is making the transmission.
Wifi Phy Threshold Weak Foreign Signal Test.
void ConfigureStandardAndBand(WifiPhyStandard standard, WifiPhyBand band) override
Configure the PHY-level parameters for different Wi-Fi standard.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Ptr< SpectrumWifiPhy > m_phy
PHY object.
void SetReceiveOkCallback(RxOkCallback callback)
uint32_t m_stateChanged
count number of PHY state change
@ CCA_BUSY
The PHY layer has sense the medium busy through the CCA mechanism.
virtual void RxFailure(Ptr< WifiPsdu > psdu)
PHY receive failure callback function.
Wifi Phy Threshold Strong Foreign Signal Test.
static WifiPhyThresholdsTestSuite wifiPhyThresholdsTestSuite
the test suite
WifiPhyThresholdsWeakWifiSignalTest()
Ptr< WifiPhyStateHelper > GetState(void) const
Return the WifiPhyStateHelper of this PHY.
Smart pointer class similar to boost::intrusive_ptr.
@ WIFI_PHY_STANDARD_80211ax
HE PHY (clause 26)
uint32_t m_rxSuccess
count number of successfully received packets
WifiPhyThresholdsTest(std::string test_name)
Constructor.
WifiPhyRxfailureReason
Enumeration of the possible reception failure reasons.
virtual Ptr< SpectrumSignalParameters > MakeWifiSignal(double txPowerWatts)
Make wifi signal function.
void SetReceiveErrorCallback(RxErrorCallback callback)
uint32_t m_idleStateCount
count number of PHY state change to IDLE state
static const uint16_t CHANNEL_WIDTH
virtual ~WifiPhyThresholdsWeakForeignSignalTest()
uint32_t GetSize(void) const
Return the size of the PSDU in bytes.
WifiPhyBand GetPhyBand(void) const
Get the configured Wi-Fi band.
Ptr< WifiPpdu > ppdu
The PPDU being transmitted.
Simulation virtual time values and global simulation resolution.
WifiPhyThresholdsWeakForeignSignalTest()
virtual ~WifiPhyThresholdsStrongWifiSignalTest()
Time duration
The duration of the packet transmission.
virtual void DoRun(void)
Implementation to actually run this TestCase.
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...
WifiPhyState
The state of the PHY layer.
uint32_t m_rxDropped
count number of dropped packets
virtual ~WifiPhyThresholdsWeakWifiSignalTest()
#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.
double DbmToW(double dBm)
Convert from dBm to Watts.
WifiPhyThresholdsStrongForeignSignalTest()
RxSignalInfo structure containing info on the received signal.
Time Seconds(double value)
Construct a Time in the indicated unit.
Wifi Phy Thresholds Test Suite.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
virtual void SendSignal(double txPowerWatts, bool wifiSignal)
Send signal function.
virtual void RxSuccess(Ptr< WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
PHY receive success callback function.
WifiPhyThresholdsTestSuite()
void SetFrequency(uint16_t freq) override
If the operating channel for this object has not been set yet, the given center frequency is saved an...
virtual void DoRun(void)
Implementation to actually run this TestCase.
WifiPhyThresholdsStrongWifiSignalTest()
virtual void DoRun(void)
Implementation to actually run this TestCase.
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
Wifi Phy Threshold Strong Wifi Signal Test.
uint32_t m_rxStateCount
count number of PHY state change to RX state
static const uint32_t FREQUENCY
virtual Ptr< SpectrumSignalParameters > MakeForeignSignal(double txPowerWatts)
Make foreign signal function.
uint32_t m_ccabusyStateCount
count number of PHY state change to CCA_BUSY state
void SetErrorRateModel(const Ptr< ErrorRateModel > rate)
Sets the error rate model.
virtual ~WifiPhyThresholdsTest()
Destructor.
void DoSetup(void) override
Implementation to do any local setup required for this TestCase.