35#include <ns3/constant-position-mobility-model.h>
36#include <ns3/core-module.h>
38#include <ns3/lr-wpan-module.h>
39#include <ns3/packet.h>
40#include <ns3/propagation-delay-model.h>
41#include <ns3/propagation-loss-model.h>
42#include <ns3/simulator.h>
43#include <ns3/single-model-spectrum-channel.h>
60 <<
" secs | Received DATA packet of size " << p->GetSize());
68 if (params.m_status == MacStatus::SUCCESS)
78 <<
"s Coordinator Received DATA packet (size " << p->GetSize() <<
" bytes)");
84 if (params.m_status == MacStatus::SUCCESS)
91main(
int argc,
char* argv[])
112 CreateObject<LogDistancePropagationLossModel>();
114 CreateObject<ConstantSpeedPropagationDelayModel>();
115 channel->AddPropagationLossModel(propModel);
116 channel->SetPropagationDelayModel(delayModel);
118 dev0->SetChannel(channel);
119 dev1->SetChannel(channel);
126 CreateObject<ConstantPositionMobilityModel>();
127 sender0Mobility->SetPosition(Vector(0, 0, 0));
128 dev0->GetPhy()->SetMobility(sender0Mobility);
130 CreateObject<ConstantPositionMobilityModel>();
132 sender1Mobility->SetPosition(Vector(0, 10, 0));
133 dev1->GetPhy()->SetMobility(sender1Mobility);
139 dev0->GetMac()->SetMlmeStartConfirmCallback(cb0);
143 dev1->GetMac()->SetMcpsDataConfirmCallback(cb1);
147 dev1->GetMac()->SetMlmeBeaconNotifyIndicationCallback(cb3);
151 dev1->GetMac()->SetMcpsDataIndicationCallback(cb4);
155 dev0->GetMac()->SetMcpsDataIndicationCallback(cb5);
164 dev1->GetMac()->SetPanId(5);
165 dev1->GetMac()->SetAssociatedCoor(
Mac16Address(
"00:01"));
helps to manage and create IEEE 802.15.4 NetDevice objects
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 Time Now()
Return the current simulation virtual time.
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
void MlmeStartRequest(MlmeStartRequestParams params) override
IEEE 802.15.4-2006, section 7.1.14.1 MLME-START.request Request to allow a PAN coordinator to initiat...
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.
Time Seconds(double value)
Construct a Time in the indicated unit.
void DataIndicationCoordinator(McpsDataIndicationParams params, Ptr< Packet > p)
void BeaconIndication(MlmeBeaconNotifyIndicationParams params)
void TransEndIndication(McpsDataConfirmParams params)
void StartConfirm(MlmeStartConfirmParams params)
void DataIndication(McpsDataIndicationParams params, Ptr< Packet > p)
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...
@ LOG_PREFIX_FUNC
Prefix all trace prints with function.
@ LOG_PREFIX_TIME
Prefix all trace prints with simulation time.
@ LOG_LEVEL_INFO
LOG_INFO and above.
void LogComponentEnableAll(LogLevel level)
Enable the logging output for all registered log components.
FtrParams 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.
AddressMode m_dstAddrMode
Destination address mode.
Mac16Address m_dstAddr
Destination address.
uint16_t m_dstPanId
Destination PAN identifier.
AddressMode m_srcAddrMode
Source address mode.
uint8_t m_msduHandle
MSDU handle.
MLME-BEACON-NOTIFY.indication params.
MLME-START.confirm params.
MLME-START.request params.