Installable listener for LoRa physiscal layer state changes. More...
#include "lora-radio-energy-model.h"
Public Types | |
typedef Callback< void, double > | UpdateTxCurrentCallback |
Callback type for updating the transmit current based on the nominal tx power. | |
Public Member Functions | |
LoraRadioEnergyModelPhyListener () | |
Default constructor. | |
~LoraRadioEnergyModelPhyListener () override | |
Destructor. | |
void | NotifyRxStart () override |
Switches the LoraRadioEnergyModel to RX state. | |
void | NotifySleep () override |
Defined in ns3::LoraEndDevicePhyListener. | |
void | NotifyStandby () override |
Defined in ns3::LoraEndDevicePhyListener. | |
void | NotifyTxStart (double txPowerDbm) override |
Switches the LoraRadioEnergyModel to TX state and switches back to STANDBY after TX duration. | |
void | SetChangeStateCallback (DeviceEnergyModel::ChangeStateCallback callback) |
Sets the change state callback. | |
void | SetUpdateTxCurrentCallback (UpdateTxCurrentCallback callback) |
Sets the update tx current callback. | |
Public Member Functions inherited from ns3::lorawan::EndDeviceLoraPhyListener | |
virtual | ~EndDeviceLoraPhyListener () |
Destructor. | |
virtual void | NotifyRxStart ()=0 |
We have received the first bit of a packet. | |
virtual void | NotifySleep ()=0 |
Notify listeners that we went to sleep. | |
virtual void | NotifyStandby ()=0 |
Notify listeners that we woke up. | |
virtual void | NotifyTxStart (double txPowerDbm)=0 |
We are about to send the first bit of the packet. | |
Private Member Functions | |
void | SwitchToStandby () |
A helper function that makes scheduling m_changeStateCallback possible. | |
Private Attributes | |
DeviceEnergyModel::ChangeStateCallback | m_changeStateCallback |
Change state callback used to notify the LoraRadioEnergyModel of a state change. | |
UpdateTxCurrentCallback | m_updateTxCurrentCallback |
Callback used to update the tx current stored in LoraRadioEnergyModel based on the nominal tx power used to transmit the current frame. | |
Installable listener for LoRa physiscal layer state changes.
Definition at line 42 of file lora-radio-energy-model.h.
typedef Callback<void, double> ns3::lorawan::LoraRadioEnergyModelPhyListener::UpdateTxCurrentCallback |
Callback type for updating the transmit current based on the nominal tx power.
Definition at line 48 of file lora-radio-energy-model.h.
ns3::lorawan::LoraRadioEnergyModelPhyListener::LoraRadioEnergyModelPhyListener | ( | ) |
Default constructor.
Definition at line 377 of file lora-radio-energy-model.cc.
References m_changeStateCallback, m_updateTxCurrentCallback, NS_LOG_FUNCTION, and ns3::Callback< R, UArgs >::Nullify().
|
override |
|
overridevirtual |
Switches the LoraRadioEnergyModel to RX state.
Defined in ns3::LoraEndDevicePhyListener.
Implements ns3::lorawan::EndDeviceLoraPhyListener.
Definition at line 407 of file lora-radio-energy-model.cc.
References ns3::Callback< R, UArgs >::IsNull(), m_changeStateCallback, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::lorawan::EndDeviceLoraPhy::RX.
|
overridevirtual |
Defined in ns3::LoraEndDevicePhyListener.
Implements ns3::lorawan::EndDeviceLoraPhyListener.
Definition at line 434 of file lora-radio-energy-model.cc.
References ns3::Callback< R, UArgs >::IsNull(), m_changeStateCallback, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::lorawan::EndDeviceLoraPhy::SLEEP.
|
overridevirtual |
Defined in ns3::LoraEndDevicePhyListener.
Implements ns3::lorawan::EndDeviceLoraPhyListener.
Definition at line 445 of file lora-radio-energy-model.cc.
References ns3::Callback< R, UArgs >::IsNull(), m_changeStateCallback, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::lorawan::EndDeviceLoraPhy::STANDBY.
|
overridevirtual |
Switches the LoraRadioEnergyModel to TX state and switches back to STANDBY after TX duration.
txPowerDbm | The nominal tx power in dBm. |
Defined in ns3::LoraEndDevicePhyListener.
Implements ns3::lorawan::EndDeviceLoraPhyListener.
Definition at line 418 of file lora-radio-energy-model.cc.
References ns3::Callback< R, UArgs >::IsNull(), m_changeStateCallback, m_updateTxCurrentCallback, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::lorawan::EndDeviceLoraPhy::TX.
void ns3::lorawan::LoraRadioEnergyModelPhyListener::SetChangeStateCallback | ( | DeviceEnergyModel::ChangeStateCallback | callback | ) |
Sets the change state callback.
Used by helper class.
callback | Change state callback. |
Definition at line 390 of file lora-radio-energy-model.cc.
References ns3::Callback< R, UArgs >::IsNull(), m_changeStateCallback, NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by ns3::lorawan::LoraRadioEnergyModel::LoraRadioEnergyModel().
void ns3::lorawan::LoraRadioEnergyModelPhyListener::SetUpdateTxCurrentCallback | ( | UpdateTxCurrentCallback | callback | ) |
Sets the update tx current callback.
callback | Update tx current callback. |
Definition at line 399 of file lora-radio-energy-model.cc.
References ns3::Callback< R, UArgs >::IsNull(), m_updateTxCurrentCallback, NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by ns3::lorawan::LoraRadioEnergyModel::LoraRadioEnergyModel().
|
private |
A helper function that makes scheduling m_changeStateCallback possible.
Definition at line 460 of file lora-radio-energy-model.cc.
References ns3::Callback< R, UArgs >::IsNull(), m_changeStateCallback, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::lorawan::EndDeviceLoraPhy::STANDBY.
|
private |
Change state callback used to notify the LoraRadioEnergyModel of a state change.
Definition at line 104 of file lora-radio-energy-model.h.
Referenced by LoraRadioEnergyModelPhyListener(), NotifyRxStart(), NotifySleep(), NotifyStandby(), NotifyTxStart(), SetChangeStateCallback(), and SwitchToStandby().
|
private |
Callback used to update the tx current stored in LoraRadioEnergyModel based on the nominal tx power used to transmit the current frame.
Definition at line 110 of file lora-radio-energy-model.h.
Referenced by LoraRadioEnergyModelPhyListener(), NotifyTxStart(), and SetUpdateTxCurrentCallback().