|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
26 #include "ns3/object.h"
27 #include "ns3/uan-mac.h"
28 #include "ns3/uan-tx-mode.h"
29 #include "ns3/uan-prop-model.h"
30 #include "ns3/uan-transducer.h"
31 #include "ns3/device-energy-model.h"
74 virtual void Clear (
void);
82 inline double DbToKp (
double db)
const
84 return std::pow (10, db / 10.0);
92 inline double KpToDb (
double kp)
const
94 return 10 * std::log10 (kp);
130 virtual void Clear (
void);
a unique identifier for an interface.
virtual void NotifyRxStart(void)=0
Called when UanPhy begins receiving packet.
virtual bool IsStateIdle(void)=0
virtual uint32_t GetNModes(void)=0
Get the number of transmission modes supported by this Phy.
virtual void EnergyDepletionHandler(void)=0
Handle the energy depletion event.
virtual void DoDispose(void)
Destructor implementation.
void NotifyTxEnd(Ptr< const Packet > packet)
Called when the transducer finishes transmitting a packet.
The power delay profile returned by propagation models.
virtual void SetMac(Ptr< UanMac > mac)=0
Set the MAC forwarding messages to this Phy.
virtual Ptr< UanNetDevice > GetDevice(void) const =0
Get the device hosting this Phy.
virtual double CalcSinrDb(Ptr< Packet > pkt, Time arrTime, double rxPowerDb, double ambNoiseDb, UanTxMode mode, UanPdp pdp, const UanTransducer::ArrivalList &arrivalList) const =0
Calculate the SINR value for a packet.
void NotifyTxDrop(Ptr< const Packet > packet)
Called when the transducer attempts to transmit a new packet while already transmitting a prior packe...
virtual bool IsStateRx(void)=0
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< void, Ptr< Packet >, double > RxErrCallback
Packet receive error callback function type.
virtual void StartRxPacket(Ptr< Packet > pkt, double rxPowerDb, UanTxMode txMode, UanPdp pdp)=0
Packet arriving from channel: i.e.
virtual bool IsStateCcaBusy(void)=0
virtual ~UanPhyListener()
Default destructor.
virtual bool IsStateBusy(void)=0
virtual void SetTxPowerDb(double txpwr)=0
Set the transmit power.
virtual void Clear(void)=0
Clear all pointer references.
void NotifyRxDrop(Ptr< const Packet > packet)
Called when the Phy drops a packet.
virtual Ptr< Packet > GetPacketRx(void) const =0
Get the packet currently being received.
ns3::TracedCallback< Ptr< const Packet > > m_phyRxDropTrace
Trace source indicating a packet has been dropped by the device during reception.
virtual void NotifyRxEndOk(void)=0
Called when UanPhy finishes receiving packet without error.
virtual void Clear(void)
Clear all pointer references.
ns3::TracedCallback< Ptr< const Packet > > m_phyTxBeginTrace
Trace source indicating a packet has begun transmitting over the channel medium.
static TypeId GetTypeId(void)
Register this type.
Callback< void, Ptr< Packet >, double, UanTxMode > RxOkCallback
Packet received successfully callback function type.
virtual void NotifyTxStart(Time duration)=0
Called when transmission starts from Phy object.
Base class for UAN Phy models.
virtual double GetTxPowerDb(void)=0
Get the current transmit power, in dB.
ns3::TracedCallback< Ptr< const Packet > > m_phyRxEndTrace
Trace source indicating a packet has been completely received from the channel medium by the device.
virtual void SetDevice(Ptr< UanNetDevice > device)=0
Set the device hosting this Phy.
static TypeId GetTypeId(void)
Register this type.
virtual void SetReceiveOkCallback(RxOkCallback cb)=0
Set the callback to be used when a packet is received without error.
Calculate packet error probability, based on received SINR and modulation (mode).
ns3::TracedCallback< Ptr< const Packet > > m_phyTxEndTrace
Trace source indicating a packet has been completely transmitted over the channel.
virtual Ptr< UanTransducer > GetTransducer(void)=0
Get the attached transducer.
A base class which provides memory management and object aggregation.
virtual Ptr< UanChannel > GetChannel(void) const =0
Get the attached channel.
void NotifyRxBegin(Ptr< const Packet > packet)
Called when the Phy begins to receive a packet.
virtual void SetEnergyModelCallback(DeviceEnergyModel::ChangeStateCallback callback)=0
Set the DeviceEnergyModel callback for UanPhy device.
virtual void SetChannel(Ptr< UanChannel > channel)=0
Attach to a channel.
virtual void NotifyCcaEnd(void)=0
Called when UanPhy stops sensing channel is busy.
Simulation virtual time values and global simulation resolution.
Abstraction of packet modulation information.
State
Enum defining possible Phy states.
virtual void SetReceiveErrorCallback(RxErrCallback cb)=0
Set the callback to be used when a packet is received with errors.
double KpToDb(double kp) const
Convert kilopascals to dB re 1 uPa.
virtual UanTxMode GetMode(uint32_t n)=0
Get a specific transmission mode.
void NotifyRxEnd(Ptr< const Packet > packet)
Called when a packet is received without error.
virtual bool IsStateSleep(void)=0
virtual void Clear(void)
Clear all pointer references.
virtual bool IsStateTx(void)=0
static TypeId GetTypeId(void)
Register this type.
virtual void DoDispose(void)
Destructor implementation.
virtual double CalcPer(Ptr< Packet > pkt, double sinrDb, UanTxMode mode)=0
Calculate the packet error probability based on SINR at the receiver and a tx mode.
virtual void RegisterListener(UanPhyListener *listener)=0
Register a UanPhyListener to be notified of common UanPhy events.
virtual void NotifyCcaStart(void)=0
Called when UanPhy begins sensing channel is busy.
Interface for PHY event listener.
virtual void SetTransducer(Ptr< UanTransducer > trans)=0
Attach a transducer to this Phy.
std::list< UanPacketArrival > ArrivalList
List of arriving packets overlapping in time.
virtual void EnergyRechargeHandler(void)=0
Handle the energy recharge event.
virtual void SendPacket(Ptr< Packet > pkt, uint32_t modeNum)=0
Send a packet using a specific transmission mode.
virtual int64_t AssignStreams(int64_t stream)=0
Assign a fixed random variable stream number to the random variables used by this model.
virtual void NotifyIntChange(void)=0
Called when there has been a change in the amount of interference this node is experiencing from othe...
Class used for calculating SINR of packet in UanPhy.
virtual void NotifyRxEndError(void)=0
Called when UanPhy finishes receiving packet in error.
Forward calls to a chain of Callback.
virtual void NotifyTransStartTx(Ptr< Packet > packet, double txPowerDb, UanTxMode txMode)=0
Called when a transmission is beginning on the attached transducer.
virtual void NotifyTxEnd(void)=0
Function called when Phy object finishes transmitting packet.
void NotifyTxBegin(Ptr< const Packet > packet)
Called when the transducer begins transmitting a packet.
virtual double GetCcaThresholdDb(void)=0
Get the CCA threshold signal strength required to detect channel busy.
virtual double GetRxThresholdDb(void)=0
Get the minimum received signal strength required to receive a packet without errors.
virtual void SetCcaThresholdDb(double thresh)=0
Set the threshold for detecting channel busy.
virtual void SetRxThresholdDb(double thresh)=0
Set the minimum SINR threshold to receive a packet without errors.
ns3::TracedCallback< Ptr< const Packet > > m_phyTxDropTrace
Trace source indicating a packet has been dropped by the device during transmission.
virtual void SetSleepMode(bool sleep)=0
Set the Phy SLEEP mode.
double DbToKp(double db) const
Convert dB re 1 uPa to kilopascals.
ns3::TracedCallback< Ptr< const Packet > > m_phyRxBeginTrace
Trace source indicating a packet has begun being received from the channel medium by the device.