A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::lorawan::LoraRadioEnergyModelPhyListener Class Reference

Installable listener for LoRa physiscal layer state changes. More...

#include "lora-radio-energy-model.h"

+ Inheritance diagram for ns3::lorawan::LoraRadioEnergyModelPhyListener:
+ Collaboration diagram for ns3::lorawan::LoraRadioEnergyModelPhyListener:

Public Types

typedef Callback< void, doubleUpdateTxCurrentCallback
 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.
 

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.
 

Detailed Description

Installable listener for LoRa physiscal layer state changes.

Definition at line 31 of file lora-radio-energy-model.h.

Member Typedef Documentation

◆ UpdateTxCurrentCallback

Callback type for updating the transmit current based on the nominal tx power.

Definition at line 37 of file lora-radio-energy-model.h.

Constructor & Destructor Documentation

◆ LoraRadioEnergyModelPhyListener()

ns3::lorawan::LoraRadioEnergyModelPhyListener::LoraRadioEnergyModelPhyListener ( )

Default constructor.

Definition at line 366 of file lora-radio-energy-model.cc.

References m_changeStateCallback, m_updateTxCurrentCallback, and NS_LOG_FUNCTION.

◆ ~LoraRadioEnergyModelPhyListener()

ns3::lorawan::LoraRadioEnergyModelPhyListener::~LoraRadioEnergyModelPhyListener ( )
override

Destructor.

Definition at line 373 of file lora-radio-energy-model.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ NotifyRxStart()

void ns3::lorawan::LoraRadioEnergyModelPhyListener::NotifyRxStart ( )
overridevirtual

Switches the LoraRadioEnergyModel to RX state.

Defined in ns3::LoraEndDevicePhyListener.

Implements ns3::lorawan::EndDeviceLoraPhyListener.

Definition at line 396 of file lora-radio-energy-model.cc.

References m_changeStateCallback, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::lorawan::EndDeviceLoraPhy::RX.

◆ NotifySleep()

void ns3::lorawan::LoraRadioEnergyModelPhyListener::NotifySleep ( )
overridevirtual

Defined in ns3::LoraEndDevicePhyListener.

Implements ns3::lorawan::EndDeviceLoraPhyListener.

Definition at line 423 of file lora-radio-energy-model.cc.

References m_changeStateCallback, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::lorawan::EndDeviceLoraPhy::SLEEP.

◆ NotifyStandby()

void ns3::lorawan::LoraRadioEnergyModelPhyListener::NotifyStandby ( )
overridevirtual

Defined in ns3::LoraEndDevicePhyListener.

Implements ns3::lorawan::EndDeviceLoraPhyListener.

Definition at line 434 of file lora-radio-energy-model.cc.

References m_changeStateCallback, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::lorawan::EndDeviceLoraPhy::STANDBY.

◆ NotifyTxStart()

void ns3::lorawan::LoraRadioEnergyModelPhyListener::NotifyTxStart ( double txPowerDbm)
overridevirtual

Switches the LoraRadioEnergyModel to TX state and switches back to STANDBY after TX duration.

Parameters
txPowerDbmThe nominal tx power in dBm.

Defined in ns3::LoraEndDevicePhyListener.

Implements ns3::lorawan::EndDeviceLoraPhyListener.

Definition at line 407 of file lora-radio-energy-model.cc.

References m_changeStateCallback, m_updateTxCurrentCallback, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::lorawan::EndDeviceLoraPhy::TX.

◆ SetChangeStateCallback()

void ns3::lorawan::LoraRadioEnergyModelPhyListener::SetChangeStateCallback ( DeviceEnergyModel::ChangeStateCallback callback)

Sets the change state callback.

Used by helper class.

Parameters
callbackChange state callback.

Definition at line 379 of file lora-radio-energy-model.cc.

References ns3::Callback< R, UArgs >::IsNull(), m_changeStateCallback, NS_ASSERT, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ SetUpdateTxCurrentCallback()

void ns3::lorawan::LoraRadioEnergyModelPhyListener::SetUpdateTxCurrentCallback ( UpdateTxCurrentCallback callback)

Sets the update tx current callback.

Parameters
callbackUpdate tx current callback.

Definition at line 388 of file lora-radio-energy-model.cc.

References ns3::Callback< R, UArgs >::IsNull(), m_updateTxCurrentCallback, NS_ASSERT, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ SwitchToStandby()

void ns3::lorawan::LoraRadioEnergyModelPhyListener::SwitchToStandby ( )
private

A helper function that makes scheduling m_changeStateCallback possible.

Definition at line 449 of file lora-radio-energy-model.cc.

References m_changeStateCallback, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::lorawan::EndDeviceLoraPhy::STANDBY.

Member Data Documentation

◆ m_changeStateCallback

DeviceEnergyModel::ChangeStateCallback ns3::lorawan::LoraRadioEnergyModelPhyListener::m_changeStateCallback
private

Change state callback used to notify the LoraRadioEnergyModel of a state change.

Definition at line 93 of file lora-radio-energy-model.h.

Referenced by LoraRadioEnergyModelPhyListener(), NotifyRxStart(), NotifySleep(), NotifyStandby(), NotifyTxStart(), SetChangeStateCallback(), and SwitchToStandby().

◆ m_updateTxCurrentCallback

UpdateTxCurrentCallback ns3::lorawan::LoraRadioEnergyModelPhyListener::m_updateTxCurrentCallback
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 99 of file lora-radio-energy-model.h.

Referenced by LoraRadioEnergyModelPhyListener(), NotifyTxStart(), and SetUpdateTxCurrentCallback().


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