Test the correct allocation of DIRECT transmissions in the contention access period (CAP) of the superframe (Slotted CSMA-CA algorithm). More...
Public Member Functions | |
LrWpanSlottedCsmacaTestCase () | |
~LrWpanSlottedCsmacaTestCase () override | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
void | DoRun () override |
Implementation to actually run this TestCase. More... | |
Static Private Member Functions | |
static void | DataIndicationCoordinator (LrWpanSlottedCsmacaTestCase *testcase, Ptr< LrWpanNetDevice > dev, McpsDataIndicationParams params, Ptr< Packet > p) |
Function called when McpsDataIndication is hit. More... | |
static void | IncomingSuperframeStatus (LrWpanSlottedCsmacaTestCase *testcase, Ptr< LrWpanNetDevice > dev, SuperframeStatus oldValue, SuperframeStatus newValue) |
Function called on each Superframe status change (CAP|CFP|INACTIVE). More... | |
static void | StartConfirm (LrWpanSlottedCsmacaTestCase *testcase, Ptr< LrWpanNetDevice > dev, MlmeStartConfirmParams params) |
Function called when MlmeStartConfirm is hit. More... | |
static void | TransactionCost (LrWpanSlottedCsmacaTestCase *testcase, Ptr< LrWpanNetDevice > dev, uint32_t trans) |
Function called to indicated the calculated transaction cost in slotted CSMA-CA. More... | |
static void | TransEndIndication (LrWpanSlottedCsmacaTestCase *testcase, Ptr< LrWpanNetDevice > dev, McpsDataConfirmParams params) |
Function called when McpsDataConfirm is hit. More... | |
Private Attributes | |
Time | m_apBoundary |
Indicates the time after the calculation of the transaction cost (A boundary of an Active Period in the CAP) More... | |
Time | m_sentTime |
Indicates the time after a successful transmission. More... | |
Time | m_startCap |
The time of the start of the Contention Access Period (CAP). More... | |
uint32_t | m_transCost |
The current transaction cost in symbols. More... | |
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... | |
Protected Member Functions inherited from ns3::TestCase | |
TestCase (std::string name) | |
Constructor. More... | |
void | AddTestCase (TestCase *testCase, TestDuration duration=QUICK) |
Add an individual child TestCase to this test suite. More... | |
TestCase * | GetParent () const |
Get the parent of this TestCase. More... | |
bool | IsStatusFailure () const |
Check if any tests failed. More... | |
bool | IsStatusSuccess () const |
Check if all tests passed. More... | |
void | SetDataDir (std::string directory) |
Set the data directory where reference trace files can be found. More... | |
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. More... | |
bool | MustAssertOnFailure () const |
Check if this run should assert on failure. More... | |
bool | MustContinueOnFailure () const |
Check if this run should continue on failure. More... | |
std::string | CreateDataDirFilename (std::string filename) |
Construct the full path to a file in the data directory. More... | |
std::string | CreateTempDirFilename (std::string filename) |
Construct the full path to a file in a temporary directory. More... | |
Test the correct allocation of DIRECT transmissions in the contention access period (CAP) of the superframe (Slotted CSMA-CA algorithm).
Definition at line 43 of file lr-wpan-slotted-csmaca-test.cc.
LrWpanSlottedCsmacaTestCase::LrWpanSlottedCsmacaTestCase | ( | ) |
Definition at line 111 of file lr-wpan-slotted-csmaca-test.cc.
References m_transCost.
|
override |
Definition at line 117 of file lr-wpan-slotted-csmaca-test.cc.
|
staticprivate |
Function called when McpsDataIndication is hit.
testcase | The TestCase. |
dev | The LrWpanNetDevice. |
params | The McpsDataIndication parameters. |
p | The received packet. |
Definition at line 136 of file lr-wpan-slotted-csmaca-test.cc.
References ns3::Packet::GetSize(), ns3::Now(), and NS_LOG_UNCOND.
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 177 of file lr-wpan-slotted-csmaca-test.cc.
References ns3::Node::AddDevice(), ns3::Time::As(), third::channel, DataIndicationCoordinator(), ns3::LrWpanNetDevice::GetCsmaCa(), ns3::LrWpanNetDevice::GetMac(), ns3::Time::GetMicroSeconds(), ns3::LrWpanNetDevice::GetPhy(), ns3::Packet::GetSize(), IncomingSuperframeStatus(), m_apBoundary, ns3::McpsDataRequestParams::m_dstAddr, ns3::McpsDataRequestParams::m_dstAddrMode, ns3::McpsDataRequestParams::m_dstPanId, ns3::McpsDataRequestParams::m_msduHandle, m_sentTime, ns3::McpsDataRequestParams::m_srcAddrMode, m_startCap, m_transCost, ns3::MakeBoundCallback(), NS_LOG_UNCOND, NS_TEST_EXPECT_MSG_EQ, two-ray-to-three-gpp-ch-calibration::params, ns3::Seconds(), ns3::LrWpanNetDevice::SetAddress(), ns3::LrWpanNetDevice::SetChannel(), ns3::SHORT_ADDR, StartConfirm(), TransactionCost(), and TransEndIndication().
|
staticprivate |
Function called on each Superframe status change (CAP|CFP|INACTIVE).
testcase | The TestCase. |
dev | The LrWpanNetDevice. |
oldValue | The previous superframe status. |
newValue | THe new superframe status. |
Definition at line 154 of file lr-wpan-slotted-csmaca-test.cc.
References ns3::CAP, m_startCap, ns3::Now(), and NS_LOG_UNCOND.
Referenced by DoRun().
|
staticprivate |
Function called when MlmeStartConfirm is hit.
testcase | The TestCase. |
dev | The LrWpanNetDevice. |
params | The MlmeStartConfirm parameters. |
Definition at line 146 of file lr-wpan-slotted-csmaca-test.cc.
References ns3::Now(), and NS_LOG_UNCOND.
Referenced by DoRun().
|
staticprivate |
Function called to indicated the calculated transaction cost in slotted CSMA-CA.
testcase | The TestCase. |
dev | The LrWpanNetDevice. |
trans | The transaction cost in symbols. |
Definition at line 167 of file lr-wpan-slotted-csmaca-test.cc.
References m_apBoundary, m_transCost, ns3::Now(), and NS_LOG_UNCOND.
Referenced by DoRun().
|
staticprivate |
Function called when McpsDataConfirm is hit.
testcase | The TestCase. |
dev | The LrWpanNetDevice. |
params | The McpsDataConfirm parameters. |
Definition at line 122 of file lr-wpan-slotted-csmaca-test.cc.
References m_sentTime, ns3::Now(), NS_LOG_UNCOND, two-ray-to-three-gpp-ch-calibration::params, and ns3::SUCCESS.
Referenced by DoRun().
|
private |
Indicates the time after the calculation of the transaction cost (A boundary of an Active Period in the CAP)
Definition at line 105 of file lr-wpan-slotted-csmaca-test.cc.
Referenced by DoRun(), and TransactionCost().
|
private |
Indicates the time after a successful transmission.
Definition at line 107 of file lr-wpan-slotted-csmaca-test.cc.
Referenced by DoRun(), and TransEndIndication().
|
private |
The time of the start of the Contention Access Period (CAP).
Definition at line 104 of file lr-wpan-slotted-csmaca-test.cc.
Referenced by DoRun(), and IncomingSuperframeStatus().
|
private |
The current transaction cost in symbols.
Definition at line 108 of file lr-wpan-slotted-csmaca-test.cc.
Referenced by LrWpanSlottedCsmacaTestCase(), DoRun(), and TransactionCost().