27 #include "ns3/traced-callback.h"
28 #include "ns3/nstime.h"
29 #include "ns3/device-energy-model.h"
30 #include "ns3/random-variable-stream.h"
47 static TypeId GetTypeId (
void);
66 static TypeId GetTypeId (
void);
83 double NChooseK (uint32_t n, uint32_t k);
99 static TypeId GetTypeId (
void);
139 static TypeId GetTypeId (
void);
171 static TypeId GetTypeId (
void);
205 virtual void Clear (
void);
207 virtual void SetSleepMode (
bool sleep);
220 typedef std::list<UanPhyListener *> ListenerList;
225 ListenerList m_listeners;
238 double m_ccaThreshDb;
241 double m_minRxSinrDb;
242 double m_rxRecvPwrDb;
260 double DbToKp (
double db);
261 double KpToDb (
double kp);
264 void UpdatePowerConsumption (
const State state);
266 void NotifyListenersRxStart (
void);
267 void NotifyListenersRxGood (
void);
268 void NotifyListenersRxBad (
void);
269 void NotifyListenersCcaStart (
void);
270 void NotifyListenersCcaEnd (
void);
271 void NotifyListenersTxStart (
Time duration);
virtual void NotifyTransStartTx(Ptr< Packet > packet, double txPowerDb, UanTxMode txMode)
virtual bool IsStateBusy(void)
virtual Ptr< UanTransducer > GetTransducer(void)
virtual double GetRxThresholdDb(void)
virtual bool IsStateRx(void)
virtual void SetEnergyModelCallback(DeviceEnergyModel::ChangeStateCallback cb)
virtual void SetReceiveErrorCallback(RxErrCallback cb)
virtual void EnergyDepletionHandler(void)
virtual void SetTransducer(Ptr< UanTransducer > trans)
forward calls to a chain of CallbackAn ns3::TracedCallback has almost exactly the same API as a norma...
Ptr< UniformRandomVariable > m_pg
Provides uniform random variables.
Packet error rate calculation assuming WHOI Micromodem like PHY Calculates PER assuming rate 1/2 conv...
virtual void StartRxPacket(Ptr< Packet > pkt, double rxPowerDb, UanTxMode txMode, UanPdp pdp)
Packet arriving from channel: i.e. leading bit of packet has arrived.
virtual uint32_t GetNModes(void)
Container for UanTxModes.
virtual double GetTxPowerDb(void)
virtual double GetCcaThresholdDb(void)
WHOI Micromodem like FH-FSK model.
virtual double CalcSinrDb(Ptr< Packet > pkt, Time arrTime, double rxPowerDb, double ambNoiseDb, UanTxMode mode, UanPdp pdp, const UanTransducer::ArrivalList &arrivalList) const
virtual bool IsStateTx(void)
virtual void SetDevice(Ptr< UanNetDevice > device)
int64_t AssignStreams(int64_t stream)
virtual Ptr< Packet > GetPacketRx(void) const
Abstraction of packet modulation information.
std::list< UanPacketArrival > ArrivalList
Arrival list is a standard template library list of UanPacketArrivals objects.
State
Enum defining possible Phy states.
virtual void SetCcaThresholdDb(double thresh)
virtual void NotifyIntChange(void)
virtual double CalcSinrDb(Ptr< Packet > pkt, Time arrTime, double rxPowerDb, double ambNoiseDb, UanTxMode mode, UanPdp pdp, const UanTransducer::ArrivalList &arrivalList) const
virtual Ptr< UanChannel > GetChannel(void) const
virtual UanTxMode GetMode(uint32_t n)
virtual void SetRxThresholdDb(double thresh)
virtual void SetRxGainDb(double gain)
Interface for PHY event listener A class which implements this interface may register with Phy object...
virtual double CalcPer(Ptr< Packet > pkt, double sinrDb, UanTxMode mode)
virtual void SetChannel(Ptr< UanChannel > channel)
Default SINR calculator for UanPhyGen The default ignores mode data and assumes that all rxpower tran...
Base class for UAN Phy models.
virtual bool IsStateIdle(void)
virtual void SendPacket(Ptr< Packet > pkt, uint32_t modeNum)
Default Packet Error Rate calculator for UanPhyGen Considers no error if SINR is > user defined thres...
virtual bool IsStateCcaBusy(void)
virtual void RegisterListener(UanPhyListener *listener)
virtual double GetRxGainDb(void)
virtual bool IsStateSleep(void)
virtual void SetMac(Ptr< UanMac > mac)
virtual void SetReceiveOkCallback(RxOkCallback cb)
static UanModesList GetDefaultModes(void)
a unique identifier for an interface.
virtual double CalcPer(Ptr< Packet > pkt, double sinrDb, UanTxMode mode)
virtual Ptr< UanNetDevice > GetDevice(void)
virtual void SetTxPowerDb(double txpwr)