Wifi Phy Threshold Test base class. More...
Classes | |
struct | CcaCheckPoint |
structure that holds information to perform CCA check More... | |
struct | StateCheckPoint |
structure that holds information to perform PHY state check More... | |
struct | TxPpduInfo |
structure that holds information to generate PPDUs More... | |
struct | TxSignalInfo |
structure that holds information to generate signals More... | |
Public Member Functions | |
WifiPhyCcaIndicationTest () | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
void | CheckLastCcaBusyNotification (Time expectedEndTime, WifiChannelListType expectedChannelType, const std::vector< Time > &expectedPer20MhzDurations) |
Check the last CCA-BUSY notification. More... | |
void | CheckPhyState (WifiPhyState expectedState) |
Check the PHY state. More... | |
void | DoCheckPhyState (WifiPhyState expectedState) |
Check the PHY state. More... | |
void | DoRun () override |
Implementation to actually run this TestCase. More... | |
void | DoSetup () override |
Implementation to do any local setup required for this TestCase. More... | |
void | DoTeardown () override |
Implementation to do any local setup required for this TestCase. More... | |
void | LogScenario (const std::string &log) const |
Log scenario description. More... | |
void | Reset () |
Reset function. More... | |
void | RunOne () |
Run one function. More... | |
void | ScheduleTest (Time delay, const std::vector< TxSignalInfo > &generatedSignals, const std::vector< TxPpduInfo > &generatedPpdus, const std::vector< StateCheckPoint > &stateCheckpoints, const std::vector< CcaCheckPoint > &ccaCheckpoints) |
Schedule test to perform. More... | |
void | SendHeSuPpdu (double txPowerDbm, uint16_t frequency, uint16_t bandwidth) |
Send an HE SU PPDU. More... | |
void | StartSignal (Ptr< WaveformGenerator > signalGenerator, double txPowerDbm, uint16_t frequency, uint16_t bandwidth, Time duration) |
Start to generate a signal. More... | |
void | StopSignal (Ptr< WaveformGenerator > signalGenerator) |
Stop to generate a signal. More... | |
Private Attributes | |
uint16_t | m_channelWidth |
Operating channel width in MHz. More... | |
uint16_t | m_frequency |
Operating frequency in MHz. More... | |
std::size_t | m_numSignalGenerators |
The number of non-wifi signals generators needed for the test. More... | |
Ptr< SpectrumWifiPhy > | m_rxPhy |
PHY object of the receiver. More... | |
std::shared_ptr< CcaTestPhyListener > | m_rxPhyStateListener |
Listener for PHY state transitions. More... | |
std::vector< Ptr< WaveformGenerator > > | m_signalGenerators |
Generators of non-wifi signals. More... | |
Ptr< SpectrumWifiPhy > | m_txPhy |
PHY object of the transmitter. More... | |
Additional Inherited Members | |
Public Types inherited from ns3::TestCase | |
enum | TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
Protected Member Functions inherited from ns3::TestCase | |
TestCase (std::string name) | |
Constructor. More... | |
void | AddTestCase (TestCase *testCase, TestDuration duration=QUICK) |
Add an individual child TestCase to this test suite. More... | |
TestCase * | GetParent () const |
Get the parent of this TestCase. More... | |
bool | IsStatusFailure () const |
Check if any tests failed. More... | |
bool | IsStatusSuccess () const |
Check if all tests passed. More... | |
void | SetDataDir (std::string directory) |
Set the data directory where reference trace files can be found. More... | |
void | ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line) |
Log the failure of this TestCase. More... | |
bool | MustAssertOnFailure () const |
Check if this run should assert on failure. More... | |
bool | MustContinueOnFailure () const |
Check if this run should continue on failure. More... | |
std::string | CreateDataDirFilename (std::string filename) |
Construct the full path to a file in the data directory. More... | |
std::string | CreateTempDirFilename (std::string filename) |
Construct the full path to a file in a temporary directory. More... | |
Wifi Phy Threshold Test base class.
Definition at line 678 of file wifi-phy-cca-test.cc.
WifiPhyCcaIndicationTest::WifiPhyCcaIndicationTest | ( | ) |
Definition at line 822 of file wifi-phy-cca-test.cc.
|
private |
Check the last CCA-BUSY notification.
expectedEndTime | the expected CCA-BUSY end time |
expectedChannelType | the expected channel type |
expectedPer20MhzDurations | the expected per-20 MHz CCA-BUSY durations |
Definition at line 914 of file wifi-phy-cca-test.cc.
References m_rxPhyStateListener, ns3::Now(), and NS_TEST_ASSERT_MSG_EQ.
Referenced by ScheduleTest().
|
private |
Check the PHY state.
expectedState | the expected state of the PHY |
Definition at line 892 of file wifi-phy-cca-test.cc.
References DoCheckPhyState().
Referenced by ScheduleTest().
|
private |
Check the PHY state.
expectedState | the expected state of the PHY |
Definition at line 900 of file wifi-phy-cca-test.cc.
References ns3::PointerValue::Get(), ns3::ObjectBase::GetAttribute(), m_rxPhy, ns3::Now(), and NS_TEST_ASSERT_MSG_EQ.
Referenced by CheckPhyState().
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 2897 of file wifi-phy-cca-test.cc.
References m_channelWidth, m_frequency, and RunOne().
|
overrideprivatevirtual |
Implementation to do any local setup required for this TestCase.
Subclasses should override this method to perform any costly per-test setup before DoRun is invoked.
Reimplemented from ns3::TestCase.
Definition at line 1007 of file wifi-phy-cca-test.cc.
References ns3::SpectrumWifiPhy::AddChannel(), ns3::Node::AddDevice(), ns3::WifiPhy::ConfigureStandard(), m_numSignalGenerators, m_rxPhy, m_rxPhyStateListener, m_signalGenerators, m_txPhy, ns3::WifiPhy::RegisterListener(), ns3::Seconds(), ns3::ObjectBase::SetAttribute(), ns3::WaveformGenerator::SetChannel(), ns3::SpectrumWifiPhy::SetDevice(), ns3::WaveformGenerator::SetDevice(), ns3::WaveformGenerator::SetDutyCycle(), ns3::WifiPhy::SetErrorRateModel(), ns3::WifiPhy::SetInterferenceHelper(), ns3::WifiNetDevice::SetPhy(), ns3::WifiPhy::SetPreambleDetectionModel(), ns3::WifiNetDevice::SetStandard(), ns3::WifiNetDevice::SetVhtConfiguration(), and ns3::WIFI_STANDARD_80211ax.
|
overrideprivatevirtual |
Implementation to do any local setup required for this TestCase.
Subclasses should override this method to perform any costly per-test teardown
Reimplemented from ns3::TestCase.
Definition at line 2919 of file wifi-phy-cca-test.cc.
References ns3::Object::Dispose(), m_rxPhy, m_signalGenerators, and m_txPhy.
|
private |
Log scenario description.
log | the scenario description to add to log |
Definition at line 944 of file wifi-phy-cca-test.cc.
References NS_LOG_INFO.
Referenced by RunOne().
|
private |
Reset function.
Definition at line 1001 of file wifi-phy-cca-test.cc.
References m_rxPhyStateListener.
Referenced by RunOne(), and ScheduleTest().
|
private |
Run one function.
Definition at line 1064 of file wifi-phy-cca-test.cc.
References aCcaTime, ns3::WifiPhy::AssignStreams(), CCA_BUSY, IDLE, LogScenario(), m_channelWidth, m_frequency, m_rxPhy, m_txPhy, ns3::MicroSeconds(), ns3::NanoSeconds(), P160_CENTER_FREQUENCY, P20_CENTER_FREQUENCY, P40_CENTER_FREQUENCY, P80_CENTER_FREQUENCY, PpduDurations, Reset(), RX, S20_CENTER_FREQUENCY, S40_CENTER_FREQUENCY, S80_CENTER_FREQUENCY, ScheduleTest(), ns3::Seconds(), ns3::WifiPhy::SetOperatingChannel(), smallDelta, ns3::WIFI_CHANLIST_PRIMARY, ns3::WIFI_CHANLIST_SECONDARY, ns3::WIFI_CHANLIST_SECONDARY40, ns3::WIFI_CHANLIST_SECONDARY80, ns3::WIFI_PHY_BAND_5GHZ, and ns3::WIFI_STANDARD_80211ax.
Referenced by DoRun().
|
private |
Schedule test to perform.
delay | the reference delay to schedule the events |
generatedSignals | the vector of signals to be generated |
generatedPpdus | the vector of PPDUs to be generated |
stateCheckpoints | the vector of PHY state checks |
ccaCheckpoints | the vector of PHY CCA checks |
Definition at line 950 of file wifi-phy-cca-test.cc.
References CheckLastCcaBusyNotification(), CheckPhyState(), m_signalGenerators, ns3::Now(), Reset(), ns3::Seconds(), SendHeSuPpdu(), and StartSignal().
Referenced by RunOne().
|
private |
Send an HE SU PPDU.
txPowerDbm | the transmit power in dBm |
frequency | the center frequency the transmitter is operating on |
bandwidth | the bandwidth to use for the transmission in MHz |
Definition at line 864 of file wifi-phy-cca-test.cc.
References m_txPhy, NS_LOG_FUNCTION, ns3::WifiPhy::Send(), ns3::WifiPhy::SetOperatingChannel(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiPhy::SetTxPowerEnd(), ns3::WifiPhy::SetTxPowerStart(), ns3::WifiMacHeader::SetType(), ns3::WIFI_MAC_QOSDATA, ns3::WIFI_PHY_BAND_5GHZ, ns3::WIFI_PREAMBLE_HE_SU, and ns3::WIFI_STANDARD_80211ax.
Referenced by ScheduleTest().
|
private |
Start to generate a signal.
signalGenerator | the signal generator to use |
txPowerDbm | the transmit power in dBm |
frequency | the center frequency of the signal to send in MHz |
bandwidth | the bandwidth of the signal to send in MHz |
duration | the duration of the signal |
Definition at line 831 of file wifi-phy-cca-test.cc.
References ns3::DbmToW(), ns3::BandInfo::fc, ns3::BandInfo::fh, ns3::BandInfo::fl, NS_LOG_FUNCTION, ns3::WaveformGenerator::SetPeriod(), ns3::WaveformGenerator::SetTxPowerSpectralDensity(), ns3::WaveformGenerator::Start(), and StopSignal().
Referenced by ScheduleTest().
|
private |
Stop to generate a signal.
signalGenerator | the signal generator to use |
Definition at line 857 of file wifi-phy-cca-test.cc.
References NS_LOG_FUNCTION, and ns3::WaveformGenerator::Stop().
Referenced by StartSignal().
|
private |
Operating channel width in MHz.
Definition at line 819 of file wifi-phy-cca-test.cc.
|
private |
Operating frequency in MHz.
Definition at line 818 of file wifi-phy-cca-test.cc.
|
private |
The number of non-wifi signals generators needed for the test.
Definition at line 813 of file wifi-phy-cca-test.cc.
Referenced by DoSetup().
|
private |
PHY object of the receiver.
Definition at line 808 of file wifi-phy-cca-test.cc.
Referenced by DoCheckPhyState(), DoSetup(), DoTeardown(), and RunOne().
|
private |
Listener for PHY state transitions.
Definition at line 816 of file wifi-phy-cca-test.cc.
Referenced by CheckLastCcaBusyNotification(), DoSetup(), and Reset().
|
private |
Generators of non-wifi signals.
Definition at line 811 of file wifi-phy-cca-test.cc.
Referenced by DoSetup(), DoTeardown(), and ScheduleTest().
|
private |
PHY object of the transmitter.
Definition at line 809 of file wifi-phy-cca-test.cc.
Referenced by DoSetup(), DoTeardown(), RunOne(), and SendHeSuPpdu().