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

#include <wifi-phy-state-helper.h>

+ Inheritance diagram for ns3::WifiPhyStateHelper:
+ Collaboration diagram for ns3::WifiPhyStateHelper:

Public Member Functions

 WifiPhyStateHelper ()
Time GetDelayUntilIdle (void)
Time GetLastRxStartTime (void) const
enum WifiPhy::State GetState (void)
Time GetStateDuration (void)
bool IsStateBusy (void)
bool IsStateCcaBusy (void)
bool IsStateIdle (void)
bool IsStateRx (void)
bool IsStateSwitching (void)
bool IsStateTx (void)
void RegisterListener (WifiPhyListener *listener)
void SetReceiveErrorCallback (WifiPhy::RxErrorCallback callback)
void SetReceiveOkCallback (WifiPhy::RxOkCallback callback)
void SwitchFromRxEndError (Ptr< const Packet > packet, double snr)
void SwitchFromRxEndOk (Ptr< Packet > packet, double snr, WifiMode mode, enum WifiPreamble preamble)
void SwitchMaybeToCcaBusy (Time duration)
void SwitchToChannelSwitching (Time switchingDuration)
void SwitchToRx (Time rxDuration)
void SwitchToTx (Time txDuration, Ptr< const Packet > packet, WifiMode txMode, WifiPreamble preamble, uint8_t txPower)
- Public Member Functions inherited from ns3::Object
 Object ()
virtual ~Object ()
void AggregateObject (Ptr< Object > other)
void Dispose (void)
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 Start (void)
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 SimpleRefCount (const SimpleRefCount &o)
uint32_t GetReferenceCount (void) const
SimpleRefCountoperator= (const SimpleRefCount &o)
void Ref (void) const
void Unref (void) const
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
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 (void)
 This method returns the TypeId associated to ns3::WifiPhyStateHelper.

Public Attributes

TracedCallback< Time, Time,
enum WifiPhy::State
m_stateLogger

Private Types

typedef std::vector
< WifiPhyListener * > 
Listeners

Private Member Functions

void DoSwitchFromRx (void)
void LogPreviousIdleAndCcaBusyStates (void)
void NotifyMaybeCcaBusyStart (Time duration)
void NotifyRxEndError (void)
void NotifyRxEndOk (void)
void NotifyRxStart (Time duration)
void NotifySwitchingStart (Time duration)
void NotifyTxStart (Time duration)
void NotifyWakeup (void)

Private Attributes

Time m_endCcaBusy
Time m_endRx
Time m_endSwitching
Time m_endTx
Listeners m_listeners
Time m_previousStateChangeTime
WifiPhy::RxErrorCallback m_rxErrorCallback
TracedCallback< Ptr< const
Packet >, double > 
m_rxErrorTrace
bool m_rxing
WifiPhy::RxOkCallback m_rxOkCallback
TracedCallback< Ptr< const
Packet >, double, WifiMode,
enum WifiPreamble
m_rxOkTrace
Time m_startCcaBusy
Time m_startRx
Time m_startSwitching
Time m_startTx
TracedCallback< Ptr< const
Packet >, WifiMode,
WifiPreamble, uint8_t > 
m_txTrace

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
virtual void DoDispose (void)
virtual void DoStart (void)
virtual void NotifyNewAggregate (void)

Detailed Description

This objects implements the PHY state machine of the Wifi device.

Definition at line 35 of file wifi-phy-state-helper.h.

Member Typedef Documentation

typedef std::vector<WifiPhyListener *> ns3::WifiPhyStateHelper::Listeners
private

Definition at line 65 of file wifi-phy-state-helper.h.

Constructor & Destructor Documentation

ns3::WifiPhyStateHelper::WifiPhyStateHelper ( )

Definition at line 52 of file wifi-phy-state-helper.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

void ns3::WifiPhyStateHelper::DoSwitchFromRx ( void  )
private

Definition at line 392 of file wifi-phy-state-helper.cc.

References IsStateCcaBusy(), IsStateIdle(), IsStateRx(), m_previousStateChangeTime, m_rxing, m_startRx, m_stateLogger, ns3::Now(), NS_ASSERT, and ns3::WifiPhy::RX.

Referenced by SwitchFromRxEndError(), and SwitchFromRxEndOk().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Time ns3::WifiPhyStateHelper::GetDelayUntilIdle ( void  )
Time ns3::WifiPhyStateHelper::GetLastRxStartTime ( void  ) const

Definition at line 154 of file wifi-phy-state-helper.cc.

References m_startRx.

Referenced by ns3::YansWifiPhy::GetLastRxStartTime().

+ Here is the caller graph for this function:

Time ns3::WifiPhyStateHelper::GetStateDuration ( void  )

Definition at line 117 of file wifi-phy-state-helper.cc.

References m_previousStateChangeTime, and ns3::Now().

Referenced by ns3::YansWifiPhy::GetStateDuration().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TypeId ns3::WifiPhyStateHelper::GetTypeId ( void  )
static

This method returns the TypeId associated to ns3::WifiPhyStateHelper.

This object is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/State

No Attributes defined for this type.
TraceSources defined for this type:

  • State: The state of the PHY layer
  • RxOk: A packet has been received successfully.
  • RxError: A packet has been received unsuccessfully.
  • Tx: Packet transmission is starting.

Reimplemented from ns3::Object.

Definition at line 32 of file wifi-phy-state-helper.cc.

References m_rxErrorTrace, m_rxOkTrace, m_stateLogger, m_txTrace, ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

bool ns3::WifiPhyStateHelper::IsStateBusy ( void  )

Definition at line 89 of file wifi-phy-state-helper.cc.

References GetState(), and ns3::WifiPhy::IDLE.

Referenced by ns3::YansWifiPhy::IsStateBusy().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::WifiPhyStateHelper::IsStateCcaBusy ( void  )

Definition at line 94 of file wifi-phy-state-helper.cc.

References ns3::WifiPhy::CCA_BUSY, and GetState().

Referenced by DoSwitchFromRx(), ns3::YansWifiPhy::IsStateCcaBusy(), and SwitchToRx().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::WifiPhyStateHelper::IsStateIdle ( void  )

Definition at line 84 of file wifi-phy-state-helper.cc.

References GetState(), and ns3::WifiPhy::IDLE.

Referenced by DoSwitchFromRx(), ns3::YansWifiPhy::IsStateIdle(), and SwitchToRx().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::WifiPhyStateHelper::IsStateRx ( void  )

Definition at line 99 of file wifi-phy-state-helper.cc.

References GetState(), and ns3::WifiPhy::RX.

Referenced by DoSwitchFromRx(), ns3::YansWifiPhy::IsStateRx(), ns3::YansWifiPhy::SendPacket(), and SwitchToRx().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::WifiPhyStateHelper::IsStateSwitching ( void  )

Definition at line 109 of file wifi-phy-state-helper.cc.

References GetState(), and ns3::WifiPhy::SWITCHING.

Referenced by ns3::YansWifiPhy::IsStateSwitching(), ns3::YansWifiPhy::SendPacket(), and SwitchToChannelSwitching().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::WifiPhyStateHelper::IsStateTx ( void  )

Definition at line 104 of file wifi-phy-state-helper.cc.

References GetState(), and ns3::WifiPhy::TX.

Referenced by ns3::YansWifiPhy::IsStateTx(), and ns3::YansWifiPhy::SendPacket().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::WifiPhyStateHelper::LogPreviousIdleAndCcaBusyStates ( void  )
private

Definition at line 235 of file wifi-phy-state-helper.cc.

References ns3::WifiPhy::CCA_BUSY, ns3::WifiPhy::IDLE, m_endCcaBusy, m_endRx, m_endSwitching, m_endTx, m_startCcaBusy, m_stateLogger, ns3::Max(), ns3::Now(), and NS_ASSERT.

Referenced by SwitchMaybeToCcaBusy(), SwitchToChannelSwitching(), SwitchToRx(), and SwitchToTx().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::WifiPhyStateHelper::NotifyMaybeCcaBusyStart ( Time  duration)
private

Definition at line 218 of file wifi-phy-state-helper.cc.

References m_listeners.

Referenced by SwitchMaybeToCcaBusy().

+ Here is the caller graph for this function:

void ns3::WifiPhyStateHelper::NotifyRxEndError ( void  )
private

Definition at line 210 of file wifi-phy-state-helper.cc.

References m_listeners.

Referenced by SwitchFromRxEndError().

+ Here is the caller graph for this function:

void ns3::WifiPhyStateHelper::NotifyRxEndOk ( void  )
private

Definition at line 202 of file wifi-phy-state-helper.cc.

References m_listeners.

Referenced by SwitchFromRxEndOk().

+ Here is the caller graph for this function:

void ns3::WifiPhyStateHelper::NotifyRxStart ( Time  duration)
private

Definition at line 194 of file wifi-phy-state-helper.cc.

References m_listeners.

Referenced by SwitchToRx().

+ Here is the caller graph for this function:

void ns3::WifiPhyStateHelper::NotifySwitchingStart ( Time  duration)
private

Definition at line 226 of file wifi-phy-state-helper.cc.

References m_listeners.

Referenced by SwitchToChannelSwitching().

+ Here is the caller graph for this function:

void ns3::WifiPhyStateHelper::NotifyTxStart ( Time  duration)
private

Definition at line 186 of file wifi-phy-state-helper.cc.

References m_listeners.

Referenced by SwitchToTx().

+ Here is the caller graph for this function:

void ns3::WifiPhyStateHelper::NotifyWakeup ( void  )
private
void ns3::WifiPhyStateHelper::RegisterListener ( WifiPhyListener listener)

Definition at line 78 of file wifi-phy-state-helper.cc.

References m_listeners.

Referenced by ns3::YansWifiPhy::RegisterListener().

+ Here is the caller graph for this function:

void ns3::WifiPhyStateHelper::SetReceiveErrorCallback ( WifiPhy::RxErrorCallback  callback)

Definition at line 73 of file wifi-phy-state-helper.cc.

References m_rxErrorCallback.

Referenced by ns3::YansWifiPhy::SetReceiveErrorCallback().

+ Here is the caller graph for this function:

void ns3::WifiPhyStateHelper::SetReceiveOkCallback ( WifiPhy::RxOkCallback  callback)

Definition at line 68 of file wifi-phy-state-helper.cc.

References m_rxOkCallback.

Referenced by ns3::YansWifiPhy::SetReceiveOkCallback().

+ Here is the caller graph for this function:

void ns3::WifiPhyStateHelper::SwitchFromRxEndError ( Ptr< const Packet packet,
double  snr 
)

Definition at line 380 of file wifi-phy-state-helper.cc.

References DoSwitchFromRx(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_rxErrorCallback, m_rxErrorTrace, and NotifyRxEndError().

Referenced by ns3::YansWifiPhy::EndReceive().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::WifiPhyStateHelper::SwitchFromRxEndOk ( Ptr< Packet packet,
double  snr,
WifiMode  mode,
enum WifiPreamble  preamble 
)

Definition at line 368 of file wifi-phy-state-helper.cc.

References DoSwitchFromRx(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_rxOkCallback, m_rxOkTrace, and NotifyRxEndOk().

Referenced by ns3::YansWifiPhy::EndReceive().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::WifiPhyStateHelper::SwitchMaybeToCcaBusy ( Time  duration)
void ns3::WifiPhyStateHelper::SwitchToTx ( Time  txDuration,
Ptr< const Packet packet,
WifiMode  txMode,
WifiPreamble  preamble,
uint8_t  txPower 
)

Member Data Documentation

Time ns3::WifiPhyStateHelper::m_endCcaBusy
private
Time ns3::WifiPhyStateHelper::m_endRx
private
Time ns3::WifiPhyStateHelper::m_endSwitching
private
Time ns3::WifiPhyStateHelper::m_endTx
private
Listeners ns3::WifiPhyStateHelper::m_listeners
private
Time ns3::WifiPhyStateHelper::m_previousStateChangeTime
private
WifiPhy::RxErrorCallback ns3::WifiPhyStateHelper::m_rxErrorCallback
private

Definition at line 94 of file wifi-phy-state-helper.h.

Referenced by SetReceiveErrorCallback(), and SwitchFromRxEndError().

TracedCallback<Ptr<const Packet>, double> ns3::WifiPhyStateHelper::m_rxErrorTrace
private

Definition at line 91 of file wifi-phy-state-helper.h.

Referenced by GetTypeId(), and SwitchFromRxEndError().

bool ns3::WifiPhyStateHelper::m_rxing
private
WifiPhy::RxOkCallback ns3::WifiPhyStateHelper::m_rxOkCallback
private

Definition at line 93 of file wifi-phy-state-helper.h.

Referenced by SetReceiveOkCallback(), and SwitchFromRxEndOk().

TracedCallback<Ptr<const Packet>, double, WifiMode, enum WifiPreamble> ns3::WifiPhyStateHelper::m_rxOkTrace
private

Definition at line 90 of file wifi-phy-state-helper.h.

Referenced by GetTypeId(), and SwitchFromRxEndOk().

Time ns3::WifiPhyStateHelper::m_startCcaBusy
private
Time ns3::WifiPhyStateHelper::m_startRx
private
Time ns3::WifiPhyStateHelper::m_startSwitching
private

Definition at line 86 of file wifi-phy-state-helper.h.

Referenced by SwitchToChannelSwitching().

Time ns3::WifiPhyStateHelper::m_startTx
private

Definition at line 83 of file wifi-phy-state-helper.h.

Referenced by SwitchToTx().

TracedCallback<Ptr<const Packet>,WifiMode,WifiPreamble,uint8_t> ns3::WifiPhyStateHelper::m_txTrace
private

Definition at line 92 of file wifi-phy-state-helper.h.

Referenced by GetTypeId(), and SwitchToTx().


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