A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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.
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Private Member Functions

void DoRun () override
 Implementation to actually run this TestCase.
 

Static Private Member Functions

static void DataIndicationCoordinator (LrWpanSlottedCsmacaTestCase *testcase, Ptr< LrWpanNetDevice > dev, McpsDataIndicationParams params, Ptr< Packet > p)
 Function called when McpsDataIndication is hit.
 
static void IncomingSuperframeStatus (LrWpanSlottedCsmacaTestCase *testcase, Ptr< LrWpanNetDevice > dev, SuperframeStatus oldValue, SuperframeStatus newValue)
 Function called on each Superframe status change (CAP|CFP|INACTIVE).
 
static void StartConfirm (LrWpanSlottedCsmacaTestCase *testcase, Ptr< LrWpanNetDevice > dev, MlmeStartConfirmParams params)
 Function called when MlmeStartConfirm is hit.
 
static void TransactionCost (LrWpanSlottedCsmacaTestCase *testcase, Ptr< LrWpanNetDevice > dev, uint32_t trans)
 Function called to indicated the calculated transaction cost in slotted CSMA-CA.
 
static void TransEndIndication (LrWpanSlottedCsmacaTestCase *testcase, Ptr< LrWpanNetDevice > dev, McpsDataConfirmParams params)
 Function called when McpsDataConfirm is hit.
 

Private Attributes

Time m_apBoundary
 Indicates the time after the calculation of the transaction cost (A boundary of an Active Period in the CAP)
 
Time m_sentTime
 Indicates the time after a successful transmission.
 
Time m_startCap
 The time of the start of the Contention Access Period (CAP).
 
uint32_t m_transCost
 The current transaction cost in symbols.
 

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...
 
using instead = Duration
 
- Static Public Attributes inherited from ns3::TestCase
static constexpr auto EXTENSIVE = Duration::EXTENSIVE
 
static constexpr auto QUICK = Duration::QUICK
 
static constexpr auto 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.
 
TestCaseGetParent () 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.
 

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::Simulator::Now(), NS_LOG_UNCOND, and ns3::Time::S.

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 m_startCap, ns3::Simulator::Now(), NS_LOG_UNCOND, and ns3::Time::S.

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::Simulator::Now(), NS_LOG_UNCOND, and ns3::Time::S.

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::Simulator::Now(), NS_LOG_UNCOND, and ns3::Time::S.

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::Simulator::Now(), and NS_LOG_UNCOND.

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: