|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
22 #include <ns3/command-line.h>
23 #include <ns3/packet.h>
24 #include <ns3/lr-wpan-phy.h>
25 #include <ns3/lr-wpan-mac.h>
26 #include <ns3/simulator.h>
27 #include <ns3/single-model-spectrum-channel.h>
28 #include <ns3/constant-position-mobility-model.h>
40 <<
" Received Set TRX Confirm: " << status);
55 <<
" Received frame size: " << psduLength <<
" LQI: " <<
73 int main (
int argc,
char *argv[])
76 cmd.Parse (argc, argv);
void GetSetTRXStateConfirm(LrWpanPhyEnumeration status)
Function called when a the PHY state change is confirmed.
Parse command-line arguments.
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.
@ LOG_LEVEL_ALL
Print everything.
void ReceivePdDataIndication(uint32_t psduLength, Ptr< Packet > p, uint8_t lqi)
Function called when a the PHY receives a packet.
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.
void PlmeSetTRXStateRequest(LrWpanPhyEnumeration state)
IEEE 802.15.4-2006 section 6.2.2.7 PLME-SET-TRX-STATE.request Set PHY state.
void SetChannel(Ptr< SpectrumChannel > c)
Set the channel attached to this device.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
void SendOnePacket(Ptr< LrWpanPhy > sender, Ptr< LrWpanPhy > receiver)
Send one packet.
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
LrWpanPhyEnumeration
IEEE802.15.4-2006 PHY Emumerations Table 18 in section 6.2.3.
@ IEEE_802_15_4_PHY_TX_ON
@ IEEE_802_15_4_PHY_RX_ON
void SetPlmeSetTRXStateConfirmCallback(PlmeSetTRXStateConfirmCallback c)
set the callback for the end of an SetTRXState, as part of the interconnections betweenthe PHY and th...
#define NS_LOG_UNCOND(msg)
Output the requested message unconditionally.
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.
void SetMobility(Ptr< MobilityModel > m)
Set the mobility model associated with this device.
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().
void SetPdDataIndicationCallback(PdDataIndicationCallback c)
set the callback for the end of a RX, as part of the interconnections betweenthe PHY and the MAC.
void PdDataRequest(const uint32_t psduLength, Ptr< Packet > p)
IEEE 802.15.4-2006 section 6.2.1.1 PD-DATA.request Request to transfer MPDU from MAC (transmitting)