24#include <ns3/constant-position-mobility-model.h>
25#include <ns3/core-module.h>
27#include <ns3/lr-wpan-module.h>
28#include <ns3/packet.h>
29#include <ns3/propagation-delay-model.h>
30#include <ns3/propagation-loss-model.h>
31#include <ns3/simulator.h>
32#include <ns3/single-model-spectrum-channel.h>
49 <<
" secs | Received DATA packet of size " << p->GetSize());
57 if (params.m_status == MacStatus::SUCCESS)
67 <<
"s Coordinator Received DATA packet (size " << p->GetSize() <<
" bytes)");
73 if (params.m_status == MacStatus::SUCCESS)
80main(
int argc,
char* argv[])
107 sender0Mobility->SetPosition(Vector(0, 0, 0));
108 dev0->GetPhy()->SetMobility(sender0Mobility);
112 sender1Mobility->SetPosition(Vector(0, 10, 0));
113 dev1->GetPhy()->SetMobility(sender1Mobility);
119 dev0->GetMac()->SetMlmeStartConfirmCallback(cb0);
123 dev1->GetMac()->SetMcpsDataConfirmCallback(cb1);
127 dev1->GetMac()->SetMlmeBeaconNotifyIndicationCallback(cb3);
131 dev1->GetMac()->SetMcpsDataIndicationCallback(cb4);
135 dev0->GetMac()->SetMcpsDataIndicationCallback(cb5);
144 dev1->GetMac()->SetPanId(5);
145 dev1->GetMac()->SetAssociatedCoor(
Mac16Address(
"00:01"));
helps to manage and create IEEE 802.15.4 NetDevice objects
NetDeviceContainer Install(NodeContainer c)
Install a LrWpanNetDevice and the associated structures (e.g., channel) in the nodes.
void SetPropagationDelayModel(std::string name, Ts &&... args)
void AddPropagationLossModel(std::string name, Ts &&... args)
This class can contain 16 bit addresses.
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
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.
Network layer to device interface.
#define NS_LOG_UNCOND(msg)
Output the requested message unconditionally.
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.
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.
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.