23 #include <ns3/core-module.h>
24 #include <ns3/lr-wpan-module.h>
25 #include <ns3/propagation-loss-model.h>
26 #include <ns3/propagation-delay-model.h>
27 #include <ns3/simulator.h>
28 #include <ns3/single-model-spectrum-channel.h>
29 #include <ns3/constant-position-mobility-model.h>
30 #include <ns3/packet.h>
31 #include "ns3/rng-seed-manager.h"
72 virtual void DoRun (
void);
82 :
TestCase (
"Test the 802.15.4 ACK handling")
100 params.m_dstPanId = 0;
102 params.m_msduHandle = 0;
106 dev->
GetMac ()->McpsDataRequest (params, p);
141 RngSeedManager::SetSeed (1);
142 RngSeedManager::SetRun (6);
152 dev0->AssignStreams (0);
153 dev1->AssignStreams (10);
165 dev0->SetChannel (channel);
166 dev1->SetChannel (channel);
170 n1->AddDevice (dev1);
174 dev0->GetPhy ()->SetMobility (sender0Mobility);
178 dev1->GetPhy ()->SetMobility (sender1Mobility);
182 dev0->GetMac ()->SetMcpsDataConfirmCallback (cb0);
186 dev0->GetMac ()->SetMcpsDataIndicationCallback (cb1);
190 dev1->GetMac ()->SetMcpsDataConfirmCallback (cb2);
194 dev1->GetMac ()->SetMcpsDataIndicationCallback (cb3);
200 params.m_dstPanId = 0;
202 params.m_msduHandle = 0;
205 Simulator::ScheduleNow (&LrWpanMac::McpsDataRequest, dev0->GetMac (), params, p0);
214 Simulator::Destroy ();
static LrWpanAckTestSuite g_lrWpanAckTestSuite
Static variable for test initialization.
Simulation virtual time values and global simulation resolution.
Smart pointer class similar to boost::intrusive_ptr.
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument.
Time m_replyArrivalTime
Reply arrival time.
Time m_requestAckTime
Request ack time.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
virtual void AddPropagationLossModel(Ptr< PropagationLossModel > loss)
Add the single-frequency propagation loss model to be used.
static void DataIndication(LrWpanAckTestCase *testCase, Ptr< LrWpanNetDevice > dev, McpsDataIndicationParams params, Ptr< Packet > p)
Function called when DataIndication is hit.
static void DataIndication(McpsDataIndicationParams params, Ptr< Packet > p)
static void DataConfirm(LrWpanAckTestCase *testCase, Ptr< LrWpanNetDevice > dev, McpsDataConfirmParams params)
Function called when DataConfirm is hit.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
MCPS-DATA.confirm params.
uint8_t m_srcAddrMode
Source address mode.
LrWpanAddressMode m_srcAddrMode
Source address mode.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void DoRun(void)
Implementation to actually run this TestCase.
This class can contain 16 bit addresses.
void SetPosition(const Vector &position)
virtual Address GetAddress(void) const
This method indirects to LrWpanMac::SetShortAddress ()
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time m_replyTime
Reply time.
virtual void SetPropagationDelayModel(Ptr< PropagationDelayModel > delay)
Set the propagation delay model to be used.
#define NS_TEST_EXPECT_MSG_LT(actual, limit, msg)
Test that an actual value is less than a limit and report if not.
Time m_replyAckTime
Reply ack time.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
MCPS-DATA.request params.
Time m_requestTime
Request time.
static void DataConfirm(McpsDataConfirmParams params)
MCPS-DATA.indication params.
Ptr< LrWpanMac > GetMac(void) const
Get the MAC used by this NetDevice.