19 #include <ns3/command-line.h>
20 #include <ns3/constant-position-mobility-model.h>
22 #include <ns3/lr-wpan-mac.h>
23 #include <ns3/lr-wpan-phy.h>
24 #include <ns3/packet.h>
25 #include <ns3/simulator.h>
26 #include <ns3/single-model-spectrum-channel.h>
51 <<
" LQI: " << (uint16_t)lqi);
64 sender->PdDataRequest(p->
GetSize(), p);
68 main(
int argc,
char* argv[])
71 cmd.Parse(argc, argv);
88 CreateObject<ConstantPositionMobilityModel>();
89 sender->SetMobility(senderMobility);
91 CreateObject<ConstantPositionMobilityModel>();
92 receiver->SetMobility(receiverMobility);
Parse command-line arguments.
uint32_t GetSize() const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
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.
LrWpanPhyEnumeration
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
Time Seconds(double value)
Construct a Time in the indicated unit.
void GetSetTRXStateConfirm(LrWpanPhyEnumeration status)
Function called when a the PHY state change is confirmed.
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.
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.