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>
59 <<
" secs | Received DATA packet of size " << p->
GetSize());
77 <<
"s Coordinator Received DATA packet (size " << p->
GetSize() <<
" bytes)");
90main(
int argc,
char* argv[])
111 CreateObject<LogDistancePropagationLossModel>();
113 CreateObject<ConstantSpeedPropagationDelayModel>();
114 channel->AddPropagationLossModel(propModel);
115 channel->SetPropagationDelayModel(delayModel);
125 CreateObject<ConstantPositionMobilityModel>();
126 sender0Mobility->SetPosition(
Vector(0, 0, 0));
127 dev0->
GetPhy()->SetMobility(sender0Mobility);
129 CreateObject<ConstantPositionMobilityModel>();
131 sender1Mobility->SetPosition(
Vector(0, 10, 0));
132 dev1->
GetPhy()->SetMobility(sender1Mobility);
138 dev0->
GetMac()->SetMlmeStartConfirmCallback(cb0);
142 dev1->
GetMac()->SetMcpsDataConfirmCallback(cb1);
146 dev1->
GetMac()->SetMlmeBeaconNotifyIndicationCallback(cb3);
150 dev1->
GetMac()->SetMcpsDataIndicationCallback(cb4);
154 dev0->
GetMac()->SetMcpsDataIndicationCallback(cb5);
163 dev1->
GetMac()->SetPanId(5);
173 Simulator::ScheduleWithContext(1,
175 &LrWpanMac::MlmeStartRequest,
205 Simulator::ScheduleWithContext(1,
207 &LrWpanMac::McpsDataRequest,
215 Simulator::Destroy();
helps to manage and create IEEE 802.15.4 NetDevice objects
void SetChannel(Ptr< SpectrumChannel > channel)
Set the channel to which the NetDevice, and therefore the PHY, should be attached to.
Ptr< LrWpanMac > GetMac() const
Get the MAC used by this NetDevice.
Ptr< LrWpanPhy > GetPhy() const
Get the PHY used by this NetDevice.
void SetAddress(Address address) override
This method indirects to LrWpanMac::SetShortAddress ()
This class can contain 16 bit addresses.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
uint32_t GetSize() const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Vector3D Vector
Vector alias typedef for compatibility with mobility models.
#define NS_LOG_UNCOND(msg)
Output the requested message unconditionally.
Time Now()
create an ns3::Time instance which contains the current simulation time.
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.
LrWpanAddressMode m_srcAddrMode
Source address mode.
LrWpanAddressMode m_dstAddrMode
Destination address mode.
uint16_t m_dstPanId
Destination PAN identifier.
Mac16Address m_dstAddr
Destination address.
uint8_t m_msduHandle
MSDU handle.
MLME-BEACON-NOTIFY.indication params.
MLME-START.confirm params.
MLME-START.request params.