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

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

+ Inheritance diagram for ns3::WifiRadioEnergyModelPhyListener:

Public Member Functions

virtual void NotifyMaybeCcaBusyStart (Time duration)
 
virtual void NotifyRxEndError (void)
 Switches the WifiRadioEnergyModel back to IDLE state. More...
 
virtual void NotifyRxEndOk (void)
 Switches the WifiRadioEnergyModel back to IDLE state. More...
 
virtual void NotifyRxStart (Time duration)
 Switches the WifiRadioEnergyModel to RX state. More...
 
virtual void NotifySensingStart (Time duration)
 
virtual void NotifySwitchingStart (Time duration, uint16_t toChannel)
 
virtual void NotifyTxStart (Time duration)
 Switches the WifiRadioEnergyModel to TX state and switches back to IDLE after TX duration. More...
 
void SetChangeStateCallback (DeviceEnergyModel::ChangeStateCallback callback)
 Sets the change state callback. Used by helper class. More...
 

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.

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 377 of file wifi-radio-energy-model.cc.

References ns3::WifiPhy::IDLE, m_changeStateCallback, NS_FATAL_ERROR, and NS_LOG_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 366 of file wifi-radio-energy-model.cc.

References ns3::WifiPhy::IDLE, m_changeStateCallback, NS_FATAL_ERROR, and NS_LOG_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 354 of file wifi-radio-energy-model.cc.

References ns3::EventId::Cancel(), m_changeStateCallback, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::WifiPhy::RX.

void ns3::WifiRadioEnergyModelPhyListener::NotifySensingStart ( Time  duration)
virtual
Parameters
durationthe expected channel sensing duration.

Implements ns3::WifiPhyListener.

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

References ns3::EventId::Cancel(), m_changeStateCallback, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), ns3::WifiPhy::SENSING, and SwitchToIdle().

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

Defined in ns3::WifiPhyListener

Implements ns3::WifiPhyListener.

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

References ns3::EventId::Cancel(), m_changeStateCallback, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), ns3::WifiPhy::SWITCHING, and SwitchToIdle().

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 388 of file wifi-radio-energy-model.cc.

References ns3::EventId::Cancel(), m_changeStateCallback, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), SwitchToIdle(), and ns3::WifiPhy::TX.

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

Sets the change state callback. Used by helper class.

Parameters
callbackChange state callback.

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

References m_changeStateCallback, NS_ASSERT, and NS_LOG_FUNCTION.

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

A helper function that makes scheduling m_changeStateCallback possible.

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

References ns3::WifiPhy::IDLE, m_changeStateCallback, NS_FATAL_ERROR, and NS_LOG_FUNCTION.

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

Member Data Documentation

DeviceEnergyModel::ChangeStateCallback ns3::WifiRadioEnergyModelPhyListener::m_changeStateCallback
private

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