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

This test verifies the correct function of the WifiBandwidthFilter. More...

+ Inheritance diagram for TestSpectrumChannelWithBandwidthFilter:
+ Collaboration diagram for TestSpectrumChannelWithBandwidthFilter:

Public Member Functions

 TestSpectrumChannelWithBandwidthFilter (uint16_t channel, uint16_t expectedValue)
 Constructor.
 
- 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 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.
 
- 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.
 

Private Member Functions

void CheckRxPacketCount (uint16_t expectedValue)
 Event scheduled at end of simulation for validation.
 
void DoRun () override
 Implementation to actually run this TestCase.
 
void RxBegin (bool signalType, uint32_t senderNodeId, double rxPower, Time duration)
 Callback invoked when the PHY model starts to process a signal.
 
void Send () const
 Send function (sends a single packet)
 

Private Attributes

uint16_t m_channel {36}
 channel for packet transmission
 
uint32_t m_countRxBegin {0}
 count of receive events
 
uint16_t m_expectedValue {0}
 expected count of receive events
 
Ptr< SpectrumWifiPhym_rx {nullptr}
 receive function
 
Ptr< SpectrumWifiPhym_tx {nullptr}
 transmit function
 

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

This test verifies the correct function of the WifiBandwidthFilter.

2 SpectrumWifiPhy are setup and connected on the same spectrum channel. The test will send a packet over the channel and if the signal plus guardband overlaps the channel the filter will not discard the signal but if there is no overlap the filter will filter it out.

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

Constructor & Destructor Documentation

◆ TestSpectrumChannelWithBandwidthFilter()

TestSpectrumChannelWithBandwidthFilter::TestSpectrumChannelWithBandwidthFilter ( uint16_t  channel,
uint16_t  expectedValue 
)

Constructor.

Parameters
channelchannel to be used by transmitter
expectedValueexpected number of received packets

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

Member Function Documentation

◆ CheckRxPacketCount()

void TestSpectrumChannelWithBandwidthFilter::CheckRxPacketCount ( uint16_t  expectedValue)
private

Event scheduled at end of simulation for validation.

Parameters
expectedValueexpected number of receive events

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

References m_countRxBegin, and NS_TEST_ASSERT_MSG_EQ.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ DoRun()

void TestSpectrumChannelWithBandwidthFilter::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

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

References CheckRxPacketCount(), ns3::Simulator::Destroy(), m_channel, m_expectedValue, m_rx, m_tx, ns3::MilliSeconds(), NS_LOG_FUNCTION, ns3::Simulator::Run(), ns3::Simulator::Schedule(), Send(), ns3::WifiPhy::SetOperatingChannel(), and ns3::WIFI_PHY_BAND_5GHZ.

+ Here is the call graph for this function:

◆ DoSetup()

void TestSpectrumChannelWithBandwidthFilter::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 4781 of file wifi-phy-reception-test.cc.

References ns3::SpectrumWifiPhy::AddChannel(), ns3::WifiPhy::ConfigureStandard(), m_rx, m_tx, ns3::MakeCallback(), NS_LOG_FUNCTION, RxBegin(), ns3::SpectrumWifiPhy::SetDevice(), ns3::WifiPhy::SetErrorRateModel(), ns3::WifiPhy::SetInterferenceHelper(), ns3::WifiPhy::SetTxPowerEnd(), ns3::WifiPhy::SetTxPowerStart(), ns3::ObjectBase::TraceConnectWithoutContext(), and ns3::WIFI_STANDARD_80211ax.

+ Here is the call graph for this function:

◆ DoTeardown()

void TestSpectrumChannelWithBandwidthFilter::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 4828 of file wifi-phy-reception-test.cc.

References ns3::Object::Dispose(), m_rx, and m_tx.

+ Here is the call graph for this function:

◆ RxBegin()

void TestSpectrumChannelWithBandwidthFilter::RxBegin ( bool  signalType,
uint32_t  senderNodeId,
double  rxPower,
Time  duration 
)
private

Callback invoked when the PHY model starts to process a signal.

Parameters
signalTypewhether signal is WiFi (true) or foreign (false)
senderNodeIdnode Id of the sender of the signal
rxPowerreceived signal power (dBm)
durationsignal duration

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

References m_countRxBegin, and NS_LOG_FUNCTION.

Referenced by DoSetup().

+ Here is the caller graph for this function:

◆ Send()

void TestSpectrumChannelWithBandwidthFilter::Send ( ) const
private

Send function (sends a single packet)

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

References ns3::HePhy::GetHeMcs7(), m_tx, ns3::WifiPhy::Send(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetType(), ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_SU.

Referenced by DoRun().

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

Member Data Documentation

◆ m_channel

uint16_t TestSpectrumChannelWithBandwidthFilter::m_channel {36}
private

channel for packet transmission

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

Referenced by DoRun().

◆ m_countRxBegin

uint32_t TestSpectrumChannelWithBandwidthFilter::m_countRxBegin {0}
private

count of receive events

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

Referenced by CheckRxPacketCount(), and RxBegin().

◆ m_expectedValue

uint16_t TestSpectrumChannelWithBandwidthFilter::m_expectedValue {0}
private

expected count of receive events

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

Referenced by DoRun().

◆ m_rx

Ptr<SpectrumWifiPhy> TestSpectrumChannelWithBandwidthFilter::m_rx {nullptr}
private

receive function

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

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

◆ m_tx

Ptr<SpectrumWifiPhy> TestSpectrumChannelWithBandwidthFilter::m_tx {nullptr}
private

transmit function

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

Referenced by DoRun(), DoSetup(), DoTeardown(), and Send().


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