ns-3
|
#include <uan-phy-dual.h>
Public Member Functions | |
virtual void | SetEnergyModelCallback (DeviceEnergyModel::ChangeStateCallback callback) |
virtual void | EnergyDepletionHandler (void) |
virtual void | SendPacket (Ptr< Packet > pkt, uint32_t modeNum) |
virtual void | RegisterListener (UanPhyListener *listener) |
Register a class to receive phy state change notifications. | |
virtual void | StartRxPacket (Ptr< Packet > pkt, double rxPowerDb, UanTxMode txMode, UanPdp pdp) |
Packet arriving from channel: i.e. leading bit of packet has arrived. | |
virtual void | SetReceiveOkCallback (RxOkCallback cb) |
virtual void | SetReceiveErrorCallback (RxErrCallback cb) |
virtual void | SetRxGainDb (double gain) |
virtual void | SetTxPowerDb (double txpwr) |
virtual void | SetRxThresholdDb (double thresh) |
virtual void | SetCcaThresholdDb (double thresh) |
virtual double | GetRxGainDb (void) |
virtual double | GetTxPowerDb (void) |
virtual double | GetRxThresholdDb (void) |
virtual double | GetCcaThresholdDb (void) |
virtual bool | IsStateSleep (void) |
virtual bool | IsStateIdle (void) |
virtual bool | IsStateBusy (void) |
virtual bool | IsStateRx (void) |
virtual bool | IsStateTx (void) |
virtual bool | IsStateCcaBusy (void) |
virtual Ptr< UanChannel > | GetChannel (void) const |
virtual Ptr< UanNetDevice > | GetDevice (void) |
virtual void | SetChannel (Ptr< UanChannel > channel) |
virtual void | SetDevice (Ptr< UanNetDevice > device) |
virtual void | SetMac (Ptr< UanMac > mac) |
virtual void | NotifyTransStartTx (Ptr< Packet > packet, double txPowerDb, UanTxMode txMode) |
virtual void | NotifyIntChange (void) |
virtual void | SetTransducer (Ptr< UanTransducer > trans) |
virtual Ptr< UanTransducer > | GetTransducer (void) |
virtual uint32_t | GetNModes (void) |
virtual UanTxMode | GetMode (uint32_t n) |
virtual void | Clear (void) |
bool | IsPhy1Idle (void) |
bool | IsPhy2Idle (void) |
bool | IsPhy1Rx (void) |
bool | IsPhy2Rx (void) |
bool | IsPhy1Tx (void) |
bool | IsPhy2Tx (void) |
double | GetCcaThresholdPhy1 (void) const |
double | GetCcaThresholdPhy2 (void) const |
void | SetCcaThresholdPhy1 (double thresh) |
void | SetCcaThresholdPhy2 (double thresh) |
double | GetTxPowerDbPhy1 (void) const |
double | GetTxPowerDbPhy2 (void) const |
void | SetTxPowerDbPhy1 (double) |
void | SetTxPowerDbPhy2 (double) |
double | GetRxGainDbPhy1 (void) const |
double | GetRxGainDbPhy2 (void) const |
void | SetRxGainDbPhy1 (double gain) |
void | SetRxGainDbPhy2 (double gain) |
UanModesList | GetModesPhy1 (void) const |
UanModesList | GetModesPhy2 (void) const |
void | SetModesPhy1 (UanModesList modes) |
void | SetModesPhy2 (UanModesList modes) |
Ptr< UanPhyPer > | GetPerModelPhy1 (void) const |
Ptr< UanPhyPer > | GetPerModelPhy2 (void) const |
void | SetPerModelPhy1 (Ptr< UanPhyPer > per) |
void | SetPerModelPhy2 (Ptr< UanPhyPer > per) |
Ptr< UanPhyCalcSinr > | GetSinrModelPhy1 (void) const |
Ptr< UanPhyCalcSinr > | GetSinrModelPhy2 (void) const |
void | SetSinrModelPhy1 (Ptr< UanPhyCalcSinr > calcSinr) |
void | SetSinrModelPhy2 (Ptr< UanPhyCalcSinr > calcSinr) |
virtual void | SetSleepMode (bool sleep) |
Ptr< Packet > | GetPhy1PacketRx (void) const |
Ptr< Packet > | GetPhy2PacketRx (void) const |
Ptr< Packet > | GetPacketRx (void) const |
![]() | |
virtual void | SetReceiveOkCallback (RxOkCallback cb)=0 |
virtual void | SetReceiveErrorCallback (RxErrCallback cb)=0 |
![]() | |
virtual TypeId | GetInstanceTypeId (void) const |
template<typename T > | |
Ptr< T > | GetObject (void) const |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
void | Dispose (void) |
void | AggregateObject (Ptr< Object > other) |
AggregateIterator | GetAggregateIterator (void) const |
void | Start (void) |
![]() | |
SimpleRefCount (const SimpleRefCount &o) | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
uint32_t | GetReferenceCount (void) const |
![]() | |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
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 () |
This method returns the TypeId associated to ns3::UanPhyDual. |
Protected Member Functions | |
virtual void | DoDispose () |
Additional Inherited Members | |
![]() | |
enum | State { IDLE, CCABUSY, RX, TX, SLEEP } |
Enum defining possible Phy states. | |
typedef Callback< void, Ptr < Packet >, double, UanTxMode > | RxOkCallback |
typedef Callback< void, Ptr < Packet >, double > | RxErrCallback |
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.
|
virtual |
Clears all pointer references
Implements ns3::UanPhy.
References ns3::UanPhy::Clear().
Referenced by DoDispose().
|
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.
References Clear().
|
virtual |
This function handles the energy depletion event. Must be implemented by UanPhy child classes.
Implements ns3::UanPhy.
References NS_LOG_DEBUG.
|
virtual |
Implements ns3::UanPhy.
References ns3::UanPhy::GetCcaThresholdDb(), and NS_LOG_WARN.
double ns3::UanPhyDual::GetCcaThresholdPhy1 | ( | void | ) | const |
References ns3::UanPhy::GetCcaThresholdDb().
Referenced by GetTypeId().
double ns3::UanPhyDual::GetCcaThresholdPhy2 | ( | void | ) | const |
Referenced by GetTypeId().
|
virtual |
Implements ns3::UanPhy.
References ns3::UanPhy::GetChannel().
|
virtual |
Implements ns3::UanPhy.
References ns3::UanPhy::GetDevice().
|
virtual |
n | Mode number of mode to return (place in Modeslist) |
Implements ns3::UanPhy.
References ns3::UanPhy::GetMode(), GetNModes(), and ns3::UanPhy::GetNModes().
UanModesList ns3::UanPhyDual::GetModesPhy1 | ( | void | ) | const |
References ns3::ObjectBase::GetAttribute().
Referenced by GetTypeId().
UanModesList ns3::UanPhyDual::GetModesPhy2 | ( | void | ) | const |
Referenced by GetTypeId().
|
virtual |
Implements ns3::UanPhy.
References ns3::UanPhy::GetNModes().
Referenced by GetMode(), and SendPacket().
Implements ns3::UanPhy.
References NS_FATAL_ERROR.
References ns3::ObjectBase::GetAttribute().
Referenced by GetTypeId().
Referenced by GetTypeId().
References ns3::UanPhy::GetPacketRx().
|
virtual |
Implements ns3::UanPhy.
References ns3::UanPhy::GetRxGainDb(), and NS_LOG_WARN.
double ns3::UanPhyDual::GetRxGainDbPhy1 | ( | void | ) | const |
double ns3::UanPhyDual::GetRxGainDbPhy2 | ( | void | ) | const |
Referenced by GetTypeId().
|
virtual |
Implements ns3::UanPhy.
References ns3::UanPhy::GetRxThresholdDb().
Ptr< UanPhyCalcSinr > ns3::UanPhyDual::GetSinrModelPhy1 | ( | void | ) | const |
References ns3::ObjectBase::GetAttribute().
Referenced by GetTypeId().
Ptr< UanPhyCalcSinr > ns3::UanPhyDual::GetSinrModelPhy2 | ( | void | ) | const |
Referenced by GetTypeId().
|
virtual |
Implements ns3::UanPhy.
References ns3::UanPhy::GetTransducer(), and NS_LOG_WARN.
|
virtual |
Implements ns3::UanPhy.
References ns3::UanPhy::GetTxPowerDb(), and NS_LOG_WARN.
double ns3::UanPhyDual::GetTxPowerDbPhy1 | ( | void | ) | const |
References ns3::UanPhy::GetTxPowerDb().
Referenced by GetTypeId().
double ns3::UanPhyDual::GetTxPowerDbPhy2 | ( | void | ) | const |
Referenced by GetTypeId().
|
static |
This method returns the TypeId associated to ns3::UanPhyDual.
This object is accessible through the following paths with Config::Set and Config::Connect:
Attributes defined for this type:
TraceSources defined for this type:
Reimplemented from ns3::UanPhy.
References GetCcaThresholdPhy1(), GetCcaThresholdPhy2(), ns3::UanPhyGen::GetDefaultModes(), GetModesPhy1(), GetModesPhy2(), GetPerModelPhy1(), GetPerModelPhy2(), GetRxGainDbPhy1(), GetRxGainDbPhy2(), GetSinrModelPhy1(), GetSinrModelPhy2(), GetTxPowerDbPhy1(), GetTxPowerDbPhy2(), ns3::MakeTraceSourceAccessor(), SetCcaThresholdPhy1(), SetCcaThresholdPhy2(), SetModesPhy1(), SetModesPhy2(), ns3::TypeId::SetParent(), SetPerModelPhy1(), SetPerModelPhy2(), SetRxGainDbPhy1(), SetRxGainDbPhy2(), SetSinrModelPhy1(), SetSinrModelPhy2(), SetTxPowerDbPhy1(), and SetTxPowerDbPhy2().
bool ns3::UanPhyDual::IsPhy1Idle | ( | void | ) |
/returns True if Phy1 is Idle
References ns3::UanPhy::IsStateIdle().
bool ns3::UanPhyDual::IsPhy1Rx | ( | void | ) |
/returns True if Phy1 is currently in RX mode
References ns3::UanPhy::IsStateRx().
bool ns3::UanPhyDual::IsPhy1Tx | ( | void | ) |
/returns True if Phy1 is in TX mode
References ns3::UanPhy::IsStateTx().
bool ns3::UanPhyDual::IsPhy2Idle | ( | void | ) |
/returns True if Phy2 is Idle
bool ns3::UanPhyDual::IsPhy2Rx | ( | void | ) |
/returns True if Phy2 is currently in RX mode
bool ns3::UanPhyDual::IsPhy2Tx | ( | void | ) |
/returns True if Phy2 is in TX mode
|
virtual |
Implements ns3::UanPhy.
References IsStateIdle(), and IsStateSleep().
|
virtual |
Implements ns3::UanPhy.
References ns3::UanPhy::IsStateCcaBusy().
|
virtual |
Implements ns3::UanPhy.
References ns3::UanPhy::IsStateIdle().
Referenced by IsStateBusy().
|
virtual |
Implements ns3::UanPhy.
References ns3::UanPhy::IsStateRx().
|
virtual |
Implements ns3::UanPhy.
References ns3::UanPhy::IsStateSleep().
Referenced by IsStateBusy().
|
virtual |
Implements ns3::UanPhy.
References ns3::UanPhy::IsStateTx().
|
virtual |
Function called when there has been a change in the ammount of interference this node is experiencing from other transmissions
Implements ns3::UanPhy.
References ns3::UanPhy::NotifyIntChange().
|
virtual |
packet | Packet that is beginning transmission |
txPowerDb | Transmit power of packet |
txMode | Transmission mode of packet |
Notification that there is a transmission beginning on the transducer that this Phy is attached to.
Implements ns3::UanPhy.
|
virtual |
Register a class to receive phy state change notifications.
listener | Class derived from UanPhyListener to receive notifications |
Note that, from UanPhyDual, you may receive duplicate messages as underneath there are two generic phys here. Each will notify of state changes independently.
Implements ns3::UanPhy.
References ns3::UanPhy::RegisterListener().
pkt | Packet to transmit |
modeNum | Index of mode in SupportedModes list to use for transmission |
Implements ns3::UanPhy.
References ns3::UanPhy::GetMode(), GetNModes(), ns3::UanPhy::GetNModes(), ns3::UanPhy::GetTxPowerDb(), ns3::Simulator::Now(), NS_LOG_DEBUG, and ns3::UanPhy::SendPacket().
|
virtual |
thresh | Signal power at receiver required for CCA busy state |
Implements ns3::UanPhy.
References ns3::UanPhy::SetCcaThresholdDb().
void ns3::UanPhyDual::SetCcaThresholdPhy1 | ( | double | thresh | ) |
thresh | Signal power threshold in dB to set Phy1 to |
References ns3::UanPhy::SetCcaThresholdDb().
Referenced by GetTypeId().
void ns3::UanPhyDual::SetCcaThresholdPhy2 | ( | double | thresh | ) |
thresh | Signal power threshold in dB to set Phy2 to |
Referenced by GetTypeId().
|
virtual |
channel | The channel this Phy is attached to |
Implements ns3::UanPhy.
References ns3::UanPhy::SetChannel().
|
virtual |
device | The Net Device this Phy is a part of |
Implements ns3::UanPhy.
References ns3::UanPhy::SetDevice().
|
virtual |
callback | DeviceEnergyModel change state callback. |
This function sets the DeviceEnergyModel callback for UanPhy device. Must be implemented by UanPhy child classes.
Implements ns3::UanPhy.
References NS_LOG_DEBUG.
mac | The MAC forwarding messages to this Phy |
Implements ns3::UanPhy.
References ns3::UanPhy::SetMac().
void ns3::UanPhyDual::SetModesPhy1 | ( | UanModesList | modes | ) |
modes | List of modes to use on Phy1 (index corresponds to mode #) |
References ns3::ObjectBase::SetAttribute().
Referenced by GetTypeId().
void ns3::UanPhyDual::SetModesPhy2 | ( | UanModesList | modes | ) |
modes | List of modes to use on Phy2 (index corresponds to mode #) |
Referenced by GetTypeId().
per | Ptr to PER model to use on Phy1 |
References ns3::ObjectBase::SetAttribute().
Referenced by GetTypeId().
per | Ptr to PER model to use on Phy2 |
Referenced by GetTypeId().
|
virtual |
gain | Gain added at receiver |
Implements ns3::UanPhy.
References ns3::UanPhy::SetRxGainDb().
void ns3::UanPhyDual::SetRxGainDbPhy1 | ( | double | gain | ) |
gain | value in dB to apply to RX gain of Phy1 |
References ns3::UanPhy::SetRxGainDb().
Referenced by GetTypeId().
void ns3::UanPhyDual::SetRxGainDbPhy2 | ( | double | gain | ) |
gain | value in dB to apply to RX gain of Phy2 |
Referenced by GetTypeId().
|
virtual |
thresh | Threshold SINR for propper reception in dB |
Implements ns3::UanPhy.
References NS_LOG_WARN, and ns3::UanPhy::SetRxThresholdDb().
void ns3::UanPhyDual::SetSinrModelPhy1 | ( | Ptr< UanPhyCalcSinr > | calcSinr | ) |
calcSinr | Ptr to SINR model to use on Phy1 |
References ns3::ObjectBase::SetAttribute().
Referenced by GetTypeId().
void ns3::UanPhyDual::SetSinrModelPhy2 | ( | Ptr< UanPhyCalcSinr > | calcSinr | ) |
calcSinr | Ptr to SINR model to use on Phy2 |
Referenced by GetTypeId().
|
virtual |
trans | Transducer this Phy outputs to / receives from |
Implements ns3::UanPhy.
References ns3::UanPhy::SetTransducer().
|
virtual |
txpwr | Final output transmission power in dB |
Implements ns3::UanPhy.
References ns3::UanPhy::SetTxPowerDb().
void ns3::UanPhyDual::SetTxPowerDbPhy1 | ( | double | txpwr | ) |
References ns3::UanPhy::SetTxPowerDb().
Referenced by GetTypeId().
void ns3::UanPhyDual::SetTxPowerDbPhy2 | ( | double | txpwr | ) |
Referenced by GetTypeId().
|
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 |
txMode | Transmission mode defining modulation of incoming packet |
pdp | Power delay profile of incoming packet |
Implements ns3::UanPhy.