A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
LrWpanAckTestCase Class Reference

LrWpan ACK Test. More...

+ Inheritance diagram for LrWpanAckTestCase:
+ Collaboration diagram for LrWpanAckTestCase:

Public Types

enum  TestMode_e { EXTENDED_ADDRESS_UNICAST , SHORT_ADDRESS_UNICAST , SHORT_ADDRESS_MULTICAST , SHORT_ADDRESS_BROADCAST }
 Test modes. More...
 
- Public Types inherited from ns3::TestCase
enum class  Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
 

Public Member Functions

 LrWpanAckTestCase (const char *const prefix, TestMode_e mode)
 Create test case.
 
void DataConfirmDev0 (McpsDataConfirmParams params)
 Function called when DataConfirm is hit on dev0.
 
void DataConfirmDev1 (McpsDataConfirmParams params)
 Function called when DataConfirm is hit on dev1.
 
void DataIndicationDev0 (McpsDataIndicationParams params, Ptr< Packet > p)
 Function called when DataIndication is hit on dev0.
 
void DataIndicationDev1 (McpsDataIndicationParams params, Ptr< Packet > p)
 Function called when DataIndication is hit on dev1.
 
- 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.
 

Private Attributes

Ptr< LrWpanNetDevicem_dev0
 1st LrWpanNetDevice.
 
Ptr< LrWpanNetDevicem_dev1
 2nd LrWpanNetDevice.
 
TestMode_e m_mode
 Test mode.
 
std::string m_prefix
 Filename prefix.
 
Time m_replyArrivalTime
 Reply arrival time.
 
Time m_replySentTime
 Reply successfully sent time.
 
Time m_replyTime
 Reply time.
 
Time m_requestSentTime
 Request successfully sent time.
 
Time m_requestTime
 Request time.
 

Additional Inherited Members

- 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.
 
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

LrWpan ACK Test.

Definition at line 44 of file lr-wpan-ack-test.cc.

Member Enumeration Documentation

◆ TestMode_e

Test modes.

Enumerator
EXTENDED_ADDRESS_UNICAST 

extended addresses

SHORT_ADDRESS_UNICAST 

short addresses, unicast

SHORT_ADDRESS_MULTICAST 

short addresses, multicast

SHORT_ADDRESS_BROADCAST 

short addresses, broadcast

Definition at line 50 of file lr-wpan-ack-test.cc.

Constructor & Destructor Documentation

◆ LrWpanAckTestCase()

LrWpanAckTestCase::LrWpanAckTestCase ( const char *const prefix,
TestMode_e mode )

Create test case.

Parameters
prefixUnique file names prefix
modeTest mode

Definition at line 103 of file lr-wpan-ack-test.cc.

References m_mode, m_prefix, m_replyArrivalTime, m_replySentTime, m_replyTime, m_requestSentTime, m_requestTime, and ns3::Seconds().

+ Here is the call graph for this function:

Member Function Documentation

◆ DataConfirmDev0()

void LrWpanAckTestCase::DataConfirmDev0 ( McpsDataConfirmParams params)

Function called when DataConfirm is hit on dev0.

Parameters
paramsThe MCPS params.

Definition at line 147 of file lr-wpan-ack-test.cc.

References m_requestSentTime, and ns3::Simulator::Now().

Referenced by DoRun().

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

◆ DataConfirmDev1()

void LrWpanAckTestCase::DataConfirmDev1 ( McpsDataConfirmParams params)

Function called when DataConfirm is hit on dev1.

Parameters
paramsThe MCPS params.

Definition at line 153 of file lr-wpan-ack-test.cc.

References m_replySentTime, and ns3::Simulator::Now().

Referenced by DoRun().

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

◆ DataIndicationDev0()

void LrWpanAckTestCase::DataIndicationDev0 ( McpsDataIndicationParams params,
Ptr< Packet > p )

Function called when DataIndication is hit on dev0.

Parameters
paramsThe MCPS params.
pthe packet.

Definition at line 116 of file lr-wpan-ack-test.cc.

References m_replyArrivalTime, and ns3::Simulator::Now().

Referenced by DoRun().

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

◆ DataIndicationDev1()

void LrWpanAckTestCase::DataIndicationDev1 ( McpsDataIndicationParams params,
Ptr< Packet > p )

Function called when DataIndication is hit on dev1.

Parameters
paramsThe MCPS params.
pthe packet.

Definition at line 122 of file lr-wpan-ack-test.cc.

References ns3::Create(), ns3::lrwpan::EXT_ADDR, EXTENDED_ADDRESS_UNICAST, m_dev1, ns3::lrwpan::McpsDataRequestParams::m_dstAddr, ns3::lrwpan::McpsDataRequestParams::m_dstAddrMode, ns3::lrwpan::McpsDataRequestParams::m_dstExtAddr, ns3::lrwpan::McpsDataRequestParams::m_dstPanId, m_mode, ns3::lrwpan::McpsDataRequestParams::m_msduHandle, m_replyTime, ns3::lrwpan::McpsDataRequestParams::m_srcAddrMode, ns3::lrwpan::McpsDataRequestParams::m_txOptions, ns3::Simulator::Now(), ns3::lrwpan::SHORT_ADDR, and ns3::lrwpan::TX_OPTION_NONE.

Referenced by DoRun().

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

◆ DoRun()

void LrWpanAckTestCase::DoRun ( )
overrideprivatevirtual

Member Data Documentation

◆ m_dev0

Ptr<LrWpanNetDevice> LrWpanAckTestCase::m_dev0
private

1st LrWpanNetDevice.

Definition at line 99 of file lr-wpan-ack-test.cc.

Referenced by DoRun().

◆ m_dev1

Ptr<LrWpanNetDevice> LrWpanAckTestCase::m_dev1
private

2nd LrWpanNetDevice.

Definition at line 100 of file lr-wpan-ack-test.cc.

Referenced by DataIndicationDev1(), and DoRun().

◆ m_mode

TestMode_e LrWpanAckTestCase::m_mode
private

Test mode.

Definition at line 98 of file lr-wpan-ack-test.cc.

Referenced by LrWpanAckTestCase(), DataIndicationDev1(), and DoRun().

◆ m_prefix

std::string LrWpanAckTestCase::m_prefix
private

Filename prefix.

Definition at line 92 of file lr-wpan-ack-test.cc.

Referenced by LrWpanAckTestCase(), and DoRun().

◆ m_replyArrivalTime

Time LrWpanAckTestCase::m_replyArrivalTime
private

Reply arrival time.

Definition at line 97 of file lr-wpan-ack-test.cc.

Referenced by LrWpanAckTestCase(), DataIndicationDev0(), and DoRun().

◆ m_replySentTime

Time LrWpanAckTestCase::m_replySentTime
private

Reply successfully sent time.

Definition at line 96 of file lr-wpan-ack-test.cc.

Referenced by LrWpanAckTestCase(), DataConfirmDev1(), and DoRun().

◆ m_replyTime

Time LrWpanAckTestCase::m_replyTime
private

Reply time.

Definition at line 95 of file lr-wpan-ack-test.cc.

Referenced by LrWpanAckTestCase(), DataIndicationDev1(), and DoRun().

◆ m_requestSentTime

Time LrWpanAckTestCase::m_requestSentTime
private

Request successfully sent time.

Definition at line 94 of file lr-wpan-ack-test.cc.

Referenced by LrWpanAckTestCase(), DataConfirmDev0(), and DoRun().

◆ m_requestTime

Time LrWpanAckTestCase::m_requestTime
private

Request time.

Definition at line 93 of file lr-wpan-ack-test.cc.

Referenced by LrWpanAckTestCase(), and DoRun().


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