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