8#include <ns3/command-line.h>
9#include <ns3/constant-position-mobility-model.h>
11#include <ns3/lr-wpan-mac.h>
12#include <ns3/lr-wpan-phy.h>
13#include <ns3/packet.h>
14#include <ns3/simulator.h>
15#include <ns3/single-model-spectrum-channel.h>
41 <<
" LQI: " << (uint16_t)lqi);
54 sender->PdDataRequest(p->GetSize(), p);
58main(
int argc,
char* argv[])
61 cmd.Parse(argc, argv);
71 sender->SetChannel(channel);
72 receiver->SetChannel(channel);
79 sender->SetMobility(senderMobility);
82 receiver->SetMobility(receiverMobility);
Parse command-line arguments.
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
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.
#define NS_LOG_UNCOND(msg)
Output the requested message unconditionally.
PhyEnumeration
IEEE802.15.4-2006 PHY Emumerations Table 18 in section 6.2.3.
@ IEEE_802_15_4_PHY_RX_ON
@ IEEE_802_15_4_PHY_TX_ON
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 SendOnePacket(Ptr< LrWpanPhy > sender, Ptr< LrWpanPhy > receiver)
Send one packet.
void ReceivePdDataIndication(uint32_t psduLength, Ptr< Packet > p, uint8_t lqi)
Function called when a the PHY receives a packet.
void GetSetTRXStateConfirm(PhyEnumeration status)
Function called when a the PHY state change is confirmed.
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_LEVEL_ALL
Print everything.
@ LOG_PREFIX_FUNC
Prefix all trace prints with function.
void LogComponentEnableAll(LogLevel level)
Enable the logging output for all registered log components.