21 #ifndef WIFI_RADIO_ENERGY_MODEL_H
22 #define WIFI_RADIO_ENERGY_MODEL_H
24 #include "ns3/device-energy-model.h"
25 #include "ns3/nstime.h"
26 #include "ns3/event-id.h"
27 #include "ns3/traced-value.h"
28 #include "ns3/wifi-phy.h"
void SetWifiRadioState(const WifiPhy::State state)
keep track of time values and allow control of global simulation resolution
static TypeId GetTypeId(void)
smart pointer class similar to boost::intrusive_ptr
TracedValue< double > m_totalEnergyConsumption
Base class for device energy models.
State
The state of the PHY layer.
virtual void ChangeState(int newState)
Changes state of the WifiRadioEnergyMode.
WifiRadioEnergyModelPhyListener * m_listener
virtual ~WifiRadioEnergyModelPhyListener()
virtual double GetTotalEnergyConsumption(void) const
virtual void NotifyTxStart(Time duration)
Switches the WifiRadioEnergyModel to TX state and switches back to IDLE after TX duration.
WifiRadioEnergyModelPhyListener * GetPhyListener(void)
void SwitchToIdle(void)
A helper function that makes scheduling m_changeStateCallback possible.
void SetRxCurrentA(double rxCurrentA)
virtual void NotifyRxEndOk(void)
Switches the WifiRadioEnergyModel back to IDLE state.
Callback< void > WifiRadioEnergyDepletionCallback
Callback type for energy depletion handling.
void SetCcaBusyCurrentA(double ccaBusyCurrentA)
double GetCcaBusyCurrentA(void) const
void SetChangeStateCallback(DeviceEnergyModel::ChangeStateCallback callback)
Sets the change state callback.
WifiPhy::State m_currentState
Ptr< EnergySource > m_source
virtual void NotifySwitchingStart(Time duration)
receive notifications about phy events.
virtual void NotifyMaybeCcaBusyStart(Time duration)
WifiRadioEnergyModelPhyListener()
virtual void NotifyRxEndError(void)
Switches the WifiRadioEnergyModel back to IDLE state.
WifiPhy::State GetCurrentState(void) const
DeviceEnergyModel::ChangeStateCallback m_changeStateCallback
Change state callback used to notify the WifiRadioEnergyModel of a state change.
EventId m_switchToIdleEvent
virtual void SetEnergySource(Ptr< EnergySource > source)
Sets pointer to EnergySouce installed on node.
double GetTxCurrentA(void) const
double GetRxCurrentA(void) const
A WifiPhy listener class for notifying the WifiRadioEnergyModel of Wifi radio state change...
void SetTxCurrentA(double txCurrentA)
A WiFi radio energy model.
virtual void NotifyRxStart(Time duration)
Switches the WifiRadioEnergyModel to RX state.
void SetEnergyDepletionCallback(WifiRadioEnergyDepletionCallback callback)
an identifier for simulation events.
void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
WifiRadioEnergyDepletionCallback m_energyDepletionCallback
double GetIdleCurrentA(void) const
void SetSwitchingCurrentA(double switchingCurrentA)
double m_switchingCurrentA
virtual double DoGetCurrentA(void) const
virtual ~WifiRadioEnergyModel()
a unique identifier for an interface.
void SetIdleCurrentA(double idleCurrentA)
double GetSwitchingCurrentA(void) const
virtual void HandleEnergyDepletion(void)
Handles energy depletion.