LrWpan CCA Test. More...
Public Member Functions | |
LrWpanCcaTestCase () | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
void | DoRun () override |
Implementation to actually run this TestCase. | |
Static Private Member Functions | |
static void | PhyRxBegin (LrWpanCcaTestCase *testcase, Ptr< LrWpanNetDevice > device, Ptr< const Packet > packet) |
Function called when PhyRxBegin is hit. | |
static void | PhyRxDrop (LrWpanCcaTestCase *testcase, Ptr< LrWpanNetDevice > device, Ptr< const Packet > packet) |
Function called when PhyRxDrop is hit. | |
static void | PhyRxEnd (LrWpanCcaTestCase *testcase, Ptr< LrWpanNetDevice > device, Ptr< const Packet > packet, double sinr) |
Function called when PhyRxEnd is hit. | |
static void | PhyTxBegin (LrWpanCcaTestCase *testcase, Ptr< LrWpanNetDevice > device, Ptr< const Packet > packet) |
Function called when PhyTxBegin is hit. | |
static void | PhyTxEnd (LrWpanCcaTestCase *testcase, Ptr< LrWpanNetDevice > device, Ptr< const Packet > packet) |
Function called when PhyTxEnd is hit. | |
static void | PlmeCcaConfirm (LrWpanCcaTestCase *testcase, Ptr< LrWpanNetDevice > device, PhyEnumeration status) |
Function called when PlmeCcaConfirm is hit. | |
Private Attributes | |
PhyEnumeration | m_status |
PHY status. | |
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 |
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. | |
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. | |
LrWpan CCA Test.
Definition at line 36 of file lr-wpan-cca-test.cc.
LrWpanCcaTestCase::LrWpanCcaTestCase | ( | ) |
Definition at line 110 of file lr-wpan-cca-test.cc.
References ns3::lrwpan::IEEE_802_15_4_PHY_UNSPECIFIED, and m_status.
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 195 of file lr-wpan-cca-test.cc.
References ns3::Create(), ns3::CreateObject(), ns3::Simulator::Destroy(), ns3::lrwpan::IEEE_802_15_4_PHY_BUSY, ns3::lrwpan::IEEE_802_15_4_PHY_IDLE, ns3::lrwpan::IEEE_802_15_4_PHY_UNSPECIFIED, ns3::lrwpan::McpsDataRequestParams::m_dstAddr, ns3::lrwpan::McpsDataRequestParams::m_dstAddrMode, ns3::lrwpan::McpsDataRequestParams::m_dstPanId, ns3::lrwpan::McpsDataRequestParams::m_msduHandle, ns3::lrwpan::McpsDataRequestParams::m_srcAddrMode, m_status, ns3::lrwpan::McpsDataRequestParams::m_txOptions, ns3::MakeBoundCallback(), ns3::MakeNullCallback(), ns3::lrwpan::LrWpanMac::McpsDataRequest(), NS_TEST_EXPECT_MSG_EQ, PhyRxBegin(), PhyRxDrop(), PhyRxEnd(), PhyTxBegin(), PhyTxEnd(), PlmeCcaConfirm(), ns3::Simulator::Run(), ns3::Simulator::ScheduleNow(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), ns3::lrwpan::SHORT_ADDR, and ns3::lrwpan::TX_OPTION_NONE.
|
staticprivate |
Function called when PhyRxBegin is hit.
testcase | The TestCase. |
device | The LrWpanNetDevice. |
packet | The packet. |
Definition at line 154 of file lr-wpan-cca-test.cc.
References ns3::Time::As(), ns3::Simulator::Now(), and ns3::Time::S.
Referenced by DoRun().
|
staticprivate |
Function called when PhyRxDrop is hit.
testcase | The TestCase. |
device | The LrWpanNetDevice. |
packet | The packet. |
Definition at line 183 of file lr-wpan-cca-test.cc.
References ns3::Time::As(), ns3::Simulator::Now(), and ns3::Time::S.
Referenced by DoRun().
|
staticprivate |
Function called when PhyRxEnd is hit.
testcase | The TestCase. |
device | The LrWpanNetDevice. |
packet | The packet. |
sinr | The received SINR. |
Definition at line 166 of file lr-wpan-cca-test.cc.
References ns3::Time::As(), ns3::Simulator::Now(), and ns3::Time::S.
Referenced by DoRun().
|
staticprivate |
Function called when PhyTxBegin is hit.
testcase | The TestCase. |
device | The LrWpanNetDevice. |
packet | The packet. |
Definition at line 130 of file lr-wpan-cca-test.cc.
References ns3::Time::As(), ns3::Simulator::Now(), and ns3::Time::S.
Referenced by DoRun().
|
staticprivate |
Function called when PhyTxEnd is hit.
testcase | The TestCase. |
device | The LrWpanNetDevice. |
packet | The packet. |
Definition at line 142 of file lr-wpan-cca-test.cc.
References ns3::Time::As(), ns3::Simulator::Now(), and ns3::Time::S.
Referenced by DoRun().
|
staticprivate |
Function called when PlmeCcaConfirm is hit.
testcase | The TestCase. |
device | The LrWpanNetDevice. |
status | The device status. |
Definition at line 117 of file lr-wpan-cca-test.cc.
References ns3::Time::As(), ns3::LrWpanHelper::LrWpanPhyEnumerationPrinter(), m_status, ns3::Simulator::Now(), and ns3::Time::S.
Referenced by DoRun().
|
private |
PHY status.
Definition at line 107 of file lr-wpan-cca-test.cc.
Referenced by LrWpanCcaTestCase(), DoRun(), and PlmeCcaConfirm().