Generic PHY model. More...
#include "uan-phy-gen.h"
Public Member Functions | |
UanPhyGen () | |
Constructor. | |
~UanPhyGen () override | |
Dummy destructor, see DoDispose. | |
int64_t | AssignStreams (int64_t stream) override |
Assign a fixed random variable stream number to the random variables used by this model. | |
void | Clear () override |
Clear all pointer references. | |
void | EnergyDepletionHandler () override |
Handle the energy depletion event. | |
void | EnergyRechargeHandler () override |
Handle the energy recharge event. | |
double | GetCcaThresholdDb () override |
Get the CCA threshold signal strength required to detect channel busy. | |
Ptr< UanChannel > | GetChannel () const override |
Get the attached channel. | |
Ptr< UanNetDevice > | GetDevice () const override |
Get the device hosting this Phy. | |
UanTxMode | GetMode (uint32_t n) override |
Get a specific transmission mode. | |
uint32_t | GetNModes () override |
Get the number of transmission modes supported by this Phy. | |
Ptr< Packet > | GetPacketRx () const override |
Get the packet currently being received. | |
double | GetRxThresholdDb () override |
Get the minimum received signal strength required to receive a packet without errors. | |
Ptr< UanTransducer > | GetTransducer () override |
Get the attached transducer. | |
double | GetTxPowerDb () override |
Get the current transmit power, in dB. | |
bool | IsStateBusy () override |
bool | IsStateCcaBusy () override |
bool | IsStateIdle () override |
bool | IsStateRx () override |
bool | IsStateSleep () override |
bool | IsStateTx () override |
void | NotifyIntChange () override |
Called when there has been a change in the amount of interference this node is experiencing from other transmissions. | |
void | NotifyTransStartTx (Ptr< Packet > packet, double txPowerDb, UanTxMode txMode) override |
Called when a transmission is beginning on the attached transducer. | |
void | RegisterListener (UanPhyListener *listener) override |
Register a UanPhyListener to be notified of common UanPhy events. | |
void | SendPacket (Ptr< Packet > pkt, uint32_t modeNum) override |
Send a packet using a specific transmission mode. | |
void | SetCcaThresholdDb (double thresh) override |
Set the threshold for detecting channel busy. | |
void | SetChannel (Ptr< UanChannel > channel) override |
Attach to a channel. | |
void | SetDevice (Ptr< UanNetDevice > device) override |
Set the device hosting this Phy. | |
void | SetEnergyModelCallback (energy::DeviceEnergyModel::ChangeStateCallback cb) override |
Set the DeviceEnergyModel callback for UanPhy device. | |
void | SetMac (Ptr< UanMac > mac) override |
Set the MAC forwarding messages to this Phy. | |
void | SetReceiveErrorCallback (RxErrCallback cb) override |
Set the callback to be used when a packet is received with errors. | |
void | SetReceiveOkCallback (RxOkCallback cb) override |
Set the callback to be used when a packet is received without error. | |
void | SetRxThresholdDb (double thresh) override |
Set the minimum SINR threshold to receive a packet without errors. | |
void | SetSleepMode (bool sleep) override |
Set the Phy SLEEP mode. | |
void | SetTransducer (Ptr< UanTransducer > trans) override |
Attach a transducer to this Phy. | |
void | SetTxPowerDb (double txpwr) override |
Set the transmit power. | |
void | StartRxPacket (Ptr< Packet > pkt, double rxPowerDb, UanTxMode txMode, UanPdp pdp) override |
Packet arriving from channel: i.e. | |
Public Member Functions inherited from ns3::UanPhy | |
void | NotifyRxBegin (Ptr< const Packet > packet) |
Called when the Phy begins to receive a packet. | |
void | NotifyRxDrop (Ptr< const Packet > packet) |
Called when the Phy drops a packet. | |
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. | |
void | NotifyTxDrop (Ptr< const Packet > packet) |
Called when the transducer attempts to transmit a new packet while already transmitting a prior packet. | |
void | NotifyTxEnd (Ptr< const Packet > packet) |
Called when the transducer finishes transmitting a packet. | |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. | |
~Object () override | |
Destructor. | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. | |
void | Dispose () |
Dispose of this Object. | |
AggregateIterator | GetAggregateIterator () const |
Get an iterator to the Objects aggregated to this one. | |
TypeId | GetInstanceTypeId () const override |
Get the most derived TypeId for this Object. | |
template<typename T > | |
Ptr< T > | GetObject () const |
Get a pointer to the requested aggregated Object. | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. | |
void | Initialize () |
Invoke DoInitialize on all Objects aggregated to this one. | |
bool | IsInitialized () const |
Check if the object has been initialized. | |
void | UnidirectionalAggregateObject (Ptr< Object > other) |
Aggregate an Object to another Object. | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. | |
void | Ref () const |
Increment the reference count. | |
void | Unref () const |
Decrement the reference count. | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. | |
void | GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const |
Get the value of an attribute, raising fatal errors if unsuccessful. | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising errors. | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. | |
Static Public Member Functions | |
static UanModesList | GetDefaultModes () |
Get the default transmission modes. | |
static TypeId | GetTypeId () |
Register this type. | |
Static Public Member Functions inherited from ns3::UanPhy | |
static TypeId | GetTypeId () |
Register this type. | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId () |
Register this type. | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId () |
Get the type ID. | |
Protected Member Functions | |
void | DoDispose () override |
Destructor implementation. | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. | |
virtual void | DoInitialize () |
Initialize() implementation. | |
virtual void | NotifyNewAggregate () |
Notify all Objects aggregated to this one of a new Object being aggregated. | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. | |
virtual void | NotifyConstructionCompleted () |
Notifier called once the ObjectBase is fully constructed. | |
Private Types | |
typedef std::list< UanPhyListener * > | ListenerList |
List of Phy Listeners. | |
Private Member Functions | |
double | CalculateSinrDb (Ptr< Packet > pkt, Time arrTime, double rxPowerDb, UanTxMode mode, UanPdp pdp) |
Calculate the SINR value for a packet. | |
double | DbToKp (double db) |
Convert dB to kilopascals. | |
double | GetInterferenceDb (Ptr< Packet > pkt) |
Calculate interference power from overlapping packet arrivals, in dB. | |
double | KpToDb (double kp) |
Convert kilopascals to dB. | |
void | NotifyListenersCcaEnd () |
Call UanListener::NotifyCcaEnd on all listeners. | |
void | NotifyListenersCcaStart () |
Call UanListener::NotifyCcaStart on all listeners. | |
void | NotifyListenersRxBad () |
Call UanListener::NotifyRxEndError on all listeners. | |
void | NotifyListenersRxGood () |
Call UanListener::NotifyRxEndOk on all listeners. | |
void | NotifyListenersRxStart () |
Call UanListener::NotifyRxStart on all listeners. | |
void | NotifyListenersTxEnd () |
Call UanListener::NotifyTxEnd on all listeners. | |
void | NotifyListenersTxStart (Time duration) |
Call UanListener::NotifyTxStart on all listeners. | |
void | RxEndEvent (Ptr< Packet > pkt, double rxPowerDb, UanTxMode txMode) |
Event to process end of packet reception. | |
void | TxEndEvent () |
Event to process end of packet transmission. | |
void | UpdatePowerConsumption (const State state) |
Update energy source with new state. | |
Private Attributes | |
double | m_ccaThreshDb |
CCA busy threshold. | |
Ptr< UanChannel > | m_channel |
Attached channel. | |
bool | m_cleared |
Flag when we've been cleared. | |
Ptr< UanNetDevice > | m_device |
Device hosting this Phy. | |
energy::DeviceEnergyModel::ChangeStateCallback | m_energyCallback |
Energy model callback. | |
ListenerList | m_listeners |
List of listeners. | |
Ptr< UanMac > | m_mac |
MAC layer. | |
double | m_minRxSinrDb |
Minimum receive SINR during packet reception. | |
UanModesList | m_modes |
List of modes supported by this PHY. | |
Ptr< UanPhyPer > | m_per |
Error model. | |
Ptr< UniformRandomVariable > | m_pg |
Provides uniform random variables. | |
Ptr< Packet > | m_pktRx |
Received packet. | |
Time | m_pktRxArrTime |
Packet arrival time. | |
UanTxMode | m_pktRxMode |
Packet transmission mode at receiver. | |
UanPdp | m_pktRxPdp |
Power delay profile of packet. | |
Ptr< Packet > | m_pktTx |
Sent packet. | |
RxErrCallback | m_recErrCb |
Callback for packets received with errors. | |
RxOkCallback | m_recOkCb |
Callback for packets received without error. | |
EventId | m_rxEndEvent |
Rx event. | |
ns3::TracedCallback< Ptr< const Packet >, double, UanTxMode > | m_rxErrLogger |
A packet destined for this Phy was received with error. | |
ns3::TracedCallback< Ptr< const Packet >, double, UanTxMode > | m_rxOkLogger |
A packet destined for this Phy was received without error. | |
double | m_rxRecvPwrDb |
Receiver power. | |
double | m_rxThreshDb |
Receive SINR threshold. | |
Ptr< UanPhyCalcSinr > | m_sinr |
SINR calculator. | |
State | m_state |
Phy state. | |
Ptr< UanTransducer > | m_transducer |
Associated transducer. | |
EventId | m_txEndEvent |
Tx event. | |
ns3::TracedCallback< Ptr< const Packet >, double, UanTxMode > | m_txLogger |
A packet was sent from this Phy. | |
double | m_txPwrDb |
Transmit power. | |
Additional Inherited Members | |
Public Types inherited from ns3::UanPhy | |
typedef Callback< void, Ptr< Packet >, double > | RxErrCallback |
Packet receive error callback function type. | |
typedef Callback< void, Ptr< Packet >, double, UanTxMode > | RxOkCallback |
Packet received successfully callback function type. | |
enum | State { IDLE , CCABUSY , RX , TX , SLEEP , DISABLED } |
Enum defining possible Phy states. More... | |
typedef void(* | TracedCallback) (Ptr< const Packet > pkt, double sinr, UanTxMode mode) |
TracedCallback signature for UanPhy packet send/receive events. | |
Related Symbols inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
Generic PHY model.
This is a generic PHY class. SINR and PER information are controlled via attributes. By adapting the SINR and PER models to a specific situation, this PHY should be able to model a wide variety of networks.
Definition at line 249 of file uan-phy-gen.h.
|
private |
List of Phy Listeners.
Definition at line 308 of file uan-phy-gen.h.
ns3::UanPhyGen::UanPhyGen | ( | ) |
Constructor.
Definition at line 482 of file uan-phy-gen.cc.
References ns3::CreateObject(), m_energyCallback, m_pg, and ns3::Callback< R, UArgs >::Nullify().
|
override |
Dummy destructor, see DoDispose.
Definition at line 501 of file uan-phy-gen.cc.
|
overridevirtual |
Assign a fixed random variable stream number to the random variables used by this model.
Return the number of streams (possibly zero) that have been assigned.
stream | First stream index to use. |
Implements ns3::UanPhy.
Definition at line 1033 of file uan-phy-gen.cc.
References m_pg, and NS_LOG_FUNCTION.
|
private |
Calculate the SINR value for a packet.
pkt | Packet to calculate SINR for. |
arrTime | Arrival time of pkt. |
rxPowerDb | The received signal strength of the packet in dB re 1 uPa. |
mode | TX Mode of pkt. |
pdp | Power delay profile of pkt. |
Definition at line 1062 of file uan-phy-gen.cc.
References ns3::UanTransducer::GetArrivalList(), ns3::UanTxMode::GetBandwidthHz(), ns3::UanTxMode::GetCenterFreqHz(), m_channel, m_sinr, and m_transducer.
Referenced by StartRxPacket().
|
overridevirtual |
Clear all pointer references.
Implements ns3::UanPhy.
Definition at line 506 of file uan-phy-gen.cc.
References ns3::UanNetDevice::Clear(), ns3::UanTransducer::Clear(), m_channel, m_cleared, m_device, m_listeners, m_mac, m_per, m_pktRx, m_sinr, and m_transducer.
Referenced by DoDispose().
Convert dB to kilopascals.
db | Signal level in dB. |
Definition at line 1095 of file uan-phy-gen.cc.
Referenced by GetInterferenceDb().
|
overrideprotectedvirtual |
Destructor implementation.
This method is called by Dispose() or by the Object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.
It is safe to call GetObject() from within this method.
Reimplemented from ns3::Object.
Definition at line 548 of file uan-phy-gen.cc.
References Clear(), ns3::Object::DoDispose(), m_energyCallback, and ns3::Callback< R, UArgs >::Nullify().
|
overridevirtual |
Handle the energy depletion event.
Implements ns3::UanPhy.
Definition at line 641 of file uan-phy-gen.cc.
References ns3::Simulator::Cancel(), ns3::UanPhy::DISABLED, ns3::Node::GetId(), ns3::UanNetDevice::GetNode(), ns3::EventId::IsPending(), m_device, m_pktRx, m_pktTx, m_rxEndEvent, m_state, m_txEndEvent, ns3::UanPhy::NotifyRxDrop(), ns3::UanPhy::NotifyTxDrop(), NS_LOG_DEBUG, and NS_LOG_FUNCTION.
|
overridevirtual |
Handle the energy recharge event.
Implements ns3::UanPhy.
Definition at line 663 of file uan-phy-gen.cc.
References ns3::Node::GetId(), ns3::UanNetDevice::GetNode(), ns3::UanPhy::IDLE, m_device, m_state, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
|
overridevirtual |
Get the CCA threshold signal strength required to detect channel busy.
Implements ns3::UanPhy.
Definition at line 954 of file uan-phy-gen.cc.
References m_ccaThreshDb.
|
overridevirtual |
Get the attached channel.
Implements ns3::UanPhy.
Definition at line 960 of file uan-phy-gen.cc.
References m_channel.
|
static |
Get the default transmission modes.
Definition at line 556 of file uan-phy-gen.cc.
References ns3::UanModesList::AppendMode(), ns3::UanTxModeFactory::CreateMode(), ns3::UanTxMode::FSK, and ns3::UanTxMode::PSK.
Referenced by UanTest::DoRun(), ns3::UanPhyDual::GetTypeId(), and GetTypeId().
|
overridevirtual |
Get the device hosting this Phy.
Implements ns3::UanPhy.
Definition at line 966 of file uan-phy-gen.cc.
References m_device.
Calculate interference power from overlapping packet arrivals, in dB.
The "signal" packet power is excluded. Use GetInterferenceDb ( (Ptr<Packet>) 0) to treat all signals as interference, for instance in calculating the CCA busy.
pkt | The arriving (signal) packet. |
Definition at line 1075 of file uan-phy-gen.cc.
References DbToKp(), ns3::UanTransducer::GetArrivalList(), KpToDb(), and m_transducer.
Referenced by NotifyIntChange(), RxEndEvent(), SetSleepMode(), StartRxPacket(), and TxEndEvent().
Get a specific transmission mode.
n | The mode number. |
Implements ns3::UanPhy.
Definition at line 1183 of file uan-phy-gen.cc.
References ns3::UanModesList::GetNModes(), m_modes, and NS_ASSERT.
Referenced by SendPacket(), and StartRxPacket().
|
overridevirtual |
Get the number of transmission modes supported by this Phy.
Implements ns3::UanPhy.
Definition at line 1177 of file uan-phy-gen.cc.
References ns3::UanModesList::GetNModes(), and m_modes.
Referenced by StartRxPacket().
Get the packet currently being received.
Implements ns3::UanPhy.
Definition at line 1191 of file uan-phy-gen.cc.
References m_pktRx.
|
overridevirtual |
Get the minimum received signal strength required to receive a packet without errors.
Implements ns3::UanPhy.
Definition at line 948 of file uan-phy-gen.cc.
References m_rxThreshDb.
|
overridevirtual |
Get the attached transducer.
Implements ns3::UanPhy.
Definition at line 972 of file uan-phy-gen.cc.
References m_transducer.
|
overridevirtual |
Get the current transmit power, in dB.
Implements ns3::UanPhy.
Definition at line 942 of file uan-phy-gen.cc.
References m_txPwrDb.
|
static |
Register this type.
Definition at line 570 of file uan-phy-gen.cc.
References GetDefaultModes(), m_ccaThreshDb, m_modes, m_per, m_rxErrLogger, m_rxOkLogger, m_rxThreshDb, m_sinr, m_txLogger, m_txPwrDb, ns3::MakeDoubleAccessor(), ns3::MakeDoubleChecker(), ns3::MakePointerAccessor(), ns3::MakePointerChecker(), ns3::MakeTraceSourceAccessor(), ns3::MakeUanModesListAccessor(), ns3::MakeUanModesListChecker(), and ns3::TypeId::SetParent().
|
overridevirtual |
Implements ns3::UanPhy.
Definition at line 900 of file uan-phy-gen.cc.
References IsStateIdle(), and IsStateSleep().
|
overridevirtual |
Implements ns3::UanPhy.
Definition at line 918 of file uan-phy-gen.cc.
References ns3::UanPhy::CCABUSY, and m_state.
|
overridevirtual |
Implements ns3::UanPhy.
Definition at line 894 of file uan-phy-gen.cc.
References ns3::UanPhy::IDLE, and m_state.
Referenced by IsStateBusy().
|
overridevirtual |
Implements ns3::UanPhy.
Definition at line 906 of file uan-phy-gen.cc.
References m_state, and ns3::UanPhy::RX.
|
overridevirtual |
Implements ns3::UanPhy.
Definition at line 888 of file uan-phy-gen.cc.
References m_state, and ns3::UanPhy::SLEEP.
Referenced by IsStateBusy().
|
overridevirtual |
Implements ns3::UanPhy.
Definition at line 912 of file uan-phy-gen.cc.
References m_state, and ns3::UanPhy::TX.
Convert kilopascals to dB.
kp | Sound pressure in kPa. |
Definition at line 1101 of file uan-phy-gen.cc.
Referenced by GetInterferenceDb().
|
overridevirtual |
Called when there has been a change in the amount of interference this node is experiencing from other transmissions.
Implements ns3::UanPhy.
Definition at line 1052 of file uan-phy-gen.cc.
References ns3::UanPhy::CCABUSY, GetInterferenceDb(), ns3::UanPhy::IDLE, m_ccaThreshDb, m_state, and NotifyListenersCcaEnd().
|
private |
Call UanListener::NotifyCcaEnd on all listeners.
Definition at line 1147 of file uan-phy-gen.cc.
References m_listeners.
Referenced by NotifyIntChange().
|
private |
Call UanListener::NotifyCcaStart on all listeners.
Definition at line 1137 of file uan-phy-gen.cc.
References m_listeners.
Referenced by RxEndEvent(), SetSleepMode(), StartRxPacket(), and TxEndEvent().
|
private |
Call UanListener::NotifyRxEndError on all listeners.
Definition at line 1127 of file uan-phy-gen.cc.
References m_listeners.
Referenced by RxEndEvent().
|
private |
Call UanListener::NotifyRxEndOk on all listeners.
Definition at line 1117 of file uan-phy-gen.cc.
References m_listeners.
Referenced by RxEndEvent().
|
private |
Call UanListener::NotifyRxStart on all listeners.
Definition at line 1107 of file uan-phy-gen.cc.
References m_listeners.
Referenced by StartRxPacket().
|
private |
Call UanListener::NotifyTxEnd on all listeners.
Definition at line 1167 of file uan-phy-gen.cc.
References m_listeners.
Referenced by TxEndEvent().
|
private |
Call UanListener::NotifyTxStart on all listeners.
duration | Duration of transmission. |
Definition at line 1157 of file uan-phy-gen.cc.
References m_listeners.
Referenced by SendPacket().
|
overridevirtual |
Called when a transmission is beginning on the attached transducer.
packet | Packet that is beginning transmission. |
txPowerDb | Transmit power of packet. |
txMode | Transmission mode of packet. |
Implements ns3::UanPhy.
Definition at line 1041 of file uan-phy-gen.cc.
References m_minRxSinrDb, and m_pktRx.
|
overridevirtual |
Register a UanPhyListener to be notified of common UanPhy events.
listener | New listener to register. |
Implements ns3::UanPhy.
Definition at line 737 of file uan-phy-gen.cc.
References m_listeners.
Event to process end of packet reception.
pkt | The packet. |
rxPowerDb | Received signal power. |
txMode | Transmission mode. |
Definition at line 825 of file uan-phy-gen.cc.
References ns3::UanPhy::CCABUSY, ns3::UanPhy::DISABLED, GetInterferenceDb(), ns3::UanPhy::IDLE, ns3::Callback< R, UArgs >::IsNull(), m_ccaThreshDb, m_minRxSinrDb, m_per, m_pg, m_pktRx, m_recErrCb, m_recOkCb, m_rxErrLogger, m_rxOkLogger, m_state, NotifyListenersCcaStart(), NotifyListenersRxBad(), NotifyListenersRxGood(), ns3::UanPhy::NotifyRxDrop(), ns3::UanPhy::NotifyRxEnd(), NS_LOG_DEBUG, ns3::UanPhy::SLEEP, and UpdatePowerConsumption().
Referenced by StartRxPacket().
Send a packet using a specific transmission mode.
pkt | Packet to transmit. |
modeNum | Index of mode in SupportedModes list to use for transmission. |
Implements ns3::UanPhy.
Definition at line 673 of file uan-phy-gen.cc.
References ns3::UanPhy::DISABLED, ns3::UanTxMode::GetDataRateBps(), GetMode(), m_mac, m_minRxSinrDb, m_pktRx, m_pktTx, m_state, m_transducer, m_txEndEvent, m_txLogger, m_txPwrDb, NotifyListenersTxStart(), NS_LOG_DEBUG, ns3::Simulator::Schedule(), ns3::Seconds(), ns3::UanPhy::SLEEP, ns3::UanTransducer::Transmit(), ns3::UanPhy::TX, TxEndEvent(), and UpdatePowerConsumption().
|
overridevirtual |
Set the threshold for detecting channel busy.
thresh | Signal power threshold at receiver. |
Implements ns3::UanPhy.
Definition at line 936 of file uan-phy-gen.cc.
References m_ccaThreshDb.
|
overridevirtual |
Attach to a channel.
channel | The channel to attach to. |
Implements ns3::UanPhy.
Definition at line 978 of file uan-phy-gen.cc.
References m_channel.
|
overridevirtual |
Set the device hosting this Phy.
device | The device. |
Implements ns3::UanPhy.
Definition at line 984 of file uan-phy-gen.cc.
References m_device.
|
overridevirtual |
Set the DeviceEnergyModel callback for UanPhy device.
callback | The DeviceEnergyModel change state callback. |
Implements ns3::UanPhy.
Definition at line 623 of file uan-phy-gen.cc.
References m_energyCallback, and NS_LOG_FUNCTION.
Set the MAC forwarding messages to this Phy.
mac | The MAC. |
Implements ns3::UanPhy.
Definition at line 990 of file uan-phy-gen.cc.
References m_mac.
|
overridevirtual |
Set the callback to be used when a packet is received with errors.
cb | The callback. |
Implements ns3::UanPhy.
Definition at line 882 of file uan-phy-gen.cc.
References m_recErrCb.
|
overridevirtual |
Set the callback to be used when a packet is received without error.
cb | The callback. |
Implements ns3::UanPhy.
Definition at line 876 of file uan-phy-gen.cc.
References m_recOkCb.
|
overridevirtual |
Set the minimum SINR threshold to receive a packet without errors.
thresh | Threshold SINR for proper reception in dB re 1 uPa. |
Implements ns3::UanPhy.
Definition at line 930 of file uan-phy-gen.cc.
References m_rxThreshDb.
|
overridevirtual |
Set the Phy SLEEP mode.
sleep | SLEEP on or off. |
Implements ns3::UanPhy.
Definition at line 1003 of file uan-phy-gen.cc.
References ns3::UanPhy::CCABUSY, GetInterferenceDb(), ns3::UanPhy::IDLE, ns3::Callback< R, UArgs >::IsNull(), m_ccaThreshDb, m_energyCallback, m_state, NotifyListenersCcaStart(), and ns3::UanPhy::SLEEP.
|
overridevirtual |
Attach a transducer to this Phy.
trans | The transducer. |
Implements ns3::UanPhy.
Definition at line 996 of file uan-phy-gen.cc.
References ns3::UanTransducer::AddPhy(), and m_transducer.
|
overridevirtual |
Set the transmit power.
txpwr | Final output transmission power, in dB. |
Implements ns3::UanPhy.
Definition at line 924 of file uan-phy-gen.cc.
References m_txPwrDb.
|
overridevirtual |
Packet arriving from channel: i.e.
leading bit of packet has arrived.
pkt | Packet which is arriving. |
rxPowerDb | Signal power of incoming packet in dB re 1 uPa. |
txMode | Transmission mode defining modulation of incoming packet. |
pdp | Power delay profile of incoming packet. |
Implements ns3::UanPhy.
Definition at line 743 of file uan-phy-gen.cc.
References CalculateSinrDb(), ns3::UanPhy::CCABUSY, ns3::UanPhy::DISABLED, ns3::UanTxMode::GetDataRateBps(), GetInterferenceDb(), GetMode(), GetNModes(), ns3::UanTxMode::GetUid(), ns3::UanPhy::IDLE, m_ccaThreshDb, m_mac, m_minRxSinrDb, m_pktRx, m_pktRxArrTime, m_pktRxMode, m_pktRxPdp, m_rxEndEvent, m_rxRecvPwrDb, m_rxThreshDb, m_state, NotifyListenersCcaStart(), NotifyListenersRxStart(), ns3::UanPhy::NotifyRxBegin(), ns3::UanPhy::NotifyRxDrop(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, ns3::UanPhy::RX, RxEndEvent(), ns3::Simulator::Schedule(), ns3::Seconds(), ns3::UanPhy::SLEEP, ns3::UanPhy::TX, and UpdatePowerConsumption().
|
private |
Event to process end of packet transmission.
Definition at line 713 of file uan-phy-gen.cc.
References ns3::UanPhy::CCABUSY, ns3::UanPhy::DISABLED, GetInterferenceDb(), ns3::UanPhy::IDLE, m_ccaThreshDb, m_state, NotifyListenersCcaStart(), NotifyListenersTxEnd(), NS_ASSERT, NS_LOG_DEBUG, ns3::UanPhy::SLEEP, ns3::UanPhy::TX, and UpdatePowerConsumption().
Referenced by SendPacket().
|
private |
Update energy source with new state.
state | The new Phy state. |
Definition at line 630 of file uan-phy-gen.cc.
References ns3::Callback< R, UArgs >::IsNull(), m_energyCallback, and NS_LOG_FUNCTION.
Referenced by RxEndEvent(), SendPacket(), StartRxPacket(), and TxEndEvent().
|
private |
CCA busy threshold.
Definition at line 325 of file uan-phy-gen.h.
Referenced by GetCcaThresholdDb(), GetTypeId(), NotifyIntChange(), RxEndEvent(), SetCcaThresholdDb(), SetSleepMode(), StartRxPacket(), and TxEndEvent().
|
private |
Attached channel.
Definition at line 316 of file uan-phy-gen.h.
Referenced by CalculateSinrDb(), Clear(), GetChannel(), and SetChannel().
|
private |
|
private |
Device hosting this Phy.
Definition at line 318 of file uan-phy-gen.h.
Referenced by Clear(), EnergyDepletionHandler(), EnergyRechargeHandler(), GetDevice(), and SetDevice().
|
private |
Energy model callback.
Definition at line 344 of file uan-phy-gen.h.
Referenced by UanPhyGen(), DoDispose(), SetEnergyModelCallback(), SetSleepMode(), and UpdatePowerConsumption().
|
private |
List of listeners.
Definition at line 313 of file uan-phy-gen.h.
Referenced by Clear(), NotifyListenersCcaEnd(), NotifyListenersCcaStart(), NotifyListenersRxBad(), NotifyListenersRxGood(), NotifyListenersRxStart(), NotifyListenersTxEnd(), NotifyListenersTxStart(), and RegisterListener().
MAC layer.
Definition at line 319 of file uan-phy-gen.h.
Referenced by Clear(), SendPacket(), SetMac(), and StartRxPacket().
|
private |
Minimum receive SINR during packet reception.
Definition at line 329 of file uan-phy-gen.h.
Referenced by NotifyTransStartTx(), RxEndEvent(), SendPacket(), and StartRxPacket().
|
private |
List of modes supported by this PHY.
Definition at line 310 of file uan-phy-gen.h.
Referenced by GetMode(), GetNModes(), and GetTypeId().
Error model.
Definition at line 320 of file uan-phy-gen.h.
Referenced by Clear(), GetTypeId(), and RxEndEvent().
|
private |
Provides uniform random variables.
Definition at line 341 of file uan-phy-gen.h.
Referenced by UanPhyGen(), AssignStreams(), and RxEndEvent().
Received packet.
Definition at line 327 of file uan-phy-gen.h.
Referenced by Clear(), EnergyDepletionHandler(), GetPacketRx(), NotifyTransStartTx(), RxEndEvent(), SendPacket(), and StartRxPacket().
|
private |
|
private |
Packet transmission mode at receiver.
Definition at line 333 of file uan-phy-gen.h.
Referenced by StartRxPacket().
|
private |
Power delay profile of packet.
Definition at line 332 of file uan-phy-gen.h.
Referenced by StartRxPacket().
Sent packet.
Definition at line 328 of file uan-phy-gen.h.
Referenced by EnergyDepletionHandler(), and SendPacket().
|
private |
Callback for packets received with errors.
Definition at line 315 of file uan-phy-gen.h.
Referenced by RxEndEvent(), and SetReceiveErrorCallback().
|
private |
Callback for packets received without error.
Definition at line 314 of file uan-phy-gen.h.
Referenced by RxEndEvent(), and SetReceiveOkCallback().
|
private |
Rx event.
Definition at line 338 of file uan-phy-gen.h.
Referenced by EnergyDepletionHandler(), and StartRxPacket().
|
private |
A packet destined for this Phy was received with error.
Definition at line 348 of file uan-phy-gen.h.
Referenced by GetTypeId(), and RxEndEvent().
|
private |
A packet destined for this Phy was received without error.
Definition at line 346 of file uan-phy-gen.h.
Referenced by GetTypeId(), and RxEndEvent().
|
private |
|
private |
Receive SINR threshold.
Definition at line 324 of file uan-phy-gen.h.
Referenced by GetRxThresholdDb(), GetTypeId(), SetRxThresholdDb(), and StartRxPacket().
|
private |
SINR calculator.
Definition at line 321 of file uan-phy-gen.h.
Referenced by CalculateSinrDb(), Clear(), and GetTypeId().
|
private |
Phy state.
Definition at line 312 of file uan-phy-gen.h.
Referenced by EnergyDepletionHandler(), EnergyRechargeHandler(), IsStateCcaBusy(), IsStateIdle(), IsStateRx(), IsStateSleep(), IsStateTx(), NotifyIntChange(), RxEndEvent(), SendPacket(), SetSleepMode(), StartRxPacket(), and TxEndEvent().
|
private |
Associated transducer.
Definition at line 317 of file uan-phy-gen.h.
Referenced by CalculateSinrDb(), Clear(), GetInterferenceDb(), GetTransducer(), SendPacket(), and SetTransducer().
|
private |
Tx event.
Definition at line 337 of file uan-phy-gen.h.
Referenced by EnergyDepletionHandler(), and SendPacket().
|
private |
A packet was sent from this Phy.
Definition at line 350 of file uan-phy-gen.h.
Referenced by GetTypeId(), and SendPacket().
|
private |
Transmit power.
Definition at line 323 of file uan-phy-gen.h.
Referenced by GetTxPowerDb(), GetTypeId(), SendPacket(), and SetTxPowerDb().