A Discrete-Event Network Simulator
API
LrWpanSlottedCsmacaTestCase Class Reference

Test the correct allocation of DIRECT transmissions in the contention access period (CAP) of the superframe (Slotted CSMA-CA algorithm). More...

+ Inheritance diagram for LrWpanSlottedCsmacaTestCase:
+ Collaboration diagram for LrWpanSlottedCsmacaTestCase:

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
 
TestCaseoperator= (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...
 
TestCaseGetParent () 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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ LrWpanSlottedCsmacaTestCase()

LrWpanSlottedCsmacaTestCase::LrWpanSlottedCsmacaTestCase ( )

Definition at line 111 of file lr-wpan-slotted-csmaca-test.cc.

References m_transCost.

◆ ~LrWpanSlottedCsmacaTestCase()

LrWpanSlottedCsmacaTestCase::~LrWpanSlottedCsmacaTestCase ( )
override

Definition at line 117 of file lr-wpan-slotted-csmaca-test.cc.

Member Function Documentation

◆ DataIndicationCoordinator()

void LrWpanSlottedCsmacaTestCase::DataIndicationCoordinator ( LrWpanSlottedCsmacaTestCase testcase,
Ptr< LrWpanNetDevice dev,
McpsDataIndicationParams  params,
Ptr< Packet p 
)
staticprivate

Function called when McpsDataIndication is hit.

Parameters
testcaseThe TestCase.
devThe LrWpanNetDevice.
paramsThe McpsDataIndication parameters.
pThe 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().

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

◆ DoRun()

◆ IncomingSuperframeStatus()

void LrWpanSlottedCsmacaTestCase::IncomingSuperframeStatus ( LrWpanSlottedCsmacaTestCase testcase,
Ptr< LrWpanNetDevice dev,
SuperframeStatus  oldValue,
SuperframeStatus  newValue 
)
staticprivate

Function called on each Superframe status change (CAP|CFP|INACTIVE).

Parameters
testcaseThe TestCase.
devThe LrWpanNetDevice.
oldValueThe previous superframe status.
newValueTHe 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().

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

◆ StartConfirm()

void LrWpanSlottedCsmacaTestCase::StartConfirm ( LrWpanSlottedCsmacaTestCase testcase,
Ptr< LrWpanNetDevice dev,
MlmeStartConfirmParams  params 
)
staticprivate

Function called when MlmeStartConfirm is hit.

Parameters
testcaseThe TestCase.
devThe LrWpanNetDevice.
paramsThe MlmeStartConfirm parameters.

Definition at line 146 of file lr-wpan-slotted-csmaca-test.cc.

References ns3::Now(), and NS_LOG_UNCOND.

Referenced by DoRun().

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

◆ TransactionCost()

void LrWpanSlottedCsmacaTestCase::TransactionCost ( LrWpanSlottedCsmacaTestCase testcase,
Ptr< LrWpanNetDevice dev,
uint32_t  trans 
)
staticprivate

Function called to indicated the calculated transaction cost in slotted CSMA-CA.

Parameters
testcaseThe TestCase.
devThe LrWpanNetDevice.
transThe 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().

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

◆ TransEndIndication()

void LrWpanSlottedCsmacaTestCase::TransEndIndication ( LrWpanSlottedCsmacaTestCase testcase,
Ptr< LrWpanNetDevice dev,
McpsDataConfirmParams  params 
)
staticprivate

Function called when McpsDataConfirm is hit.

Parameters
testcaseThe TestCase.
devThe LrWpanNetDevice.
paramsThe 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().

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

Member Data Documentation

◆ m_apBoundary

Time LrWpanSlottedCsmacaTestCase::m_apBoundary
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().

◆ m_sentTime

Time LrWpanSlottedCsmacaTestCase::m_sentTime
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().

◆ m_startCap

Time LrWpanSlottedCsmacaTestCase::m_startCap
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().

◆ m_transCost

uint32_t LrWpanSlottedCsmacaTestCase::m_transCost
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().


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