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 () | |
virtual | ~LrWpanSlottedCsmacaTestCase () |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName (void) const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
virtual void | DoRun (void) |
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 TestCsse. More... | |
bool | IsStatusFailure (void) const |
Check if any tests failed. More... | |
bool | IsStatusSuccess (void) 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 (void) const |
Check if this run should assert on failure. More... | |
bool | MustContinueOnFailure (void) 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 45 of file lr-wpan-slotted-csmaca-test.cc.
LrWpanSlottedCsmacaTestCase::LrWpanSlottedCsmacaTestCase | ( | ) |
Definition at line 115 of file lr-wpan-slotted-csmaca-test.cc.
References m_transCost.
|
virtual |
Definition at line 121 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 139 of file lr-wpan-slotted-csmaca-test.cc.
References ns3::Packet::GetSize(), ns3::Now(), and NS_LOG_UNCOND.
Referenced by DoRun().
|
privatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 174 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::MlmeStartRequestParams::m_bcnOrd, ns3::McpsDataRequestParams::m_dstAddr, ns3::McpsDataRequestParams::m_dstAddrMode, ns3::McpsDataRequestParams::m_dstPanId, ns3::McpsDataRequestParams::m_msduHandle, ns3::MlmeStartRequestParams::m_panCoor, ns3::MlmeStartRequestParams::m_PanId, m_sentTime, ns3::MlmeStartRequestParams::m_sfrmOrd, ns3::McpsDataRequestParams::m_srcAddrMode, m_startCap, m_transCost, ns3::MakeBoundCallback(), NS_LOG_UNCOND, NS_TEST_EXPECT_MSG_EQ, 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 151 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 145 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 161 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 127 of file lr-wpan-slotted-csmaca-test.cc.
References ns3::IEEE_802_15_4_SUCCESS, m_sentTime, ns3::McpsDataConfirmParams::m_status, ns3::Now(), and NS_LOG_UNCOND.
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 109 of file lr-wpan-slotted-csmaca-test.cc.
Referenced by DoRun(), and TransactionCost().
|
private |
Indicates the time after a successful transmission.
Definition at line 110 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 108 of file lr-wpan-slotted-csmaca-test.cc.
Referenced by DoRun(), and IncomingSuperframeStatus().
|
private |
The current transaction cost in symbols.
Definition at line 111 of file lr-wpan-slotted-csmaca-test.cc.
Referenced by LrWpanSlottedCsmacaTestCase(), DoRun(), and TransactionCost().