10#ifndef LORA_RADIO_ENERGY_MODEL_H
11#define LORA_RADIO_ENERGY_MODEL_H
15#include "ns3/device-energy-model.h"
16#include "ns3/traced-value.h"
58 void NotifyTx(
double txPowerDbm)
override;
265 std::shared_ptr<LoraRadioEnergyModelPhyListener>
GetPhyListener();
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.
Callback< void, int > ChangeStateCallback
Callback type for ChangeState function.
State
An enumeration of the possible internal states of an EndDeviceLoraPhy.
Receive notifications about PHY internal state changes.
double m_txCurrentA
transmit current
void HandleEnergyChanged() override
Handles energy changed.
double GetStateA(EndDeviceLoraPhy::State state) const
double m_sleepCurrentA
sleep current
Callback< void > LoraRadioEnergyDepletionCallback
Callback type for energy depletion handling.
double DoGetCurrentA() const override
double m_rxCurrentA
receive current
uint8_t m_nPendingChangeState
pending state change
double GetTxCurrentA() const
Gets transmit current.
double m_standbyCurrentA
standby current
void ChangeState(int newState) override
Changes state of the LoraRadioEnergyModel.
double GetTotalEnergyConsumption() const override
double GetRxCurrentA() const
Gets receive current.
void SetTxCurrentFromModel(double txPowerDbm)
Calls the CalcTxCurrent method of the tx current model to compute the tx current based on such model.
LoraRadioEnergyModel()
Default constructor.
LoraRadioEnergyDepletionCallback m_energyDepletionCallback
Energy depletion callback.
void DoDispose() override
Destructor implementation.
Ptr< energy::EnergySource > m_source
energy source
EndDeviceLoraPhy::State m_currentState
current state the radio is in
void HandleEnergyRecharged() override
Handles energy recharged.
std::shared_ptr< LoraRadioEnergyModelPhyListener > GetPhyListener()
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 standby current.
Ptr< LoraTxCurrentModel > m_txCurrentModel
current model
Callback< void > LoraRadioEnergyRechargedCallback
Callback type for energy recharged handling.
void SetEnergyDepletionCallback(LoraRadioEnergyDepletionCallback callback)
void SetStandbyCurrentA(double standbyCurrentA)
Sets standby current.
void SetSleepCurrentA(double sleepCurrentA)
Sets sleep current.
void SetRxCurrentA(double rxCurrentA)
Sets receive current.
void SetTxCurrentA(double txCurrentA)
Sets transmit current.
void SetEnergySource(Ptr< energy::EnergySource > source) override
Sets pointer to EnergySource installed on node.
std::shared_ptr< LoraRadioEnergyModelPhyListener > m_listener
EndDeviceLoraPhy listener.
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.
~LoraRadioEnergyModelPhyListener() override
Destructor.
void NotifyStandby() override
Notify listeners that the device entered STANDBY state.
void NotifySleep() override
Notify listeners that the device entered SLEEP state.
void SetChangeStateCallback(energy::DeviceEnergyModel::ChangeStateCallback callback)
Sets the change state callback.
energy::DeviceEnergyModel::ChangeStateCallback m_changeStateCallback
Change state callback used to notify the LoraRadioEnergyModel of a state change.
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 NotifyRxActive() override
Notify listeners that the device entered RX_ACTIVE state.
LoraRadioEnergyModelPhyListener()
Default constructor.
UpdateTxCurrentCallback m_updateTxCurrentCallback
Callback used to update the tx current stored in LoraRadioEnergyModel based on the nominal tx power u...
void NotifyRxEnabled() override
Notify listeners that the device entered RX_ENABLED state.
void NotifyTx(double txPowerDbm) override
Notify listeners that the device entered TX state.
Model the transmit current as a function of the transmit power and mode.
Every class exported by the ns3 library is enclosed in the ns3 namespace.