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

Wifi Phy Reception Test base class. More...

+ Inheritance diagram for WifiPhyReceptionTest:
+ Collaboration diagram for WifiPhyReceptionTest:

Public Member Functions

 WifiPhyReceptionTest (std::string test_name)
 Constructor.
 
 ~WifiPhyReceptionTest () override=default
 Destructor.
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor.
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Protected Member Functions

void CheckPhyState (WifiPhyState expectedState)
 Schedule now to check the PHY state.
 
void DoCheckPhyState (WifiPhyState expectedState)
 Check the PHY state now.
 
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 SendPacket (double rxPowerDbm, uint32_t packetSize, uint8_t mcs)
 Send packet function.
 
- 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.
 

Protected Attributes

Ptr< SpectrumWifiPhym_phy
 the PHY
 
uint64_t m_uid {0}
 the UID to use for the PPDU
 

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
 

Detailed Description

Wifi Phy Reception Test base class.

Definition at line 73 of file wifi-phy-reception-test.cc.

Constructor & Destructor Documentation

◆ WifiPhyReceptionTest()

WifiPhyReceptionTest::WifiPhyReceptionTest ( std::string  test_name)

Constructor.

Parameters
test_namethe test name

Definition at line 114 of file wifi-phy-reception-test.cc.

◆ ~WifiPhyReceptionTest()

WifiPhyReceptionTest::~WifiPhyReceptionTest ( )
overridedefault

Destructor.

Member Function Documentation

◆ CheckPhyState()

void WifiPhyReceptionTest::CheckPhyState ( WifiPhyState  expectedState)
protected

Schedule now to check the PHY state.

Parameters
expectedStatethe expected PHY state

Definition at line 153 of file wifi-phy-reception-test.cc.

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

Referenced by TestThresholdPreambleDetectionWithoutFrameCapture::DoRun(), TestThresholdPreambleDetectionWithFrameCapture::DoRun(), and TestPhyHeadersReception::DoRun().

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

◆ DoCheckPhyState()

void WifiPhyReceptionTest::DoCheckPhyState ( WifiPhyState  expectedState)
protected

Check the PHY state now.

Parameters
expectedStatethe expected PHY state

Definition at line 161 of file wifi-phy-reception-test.cc.

References ns3::PointerValue::Get(), ns3::ObjectBase::GetAttribute(), m_phy, ns3::Simulator::Now(), NS_LOG_FUNCTION, 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:

◆ DoSetup()

void WifiPhyReceptionTest::DoSetup ( )
overrideprotectedvirtual

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.

Reimplemented in TestThresholdPreambleDetectionWithoutFrameCapture, TestThresholdPreambleDetectionWithFrameCapture, TestSimpleFrameCaptureModel, and TestAmpduReception.

Definition at line 176 of file wifi-phy-reception-test.cc.

References ns3::SpectrumWifiPhy::AddChannel(), CHANNEL_NUMBER, ns3::WifiPhy::ConfigureStandard(), m_phy, ns3::SpectrumWifiPhy::SetDevice(), ns3::WifiPhy::SetErrorRateModel(), ns3::WifiPhy::SetInterferenceHelper(), ns3::WifiPhy::SetOperatingChannel(), ns3::WIFI_PHY_BAND_5GHZ, and ns3::WIFI_STANDARD_80211ax.

Referenced by TestThresholdPreambleDetectionWithoutFrameCapture::DoSetup(), TestThresholdPreambleDetectionWithFrameCapture::DoSetup(), TestSimpleFrameCaptureModel::DoSetup(), and TestAmpduReception::DoSetup().

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

◆ DoTeardown()

void WifiPhyReceptionTest::DoTeardown ( )
overrideprotectedvirtual

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 195 of file wifi-phy-reception-test.cc.

References ns3::Object::Dispose(), and m_phy.

+ Here is the call graph for this function:

◆ SendPacket()

void WifiPhyReceptionTest::SendPacket ( double  rxPowerDbm,
uint32_t  packetSize,
uint8_t  mcs 
)
protected

Send packet function.

Parameters
rxPowerDbmthe transmit power in dBm
packetSizethe size of the packet in bytes
mcsthe MCS to transmit the packet

Definition at line 120 of file wifi-phy-reception-test.cc.

References ns3::WifiPhy::CalculateTxDuration(), CHANNEL_WIDTH, ns3::WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity(), ns3::DbmToW(), FREQUENCY, ns3::HePhy::GetHeMcs(), ns3::WifiPhy::GetOperatingChannel(), ns3::WifiPhy::GetPhyBand(), GUARD_WIDTH, m_phy, m_uid, packetSize, ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetType(), ns3::SpectrumWifiPhy::StartRx(), ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_SU.

Referenced by TestThresholdPreambleDetectionWithoutFrameCapture::DoRun(), TestThresholdPreambleDetectionWithFrameCapture::DoRun(), TestSimpleFrameCaptureModel::DoRun(), and TestPhyHeadersReception::DoRun().

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

Member Data Documentation

◆ m_phy

◆ m_uid

uint64_t WifiPhyReceptionTest::m_uid {0}
protected

the UID to use for the PPDU

Definition at line 111 of file wifi-phy-reception-test.cc.

Referenced by TestAmpduReception::SendAmpduWithThreeMpdus(), and SendPacket().


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