Base class for UAN Phy models. More...
#include "uan-phy.h"
Public Types | |
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. | |
Public Member Functions | |
virtual int64_t | AssignStreams (int64_t stream)=0 |
Assign a fixed random variable stream number to the random variables used by this model. | |
virtual void | Clear ()=0 |
Clear all pointer references. | |
virtual void | EnergyDepletionHandler ()=0 |
Handle the energy depletion event. | |
virtual void | EnergyRechargeHandler ()=0 |
Handle the energy recharge event. | |
virtual double | GetCcaThresholdDb ()=0 |
Get the CCA threshold signal strength required to detect channel busy. | |
virtual Ptr< UanChannel > | GetChannel () const =0 |
Get the attached channel. | |
virtual Ptr< UanNetDevice > | GetDevice () const =0 |
Get the device hosting this Phy. | |
virtual UanTxMode | GetMode (uint32_t n)=0 |
Get a specific transmission mode. | |
virtual uint32_t | GetNModes ()=0 |
Get the number of transmission modes supported by this Phy. | |
virtual Ptr< Packet > | GetPacketRx () const =0 |
Get the packet currently being received. | |
virtual double | GetRxThresholdDb ()=0 |
Get the minimum received signal strength required to receive a packet without errors. | |
virtual Ptr< UanTransducer > | GetTransducer ()=0 |
Get the attached transducer. | |
virtual double | GetTxPowerDb ()=0 |
Get the current transmit power, in dB. | |
virtual bool | IsStateBusy ()=0 |
virtual bool | IsStateCcaBusy ()=0 |
virtual bool | IsStateIdle ()=0 |
virtual bool | IsStateRx ()=0 |
virtual bool | IsStateSleep ()=0 |
virtual bool | IsStateTx ()=0 |
virtual void | NotifyIntChange ()=0 |
Called when there has been a change in the amount of interference this node is experiencing from other transmissions. | |
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. | |
virtual void | NotifyTransStartTx (Ptr< Packet > packet, double txPowerDb, UanTxMode txMode)=0 |
Called when a transmission is beginning on the attached transducer. | |
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. | |
virtual void | RegisterListener (UanPhyListener *listener)=0 |
Register a UanPhyListener to be notified of common UanPhy events. | |
virtual void | SendPacket (Ptr< Packet > pkt, uint32_t modeNum)=0 |
Send a packet using a specific transmission mode. | |
virtual void | SetCcaThresholdDb (double thresh)=0 |
Set the threshold for detecting channel busy. | |
virtual void | SetChannel (Ptr< UanChannel > channel)=0 |
Attach to a channel. | |
virtual void | SetDevice (Ptr< UanNetDevice > device)=0 |
Set the device hosting this Phy. | |
virtual void | SetEnergyModelCallback (DeviceEnergyModel::ChangeStateCallback callback)=0 |
Set the DeviceEnergyModel callback for UanPhy device. | |
virtual void | SetMac (Ptr< UanMac > mac)=0 |
Set the MAC forwarding messages to this Phy. | |
virtual void | SetReceiveErrorCallback (RxErrCallback cb)=0 |
Set the callback to be used when a packet is received with errors. | |
virtual void | SetReceiveOkCallback (RxOkCallback cb)=0 |
Set the callback to be used when a packet is received without error. | |
virtual void | SetRxThresholdDb (double thresh)=0 |
Set the minimum SINR threshold to receive a packet without errors. | |
virtual void | SetSleepMode (bool sleep)=0 |
Set the Phy SLEEP mode. | |
virtual void | SetTransducer (Ptr< UanTransducer > trans)=0 |
Attach a transducer to this Phy. | |
virtual void | SetTxPowerDb (double txpwr)=0 |
Set the transmit power. | |
virtual void | StartRxPacket (Ptr< Packet > pkt, double rxPowerDb, UanTxMode txMode, UanPdp pdp)=0 |
Packet arriving from channel: i.e. | |
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. | |
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) 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. | |
virtual TypeId | GetInstanceTypeId () const =0 |
Get the most derived TypeId for this Object. | |
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 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. | |
Private Attributes | |
ns3::TracedCallback< Ptr< const Packet > > | m_phyRxBeginTrace |
Trace source indicating a packet has begun being received from the channel medium by the device. | |
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. | |
ns3::TracedCallback< Ptr< const Packet > > | m_phyTxBeginTrace |
Trace source indicating a packet has begun transmitting over the channel medium. | |
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_phyTxEndTrace |
Trace source indicating a packet has been completely transmitted over the channel. | |
Additional Inherited Members | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. | |
virtual void | DoDispose () |
Destructor implementation. | |
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. | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
Base class for UAN Phy models.
ns3::UanPhy is accessible through the following paths with Config::Set and Config::Connect:
No Attributes are defined for this type.
Size of this type is 128 bytes (on a 64-bit architecture).
typedef Callback<void, Ptr<Packet>, double> ns3::UanPhy::RxErrCallback |
TracedCallback signature for UanPhy packet send/receive events.
[in] | pkt | The packet. |
[in] | sinr | The SINR. |
[in] | mode | The channel mode. |
enum ns3::UanPhy::State |
|
pure 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. |
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
Clear all pointer references.
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
Handle the energy depletion event.
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
Handle the energy recharge event.
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
Get the CCA threshold signal strength required to detect channel busy.
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
|
pure virtual |
Get the device hosting this Phy.
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
Get a specific transmission mode.
n | The mode number. |
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
Get the number of transmission modes supported by this Phy.
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
Get the packet currently being received.
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
Get the minimum received signal strength required to receive a packet without errors.
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
Get the attached transducer.
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
Get the current transmit power, in dB.
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
static |
Register this type.
Definition at line 70 of file uan-phy.cc.
References m_phyRxBeginTrace, m_phyRxDropTrace, m_phyRxEndTrace, m_phyTxBeginTrace, m_phyTxDropTrace, m_phyTxEndTrace, ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().
|
pure virtual |
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
Called when there has been a change in the amount of interference this node is experiencing from other transmissions.
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
Called when the Phy begins to receive a packet.
This fires a PhyRxBegin trace. Implemented for encapsulation purposes.
packet | The packet. |
Definition at line 128 of file uan-phy.cc.
References m_phyRxBeginTrace.
Referenced by ns3::UanPhyGen::StartRxPacket().
Called when the Phy drops a packet.
This fires a PhyRxDrop trace. Implemented for encapsulation purposes.
packet | The packet. |
Definition at line 140 of file uan-phy.cc.
References m_phyRxDropTrace.
Referenced by ns3::UanPhyGen::EnergyDepletionHandler(), ns3::UanPhyGen::RxEndEvent(), and ns3::UanPhyGen::StartRxPacket().
Called when a packet is received without error.
This fires a PhyRxEnd trace. Implemented for encapsulation purposes.
packet | The packet. |
Definition at line 134 of file uan-phy.cc.
References m_phyRxEndTrace.
Referenced by ns3::UanPhyGen::RxEndEvent().
|
pure 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. |
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
Called when the transducer begins transmitting a packet.
This fires a PhyTxBegin trace. Implemented for encapsulation purposes.
packet | The packet. |
Definition at line 110 of file uan-phy.cc.
References m_phyTxBeginTrace.
Called when the transducer attempts to transmit a new packet while already transmitting a prior packet.
This fires a PhyTxDrop trace. Implemented for encapsulation purposes.
packet | The packet. |
Definition at line 122 of file uan-phy.cc.
References m_phyTxDropTrace.
Referenced by ns3::UanPhyGen::EnergyDepletionHandler().
Called when the transducer finishes transmitting a packet.
This fires a PhyTxEnd trace. Implemented for encapsulation purposes.
packet | The packet. |
Definition at line 116 of file uan-phy.cc.
References m_phyTxEndTrace.
Referenced by ns3::UanTransducerHd::Transmit().
|
pure virtual |
Register a UanPhyListener to be notified of common UanPhy events.
listener | New listener to register. |
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
Send a packet using a specific transmission mode.
pkt | Packet to transmit. |
modeNum | Index of mode in SupportedModes list to use for transmission. |
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
Set the threshold for detecting channel busy.
thresh | Signal power threshold at receiver. |
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
Attach to a channel.
channel | The channel to attach to. |
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
Set the device hosting this Phy.
device | The device. |
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
Set the DeviceEnergyModel callback for UanPhy device.
callback | The DeviceEnergyModel change state callback. |
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
Set the MAC forwarding messages to this Phy.
mac | The MAC. |
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
Set the callback to be used when a packet is received with errors.
cb | The callback. |
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
Set the callback to be used when a packet is received without error.
cb | The callback. |
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
Set the minimum SINR threshold to receive a packet without errors.
thresh | Threshold SINR for proper reception in dB re 1 uPa. |
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
Set the Phy SLEEP mode.
sleep | SLEEP on or off. |
Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.
|
pure virtual |
Attach a transducer to this Phy.
trans | The transducer. |
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure virtual |
Set the transmit power.
txpwr | Final output transmission power, in dB. |
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
pure 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. |
Implemented in ns3::UanPhyDual, and ns3::UanPhyGen.
|
private |
Trace source indicating a packet has begun being received from the channel medium by the device.
Definition at line 533 of file uan-phy.h.
Referenced by GetTypeId(), and NotifyRxBegin().
|
private |
Trace source indicating a packet has been dropped by the device during reception.
Definition at line 549 of file uan-phy.h.
Referenced by GetTypeId(), and NotifyRxDrop().
|
private |
Trace source indicating a packet has been completely received from the channel medium by the device.
Definition at line 541 of file uan-phy.h.
Referenced by GetTypeId(), and NotifyRxEnd().
|
private |
Trace source indicating a packet has begun transmitting over the channel medium.
Definition at line 509 of file uan-phy.h.
Referenced by GetTypeId(), and NotifyTxBegin().
|
private |
Trace source indicating a packet has been dropped by the device during transmission.
Definition at line 525 of file uan-phy.h.
Referenced by GetTypeId(), and NotifyTxDrop().
|
private |
Trace source indicating a packet has been completely transmitted over the channel.
Definition at line 517 of file uan-phy.h.
Referenced by GetTypeId(), and NotifyTxEnd().