38 #include <ns3/core-module.h>
39 #include <ns3/lr-wpan-module.h>
40 #include <ns3/propagation-loss-model.h>
41 #include <ns3/propagation-delay-model.h>
42 #include <ns3/simulator.h>
43 #include <ns3/single-model-spectrum-channel.h>
44 #include <ns3/constant-position-mobility-model.h>
45 #include <ns3/packet.h>
84 int main (
int argc,
char *argv[])
109 channel->AddPropagationLossModel (propModel);
110 channel->SetPropagationDelayModel (delayModel);
120 sender0Mobility->SetPosition (Vector (0,0,0));
121 dev0->
GetPhy ()->SetMobility (sender0Mobility);
124 sender1Mobility->SetPosition (Vector (0,10,0));
125 dev1->
GetPhy ()->SetMobility (sender1Mobility);
132 dev0->
GetMac ()->SetMlmeStartConfirmCallback (cb0);
136 dev1->
GetMac ()->SetMcpsDataConfirmCallback (cb1);
140 dev1->
GetMac ()->SetMlmeBeaconNotifyIndicationCallback (cb3);
144 dev1->
GetMac ()->SetMcpsDataIndicationCallback (cb4);
148 dev0->
GetMac ()->SetMcpsDataIndicationCallback (cb5);
159 dev1->
GetMac ()->SetPanId (5);
203 dev1->
GetMac (), params2, p1);
helps to manage and create IEEE 802.15.4 NetDevice objects
void MlmeStartRequest(MlmeStartRequestParams params)
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)
IEEE 802.15.4-2006, section 7.1.1.1 MCPS-DATA.request Request to transfer a MSDU.
virtual void SetAddress(Address address)
This method indirects to LrWpanMac::SetShortAddress ()
void SetChannel(Ptr< SpectrumChannel > channel)
Set the channel to which the NetDevice, and therefore the PHY, should be attached to.
Ptr< LrWpanPhy > GetPhy(void) const
Get the PHY used by this NetDevice.
Ptr< LrWpanMac > GetMac(void) const
Get the MAC used by this NetDevice.
This class can contain 16 bit addresses.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
static void ScheduleWithContext(uint32_t context, Time const &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
static void Run(void)
Run the simulation.
static Time Now(void)
Return the current simulation virtual time.
#define NS_LOG_UNCOND(msg)
Output the requested message unconditionally.
Time Seconds(double value)
Construct a Time in the indicated unit.
static void DataIndicationCoordinator(McpsDataIndicationParams params, Ptr< Packet > p)
static void StartConfirm(MlmeStartConfirmParams params)
static void DataIndication(McpsDataIndicationParams params, Ptr< Packet > p)
static void TransEndIndication(McpsDataConfirmParams params)
static void BeaconIndication(MlmeBeaconNotifyIndicationParams params, Ptr< Packet > p)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
@ 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 LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component.
void LogComponentEnableAll(enum LogLevel level)
Enable the logging output for all registered log components.
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
MCPS-DATA.confirm params.
LrWpanMcpsDataConfirmStatus m_status
The status of the last MSDU transmission.
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.
LrWpanMlmeStartConfirmStatus m_status
The status of a MLME-start.request.
MLME-START.request params.
bool m_panCoor
On true this device will become coordinator.
uint8_t m_bcnOrd
Beacon Order, Used to calculate the beacon interval, a value of 15 indicates no periodic beacons will...
uint16_t m_PanId
Pan Identifier used by the device.
uint8_t m_sfrmOrd
Superframe Order, indicates the length of the CAP in time slots.