10#ifndef LORA_RADIO_ENERGY_MODEL_H
11#define LORA_RADIO_ENERGY_MODEL_H
16#include "ns3/device-energy-model.h"
17#include "ns3/traced-value.h"
24using namespace energy;
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
Trace classes with value semantics.
a unique identifier for an interface.
Base class for device energy models.
State
An enumeration of the possible states of an EndDeviceLoraPhy.
Receive notifications about PHY events.
A LoRa radio energy model.
LoraRadioEnergyModelPhyListener * m_listener
EndDeviceLoraPhy listener.
LoraRadioEnergyModelPhyListener * GetPhyListener()
double m_txCurrentA
transmit current
void HandleEnergyChanged() override
Handles energy recharged.
double m_sleepCurrentA
sleep current
Callback< void > LoraRadioEnergyDepletionCallback
Callback type for energy depletion handling.
double DoGetCurrentA() const override
double m_rxCurrentA
receive current
double m_idleCurrentA
idle current
uint8_t m_nPendingChangeState
pending state change
void SetEnergySource(Ptr< EnergySource > source) override
Sets pointer to EnergySouce installed on node.
double GetTxCurrentA() const
Gets transmit current.
void ChangeState(int newState) override
Changes state of the LoraRadioEnergyMode.
double GetTotalEnergyConsumption() const override
double GetRxCurrentA() const
Gets receive current.
void SetStandbyCurrentA(double idleCurrentA)
Sets idle current.
void SetTxCurrentFromModel(double txPowerDbm)
Calls the CalcTxCurrent method of the tx current model to compute the tx current based on such model.
LoraRadioEnergyDepletionCallback m_energyDepletionCallback
Energy depletion callback.
void DoDispose() override
Destructor implementation.
EndDeviceLoraPhy::State m_currentState
current state the radio is in
bool m_isSupersededChangeState
superseded change state
void HandleEnergyRecharged() override
Handles energy recharged.
void HandleEnergyDepletion() override
Handles energy depletion.
~LoraRadioEnergyModel() override
Destructor.
void SetEnergyRechargedCallback(LoraRadioEnergyRechargedCallback callback)
void SetLoraRadioState(const EndDeviceLoraPhy::State state)
Time m_lastUpdateTime
time stamp of previous energy update
double GetStandbyCurrentA() const
Gets idle current.
Ptr< LoraTxCurrentModel > m_txCurrentModel
current model
Callback< void > LoraRadioEnergyRechargedCallback
Callback type for energy recharged handling.
void SetEnergyDepletionCallback(LoraRadioEnergyDepletionCallback callback)
void SetSleepCurrentA(double sleepCurrentA)
Sets sleep current.
void SetRxCurrentA(double rxCurrentA)
Sets receive current.
Ptr< EnergySource > m_source
energy source
void SetTxCurrentA(double txCurrentA)
Sets transmit current.
double GetSleepCurrentA() const
Gets sleep current.
void SetTxCurrentModel(Ptr< LoraTxCurrentModel > model)
static TypeId GetTypeId()
Register this type.
EndDeviceLoraPhy::State GetCurrentState() const
LoraRadioEnergyRechargedCallback m_energyRechargedCallback
Energy recharged callback.
TracedValue< double > m_totalEnergyConsumption
This variable keeps track of the total energy consumed by this model.
Installable listener for LoRa physiscal layer state changes.
void NotifyTxStart(double txPowerDbm) override
Switches the LoraRadioEnergyModel to TX state and switches back to STANDBY after TX duration.
~LoraRadioEnergyModelPhyListener() override
Destructor.
DeviceEnergyModel::ChangeStateCallback m_changeStateCallback
Change state callback used to notify the LoraRadioEnergyModel of a state change.
void NotifyStandby() override
Defined in ns3::LoraEndDevicePhyListener.
void NotifySleep() override
Defined in ns3::LoraEndDevicePhyListener.
void SetChangeStateCallback(DeviceEnergyModel::ChangeStateCallback callback)
Sets the change state callback.
Callback< void, double > UpdateTxCurrentCallback
Callback type for updating the transmit current based on the nominal tx power.
void SetUpdateTxCurrentCallback(UpdateTxCurrentCallback callback)
Sets the update tx current callback.
void SwitchToStandby()
A helper function that makes scheduling m_changeStateCallback possible.
void NotifyRxStart() override
Switches the LoraRadioEnergyModel to RX state.
LoraRadioEnergyModelPhyListener()
Default constructor.
UpdateTxCurrentCallback m_updateTxCurrentCallback
Callback used to update the tx current stored in LoraRadioEnergyModel based on the nominal tx power u...
Every class exported by the ns3 library is enclosed in the ns3 namespace.