22 #include <ns3/packet.h>
23 #include <ns3/lr-wpan-phy.h>
24 #include <ns3/lr-wpan-mac.h>
25 #include <ns3/simulator.h>
26 #include <ns3/single-model-spectrum-channel.h>
27 #include <ns3/constant-position-mobility-model.h>
34 <<
" Received Set TRX Confirm: " << status);
43 <<
" Received frame size: " << psduLength <<
" LQI: " <<
55 int main (
int argc,
char *argv[])
66 receiver->SetChannel (channel);
67 channel->AddRx (sender);
68 channel->AddRx (receiver);
74 receiver->SetMobility (senderMobility);
void ReceivePdDataIndication(uint32_t psduLength, Ptr< Packet > p, uint8_t lqi)
void LogComponentEnableAll(enum LogLevel level)
Enable the logging output for all registered log components.
void SetPlmeSetTRXStateConfirmCallback(PlmeSetTRXStateConfirmCallback c)
set the callback for the end of an SetTRXState, as part of the interconnections betweenthe PHY and th...
static void Run(void)
Run the simulation until one of:
void GetSetTRXStateConfirm(LrWpanPhyEnumeration status)
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
void SetChannel(Ptr< SpectrumChannel > c)
Set the channel attached to this device.
int main(int argc, char *argv[])
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
static void Destroy(void)
Every event scheduled by the Simulator::insertAtDestroy method is invoked.
void PlmeSetTRXStateRequest(LrWpanPhyEnumeration state)
IEEE 802.15.4-2006 section 6.2.2.7 PLME-SET-TRX-STATE.request Set PHY state.
void SetMobility(Ptr< MobilityModel > m)
Set the mobility model associated with this device.
prefix all trace prints with function
#define NS_LOG_UNCOND(msg)
Output the requested message unconditionaly.
void SendOnePacket(Ptr< LrWpanPhy > sender, Ptr< LrWpanPhy > receiver)
static Time Now(void)
Return the "current simulation time".
static void Stop(void)
If an event invokes this method, it will be the last event scheduled by the Simulator::run method bef...
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) ...
LrWpanPhyEnumeration
IEEE802.15.4-2006 PHY Emumerations Table 18 in section 6.2.3.
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component.