Generic PHY model. More...
#include "uan-phy-gen.h"
Public Member Functions | |
UanPhyGen () | |
Constructor. More... | |
virtual | ~UanPhyGen () |
Dummy destructor, see DoDispose. More... | |
int64_t | AssignStreams (int64_t stream) |
Assign a fixed random variable stream number to the random variables used by this model. More... | |
virtual void | Clear (void) |
Clear all pointer references. More... | |
virtual void | EnergyDepletionHandler (void) |
Handle the energy depletion event. More... | |
virtual void | EnergyRechargeHandler (void) |
Handle the energy recharge event. More... | |
virtual double | GetCcaThresholdDb (void) |
Get the CCA threshold signal strength required to detect channel busy. More... | |
virtual Ptr< UanChannel > | GetChannel (void) const |
Get the attached channel. More... | |
virtual Ptr< UanNetDevice > | GetDevice (void) const |
Get the device hosting this Phy. More... | |
virtual UanTxMode | GetMode (uint32_t n) |
Get a specific transmission mode. More... | |
virtual uint32_t | GetNModes (void) |
Get the number of transmission modes supported by this Phy. More... | |
virtual Ptr< Packet > | GetPacketRx (void) const |
Get the packet currently being received. More... | |
virtual double | GetRxThresholdDb (void) |
Get the minimum received signal strength required to receive a packet without errors. More... | |
virtual Ptr< UanTransducer > | GetTransducer (void) |
Get the attached transducer. More... | |
virtual double | GetTxPowerDb (void) |
Get the current transmit power, in dB. More... | |
virtual bool | IsStateBusy (void) |
virtual bool | IsStateCcaBusy (void) |
virtual bool | IsStateIdle (void) |
virtual bool | IsStateRx (void) |
virtual bool | IsStateSleep (void) |
virtual bool | IsStateTx (void) |
virtual void | NotifyIntChange (void) |
Called when there has been a change in the amount of interference this node is experiencing from other transmissions. More... | |
virtual void | NotifyTransStartTx (Ptr< Packet > packet, double txPowerDb, UanTxMode txMode) |
Called when a transmission is beginning on the attached transducer. More... | |
virtual void | RegisterListener (UanPhyListener *listener) |
Register a UanPhyListener to be notified of common UanPhy events. More... | |
virtual void | SendPacket (Ptr< Packet > pkt, uint32_t modeNum) |
Send a packet using a specific transmission mode. More... | |
virtual void | SetCcaThresholdDb (double thresh) |
Set the threshold for detecting channel busy. More... | |
virtual void | SetChannel (Ptr< UanChannel > channel) |
Attach to a channel. More... | |
virtual void | SetDevice (Ptr< UanNetDevice > device) |
Set the device hosting this Phy. More... | |
virtual void | SetEnergyModelCallback (DeviceEnergyModel::ChangeStateCallback cb) |
Set the DeviceEnergyModel callback for UanPhy device. More... | |
virtual void | SetMac (Ptr< UanMac > mac) |
Set the MAC forwarding messages to this Phy. More... | |
virtual void | SetReceiveErrorCallback (RxErrCallback cb) |
Set the callback to be used when a packet is received with errors. More... | |
virtual void | SetReceiveOkCallback (RxOkCallback cb) |
Set the callback to be used when a packet is received without error. More... | |
virtual void | SetRxThresholdDb (double thresh) |
Set the minimum SINR threshold to receive a packet without errors. More... | |
virtual void | SetSleepMode (bool sleep) |
Set the Phy SLEEP mode. More... | |
virtual void | SetTransducer (Ptr< UanTransducer > trans) |
Attach a transducer to this Phy. More... | |
virtual void | SetTxPowerDb (double txpwr) |
Set the transmit power. More... | |
virtual void | StartRxPacket (Ptr< Packet > pkt, double rxPowerDb, UanTxMode txMode, UanPdp pdp) |
Packet arriving from channel: i.e. More... | |
Public Member Functions inherited from ns3::UanPhy | |
void | NotifyRxBegin (Ptr< const Packet > packet) |
Called when the Phy begins to receive a packet. More... | |
void | NotifyRxDrop (Ptr< const Packet > packet) |
Called when the Phy drops a packet. More... | |
void | NotifyRxEnd (Ptr< const Packet > packet) |
Called when a packet is received without error. More... | |
void | NotifyTxBegin (Ptr< const Packet > packet) |
Called when the transducer begins transmitting a packet. More... | |
void | NotifyTxDrop (Ptr< const Packet > packet) |
Called when the transducer attempts to transmit a new packet while already transmitting a prior packet. More... | |
void | NotifyTxEnd (Ptr< const Packet > packet) |
Called when the transducer finishes transmitting a packet. More... | |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose (void) |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator (void) const |
Get an iterator to the Objects aggregated to this one. More... | |
virtual TypeId | GetInstanceTypeId (void) const |
Get the most derived TypeId for this Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
void | Initialize (void) |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized (void) const |
Check if the object has been initialized. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising erros. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static UanModesList | GetDefaultModes (void) |
Get the default transmission modes. More... | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
Static Public Member Functions inherited from ns3::UanPhy | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Protected Member Functions | |
virtual void | DoDispose () |
Destructor implementation. More... | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoInitialize (void) |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate (void) |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted (void) |
Notifier called once the ObjectBase is fully constructed. More... | |
Private Types | |
typedef std::list< UanPhyListener * > | ListenerList |
List of Phy Listeners. More... | |
Private Member Functions | |
double | CalculateSinrDb (Ptr< Packet > pkt, Time arrTime, double rxPowerDb, UanTxMode mode, UanPdp pdp) |
Calculate the SINR value for a packet. More... | |
double | DbToKp (double db) |
Convert dB to kilopascals. More... | |
double | GetInterferenceDb (Ptr< Packet > pkt) |
Calculate interference power from overlapping packet arrivals, in dB. More... | |
double | KpToDb (double kp) |
Convert kilopascals to dB. More... | |
void | NotifyListenersCcaEnd (void) |
Call UanListener::NotifyCcaEnd on all listeners. More... | |
void | NotifyListenersCcaStart (void) |
Call UanListener::NotifyCcaStart on all listeners. More... | |
void | NotifyListenersRxBad (void) |
Call UanListener::NotifyRxEndError on all listeners. More... | |
void | NotifyListenersRxGood (void) |
Call UanListener::NotifyRxEndOk on all listeners. More... | |
void | NotifyListenersRxStart (void) |
Call UanListener::NotifyRxStart on all listeners. More... | |
void | NotifyListenersTxStart (Time duration) |
Call UanListener::NotifyTxStart on all listeners. More... | |
void | RxEndEvent (Ptr< Packet > pkt, double rxPowerDb, UanTxMode txMode) |
Event to process end of packet reception. More... | |
void | TxEndEvent () |
Event to process end of packet transmission. More... | |
void | UpdatePowerConsumption (const State state) |
Update energy source with new state. More... | |
Private Attributes | |
double | m_ccaThreshDb |
CCA busy threshold. More... | |
Ptr< UanChannel > | m_channel |
Attached channel. More... | |
bool | m_cleared |
Flag when we've been cleared. More... | |
Ptr< UanNetDevice > | m_device |
Device hosting this Phy. More... | |
DeviceEnergyModel::ChangeStateCallback | m_energyCallback |
Energy model callback. More... | |
ListenerList | m_listeners |
List of listeners. More... | |
Ptr< UanMac > | m_mac |
MAC layer. More... | |
double | m_minRxSinrDb |
Minimum receive SINR during packet reception. More... | |
UanModesList | m_modes |
List of modes supported by this PHY. More... | |
Ptr< UanPhyPer > | m_per |
Error model. More... | |
Ptr< UniformRandomVariable > | m_pg |
Provides uniform random variables. More... | |
Ptr< Packet > | m_pktRx |
Received packet. More... | |
Time | m_pktRxArrTime |
Packet arrival time. More... | |
UanTxMode | m_pktRxMode |
Packet transmission mode at receiver. More... | |
UanPdp | m_pktRxPdp |
Power delay profile of packet. More... | |
Ptr< Packet > | m_pktTx |
Sent packet. More... | |
RxErrCallback | m_recErrCb |
Callback for packets received with errors. More... | |
RxOkCallback | m_recOkCb |
Callback for packets received without error. More... | |
EventId | m_rxEndEvent |
Rx event. More... | |
ns3::TracedCallback< Ptr< const Packet >, double, UanTxMode > | m_rxErrLogger |
A packet destined for this Phy was received with error. More... | |
ns3::TracedCallback< Ptr< const Packet >, double, UanTxMode > | m_rxOkLogger |
A packet destined for this Phy was received without error. More... | |
double | m_rxRecvPwrDb |
Receiver power. More... | |
double | m_rxThreshDb |
Receive SINR threshold. More... | |
Ptr< UanPhyCalcSinr > | m_sinr |
SINR calculator. More... | |
State | m_state |
Phy state. More... | |
Ptr< UanTransducer > | m_transducer |
Associated transducer. More... | |
EventId | m_txEndEvent |
Tx event. More... | |
ns3::TracedCallback< Ptr< const Packet >, double, UanTxMode > | m_txLogger |
A packet was sent from this Phy. More... | |
double | m_txPwrDb |
Transmit power. More... | |
Additional Inherited Members | |
Public Types inherited from ns3::UanPhy | |
typedef Callback< void, Ptr< Packet >, double > | RxErrCallback |
Packet receive error callback function type. More... | |
typedef Callback< void, Ptr< Packet >, double, UanTxMode > | RxOkCallback |
Packet received successfully callback function type. More... | |
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. More... | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
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.
ns3::UanPhyGen is accessible through the following paths with Config::Set and Config::Connect:
Size of this type is 544 bytes (on a 64-bit architecture).
Definition at line 266 of file uan-phy-gen.h.
|
private |
List of Phy Listeners.
Definition at line 325 of file uan-phy-gen.h.
ns3::UanPhyGen::UanPhyGen | ( | ) |
Constructor.
Definition at line 495 of file uan-phy-gen.cc.
References m_energyCallback, m_pg, and ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::Nullify().
|
virtual |
Dummy destructor, see DoDispose.
Definition at line 514 of file uan-phy-gen.cc.
|
virtual |
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 1035 of file uan-phy-gen.cc.
References m_pg, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().
|
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 1063 of file uan-phy-gen.cc.
References ns3::UanTxMode::GetBandwidthHz(), ns3::UanTxMode::GetCenterFreqHz(), m_channel, m_sinr, and m_transducer.
Referenced by StartRxPacket().
|
virtual |
Clear all pointer references.
Implements ns3::UanPhy.
Definition at line 520 of file uan-phy-gen.cc.
References m_channel, m_cleared, m_device, m_listeners, m_mac, m_per, m_pktRx, m_sinr, and m_transducer.
Referenced by DoDispose().
|
private |
Convert dB to kilopascals.
db | Signal level in dB. |
Definition at line 1092 of file uan-phy-gen.cc.
Referenced by GetInterferenceDb().
|
protectedvirtual |
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 562 of file uan-phy-gen.cc.
References Clear(), ns3::Object::DoDispose(), m_energyCallback, and ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::Nullify().
|
virtual |
Handle the energy depletion event.
Implements ns3::UanPhy.
Definition at line 654 of file uan-phy-gen.cc.
References ns3::Simulator::Cancel(), ns3::UanPhy::DISABLED, ns3::EventId::IsRunning(), 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.
|
virtual |
Handle the energy recharge event.
Implements ns3::UanPhy.
Definition at line 676 of file uan-phy-gen.cc.
References ns3::UanPhy::IDLE, m_device, m_state, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
|
virtual |
Get the CCA threshold signal strength required to detect channel busy.
Implements ns3::UanPhy.
Definition at line 957 of file uan-phy-gen.cc.
References m_ccaThreshDb.
|
virtual |
Get the attached channel.
Implements ns3::UanPhy.
Definition at line 963 of file uan-phy-gen.cc.
References m_channel.
|
static |
Get the default transmission modes.
Definition at line 570 of file uan-phy-gen.cc.
References ns3::UanModesList::AppendMode(), ns3::UanTxModeFactory::CreateMode(), ns3::UanTxMode::FSK, and ns3::UanTxMode::PSK.
Referenced by ns3::UanPhyDual::GetTypeId(), and GetTypeId().
|
virtual |
Get the device hosting this Phy.
Implements ns3::UanPhy.
Definition at line 969 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 1070 of file uan-phy-gen.cc.
References DbToKp(), KpToDb(), and m_transducer.
Referenced by NotifyIntChange(), RxEndEvent(), SetSleepMode(), StartRxPacket(), and TxEndEvent().
|
virtual |
Get a specific transmission mode.
n | The mode number. |
Implements ns3::UanPhy.
Definition at line 1166 of file uan-phy-gen.cc.
References ns3::UanModesList::GetNModes(), m_modes, sample-rng-plot::n, and NS_ASSERT.
Referenced by SendPacket(), and StartRxPacket().
|
virtual |
Get the number of transmission modes supported by this Phy.
Implements ns3::UanPhy.
Definition at line 1160 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 1174 of file uan-phy-gen.cc.
References m_pktRx.
|
virtual |
Get the minimum received signal strength required to receive a packet without errors.
Implements ns3::UanPhy.
Definition at line 952 of file uan-phy-gen.cc.
References m_rxThreshDb.
|
virtual |
Get the attached transducer.
Implements ns3::UanPhy.
Definition at line 975 of file uan-phy-gen.cc.
References m_transducer.
|
virtual |
Get the current transmit power, in dB.
Implements ns3::UanPhy.
Definition at line 945 of file uan-phy-gen.cc.
References m_txPwrDb.
|
static |
Register this type.
Definition at line 581 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::MakePointerAccessor(), ns3::MakeTraceSourceAccessor(), ns3::MakeUanModesListAccessor(), ns3::MakeUanModesListChecker(), and ns3::TypeId::SetParent().
|
virtual |
Implements ns3::UanPhy.
Definition at line 906 of file uan-phy-gen.cc.
References IsStateIdle(), and IsStateSleep().
|
virtual |
Implements ns3::UanPhy.
Definition at line 922 of file uan-phy-gen.cc.
References ns3::UanPhy::CCABUSY, and m_state.
|
virtual |
Implements ns3::UanPhy.
Definition at line 901 of file uan-phy-gen.cc.
References ns3::UanPhy::IDLE, and m_state.
Referenced by IsStateBusy().
|
virtual |
Implements ns3::UanPhy.
Definition at line 911 of file uan-phy-gen.cc.
References m_state, and ns3::UanPhy::RX.
|
virtual |
Implements ns3::UanPhy.
Definition at line 896 of file uan-phy-gen.cc.
References m_state, and ns3::UanPhy::SLEEP.
Referenced by IsStateBusy().
|
virtual |
Implements ns3::UanPhy.
Definition at line 916 of file uan-phy-gen.cc.
References m_state, and ns3::UanPhy::TX.
|
private |
Convert kilopascals to dB.
kp | Sound pressure in kPa. |
Definition at line 1097 of file uan-phy-gen.cc.
Referenced by GetInterferenceDb().
|
virtual |
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 1053 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 1140 of file uan-phy-gen.cc.
References m_listeners.
Referenced by NotifyIntChange().
|
private |
Call UanListener::NotifyCcaStart on all listeners.
Definition at line 1131 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 1122 of file uan-phy-gen.cc.
References m_listeners.
Referenced by RxEndEvent().
|
private |
Call UanListener::NotifyRxEndOk on all listeners.
Definition at line 1113 of file uan-phy-gen.cc.
References m_listeners.
Referenced by RxEndEvent().
|
private |
Call UanListener::NotifyRxStart on all listeners.
Definition at line 1103 of file uan-phy-gen.cc.
References m_listeners.
Referenced by StartRxPacket().
|
private |
Call UanListener::NotifyTxStart on all listeners.
duration | Duration of transmission. |
Definition at line 1150 of file uan-phy-gen.cc.
References m_listeners.
Referenced by SendPacket().
|
virtual |
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 1043 of file uan-phy-gen.cc.
References m_minRxSinrDb, m_pktRx, and NS_UNUSED.
|
virtual |
Register a UanPhyListener to be notified of common UanPhy events.
listener | New listener to register. |
Implements ns3::UanPhy.
Definition at line 748 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 833 of file uan-phy-gen.cc.
References ns3::UanPhy::CCABUSY, ns3::UanPhy::DISABLED, GetInterferenceDb(), ns3::UniformRandomVariable::GetValue(), ns3::UanPhy::IDLE, ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::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, NS_UNUSED, 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 686 of file uan-phy-gen.cc.
References ns3::UanPhy::DISABLED, ns3::UanTxMode::GetDataRateBps(), GetMode(), ns3::Packet::GetSize(), 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::UanPhy::TX, TxEndEvent(), and UpdatePowerConsumption().
|
virtual |
Set the threshold for detecting channel busy.
thresh | Signal power threshold at receiver. |
Implements ns3::UanPhy.
Definition at line 939 of file uan-phy-gen.cc.
References m_ccaThreshDb.
|
virtual |
Attach to a channel.
channel | The channel to attach to. |
Implements ns3::UanPhy.
Definition at line 980 of file uan-phy-gen.cc.
References third::channel, and m_channel.
|
virtual |
Set the device hosting this Phy.
device | The device. |
Implements ns3::UanPhy.
Definition at line 986 of file uan-phy-gen.cc.
References m_device.
|
virtual |
Set the DeviceEnergyModel callback for UanPhy device.
callback | The DeviceEnergyModel change state callback. |
Implements ns3::UanPhy.
Definition at line 636 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 992 of file uan-phy-gen.cc.
References m_mac, and third::mac.
|
virtual |
Set the callback to be used when a packet is received with errors.
cb | The callback. |
Implements ns3::UanPhy.
Definition at line 891 of file uan-phy-gen.cc.
References m_recErrCb.
|
virtual |
Set the callback to be used when a packet is received without error.
cb | The callback. |
Implements ns3::UanPhy.
Definition at line 885 of file uan-phy-gen.cc.
References m_recOkCb.
|
virtual |
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 934 of file uan-phy-gen.cc.
References m_rxThreshDb.
|
virtual |
Set the Phy SLEEP mode.
sleep | SLEEP on or off. |
Implements ns3::UanPhy.
Definition at line 1005 of file uan-phy-gen.cc.
References ns3::UanPhy::CCABUSY, GetInterferenceDb(), ns3::UanPhy::IDLE, ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_ccaThreshDb, m_energyCallback, m_state, NotifyListenersCcaStart(), and ns3::UanPhy::SLEEP.
|
virtual |
Attach a transducer to this Phy.
trans | The transducer. |
Implements ns3::UanPhy.
Definition at line 998 of file uan-phy-gen.cc.
References m_transducer.
|
virtual |
Set the transmit power.
txpwr | Final output transmission power, in dB. |
Implements ns3::UanPhy.
Definition at line 929 of file uan-phy-gen.cc.
References m_txPwrDb.
|
virtual |
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 755 of file uan-phy-gen.cc.
References CalculateSinrDb(), ns3::UanPhy::CCABUSY, ns3::UanPhy::DISABLED, ns3::UanTxMode::GetDataRateBps(), GetInterferenceDb(), GetMode(), GetNModes(), ns3::Packet::GetSize(), 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 726 of file uan-phy-gen.cc.
References ns3::UanPhy::CCABUSY, ns3::UanPhy::DISABLED, GetInterferenceDb(), ns3::UanPhy::IDLE, m_ccaThreshDb, m_state, NotifyListenersCcaStart(), 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 643 of file uan-phy-gen.cc.
References ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_energyCallback, and NS_LOG_FUNCTION.
Referenced by RxEndEvent(), SendPacket(), StartRxPacket(), and TxEndEvent().
|
private |
CCA busy threshold.
Definition at line 342 of file uan-phy-gen.h.
Referenced by GetCcaThresholdDb(), GetTypeId(), NotifyIntChange(), RxEndEvent(), SetCcaThresholdDb(), SetSleepMode(), StartRxPacket(), and TxEndEvent().
|
private |
Attached channel.
Definition at line 333 of file uan-phy-gen.h.
Referenced by CalculateSinrDb(), Clear(), GetChannel(), and SetChannel().
|
private |
|
private |
Device hosting this Phy.
Definition at line 335 of file uan-phy-gen.h.
Referenced by Clear(), EnergyDepletionHandler(), EnergyRechargeHandler(), GetDevice(), and SetDevice().
|
private |
Energy model callback.
Definition at line 361 of file uan-phy-gen.h.
Referenced by DoDispose(), SetEnergyModelCallback(), SetSleepMode(), UanPhyGen(), and UpdatePowerConsumption().
|
private |
List of listeners.
Definition at line 330 of file uan-phy-gen.h.
Referenced by Clear(), NotifyListenersCcaEnd(), NotifyListenersCcaStart(), NotifyListenersRxBad(), NotifyListenersRxGood(), NotifyListenersRxStart(), NotifyListenersTxStart(), and RegisterListener().
MAC layer.
Definition at line 336 of file uan-phy-gen.h.
Referenced by Clear(), SendPacket(), SetMac(), and StartRxPacket().
|
private |
Minimum receive SINR during packet reception.
Definition at line 346 of file uan-phy-gen.h.
Referenced by NotifyTransStartTx(), RxEndEvent(), SendPacket(), and StartRxPacket().
|
private |
List of modes supported by this PHY.
Definition at line 327 of file uan-phy-gen.h.
Referenced by GetMode(), GetNModes(), and GetTypeId().
Error model.
Definition at line 337 of file uan-phy-gen.h.
Referenced by Clear(), GetTypeId(), and RxEndEvent().
|
private |
Provides uniform random variables.
Definition at line 358 of file uan-phy-gen.h.
Referenced by AssignStreams(), RxEndEvent(), and UanPhyGen().
Received packet.
Definition at line 344 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 350 of file uan-phy-gen.h.
Referenced by StartRxPacket().
|
private |
Power delay profile of packet.
Definition at line 349 of file uan-phy-gen.h.
Referenced by StartRxPacket().
Sent packet.
Definition at line 345 of file uan-phy-gen.h.
Referenced by EnergyDepletionHandler(), and SendPacket().
|
private |
Callback for packets received with errors.
Definition at line 332 of file uan-phy-gen.h.
Referenced by RxEndEvent(), and SetReceiveErrorCallback().
|
private |
Callback for packets received without error.
Definition at line 331 of file uan-phy-gen.h.
Referenced by RxEndEvent(), and SetReceiveOkCallback().
|
private |
Rx event.
Definition at line 355 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 365 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 363 of file uan-phy-gen.h.
Referenced by GetTypeId(), and RxEndEvent().
|
private |
|
private |
Receive SINR threshold.
Definition at line 341 of file uan-phy-gen.h.
Referenced by GetRxThresholdDb(), GetTypeId(), SetRxThresholdDb(), and StartRxPacket().
|
private |
SINR calculator.
Definition at line 338 of file uan-phy-gen.h.
Referenced by CalculateSinrDb(), Clear(), and GetTypeId().
|
private |
Phy state.
Definition at line 329 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 334 of file uan-phy-gen.h.
Referenced by CalculateSinrDb(), Clear(), GetInterferenceDb(), GetTransducer(), SendPacket(), and SetTransducer().
|
private |
Tx event.
Definition at line 354 of file uan-phy-gen.h.
Referenced by EnergyDepletionHandler(), and SendPacket().
|
private |
A packet was sent from this Phy.
Definition at line 367 of file uan-phy-gen.h.
Referenced by GetTypeId(), and SendPacket().
|
private |
Transmit power.
Definition at line 340 of file uan-phy-gen.h.
Referenced by GetTxPowerDb(), GetTypeId(), SendPacket(), and SetTxPowerDb().