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);
116 n1->AddDevice (dev1);
121 dev0->GetPhy ()->SetMobility (sender0Mobility);
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);
160 dev1->GetMac ()->SetAssociatedCoor (
Mac16Address (
"00:01"));
173 dev0->GetMac (), params);
183 params2.m_msduHandle = 0;
203 dev1->GetMac (), params2, p1);
uint16_t m_dstPanId
Destination PAN identifier.
static void TransEndIndication(McpsDataConfirmParams params)
static void BeaconIndication(MlmeBeaconNotifyIndicationParams params, Ptr< Packet > p)
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
static void Run(void)
Run the simulation.
static void DataIndication(McpsDataIndicationParams params, Ptr< Packet > p)
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. ...
MLME-START.request params.
MLME-BEACON-NOTIFY.indication params.
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 LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component.
uint8_t m_sfrmOrd
Superframe Order, indicates the length of the CAP in time slots.
MCPS-DATA.confirm params.
uint8_t m_bcnOrd
Beacon Order, Used to calculate the beacon interval, a value of 15 indicates no periodic beacons will...
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.
uint16_t m_PanId
Pan Identifier used by the device.
LrWpanMcpsDataConfirmStatus m_status
The status of the last MSDU transmission.
void LogComponentEnableAll(enum LogLevel level)
Enable the logging output for all registered log components.
Prefix all trace prints with simulation time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
#define NS_LOG_UNCOND(msg)
Output the requested message unconditionally.
This class can contain 16 bit addresses.
static Time Now(void)
Return the current simulation virtual time.
void SetPosition(const Vector &position)
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
Prefix all trace prints with function.
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
Time Seconds(double value)
Construct a Time in the indicated unit.
static void StartConfirm(MlmeStartConfirmParams params)
bool m_panCoor
On true this device will become coordinator.
MCPS-DATA.request params.
LrWpanMlmeStartConfirmStatus m_status
The status of a MLME-start.request.
helps to manage and create IEEE 802.15.4 NetDevice objects
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...
MLME-START.confirm params.
MCPS-DATA.indication params.
static void DataIndicationCoordinator(McpsDataIndicationParams params, Ptr< Packet > p)