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"
50 virtual void DoRun (
void);
60 :
TestCase (
"Test the 802.15.4 ACK handling")
78 params.m_dstPanId = 0;
80 params.m_msduHandle = 0;
84 dev->
GetMac ()->McpsDataRequest (params, p);
119 RngSeedManager::SetSeed (1);
120 RngSeedManager::SetRun (6);
130 dev0->AssignStreams (0);
131 dev1->AssignStreams (10);
143 dev0->SetChannel (channel);
144 dev1->SetChannel (channel);
148 n1->AddDevice (dev1);
152 dev0->GetPhy ()->SetMobility (sender0Mobility);
156 dev1->GetPhy ()->SetMobility (sender1Mobility);
160 dev0->GetMac ()->SetMcpsDataConfirmCallback (cb0);
164 dev0->GetMac ()->SetMcpsDataIndicationCallback (cb1);
168 dev1->GetMac ()->SetMcpsDataConfirmCallback (cb2);
172 dev1->GetMac ()->SetMcpsDataIndicationCallback (cb3);
178 params.m_dstPanId = 0;
180 params.m_msduHandle = 0;
183 Simulator::ScheduleNow (&LrWpanMac::McpsDataRequest, dev0->GetMac (), params, p0);
192 Simulator::Destroy ();
static LrWpanAckTestSuite g_lrWpanAckTestSuite
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.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
virtual void AddPropagationLossModel(Ptr< PropagationLossModel > loss)
Set the single-frequency propagation loss model to be used.
static void DataIndication(LrWpanAckTestCase *testCase, Ptr< LrWpanNetDevice > dev, McpsDataIndicationParams params, Ptr< Packet > p)
static void DataIndication(McpsDataIndicationParams params, Ptr< Packet > p)
static void DataConfirm(LrWpanAckTestCase *testCase, Ptr< LrWpanNetDevice > dev, McpsDataConfirmParams params)
void AddTestCase(TestCase *testCase, enum TestDuration duration)
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.
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.
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 Now(void)
create an ns3::Time instance which contains the current simulation time.
MCPS-DATA.request params.
static void DataConfirm(McpsDataConfirmParams params)
MCPS-DATA.indication params.
Ptr< LrWpanMac > GetMac(void) const
Get the MAC used by this NetDevice.