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

Test PHY going to TRX_OFF after CSMA failure (MAC->RxOnWhenIdle(false)) More...

+ Inheritance diagram for TestRxOffWhenIdleAfterCsmaFailure:
+ Collaboration diagram for TestRxOffWhenIdleAfterCsmaFailure:

Public Member Functions

 TestRxOffWhenIdleAfterCsmaFailure ()
 
 ~TestRxOffWhenIdleAfterCsmaFailure () 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 DataConfirm (McpsDataConfirmParams params)
 Function called when a Data confirm is invoked (After Tx Attempt)
 
void DataIndication (McpsDataIndicationParams params, Ptr< Packet > p)
 Function called when a Data indication is invoked.
 
void DoRun () override
 Implementation to actually run this TestCase.
 
void StateChangeNotificationDev0 (std::string context, Time now, PhyEnumeration oldState, PhyEnumeration newState)
 Function called when a the PHY state changes in Dev0 [00:01].
 
void StateChangeNotificationDev2 (std::string context, Time now, PhyEnumeration oldState, PhyEnumeration newState)
 Function called when a the PHY state changes in Dev2 [00:03].
 

Private Attributes

PhyEnumeration m_dev0State
 Stores the PHY state of device 0 [00:01].
 

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 PHY going to TRX_OFF after CSMA failure (MAC->RxOnWhenIdle(false))

Definition at line 43 of file lr-wpan-mac-test.cc.

Constructor & Destructor Documentation

◆ TestRxOffWhenIdleAfterCsmaFailure()

TestRxOffWhenIdleAfterCsmaFailure::TestRxOffWhenIdleAfterCsmaFailure ( )

Definition at line 89 of file lr-wpan-mac-test.cc.

◆ ~TestRxOffWhenIdleAfterCsmaFailure()

TestRxOffWhenIdleAfterCsmaFailure::~TestRxOffWhenIdleAfterCsmaFailure ( )
override

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

Member Function Documentation

◆ DataConfirm()

void TestRxOffWhenIdleAfterCsmaFailure::DataConfirm ( McpsDataConfirmParams  params)
private

Function called when a Data confirm is invoked (After Tx Attempt)

Parameters
paramsMCPS data confirm parameters

Definition at line 105 of file lr-wpan-mac-test.cc.

References NS_LOG_DEBUG.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ DataIndication()

void TestRxOffWhenIdleAfterCsmaFailure::DataIndication ( McpsDataIndicationParams  params,
Ptr< Packet p 
)
private

Function called when a Data indication is invoked.

Parameters
paramsMCPS data indication parameters
ppacket

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

References NS_LOG_DEBUG.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ DoRun()

void TestRxOffWhenIdleAfterCsmaFailure::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 144 of file lr-wpan-mac-test.cc.

References DataConfirm(), DataIndication(), ns3::Simulator::Destroy(), ns3::LOG_LEVEL_DEBUG, ns3::LOG_PREFIX_FUNC, ns3::LOG_PREFIX_TIME, ns3::LogComponentEnable(), ns3::LogComponentEnableAll(), m_dev0State, ns3::MakeCallback(), ns3::lrwpan::LrWpanMac::McpsDataRequest(), NS_LOG_DEBUG, NS_TEST_EXPECT_MSG_EQ, ns3::Simulator::Run(), ns3::Simulator::ScheduleWithContext(), ns3::Seconds(), ns3::lrwpan::SHORT_ADDR, StateChangeNotificationDev0(), and StateChangeNotificationDev2().

+ Here is the call graph for this function:

◆ StateChangeNotificationDev0()

void TestRxOffWhenIdleAfterCsmaFailure::StateChangeNotificationDev0 ( std::string  context,
Time  now,
PhyEnumeration  oldState,
PhyEnumeration  newState 
)
private

Function called when a the PHY state changes in Dev0 [00:01].

Parameters
contextcontext
nowtime at which the function is called
oldStateold PHY state
newStatenew PHY state

Definition at line 118 of file lr-wpan-mac-test.cc.

References ns3::Time::As(), ns3::LrWpanHelper::LrWpanPhyEnumerationPrinter(), m_dev0State, ns3::Simulator::Now(), NS_LOG_DEBUG, and ns3::Time::S.

Referenced by DoRun().

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

◆ StateChangeNotificationDev2()

void TestRxOffWhenIdleAfterCsmaFailure::StateChangeNotificationDev2 ( std::string  context,
Time  now,
PhyEnumeration  oldState,
PhyEnumeration  newState 
)
private

Function called when a the PHY state changes in Dev2 [00:03].

Parameters
contextcontext
nowtime at which the function is called
oldStateold PHY state
newStatenew PHY state

Definition at line 132 of file lr-wpan-mac-test.cc.

References ns3::Time::As(), ns3::LrWpanHelper::LrWpanPhyEnumerationPrinter(), ns3::Simulator::Now(), NS_LOG_DEBUG, and ns3::Time::S.

Referenced by DoRun().

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

Member Data Documentation

◆ m_dev0State

PhyEnumeration TestRxOffWhenIdleAfterCsmaFailure::m_dev0State
private

Stores the PHY state of device 0 [00:01].

Definition at line 86 of file lr-wpan-mac-test.cc.

Referenced by DoRun(), and StateChangeNotificationDev0().


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