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