A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
WifiPhyCcaIndicationTest Class Reference

Wifi Phy Threshold Test base class. More...

+ Inheritance diagram for WifiPhyCcaIndicationTest:
+ Collaboration diagram for WifiPhyCcaIndicationTest:

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.
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Private Member Functions

void CheckLastCcaBusyNotification (Time expectedEndTime, WifiChannelListType expectedChannelType, const std::vector< Time > &expectedPer20MhzDurations)
 Check the last CCA-BUSY notification.
 
void CheckPhyState (WifiPhyState expectedState)
 Check the PHY state.
 
void DoCheckPhyState (WifiPhyState expectedState)
 Check the PHY state.
 
void DoRun () override
 Implementation to actually run this TestCase.
 
void DoSetup () override
 Implementation to do any local setup required for this TestCase.
 
void DoTeardown () override
 Implementation to do any local setup required for this TestCase.
 
void LogScenario (const std::string &log) const
 Log scenario description.
 
void Reset ()
 Reset function.
 
void RunOne ()
 Run one function.
 
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.
 
void SendHeSuPpdu (double txPowerDbm, uint16_t frequency, uint16_t bandwidth)
 Send an HE SU PPDU.
 
void StartSignal (Ptr< WaveformGenerator > signalGenerator, double txPowerDbm, uint16_t frequency, uint16_t bandwidth, Time duration)
 Start to generate a signal.
 
void StopSignal (Ptr< WaveformGenerator > signalGenerator)
 Stop to generate a signal.
 

Private Attributes

uint16_t m_channelWidth
 Operating channel width in MHz.
 
uint16_t m_frequency
 Operating frequency in MHz.
 
std::size_t m_numSignalGenerators
 The number of non-wifi signals generators needed for the test.
 
Ptr< SpectrumWifiPhym_rxPhy
 PHY object of the receiver.
 
std::shared_ptr< CcaTestPhyListenerm_rxPhyStateListener
 Listener for PHY state transitions.
 
std::vector< Ptr< WaveformGenerator > > m_signalGenerators
 Generators of non-wifi signals.
 
Ptr< SpectrumWifiPhym_txPhy
 PHY object of the transmitter.
 

Additional Inherited Members

- Public Types inherited from ns3::TestCase
enum class  Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
 
using instead = Duration
 
- Static Public Attributes inherited from ns3::TestCase
static constexpr auto EXTENSIVE = Duration::EXTENSIVE
 
static constexpr auto QUICK = Duration::QUICK
 
static constexpr auto TAKES_FOREVER
 
- Protected Member Functions inherited from ns3::TestCase
 TestCase (std::string name)
 Constructor.
 
void AddTestCase (TestCase *testCase, Duration duration=Duration::QUICK)
 Add an individual child TestCase to this test suite.
 
TestCaseGetParent () const
 Get the parent of this TestCase.
 
bool IsStatusFailure () const
 Check if any tests failed.
 
bool IsStatusSuccess () const
 Check if all tests passed.
 
void SetDataDir (std::string directory)
 Set the data directory where reference trace files can be found.
 
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.
 
bool MustAssertOnFailure () const
 Check if this run should assert on failure.
 
bool MustContinueOnFailure () const
 Check if this run should continue on failure.
 
std::string CreateDataDirFilename (std::string filename)
 Construct the full path to a file in the data directory.
 
std::string CreateTempDirFilename (std::string filename)
 Construct the full path to a file in a temporary directory.
 

Detailed Description

Wifi Phy Threshold Test base class.

Definition at line 678 of file wifi-phy-cca-test.cc.

Constructor & Destructor Documentation

◆ WifiPhyCcaIndicationTest()

WifiPhyCcaIndicationTest::WifiPhyCcaIndicationTest ( )

Definition at line 822 of file wifi-phy-cca-test.cc.

Member Function Documentation

◆ CheckLastCcaBusyNotification()

void WifiPhyCcaIndicationTest::CheckLastCcaBusyNotification ( Time  expectedEndTime,
WifiChannelListType  expectedChannelType,
const std::vector< Time > &  expectedPer20MhzDurations 
)
private

Check the last CCA-BUSY notification.

Parameters
expectedEndTimethe expected CCA-BUSY end time
expectedChannelTypethe expected channel type
expectedPer20MhzDurationsthe expected per-20 MHz CCA-BUSY durations

Definition at line 914 of file wifi-phy-cca-test.cc.

References m_rxPhyStateListener, ns3::Simulator::Now(), and NS_TEST_ASSERT_MSG_EQ.

Referenced by ScheduleTest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckPhyState()

void WifiPhyCcaIndicationTest::CheckPhyState ( WifiPhyState  expectedState)
private

Check the PHY state.

Parameters
expectedStatethe expected state of the PHY

Definition at line 892 of file wifi-phy-cca-test.cc.

References DoCheckPhyState(), and ns3::Simulator::ScheduleNow().

Referenced by ScheduleTest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoCheckPhyState()

void WifiPhyCcaIndicationTest::DoCheckPhyState ( WifiPhyState  expectedState)
private

Check the PHY state.

Parameters
expectedStatethe 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::Simulator::Now(), and NS_TEST_ASSERT_MSG_EQ.

Referenced by CheckPhyState().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoRun()

void WifiPhyCcaIndicationTest::DoRun ( )
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 ns3::Simulator::Destroy(), m_channelWidth, m_frequency, and RunOne().

+ Here is the call graph for this function:

◆ DoSetup()

void WifiPhyCcaIndicationTest::DoSetup ( )
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::WifiPhy::ConfigureStandard(), m_numSignalGenerators, m_rxPhy, m_rxPhyStateListener, m_signalGenerators, m_txPhy, ns3::WifiPhy::RegisterListener(), ns3::Seconds(), ns3::ObjectBase::SetAttribute(), ns3::SpectrumWifiPhy::SetDevice(), ns3::WifiPhy::SetErrorRateModel(), ns3::WifiPhy::SetInterferenceHelper(), ns3::WifiPhy::SetPreambleDetectionModel(), and ns3::WIFI_STANDARD_80211ax.

+ Here is the call graph for this function:

◆ DoTeardown()

void WifiPhyCcaIndicationTest::DoTeardown ( )
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.

+ Here is the call graph for this function:

◆ LogScenario()

void WifiPhyCcaIndicationTest::LogScenario ( const std::string &  log) const
private

Log scenario description.

Parameters
logthe scenario description to add to log

Definition at line 944 of file wifi-phy-cca-test.cc.

References NS_LOG_INFO.

Referenced by RunOne().

+ Here is the caller graph for this function:

◆ Reset()

void WifiPhyCcaIndicationTest::Reset ( )
private

Reset function.

Definition at line 1001 of file wifi-phy-cca-test.cc.

References m_rxPhyStateListener.

Referenced by RunOne(), and ScheduleTest().

+ Here is the caller graph for this function:

◆ RunOne()

void WifiPhyCcaIndicationTest::RunOne ( )
private

◆ ScheduleTest()

void WifiPhyCcaIndicationTest::ScheduleTest ( Time  delay,
const std::vector< TxSignalInfo > &  generatedSignals,
const std::vector< TxPpduInfo > &  generatedPpdus,
const std::vector< StateCheckPoint > &  stateCheckpoints,
const std::vector< CcaCheckPoint > &  ccaCheckpoints 
)
private

Schedule test to perform.

Parameters
delaythe reference delay to schedule the events
generatedSignalsthe vector of signals to be generated
generatedPpdusthe vector of PPDUs to be generated
stateCheckpointsthe vector of PHY state checks
ccaCheckpointsthe vector of PHY CCA checks

Definition at line 950 of file wifi-phy-cca-test.cc.

References CheckLastCcaBusyNotification(), CheckPhyState(), m_signalGenerators, ns3::Simulator::Now(), Reset(), ns3::Simulator::Schedule(), ns3::Seconds(), SendHeSuPpdu(), and StartSignal().

Referenced by RunOne().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendHeSuPpdu()

void WifiPhyCcaIndicationTest::SendHeSuPpdu ( double  txPowerDbm,
uint16_t  frequency,
uint16_t  bandwidth 
)
private

Send an HE SU PPDU.

Parameters
txPowerDbmthe transmit power in dBm
frequencythe center frequency the transmitter is operating on
bandwidththe bandwidth to use for the transmission in MHz

Definition at line 864 of file wifi-phy-cca-test.cc.

References ns3::WifiPhyOperatingChannel::FindFirst(), ns3::HePhy::GetHeMcs0(), 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StartSignal()

void WifiPhyCcaIndicationTest::StartSignal ( Ptr< WaveformGenerator signalGenerator,
double  txPowerDbm,
uint16_t  frequency,
uint16_t  bandwidth,
Time  duration 
)
private

Start to generate a signal.

Parameters
signalGeneratorthe signal generator to use
txPowerDbmthe transmit power in dBm
frequencythe center frequency of the signal to send in MHz
bandwidththe bandwidth of the signal to send in MHz
durationthe 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::Simulator::Schedule(), and StopSignal().

Referenced by ScheduleTest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StopSignal()

void WifiPhyCcaIndicationTest::StopSignal ( Ptr< WaveformGenerator signalGenerator)
private

Stop to generate a signal.

Parameters
signalGeneratorthe signal generator to use

Definition at line 857 of file wifi-phy-cca-test.cc.

References NS_LOG_FUNCTION.

Referenced by StartSignal().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_channelWidth

uint16_t WifiPhyCcaIndicationTest::m_channelWidth
private

Operating channel width in MHz.

Definition at line 819 of file wifi-phy-cca-test.cc.

Referenced by DoRun(), and RunOne().

◆ m_frequency

uint16_t WifiPhyCcaIndicationTest::m_frequency
private

Operating frequency in MHz.

Definition at line 818 of file wifi-phy-cca-test.cc.

Referenced by DoRun(), and RunOne().

◆ m_numSignalGenerators

std::size_t WifiPhyCcaIndicationTest::m_numSignalGenerators
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().

◆ m_rxPhy

Ptr<SpectrumWifiPhy> WifiPhyCcaIndicationTest::m_rxPhy
private

PHY object of the receiver.

Definition at line 808 of file wifi-phy-cca-test.cc.

Referenced by DoCheckPhyState(), DoSetup(), DoTeardown(), and RunOne().

◆ m_rxPhyStateListener

std::shared_ptr<CcaTestPhyListener> WifiPhyCcaIndicationTest::m_rxPhyStateListener
private

Listener for PHY state transitions.

Definition at line 816 of file wifi-phy-cca-test.cc.

Referenced by CheckLastCcaBusyNotification(), DoSetup(), and Reset().

◆ m_signalGenerators

std::vector<Ptr<WaveformGenerator> > WifiPhyCcaIndicationTest::m_signalGenerators
private

Generators of non-wifi signals.

Definition at line 811 of file wifi-phy-cca-test.cc.

Referenced by DoSetup(), DoTeardown(), and ScheduleTest().

◆ m_txPhy

Ptr<SpectrumWifiPhy> WifiPhyCcaIndicationTest::m_txPhy
private

PHY object of the transmitter.

Definition at line 809 of file wifi-phy-cca-test.cc.

Referenced by DoSetup(), DoTeardown(), RunOne(), and SendHeSuPpdu().


The documentation for this class was generated from the following file: