|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
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);
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);
203 dev1->
GetMac (), params2, p1);
helps to manage and create IEEE 802.15.4 NetDevice objects
bool m_panCoor
On true this device will become coordinator.
@ LOG_LEVEL_INFO
LOG_INFO and above.
static void ScheduleWithContext(uint32_t context, Time const &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
static Time Now(void)
Return the current simulation virtual time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
This class can contain 16 bit addresses.
LrWpanAddressMode m_dstAddrMode
Destination address mode.
uint16_t m_dstPanId
Destination PAN identifier.
void SetPosition(const Vector &position)
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.
static void DataIndication(McpsDataIndicationParams params, Ptr< Packet > p)
MLME-START.request params.
MLME-BEACON-NOTIFY.indication params.
uint8_t m_sfrmOrd
Superframe Order, indicates the length of the CAP in time slots.
MCPS-DATA.confirm params.
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
uint8_t m_bcnOrd
Beacon Order, Used to calculate the beacon interval, a value of 15 indicates no periodic beacons will...
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...
uint16_t m_PanId
Pan Identifier used by the device.
Ptr< LrWpanPhy > GetPhy(void) const
Get the PHY used by this NetDevice.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
#define NS_LOG_UNCOND(msg)
Output the requested message unconditionally.
void SetChannel(Ptr< SpectrumChannel > channel)
Set the channel to which the NetDevice, and therefore the PHY, should be attached to.
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...
static void Run(void)
Run the simulation.
@ LOG_PREFIX_TIME
Prefix all trace prints with simulation time.
MCPS-DATA.indication params.
Time Seconds(double value)
Construct a Time in the indicated unit.
@ LOG_PREFIX_FUNC
Prefix all trace prints with function.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
LrWpanMcpsDataConfirmStatus m_status
The status of the last MSDU transmission.
LrWpanAddressMode m_srcAddrMode
Source address mode.
Mac16Address m_dstAddr
Destination address.
virtual void SetAddress(Address address)
This method indirects to LrWpanMac::SetShortAddress ()
static void StartConfirm(MlmeStartConfirmParams params)
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.
MCPS-DATA.request params.
LrWpanMlmeStartConfirmStatus m_status
The status of a MLME-start.request.
Ptr< LrWpanMac > GetMac(void) const
Get the MAC used by this NetDevice.
static void DataIndicationCoordinator(McpsDataIndicationParams params, Ptr< Packet > p)
static void BeaconIndication(MlmeBeaconNotifyIndicationParams params, Ptr< Packet > p)
MLME-START.confirm params.
static void TransEndIndication(McpsDataConfirmParams params)
uint8_t m_msduHandle
MSDU handle.