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.
 
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.
 

Detailed Description

Installable listener for LoRa physiscal layer state changes.

Definition at line 42 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 48 of file lora-radio-energy-model.h.

Constructor & Destructor Documentation

◆ LoraRadioEnergyModelPhyListener()

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().

+ Here is the call graph for this function:

◆ ~LoraRadioEnergyModelPhyListener()

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

Destructor.

Definition at line 384 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 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.

+ Here is the call graph for this function:

◆ NotifySleep()

void ns3::lorawan::LoraRadioEnergyModelPhyListener::NotifySleep ( )
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.

+ Here is the call graph for this function:

◆ NotifyStandby()

void ns3::lorawan::LoraRadioEnergyModelPhyListener::NotifyStandby ( )
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.

+ Here is the call graph for this function:

◆ 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 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.

+ Here is the call graph for this function:

◆ 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 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().

+ Here is the call graph for this function:
+ Here is the caller 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 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SwitchToStandby()

void ns3::lorawan::LoraRadioEnergyModelPhyListener::SwitchToStandby ( )
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.

+ Here is the call graph for this function:

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 104 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 110 of file lora-radio-energy-model.h.

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


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