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" 70 virtual void DoRun (
void);
80 :
TestCase (
"Lrwpan: IFS with and without ACK")
151 channel->AddPropagationLossModel (propModel);
152 channel->SetPropagationDelayModel (delayModel);
159 n1->AddDevice (dev1);
167 dev0->GetPhy ()->SetMobility (sender0Mobility);
171 dev1->GetPhy ()->SetMobility (sender1Mobility);
175 dev0->GetMac ()->SetMcpsDataConfirmCallback (cb0);
184 params.m_msduHandle = 0;
190 Simulator::ScheduleWithContext (1,
Seconds (0.0),
191 &LrWpanMac::McpsDataRequest,
192 dev0->GetMac (), params, p0);
205 p0 = Create<Packet> (6);
207 Simulator::ScheduleWithContext (1,
Seconds (0.0),
208 &LrWpanMac::McpsDataRequest,
209 dev0->GetMac (), params, p0);
223 p0 = Create<Packet> (2);
225 Simulator::ScheduleWithContext (1,
Seconds (0.0),
226 &LrWpanMac::McpsDataRequest,
227 dev0->GetMac (), params, p0);
240 p0 = Create<Packet> (6);
242 Simulator::ScheduleWithContext (1,
Seconds (0.0),
243 &LrWpanMac::McpsDataRequest,
244 dev0->GetMac (), params, p0);
255 Simulator::Destroy ();
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
uint16_t m_dstPanId
Destination PAN identifier.
Simulation virtual time values and global simulation resolution.
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
virtual ~LrWpanDataIfsTestCase()
virtual void SetAddress(Address address)
This method indirects to LrWpanMac::SetShortAddress ()
static void MacState(LrWpanDataIfsTestCase *testcase, Ptr< LrWpanNetDevice > dev, LrWpanMacState oldValue, LrWpanMacState newValue)
static void DataConfirm(LrWpanDataIfsTestCase *testcase, Ptr< LrWpanNetDevice > dev, McpsDataConfirmParams params)
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
MCPS-DATA.confirm params.
static LrWpanIfsTestSuite lrWpanIfsTestSuite
Static variable for test initialization.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
LrWpan Dataframe transmission with Interframe Space.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
This class can contain 16 bit addresses.
void SetPosition(const Vector &position)
static void DataReceived(LrWpanDataIfsTestCase *testcase, Ptr< LrWpanNetDevice > dev, Ptr< const Packet >)
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 DoRun(void)
Implementation to actually run this TestCase.
Time m_ackRxTime
The time of the received acknoledgment.
LrWpanMacState
MAC states.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
MCPS-DATA.request params.
Time m_endIfs
The time where the Interframe Space ended.
static void DataConfirm(McpsDataConfirmParams params)
Time m_lastTxTime
The time of the last transmitted packet.