16#include <ns3/constant-position-mobility-model.h>
17#include <ns3/core-module.h>
19#include <ns3/lr-wpan-module.h>
20#include <ns3/packet.h>
21#include <ns3/propagation-delay-model.h>
22#include <ns3/propagation-loss-model.h>
23#include <ns3/simulator.h>
24#include <ns3/single-model-spectrum-channel.h>
49 NS_LOG_UNCOND(
"LrWpanMcpsDataConfirmStatus = " << params.m_status);
71main(
int argc,
char* argv[])
78 cmd.AddValue(
"verbose",
"turn on all log components",
verbose);
79 cmd.AddValue(
"extended",
"use extended addressing",
extended);
81 cmd.Parse(argc, argv);
106 channel->AddPropagationLossModel(propModel);
107 channel->SetPropagationDelayModel(delayModel);
109 dev0->SetChannel(channel);
110 dev1->SetChannel(channel);
139 mac0->SetExtendedAddress(
Mac64Address(
"00:00:00:00:00:00:00:01"));
140 mac1->SetExtendedAddress(
Mac64Address(
"00:00:00:00:00:00:00:02"));
144 dev0->GetPhy()->TraceConnect(
"TrxState",
147 dev1->GetPhy()->TraceConnect(
"TrxState",
153 sender0Mobility->SetPosition(Vector(0, 0, 0));
154 dev0->GetPhy()->SetMobility(sender0Mobility);
158 sender1Mobility->SetPosition(Vector(0, 10, 0));
159 dev1->GetPhy()->SetMobility(sender1Mobility);
163 dev0->GetMac()->SetMcpsDataConfirmCallback(cb0);
167 dev0->GetMac()->SetMcpsDataIndicationCallback(cb1);
171 dev1->GetMac()->SetMcpsDataConfirmCallback(cb2);
175 dev1->GetMac()->SetMcpsDataIndicationCallback(cb3);
Parse command-line arguments.
static std::string LrWpanPhyEnumerationPrinter(lrwpan::PhyEnumeration e)
Transform the LrWpanPhyEnumeration enumeration into a printable string.
This class can contain 16 bit addresses.
Smart pointer class similar to boost::intrusive_ptr.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void ScheduleWithContext(uint32_t context, const Time &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
static void Run()
Run the simulation.
Simulation virtual time values and global simulation resolution.
TimeWithUnit As(const Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
void McpsDataRequest(McpsDataRequestParams params, Ptr< Packet > p) override
IEEE 802.15.4-2006, section 7.1.1.1 MCPS-DATA.request Request to transfer a MSDU.
#define NS_LOG_UNCOND(msg)
Output the requested message unconditionally.
PhyEnumeration
IEEE802.15.4-2006 PHY Emumerations Table 18 in section 6.2.3.
@ TX_OPTION_ACK
TX_OPTION_ACK.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Time Seconds(double value)
Construct a Time in the indicated unit.
static void DataConfirm(McpsDataConfirmParams params)
Function called when a Data confirm is invoked.
static void StateChangeNotification(std::string context, Time now, PhyEnumeration oldState, PhyEnumeration newState)
Function called when a the PHY state changes.
static void DataIndication(McpsDataIndicationParams params, Ptr< Packet > p)
Function called when a Data indication is invoked.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void LogComponentEnable(const std::string &name, LogLevel level)
Enable the logging output associated with that log component.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
LogLevel
Logging severity classes and levels.
@ LOG_LEVEL_ALL
Print everything.
@ LOG_PREFIX_FUNC
Prefix all trace prints with function.
@ LOG_PREFIX_TIME
Prefix all trace prints with simulation time.
void LogComponentEnableAll(LogLevel level)
Enable the logging output for all registered log components.
params
Fit Fluctuating Two Ray model to the 3GPP TR 38.901 using the Anderson-Darling goodness-of-fit ##.
MCPS-DATA.confirm params.
MCPS-DATA.indication params.
MCPS-DATA.request params.