This test verifies the correct function of the WifiBandwidthFilter. More...
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 |
TestCase & | operator= (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, TestDuration duration=QUICK) |
Add an individual child TestCase to this test suite. | |
TestCase * | GetParent () 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< SpectrumWifiPhy > | m_rx {nullptr} |
receive function | |
Ptr< SpectrumWifiPhy > | m_tx {nullptr} |
transmit function | |
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... | |
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 4697 of file wifi-phy-reception-test.cc.
TestSpectrumChannelWithBandwidthFilter::TestSpectrumChannelWithBandwidthFilter | ( | uint16_t | channel, |
uint16_t | expectedValue | ||
) |
Constructor.
channel | channel to be used by transmitter |
expectedValue | expected number of received packets |
Definition at line 4744 of file wifi-phy-reception-test.cc.
|
private |
Event scheduled at end of simulation for validation.
expectedValue | expected number of receive events |
Definition at line 4770 of file wifi-phy-reception-test.cc.
References m_countRxBegin, and NS_TEST_ASSERT_MSG_EQ.
Referenced by DoRun().
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 4842 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.
|
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 4788 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.
|
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 4835 of file wifi-phy-reception-test.cc.
References ns3::Object::Dispose(), m_rx, and m_tx.
|
private |
Callback invoked when the PHY model starts to process a signal.
signalType | whether signal is WiFi (true) or foreign (false) |
senderNodeId | node Id of the sender of the signal |
rxPower | received signal power (dBm) |
duration | signal duration |
Definition at line 4778 of file wifi-phy-reception-test.cc.
References m_countRxBegin, and NS_LOG_FUNCTION.
Referenced by DoSetup().
|
private |
Send function (sends a single packet)
Definition at line 4754 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().
|
private |
channel for packet transmission
Definition at line 4740 of file wifi-phy-reception-test.cc.
Referenced by DoRun().
|
private |
count of receive events
Definition at line 4739 of file wifi-phy-reception-test.cc.
Referenced by CheckRxPacketCount(), and RxBegin().
|
private |
expected count of receive events
Definition at line 4741 of file wifi-phy-reception-test.cc.
Referenced by DoRun().
|
private |
receive function
Definition at line 4738 of file wifi-phy-reception-test.cc.
Referenced by DoRun(), DoSetup(), and DoTeardown().
|
private |
transmit function
Definition at line 4737 of file wifi-phy-reception-test.cc.
Referenced by DoRun(), DoSetup(), DoTeardown(), and Send().