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 (dBm_u rxPower, 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...
 
- Static Public Attributes inherited from ns3::TestCase
static constexpr auto QUICK = Duration::QUICK
 Deprecated test duration simple enums.
 
static constexpr auto EXTENSIVE = Duration::EXTENSIVE
 
static constexpr auto TAKES_FOREVER = Duration::TAKES_FOREVER
 

Detailed Description

Wifi Phy Reception Test base class.

Definition at line 61 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 102 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 148 of file wifi-phy-reception-test.cc.

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

Referenced by TestPhyHeadersReception::DoRun(), TestThresholdPreambleDetectionWithFrameCapture::DoRun(), and TestThresholdPreambleDetectionWithoutFrameCapture::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 156 of file wifi-phy-reception-test.cc.

References ns3::DynamicCast(), ns3::PointerValue::Get(), 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.

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

References CHANNEL_NUMBER, ns3::CreateObject(), m_phy, ns3::WIFI_PHY_BAND_5GHZ, and ns3::WIFI_STANDARD_80211ax.

Referenced by TestAmpduReception::DoSetup(), TestSimpleFrameCaptureModel::DoSetup(), TestThresholdPreambleDetectionWithFrameCapture::DoSetup(), and TestThresholdPreambleDetectionWithoutFrameCapture::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 190 of file wifi-phy-reception-test.cc.

References m_phy.

◆ SendPacket()

void WifiPhyReceptionTest::SendPacket ( dBm_u rxPower,
uint32_t packetSize,
uint8_t mcs )
protected

Send packet function.

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

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

References CHANNEL_WIDTH, ns3::Create(), ns3::WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity(), ns3::DbmToW(), FREQUENCY, ns3::HePhy::GetHeMcs(), GUARD_WIDTH, m_phy, m_uid, ns3::NanoSeconds(), packetSize, ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetType(), ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_SU.

Referenced by TestPhyHeadersReception::DoRun(), TestSimpleFrameCaptureModel::DoRun(), TestThresholdPreambleDetectionWithFrameCapture::DoRun(), and TestThresholdPreambleDetectionWithoutFrameCapture::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 99 of file wifi-phy-reception-test.cc.

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


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