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

#include <wifi-radio-energy-model.h>

+ Inheritance diagram for ns3::WifiRadioEnergyModelPhyListener:
+ Collaboration diagram for ns3::WifiRadioEnergyModelPhyListener:

Public Member Functions

 WifiRadioEnergyModelPhyListener ()
virtual ~WifiRadioEnergyModelPhyListener ()
virtual void NotifyMaybeCcaBusyStart (Time duration)
virtual void NotifyRxEndError (void)
 Switches the WifiRadioEnergyModel back to IDLE state.
virtual void NotifyRxEndOk (void)
 Switches the WifiRadioEnergyModel back to IDLE state.
virtual void NotifyRxStart (Time duration)
 Switches the WifiRadioEnergyModel to RX state.
virtual void NotifySwitchingStart (Time duration)
virtual void NotifyTxStart (Time duration)
 Switches the WifiRadioEnergyModel to TX state and switches back to IDLE after TX duration.
void SetChangeStateCallback (DeviceEnergyModel::ChangeStateCallback callback)
 Sets the change state callback. Used by helper class.
- Public Member Functions inherited from ns3::WifiPhyListener
virtual ~WifiPhyListener ()

Private Member Functions

void SwitchToIdle (void)

Private Attributes

DeviceEnergyModel::ChangeStateCallback m_changeStateCallback
EventId m_switchToIdleEvent

Detailed Description

A WifiPhy listener class for notifying the WifiRadioEnergyModel of Wifi radio state change.

Definition at line 38 of file wifi-radio-energy-model.h.

Constructor & Destructor Documentation

ns3::WifiRadioEnergyModelPhyListener::WifiRadioEnergyModelPhyListener ( )

Definition at line 319 of file wifi-radio-energy-model.cc.

References m_changeStateCallback, and ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::Nullify().

+ Here is the call graph for this function:

ns3::WifiRadioEnergyModelPhyListener::~WifiRadioEnergyModelPhyListener ( )
virtual

Definition at line 324 of file wifi-radio-energy-model.cc.

Member Function Documentation

void ns3::WifiRadioEnergyModelPhyListener::NotifyMaybeCcaBusyStart ( Time  duration)
virtual
void ns3::WifiRadioEnergyModelPhyListener::NotifyRxEndError ( void  )
virtual

Switches the WifiRadioEnergyModel back to IDLE state.

Defined in ns3::WifiPhyListener

Note that for the WifiRadioEnergyModel, the behavior of the function is the same as NotifyRxEndOk.

Implements ns3::WifiPhyListener.

Definition at line 357 of file wifi-radio-energy-model.cc.

References ns3::WifiPhy::IDLE, ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_changeStateCallback, and NS_FATAL_ERROR.

+ Here is the call graph for this function:

void ns3::WifiRadioEnergyModelPhyListener::NotifyRxEndOk ( void  )
virtual

Switches the WifiRadioEnergyModel back to IDLE state.

Defined in ns3::WifiPhyListener

Note that for the WifiRadioEnergyModel, the behavior of the function is the same as NotifyRxEndError.

Implements ns3::WifiPhyListener.

Definition at line 347 of file wifi-radio-energy-model.cc.

References ns3::WifiPhy::IDLE, ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_changeStateCallback, and NS_FATAL_ERROR.

+ Here is the call graph for this function:

void ns3::WifiRadioEnergyModelPhyListener::NotifyRxStart ( Time  duration)
virtual

Switches the WifiRadioEnergyModel to RX state.

Parameters
durationthe expected duration of the packet reception.

Defined in ns3::WifiPhyListener

Implements ns3::WifiPhyListener.

Definition at line 336 of file wifi-radio-energy-model.cc.

References ns3::EventId::Cancel(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_changeStateCallback, m_switchToIdleEvent, NS_FATAL_ERROR, and ns3::WifiPhy::RX.

+ Here is the call graph for this function:

void ns3::WifiRadioEnergyModelPhyListener::NotifySwitchingStart ( Time  duration)
virtual
Parameters
durationthe expected channel switching duration.

Defined in ns3::WifiPhyListener

Implements ns3::WifiPhyListener.

Definition at line 393 of file wifi-radio-energy-model.cc.

References ns3::EventId::Cancel(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_changeStateCallback, m_switchToIdleEvent, NS_FATAL_ERROR, ns3::Simulator::Schedule(), ns3::WifiPhy::SWITCHING, and SwitchToIdle().

+ Here is the call graph for this function:

void ns3::WifiRadioEnergyModelPhyListener::NotifyTxStart ( Time  duration)
virtual

Switches the WifiRadioEnergyModel to TX state and switches back to IDLE after TX duration.

Parameters
durationthe expected transmission duration.

Defined in ns3::WifiPhyListener

Implements ns3::WifiPhyListener.

Definition at line 367 of file wifi-radio-energy-model.cc.

References ns3::EventId::Cancel(), ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_changeStateCallback, m_switchToIdleEvent, NS_FATAL_ERROR, ns3::Simulator::Schedule(), SwitchToIdle(), and ns3::WifiPhy::TX.

+ Here is the call graph for this function:

void ns3::WifiRadioEnergyModelPhyListener::SetChangeStateCallback ( DeviceEnergyModel::ChangeStateCallback  callback)

Sets the change state callback. Used by helper class.

Parameters
callbackChange state callback.

Definition at line 329 of file wifi-radio-energy-model.cc.

References ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_changeStateCallback, and NS_ASSERT.

Referenced by ns3::WifiRadioEnergyModel::WifiRadioEnergyModel().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::WifiRadioEnergyModelPhyListener::SwitchToIdle ( void  )
private

A helper function that makes scheduling m_changeStateCallback possible.

Definition at line 410 of file wifi-radio-energy-model.cc.

References ns3::WifiPhy::IDLE, ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_changeStateCallback, and NS_FATAL_ERROR.

Referenced by NotifyMaybeCcaBusyStart(), NotifySwitchingStart(), and NotifyTxStart().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

DeviceEnergyModel::ChangeStateCallback ns3::WifiRadioEnergyModelPhyListener::m_changeStateCallback
private
EventId ns3::WifiRadioEnergyModelPhyListener::m_switchToIdleEvent
private

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