A Discrete-Event Network Simulator
API
ns3::WifiRadioEnergyModelPhyListener Class Reference

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

#include "wifi-radio-energy-model.h"

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

Public Types

typedef Callback< void, double > UpdateTxCurrentCallback
 Callback type for updating the transmit current based on the nominal tx power. More...
 

Public Member Functions

 WifiRadioEnergyModelPhyListener ()
 
virtual ~WifiRadioEnergyModelPhyListener ()
 
void NotifyMaybeCcaBusyStart (Time duration)
 
void NotifyRxEndError (void)
 Switches the WifiRadioEnergyModel back to IDLE state. More...
 
void NotifyRxEndOk (void)
 Switches the WifiRadioEnergyModel back to IDLE state. More...
 
void NotifyRxStart (Time duration)
 Switches the WifiRadioEnergyModel to RX state. More...
 
void NotifySleep (void)
 Defined in ns3::WifiPhyListener. More...
 
void NotifySwitchingStart (Time duration)
 
void NotifyTxStart (Time duration, double txPowerDbm)
 Switches the WifiRadioEnergyModel to TX state and switches back to IDLE after TX duration. More...
 
void NotifyWakeup (void)
 Defined in ns3::WifiPhyListener. More...
 
void SetChangeStateCallback (DeviceEnergyModel::ChangeStateCallback callback)
 Sets the change state callback. More...
 
void SetUpdateTxCurrentCallback (UpdateTxCurrentCallback callback)
 Sets the update tx current callback. More...
 
- Public Member Functions inherited from ns3::WifiPhyListener
virtual ~WifiPhyListener ()
 

Private Member Functions

void SwitchToIdle (void)
 A helper function that makes scheduling m_changeStateCallback possible. More...
 

Private Attributes

DeviceEnergyModel::ChangeStateCallback m_changeStateCallback
 Change state callback used to notify the WifiRadioEnergyModel of a state change. More...
 
EventId m_switchToIdleEvent
 switch to idle event More...
 
UpdateTxCurrentCallback m_updateTxCurrentCallback
 Callback used to update the tx current stored in WifiRadioEnergyModel based on the nominal tx power used to transmit the current frame. More...
 

Detailed Description

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

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

Member Typedef Documentation

Callback type for updating the transmit current based on the nominal tx power.

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

Constructor & Destructor Documentation

ns3::WifiRadioEnergyModelPhyListener::WifiRadioEnergyModelPhyListener ( )
ns3::WifiRadioEnergyModelPhyListener::~WifiRadioEnergyModelPhyListener ( )
virtual

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

References NS_LOG_FUNCTION.

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 475 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, NS_FATAL_ERROR, and NS_LOG_FUNCTION.

+ 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 464 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, NS_FATAL_ERROR, and NS_LOG_FUNCTION.

+ 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 452 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, NS_LOG_FUNCTION, and ns3::WifiPhy::RX.

+ Here is the call graph for this function:

void ns3::WifiRadioEnergyModelPhyListener::NotifySleep ( void  )
virtual
void ns3::WifiRadioEnergyModelPhyListener::NotifySwitchingStart ( Time  duration)
virtual
void ns3::WifiRadioEnergyModelPhyListener::NotifyTxStart ( Time  duration,
double  txPowerDbm 
)
virtual

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

Parameters
durationthe expected transmission duration.
txPowerDbmthe nominal tx power in dBm

Defined in ns3::WifiPhyListener

Implements ns3::WifiPhyListener.

Definition at line 486 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, m_updateTxCurrentCallback, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), SwitchToIdle(), and ns3::WifiPhy::TX.

+ Here is the call graph for this function:

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

Sets the change state callback.

Used by helper class.

Parameters
callbackChange state callback.

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

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

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::WifiRadioEnergyModelPhyListener::SetUpdateTxCurrentCallback ( UpdateTxCurrentCallback  callback)

Sets the update tx current callback.

Parameters
callbackUpdate tx current callback.

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

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

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 560 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, NS_FATAL_ERROR, and NS_LOG_FUNCTION.

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

switch to idle event

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

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

UpdateTxCurrentCallback ns3::WifiRadioEnergyModelPhyListener::m_updateTxCurrentCallback
private

Callback used to update the tx current stored in WifiRadioEnergyModel based on the nominal tx power used to transmit the current frame.

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

Referenced by NotifyTxStart(), SetUpdateTxCurrentCallback(), and WifiRadioEnergyModelPhyListener().


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