A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::UanPhyDual Class Reference

Two channel Phy. More...

#include <uan-phy-dual.h>

+ Inheritance diagram for ns3::UanPhyDual:
+ Collaboration diagram for ns3::UanPhyDual:

Public Member Functions

 UanPhyDual ()
 Constructor. More...
 
virtual ~UanPhyDual ()
 Dummy destructor. 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 double GetCcaThresholdDb (void)
 Get the CCA threshold signal strength required to detect channel busy. More...
 
double GetCcaThresholdPhy1 (void) const
 Get the CCA threshold signal strength required to detect channel busy. More...
 
double GetCcaThresholdPhy2 (void) const
 Get the CCA threshold signal strength required to detect channel busy. More...
 
virtual Ptr< UanChannelGetChannel (void) const
 Get the attached channel. More...
 
virtual Ptr< UanNetDeviceGetDevice (void)
 Get the device hosting this Phy. More...
 
virtual UanTxMode GetMode (uint32_t n)
 Get a specific transmission mode. More...
 
UanModesList GetModesPhy1 (void) const
 Get the list of available modes. More...
 
UanModesList GetModesPhy2 (void) const
 Get the list of available modes. More...
 
virtual uint32_t GetNModes (void)
 Get the number of transmission modes supported by this Phy. More...
 
Ptr< PacketGetPacketRx (void) const
 Get the packet currently being received. More...
 
Ptr< UanPhyPerGetPerModelPhy1 (void) const
 Get the error probability model. More...
 
Ptr< UanPhyPerGetPerModelPhy2 (void) const
 Get the error probability model. More...
 
Ptr< PacketGetPhy1PacketRx (void) const
 Get the packet currently being received. More...
 
Ptr< PacketGetPhy2PacketRx (void) const
 Get the packet currently being received. More...
 
virtual double GetRxGainDb (void)
 Get the receiver gain added to signal at receiver in dB. More...
 
double GetRxGainDbPhy1 (void) const
 Get the receiver gain added to signal at receiver in dB. More...
 
double GetRxGainDbPhy2 (void) const
 Get the receiver gain added to signal at receiver in dB. More...
 
virtual double GetRxThresholdDb (void)
 Get the minimum received signal strength required to receive a packet without errors. More...
 
Ptr< UanPhyCalcSinrGetSinrModelPhy1 (void) const
 Get the SINR calculator. More...
 
Ptr< UanPhyCalcSinrGetSinrModelPhy2 (void) const
 Get the SINR calculator. More...
 
virtual Ptr< UanTransducerGetTransducer (void)
 Get the attached transducer. More...
 
virtual double GetTxPowerDb (void)
 Get the current transmit power, in dB. More...
 
double GetTxPowerDbPhy1 (void) const
 Get the current transmit power, in dB. More...
 
double GetTxPowerDbPhy2 (void) const
 Get the current transmit power, in dB. More...
 
bool IsPhy1Idle (void)
 
bool IsPhy1Rx (void)
 
bool IsPhy1Tx (void)
 
bool IsPhy2Idle (void)
 
bool IsPhy2Rx (void)
 
bool IsPhy2Tx (void)
 
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 ammount 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 attched 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...
 
void SetCcaThresholdPhy1 (double thresh)
 Set the threshold for detecting channel busy. More...
 
void SetCcaThresholdPhy2 (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 callback)
 Set the DeviceEnergyModel callback for UanPhy device. More...
 
virtual void SetMac (Ptr< UanMac > mac)
 Set the MAC forwarding messages to this Phy. More...
 
void SetModesPhy1 (UanModesList modes)
 Set the available modes. More...
 
void SetModesPhy2 (UanModesList modes)
 Set the available modes. More...
 
void SetPerModelPhy1 (Ptr< UanPhyPer > per)
 Set the error probability model. More...
 
void SetPerModelPhy2 (Ptr< UanPhyPer > per)
 Set the error probability model. 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 SetRxGainDb (double gain)
 Set the receiver gain. More...
 
void SetRxGainDbPhy1 (double gain)
 Set the receiver gain. More...
 
void SetRxGainDbPhy2 (double gain)
 Set the receiver gain. More...
 
virtual void SetRxThresholdDb (double thresh) NS_DEPRECATED
 Set the minimum SINR threshold to receive a packet without errors. More...
 
void SetSinrModelPhy1 (Ptr< UanPhyCalcSinr > calcSinr)
 Set the SINR calculator. More...
 
void SetSinrModelPhy2 (Ptr< UanPhyCalcSinr > calcSinr)
 Set the SINR calculator. 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...
 
void SetTxPowerDbPhy1 (double txpwr)
 Set the transmit power. More...
 
void SetTxPowerDbPhy2 (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 ()
 
virtual ~Object ()
 
void AggregateObject (Ptr< Object > other)
 
void Dispose (void)
 Run the DoDispose methods of this object and all the objects aggregated to it. More...
 
AggregateIterator GetAggregateIterator (void) const
 
virtual TypeId GetInstanceTypeId (void) const
 
template<typename T >
Ptr< T > GetObject (void) const
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 
void Initialize (void)
 This method calls the virtual DoInitialize method on all the objects aggregated to this object. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment. 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
 
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
 
void SetAttribute (std::string name, const AttributeValue &value)
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 

Static Public Member Functions

static TypeId GetTypeId ()
 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::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
static void Cleanup (void)
 Noop. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Protected Member Functions

virtual void DoDispose ()
 This method is called by Object::Dispose or by the object's destructor, whichever comes first. More...
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 
virtual void DoInitialize (void)
 This method is called only once by Object::Initialize. More...
 
virtual void NotifyNewAggregate (void)
 This method is invoked whenever two sets of objects are aggregated together. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 
virtual void NotifyConstructionCompleted (void)
 This method is invoked once all member attributes have been initialized. More...
 

Private Member Functions

void RxErrFromSubPhy (Ptr< Packet > pkt, double sinr)
 Handle callback and logger for packets received with error. More...
 
void RxOkFromSubPhy (Ptr< Packet > pkt, double sinr, UanTxMode mode)
 Handle callback and logger for packets received without error. More...
 

Private Attributes

Ptr< UanPhym_phy1
 First Phy layer. More...
 
Ptr< UanPhym_phy2
 Second Phy layer. More...
 
RxErrCallback m_recErrCb
 Callback when packet received with errors. More...
 
RxOkCallback m_recOkCb
 Callback when packet received without errors. More...
 
TracedCallback< Ptr< const
Packet >, double, UanTxMode
m_rxErrLogger
 A packet was received unsuccessfully. More...
 
TracedCallback< Ptr< const
Packet >, double, UanTxMode
m_rxOkLogger
 A packet was received successfully. More...
 
TracedCallback< Ptr< const
Packet >, double, UanTxMode
m_txLogger
 A packet was sent from this Phy. 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
}
 Enum defining possible Phy states. More...
 

Detailed Description

Two channel Phy.

A class that wraps two generic UAN Phy layers (UanPhyGen) into a single PHY. This is used to simulate two receivers (and transmitters) that use the same front end hardware. When attached to a UanTransducerHd, this results in a net device able to transmit on one or two channels simultaneously or receive on one or two channels simultaneously but that cannot transmit and receive simultaneously.

Many of the standard PHY functions here become ambiguous. In most cases information for "Phy1" are returned.

Config Paths

ns3::UanPhyDual is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Phy/$ns3::UanPhyDual

Attributes

  • CcaThresholdPhy1: Aggregate energy of incoming signals to move to CCA Busy state dB of Phy1.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 10
    • Flags: construct write read
  • CcaThresholdPhy2: Aggregate energy of incoming signals to move to CCA Busy state dB of Phy2.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 10
    • Flags: construct write read
  • TxPowerPhy1: Transmission output power in dB of Phy1.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 190
    • Flags: construct write read
  • TxPowerPhy2: Transmission output power in dB of Phy2.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 190
    • Flags: construct write read
  • RxGainPhy1: Gain added to incoming signal at receiver of Phy1.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 0
    • Flags: construct write read
  • RxGainPhy2: Gain added to incoming signal at receiver of Phy2.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 0
    • Flags: construct write read
  • SupportedModesPhy1: List of modes supported by Phy1.
  • SupportedModesPhy2: List of modes supported by Phy2.
  • PerModelPhy1: Functor to calculate PER based on SINR and TxMode for Phy1.
    • Set with class: ns3::PointerValue
    • Underlying type: ns3::Ptr< ns3::UanPhyPer >
    • Initial value: 0xb2e8a0
    • Flags: construct write read
  • PerModelPhy2: Functor to calculate PER based on SINR and TxMode for Phy2.
    • Set with class: ns3::PointerValue
    • Underlying type: ns3::Ptr< ns3::UanPhyPer >
    • Initial value: 0xb2e530
    • Flags: construct write read
  • SinrModelPhy1: Functor to calculate SINR based on pkt arrivals and modes for Phy1.
    • Set with class: ns3::PointerValue
    • Underlying type: ns3::Ptr< ns3::UanPhyCalcSinr >
    • Initial value: 0xb2e3e0
    • Flags: construct write read
  • SinrModelPhy2: Functor to calculate SINR based on pkt arrivals and modes for Phy2.
    • Set with class: ns3::PointerValue
    • Underlying type: ns3::Ptr< ns3::UanPhyCalcSinr >
    • Initial value: 0xb2e1c0
    • Flags: construct write read

TraceSources

  • RxOk: A packet was received successfully.
  • RxError: A packet was received unsuccessfully.
  • Tx: Packet transmission beginning.

TraceSources defined in parent class ns3::UanPhy

  • PhyTxBegin: Trace source indicating a packet has begun transmitting over the channel medium.
  • PhyTxEnd: Trace source indicating a packet has been completely transmitted over the channel.
  • PhyTxDrop: Trace source indicating a packet has been dropped by the device during transmission.
  • PhyRxBegin: Trace source indicating a packet has begun being received from the channel medium by the device.
  • PhyRxEnd: Trace source indicating a packet has been completely received from the channel medium by the device.
  • PhyRxDrop: Trace source indicating a packet has been dropped by the device during reception.

Definition at line 82 of file uan-phy-dual.h.

Constructor & Destructor Documentation

ns3::UanPhyDual::UanPhyDual ( )

Constructor.

Definition at line 118 of file uan-phy-dual.cc.

References m_phy1, m_phy2, m_recErrCb, and m_recOkCb.

ns3::UanPhyDual::~UanPhyDual ( )
virtual

Dummy destructor.

See also
DoDispose

Definition at line 133 of file uan-phy-dual.cc.

Member Function Documentation

int64_t ns3::UanPhyDual::AssignStreams ( int64_t  stream)
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.

Parameters
streamFirst stream index to use.
Returns
The number of stream indices assigned by this model.

Implements ns3::UanPhy.

Definition at line 669 of file uan-phy-dual.cc.

References NS_LOG_FUNCTION.

void ns3::UanPhyDual::Clear ( void  )
virtual

Clear all pointer references.

Implements ns3::UanPhy.

Definition at line 138 of file uan-phy-dual.cc.

References m_phy1, and m_phy2.

Referenced by DoDispose().

+ Here is the caller graph for this function:

void ns3::UanPhyDual::DoDispose ( void  )
protectedvirtual

This method is called by Object::Dispose or by the object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overriden 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 152 of file uan-phy-dual.cc.

References Clear(), and ns3::Object::DoDispose().

+ Here is the call graph for this function:

void ns3::UanPhyDual::EnergyDepletionHandler ( void  )
virtual

Handle the energy depletion event.

Implements ns3::UanPhy.

Definition at line 246 of file uan-phy-dual.cc.

References NS_LOG_DEBUG.

double ns3::UanPhyDual::GetCcaThresholdDb ( void  )
virtual

Get the CCA threshold signal strength required to detect channel busy.

Returns
The CCA threshold signal strength in dB.

Implements ns3::UanPhy.

Definition at line 399 of file uan-phy-dual.cc.

References m_phy1, and NS_LOG_WARN.

double ns3::UanPhyDual::GetCcaThresholdPhy1 ( void  ) const

Get the CCA threshold signal strength required to detect channel busy.

Returns
The CCA threshold signal strength in dB.

Definition at line 405 of file uan-phy-dual.cc.

References m_phy1.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

double ns3::UanPhyDual::GetCcaThresholdPhy2 ( void  ) const

Get the CCA threshold signal strength required to detect channel busy.

Returns
The CCA threshold signal strength in dB.

Definition at line 410 of file uan-phy-dual.cc.

References m_phy2.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

Ptr< UanChannel > ns3::UanPhyDual::GetChannel ( void  ) const
virtual

Get the attached channel.

Returns
The channel.

Implements ns3::UanPhy.

Definition at line 492 of file uan-phy-dual.cc.

References m_phy1.

Ptr< UanNetDevice > ns3::UanPhyDual::GetDevice ( void  )
virtual

Get the device hosting this Phy.

Returns
The net device.

Implements ns3::UanPhy.

Definition at line 497 of file uan-phy-dual.cc.

References m_phy1.

UanTxMode ns3::UanPhyDual::GetMode ( uint32_t  n)
virtual

Get a specific transmission mode.

Parameters
nThe mode number.
Returns
The mode.

Implements ns3::UanPhy.

Definition at line 549 of file uan-phy-dual.cc.

References GetNModes(), m_phy1, and m_phy2.

+ Here is the call graph for this function:

UanModesList ns3::UanPhyDual::GetModesPhy1 ( void  ) const

Get the list of available modes.

Returns
The mode list.

Definition at line 562 of file uan-phy-dual.cc.

References m_phy1.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

UanModesList ns3::UanPhyDual::GetModesPhy2 ( void  ) const

Get the list of available modes.

Returns
The mode list.

Definition at line 571 of file uan-phy-dual.cc.

References m_phy2.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

uint32_t ns3::UanPhyDual::GetNModes ( void  )
virtual

Get the number of transmission modes supported by this Phy.

Returns
The number modes.

Implements ns3::UanPhy.

Definition at line 544 of file uan-phy-dual.cc.

References m_phy1, and m_phy2.

Referenced by GetMode(), and SendPacket().

+ Here is the caller graph for this function:

Ptr< Packet > ns3::UanPhyDual::GetPacketRx ( void  ) const
virtual

Get the packet currently being received.

Warning
Returns non-valid pointer if IsStateRx == false.
Returns
The packet.

Implements ns3::UanPhy.

Definition at line 662 of file uan-phy-dual.cc.

References NS_FATAL_ERROR.

Ptr< UanPhyPer > ns3::UanPhyDual::GetPerModelPhy1 ( void  ) const

Get the error probability model.

Returns
The error model.

Definition at line 591 of file uan-phy-dual.cc.

References m_phy1.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

Ptr< UanPhyPer > ns3::UanPhyDual::GetPerModelPhy2 ( void  ) const

Get the error probability model.

Returns
The error model.

Definition at line 599 of file uan-phy-dual.cc.

References m_phy2.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

Ptr< Packet > ns3::UanPhyDual::GetPhy1PacketRx ( void  ) const

Get the packet currently being received.

Warning
Returns non-valid pointer if IsStateRx == false.
Returns
The packet.

Definition at line 445 of file uan-phy-dual.cc.

References m_phy1.

Ptr< Packet > ns3::UanPhyDual::GetPhy2PacketRx ( void  ) const

Get the packet currently being received.

Warning
Returns non-valid pointer if IsStateRx == false.
Returns
The packet.

Definition at line 451 of file uan-phy-dual.cc.

References m_phy2.

double ns3::UanPhyDual::GetRxGainDb ( void  )
virtual

Get the receiver gain added to signal at receiver in dB.

Returns
The gain.

Implements ns3::UanPhy.

Definition at line 357 of file uan-phy-dual.cc.

References m_phy1, and NS_LOG_WARN.

double ns3::UanPhyDual::GetRxGainDbPhy1 ( void  ) const

Get the receiver gain added to signal at receiver in dB.

Returns
The gain.

Definition at line 363 of file uan-phy-dual.cc.

References m_phy1.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

double ns3::UanPhyDual::GetRxGainDbPhy2 ( void  ) const

Get the receiver gain added to signal at receiver in dB.

Returns
The gain.

Definition at line 368 of file uan-phy-dual.cc.

References m_phy2.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

double ns3::UanPhyDual::GetRxThresholdDb ( void  )
virtual

Get the minimum received signal strength required to receive a packet without errors.

Returns
The minimum required signal strength, in dB.

Implements ns3::UanPhy.

Definition at line 393 of file uan-phy-dual.cc.

References m_phy1.

Ptr< UanPhyCalcSinr > ns3::UanPhyDual::GetSinrModelPhy1 ( void  ) const

Get the SINR calculator.

Returns
The SINR calculator.

Definition at line 619 of file uan-phy-dual.cc.

References m_phy1.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

Ptr< UanPhyCalcSinr > ns3::UanPhyDual::GetSinrModelPhy2 ( void  ) const

Get the SINR calculator.

Returns
The SINR calculator.

Definition at line 627 of file uan-phy-dual.cc.

References m_phy2.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

Ptr< UanTransducer > ns3::UanPhyDual::GetTransducer ( void  )
virtual

Get the attached transducer.

Returns
The transducer.

Implements ns3::UanPhy.

Definition at line 538 of file uan-phy-dual.cc.

References m_phy1, and NS_LOG_WARN.

double ns3::UanPhyDual::GetTxPowerDb ( void  )
virtual

Get the current transmit power, in dB.

Returns
The transmit power.

Implements ns3::UanPhy.

Definition at line 374 of file uan-phy-dual.cc.

References m_phy1, and NS_LOG_WARN.

double ns3::UanPhyDual::GetTxPowerDbPhy1 ( void  ) const

Get the current transmit power, in dB.

Returns
The transmit power.

Definition at line 381 of file uan-phy-dual.cc.

References m_phy1.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

double ns3::UanPhyDual::GetTxPowerDbPhy2 ( void  ) const

Get the current transmit power, in dB.

Returns
The transmit power.

Definition at line 387 of file uan-phy-dual.cc.

References m_phy2.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

bool ns3::UanPhyDual::IsPhy1Idle ( void  )

Returns
True if Phy is in IDLE state.

Definition at line 416 of file uan-phy-dual.cc.

References m_phy1.

bool ns3::UanPhyDual::IsPhy1Rx ( void  )

Returns
True if Phy is currently in receive mode.

Definition at line 427 of file uan-phy-dual.cc.

References m_phy1.

bool ns3::UanPhyDual::IsPhy1Tx ( void  )

Returns
True if Phy is busy transmitting.

Definition at line 439 of file uan-phy-dual.cc.

References m_phy1.

bool ns3::UanPhyDual::IsPhy2Idle ( void  )

Returns
True if Phy is in IDLE state.

Definition at line 421 of file uan-phy-dual.cc.

References m_phy2.

bool ns3::UanPhyDual::IsPhy2Rx ( void  )

Returns
True if Phy is currently in receive mode.

Definition at line 433 of file uan-phy-dual.cc.

References m_phy2.

bool ns3::UanPhyDual::IsPhy2Tx ( void  )

Returns
True if Phy is busy transmitting.

Definition at line 457 of file uan-phy-dual.cc.

References m_phy2.

bool ns3::UanPhyDual::IsStateBusy ( void  )
virtual
Returns
True if Phy is neither IDLE nor SLEEP.

Implements ns3::UanPhy.

Definition at line 472 of file uan-phy-dual.cc.

References IsStateIdle(), and IsStateSleep().

+ Here is the call graph for this function:

bool ns3::UanPhyDual::IsStateCcaBusy ( void  )
virtual
Returns
True if Phy is in CCABUSY state.

Implements ns3::UanPhy.

Definition at line 487 of file uan-phy-dual.cc.

References m_phy1, and m_phy2.

bool ns3::UanPhyDual::IsStateIdle ( void  )
virtual
Returns
True if Phy is in IDLE state.

Implements ns3::UanPhy.

Definition at line 467 of file uan-phy-dual.cc.

References m_phy1, and m_phy2.

Referenced by IsStateBusy().

+ Here is the caller graph for this function:

bool ns3::UanPhyDual::IsStateRx ( void  )
virtual
Returns
True if Phy is currently in receive mode.

Implements ns3::UanPhy.

Definition at line 477 of file uan-phy-dual.cc.

References m_phy1, and m_phy2.

bool ns3::UanPhyDual::IsStateSleep ( void  )
virtual
Returns
True if Phy is in SLEEP state.

Implements ns3::UanPhy.

Definition at line 462 of file uan-phy-dual.cc.

References m_phy1, and m_phy2.

Referenced by IsStateBusy().

+ Here is the caller graph for this function:

bool ns3::UanPhyDual::IsStateTx ( void  )
virtual
Returns
True if Phy is busy transmitting.

Implements ns3::UanPhy.

Definition at line 482 of file uan-phy-dual.cc.

References m_phy1, and m_phy2.

void ns3::UanPhyDual::NotifyIntChange ( void  )
virtual

Called when there has been a change in the ammount of interference this node is experiencing from other transmissions.

Implements ns3::UanPhy.

Definition at line 525 of file uan-phy-dual.cc.

References m_phy1, and m_phy2.

void ns3::UanPhyDual::NotifyTransStartTx ( Ptr< Packet packet,
double  txPowerDb,
UanTxMode  txMode 
)
virtual

Called when a transmission is beginning on the attched transducer.

Parameters
packetPacket that is beginning transmission.
txPowerDbTransmit power of packet.
txModeTransmission mode of packet.

Implements ns3::UanPhy.

Definition at line 520 of file uan-phy-dual.cc.

void ns3::UanPhyDual::RegisterListener ( UanPhyListener listener)
virtual

Register a UanPhyListener to be notified of common UanPhy events.

Parameters
listenerNew listener to register.
Note
You may receive duplicate messages as underneath there are two generic phys here. Each will notify of state changes independently.

Implements ns3::UanPhy.

Definition at line 269 of file uan-phy-dual.cc.

References m_phy1, and m_phy2.

void ns3::UanPhyDual::RxErrFromSubPhy ( Ptr< Packet pkt,
double  sinr 
)
private

Handle callback and logger for packets received with error.

Parameters
pktThe packet.
sinrThe SINR.

Definition at line 655 of file uan-phy-dual.cc.

References m_phy1, m_recErrCb, and m_rxErrLogger.

void ns3::UanPhyDual::RxOkFromSubPhy ( Ptr< Packet pkt,
double  sinr,
UanTxMode  mode 
)
private

Handle callback and logger for packets received without error.

Parameters
pktThe packet.
sinrThe SINR.
modeThe channel mode.

Definition at line 647 of file uan-phy-dual.cc.

References m_recOkCb, m_rxOkLogger, ns3::Simulator::Now(), and NS_LOG_DEBUG.

+ Here is the call graph for this function:

void ns3::UanPhyDual::SendPacket ( Ptr< Packet pkt,
uint32_t  modeNum 
)
virtual

Send a packet using a specific transmission mode.

Parameters
pktPacket to transmit.
modeNumIndex of mode in SupportedModes list to use for transmission.

Implements ns3::UanPhy.

Definition at line 252 of file uan-phy-dual.cc.

References GetNModes(), m_phy1, m_phy2, m_txLogger, ns3::Simulator::Now(), and NS_LOG_DEBUG.

+ Here is the call graph for this function:

void ns3::UanPhyDual::SetCcaThresholdDb ( double  thresh)
virtual

Set the threshold for detecting channel busy.

Parameters
threshSignal power threshold at receiver.

Implements ns3::UanPhy.

Definition at line 339 of file uan-phy-dual.cc.

References m_phy1, and m_phy2.

void ns3::UanPhyDual::SetCcaThresholdPhy1 ( double  thresh)

Set the threshold for detecting channel busy.

Parameters
threshSignal power threshold at receiver.

Definition at line 346 of file uan-phy-dual.cc.

References m_phy1.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

void ns3::UanPhyDual::SetCcaThresholdPhy2 ( double  thresh)

Set the threshold for detecting channel busy.

Parameters
threshSignal power threshold at receiver.

Definition at line 351 of file uan-phy-dual.cc.

References m_phy2.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

void ns3::UanPhyDual::SetChannel ( Ptr< UanChannel channel)
virtual

Attach to a channel.

Parameters
channelThe channel to attach to.

Implements ns3::UanPhy.

Definition at line 502 of file uan-phy-dual.cc.

References m_phy1, and m_phy2.

void ns3::UanPhyDual::SetDevice ( Ptr< UanNetDevice device)
virtual

Set the device hosting this Phy.

Parameters
deviceThe device.

Implements ns3::UanPhy.

Definition at line 508 of file uan-phy-dual.cc.

References m_phy1, and m_phy2.

void ns3::UanPhyDual::SetEnergyModelCallback ( DeviceEnergyModel::ChangeStateCallback  callback)
virtual

Set the DeviceEnergyModel callback for UanPhy device.

Parameters
callbackThe DeviceEnergyModel change state callback.

Implements ns3::UanPhy.

Definition at line 240 of file uan-phy-dual.cc.

References NS_LOG_DEBUG.

void ns3::UanPhyDual::SetMac ( Ptr< UanMac mac)
virtual

Set the MAC forwarding messages to this Phy.

Parameters
macThe MAC.

Implements ns3::UanPhy.

Definition at line 514 of file uan-phy-dual.cc.

References m_phy1, and m_phy2.

void ns3::UanPhyDual::SetModesPhy1 ( UanModesList  modes)

Set the available modes.

Parameters
modesList of modes.

Definition at line 579 of file uan-phy-dual.cc.

References m_phy1.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

void ns3::UanPhyDual::SetModesPhy2 ( UanModesList  modes)

Set the available modes.

Parameters
modesList of modes.

Definition at line 585 of file uan-phy-dual.cc.

References m_phy2.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

void ns3::UanPhyDual::SetPerModelPhy1 ( Ptr< UanPhyPer per)

Set the error probability model.

Parameters
perThe error model.

Definition at line 607 of file uan-phy-dual.cc.

References m_phy1.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

void ns3::UanPhyDual::SetPerModelPhy2 ( Ptr< UanPhyPer per)

Set the error probability model.

Parameters
perThe error model.

Definition at line 613 of file uan-phy-dual.cc.

References m_phy2.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

void ns3::UanPhyDual::SetReceiveErrorCallback ( RxErrCallback  cb)
virtual

Set the callback to be used when a packet is received with errors.

Parameters
cbThe callback.

Implements ns3::UanPhy.

Definition at line 289 of file uan-phy-dual.cc.

References m_phy1, and m_phy2.

void ns3::UanPhyDual::SetReceiveOkCallback ( RxOkCallback  cb)
virtual

Set the callback to be used when a packet is received without error.

Parameters
cbThe callback.

Implements ns3::UanPhy.

Definition at line 282 of file uan-phy-dual.cc.

References m_phy1, and m_phy2.

void ns3::UanPhyDual::SetRxGainDb ( double  gain)
virtual

Set the receiver gain.

Parameters
gainGain added at receiver, in dB.

Implements ns3::UanPhy.

Definition at line 296 of file uan-phy-dual.cc.

References m_phy1, and m_phy2.

void ns3::UanPhyDual::SetRxGainDbPhy1 ( double  gain)

Set the receiver gain.

Parameters
gainGain added at receiver, in dB.

Definition at line 302 of file uan-phy-dual.cc.

References m_phy1.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

void ns3::UanPhyDual::SetRxGainDbPhy2 ( double  gain)

Set the receiver gain.

Parameters
gainGain added at receiver, in dB.

Definition at line 308 of file uan-phy-dual.cc.

References m_phy2.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

void ns3::UanPhyDual::SetRxThresholdDb ( double  thresh)
virtual

Set the minimum SINR threshold to receive a packet without errors.

Deprecated:
See UanPhyPer.
Parameters
threshThreshold SINR for propper reception in dB re 1 uPa.

Implements ns3::UanPhy.

Definition at line 332 of file uan-phy-dual.cc.

References m_phy1, m_phy2, and NS_LOG_WARN.

void ns3::UanPhyDual::SetSinrModelPhy1 ( Ptr< UanPhyCalcSinr calcSinr)

Set the SINR calculator.

Parameters
calcSinrThe SINR calculator.

Definition at line 635 of file uan-phy-dual.cc.

References m_phy1.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

void ns3::UanPhyDual::SetSinrModelPhy2 ( Ptr< UanPhyCalcSinr calcSinr)

Set the SINR calculator.

Parameters
calcSinrThe SINR calculator.

Definition at line 641 of file uan-phy-dual.cc.

References m_phy2.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

virtual void ns3::UanPhyDual::SetSleepMode ( bool  sleep)
inlinevirtual

Set the Phy SLEEP mode.

Parameters
sleepSLEEP on or off.
Todo:
This method has to be implemented

Implements ns3::UanPhy.

Definition at line 140 of file uan-phy-dual.h.

void ns3::UanPhyDual::SetTransducer ( Ptr< UanTransducer trans)
virtual

Attach a transducer to this Phy.

Parameters
transThe transducer.

Implements ns3::UanPhy.

Definition at line 532 of file uan-phy-dual.cc.

References m_phy1, and m_phy2.

void ns3::UanPhyDual::SetTxPowerDb ( double  txpwr)
virtual

Set the transmit power.

Parameters
txpwrFinal output transmission power, in dB.

Implements ns3::UanPhy.

Definition at line 314 of file uan-phy-dual.cc.

References m_phy1, and m_phy2.

void ns3::UanPhyDual::SetTxPowerDbPhy1 ( double  txpwr)

Set the transmit power.

Parameters
txpwrFinal output transmission power, in dB.

Definition at line 321 of file uan-phy-dual.cc.

References m_phy1.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

void ns3::UanPhyDual::SetTxPowerDbPhy2 ( double  txpwr)

Set the transmit power.

Parameters
txpwrFinal output transmission power, in dB.

Definition at line 326 of file uan-phy-dual.cc.

References m_phy2.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

void ns3::UanPhyDual::StartRxPacket ( Ptr< Packet pkt,
double  rxPowerDb,
UanTxMode  txMode,
UanPdp  pdp 
)
virtual

Packet arriving from channel: i.e.

leading bit of packet has arrived.

Parameters
pktPacket which is arriving.
rxPowerDbSignal power of incoming packet in dB re 1 uPa.
txModeTransmission mode defining modulation of incoming packet.
pdpPower delay profile of incoming packet.

Implements ns3::UanPhy.

Definition at line 276 of file uan-phy-dual.cc.

Member Data Documentation

RxErrCallback ns3::UanPhyDual::m_recErrCb
private

Callback when packet received with errors.

Definition at line 265 of file uan-phy-dual.h.

Referenced by RxErrFromSubPhy(), and UanPhyDual().

RxOkCallback ns3::UanPhyDual::m_recOkCb
private

Callback when packet received without errors.

Definition at line 263 of file uan-phy-dual.h.

Referenced by RxOkFromSubPhy(), and UanPhyDual().

TracedCallback<Ptr<const Packet>, double, UanTxMode > ns3::UanPhyDual::m_rxErrLogger
private

A packet was received unsuccessfully.

Definition at line 259 of file uan-phy-dual.h.

Referenced by GetTypeId(), and RxErrFromSubPhy().

TracedCallback<Ptr<const Packet>, double, UanTxMode > ns3::UanPhyDual::m_rxOkLogger
private

A packet was received successfully.

Definition at line 257 of file uan-phy-dual.h.

Referenced by GetTypeId(), and RxOkFromSubPhy().

TracedCallback<Ptr<const Packet>, double, UanTxMode > ns3::UanPhyDual::m_txLogger
private

A packet was sent from this Phy.

Definition at line 261 of file uan-phy-dual.h.

Referenced by GetTypeId(), and SendPacket().


The documentation for this class was generated from the following files: