ns3::LoraLogicalChannelHelper Class Reference

This class supports LorawanMac instances by managing a list of the logical channels that the device is supposed to be using, and establishes their relationship with LoraSubBands. More...

#include "lora-logical-channel-helper.h"

+ Inheritance diagram for ns3::LoraLogicalChannelHelper:
+ Collaboration diagram for ns3::LoraLogicalChannelHelper:

Public Member Functions

 LoraLogicalChannelHelper ()
 
virtual ~LoraLogicalChannelHelper ()
 
void AddChannel (double frequency)
 Add a new channel to the list. More...
 
void AddChannel (Ptr< LoraLogicalChannel > logicalChannel)
 Add a new channel to the list. More...
 
void AddEvent (Time duration, Ptr< LoraLogicalChannel > channel)
 Register the transmission of a packet. More...
 
void AddLoraSubBand (double firstFrequency, double lastFrequency, double dutyCycle, double maxTxPowerDbm)
 Add a new LoraSubBand to this helper. More...
 
void AddLoraSubBand (Ptr< LoraSubBand > subBand)
 Add a new LoraSubBand. More...
 
void DisableChannel (int index)
 Disable the channel at a specified index. More...
 
Time GetAggregatedWaitingTime (void)
 Get the time it is necessary to wait before transmitting again, according to the aggregate duty cycle timer. More...
 
std::vector< Ptr< LoraLogicalChannel > > GetChannelList (void)
 Get the list of LoraLogicalChannels currently registered on this helper. More...
 
std::vector< Ptr< LoraLogicalChannel > > GetEnabledChannelList (void)
 Get the list of LoraLogicalChannels currently registered on this helper that have been enabled for Uplink transmission with the channel mask. More...
 
Ptr< LoraSubBandGetLoraSubBandFromChannel (Ptr< LoraLogicalChannel > channel)
 Get the LoraSubBand a channel belongs to. More...
 
Ptr< LoraSubBandGetLoraSubBandFromFrequency (double frequency)
 Get the LoraSubBand a frequency belongs to. More...
 
double GetTxPowerForChannel (Ptr< LoraLogicalChannel > logicalChannel)
 Returns the maximum transmission power [dBm] that is allowed on a channel. More...
 
Time GetWaitingTime (Ptr< LoraLogicalChannel > channel)
 Get the time it is necessary to wait for before transmitting on a given channel. More...
 
void RemoveChannel (Ptr< LoraLogicalChannel > channel)
 Remove a channel. More...
 
void SetChannel (uint8_t chIndex, Ptr< LoraLogicalChannel > logicalChannel)
 Set a new channel at a fixed index. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 

Private Attributes

double m_aggregatedDutyCycle
 transmission will be possible according to the aggregated transmission timer More...
 
std::vector< Ptr< LoraLogicalChannel > > m_channelList
 A vector of the LoraLogicalChannels that are currently registered within this helper. More...
 
Time m_nextAggregatedTransmissionTime
 The next time at which. More...
 
std::list< Ptr< LoraSubBand > > m_subBandList
 A list of the LoraSubBands that are currently registered within this helper. More...
 

Detailed Description

This class supports LorawanMac instances by managing a list of the logical channels that the device is supposed to be using, and establishes their relationship with LoraSubBands.

This class also takes into account duty cycle limitations, by updating a list of LoraSubBand objects and providing methods to query whether transmission on a set channel is admissible or not.

Definition at line 49 of file lora-logical-channel-helper.h.

Constructor & Destructor Documentation

◆ LoraLogicalChannelHelper()

ns3::LoraLogicalChannelHelper::LoraLogicalChannelHelper ( )

Definition at line 42 of file lora-logical-channel-helper.cc.

◆ ~LoraLogicalChannelHelper()

ns3::LoraLogicalChannelHelper::~LoraLogicalChannelHelper ( )
virtual

Definition at line 49 of file lora-logical-channel-helper.cc.

Member Function Documentation

◆ AddChannel() [1/2]

void ns3::LoraLogicalChannelHelper::AddChannel ( double  frequency)

Add a new channel to the list.

Parameters
frequencyThe frequency of the channel to create.

Definition at line 119 of file lora-logical-channel-helper.cc.

References m_channelList.

Referenced by ns3::LorawanMacEndDevice::AddLogicalChannel(), ns3::SatLoraConf::SetEu863_870Conf(), and ns3::SatLoraConf::SetSatelliteConf().

+ Here is the caller graph for this function:

◆ AddChannel() [2/2]

void ns3::LoraLogicalChannelHelper::AddChannel ( Ptr< LoraLogicalChannel logicalChannel)

Add a new channel to the list.

Parameters
logicalChannelA pointer to the channel to add to the list.

Definition at line 133 of file lora-logical-channel-helper.cc.

References m_channelList.

◆ AddEvent()

void ns3::LoraLogicalChannelHelper::AddEvent ( Time  duration,
Ptr< LoraLogicalChannel channel 
)

Register the transmission of a packet.

Parameters
durationThe duration of the transmission event.
channelThe channel the transmission was made on.

Definition at line 220 of file lora-logical-channel-helper.cc.

References GetLoraSubBandFromChannel(), m_aggregatedDutyCycle, and m_nextAggregatedTransmissionTime.

Referenced by ns3::LorawanMacGateway::Send(), and ns3::LorawanMacEndDeviceClassA::SendToPhy().

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

◆ AddLoraSubBand() [1/2]

void ns3::LoraLogicalChannelHelper::AddLoraSubBand ( double  firstFrequency,
double  lastFrequency,
double  dutyCycle,
double  maxTxPowerDbm 
)

Add a new LoraSubBand to this helper.

Parameters
firstFrequencyThe first frequency of the subband, in MHz.
lastFrequencyThe last frequency of the subband, in MHz.
dutyCycleThe duty cycle that needs to be enforced on this subband.
maxTxPowerDbmThe maximum transmission power [dBm] that can be used on this LoraSubBand.

Definition at line 151 of file lora-logical-channel-helper.cc.

References m_subBandList.

Referenced by ns3::LorawanMacEndDevice::AddLoraSubBand(), ns3::SatLoraConf::SetEu863_870Conf(), and ns3::SatLoraConf::SetSatelliteConf().

+ Here is the caller graph for this function:

◆ AddLoraSubBand() [2/2]

void ns3::LoraLogicalChannelHelper::AddLoraSubBand ( Ptr< LoraSubBand subBand)

Add a new LoraSubBand.

Parameters
subBandA pointer to the LoraSubBand that needs to be added.

Definition at line 165 of file lora-logical-channel-helper.cc.

References m_subBandList.

◆ DisableChannel()

void ns3::LoraLogicalChannelHelper::DisableChannel ( int  index)

Disable the channel at a specified index.

Parameters
indexThe index of the channel to disable.

Definition at line 266 of file lora-logical-channel-helper.cc.

References m_channelList.

◆ GetAggregatedWaitingTime()

Time ns3::LoraLogicalChannelHelper::GetAggregatedWaitingTime ( void  )

Get the time it is necessary to wait before transmitting again, according to the aggregate duty cycle timer.

Returns
The aggregate waiting time.

Definition at line 189 of file lora-logical-channel-helper.cc.

References m_nextAggregatedTransmissionTime.

◆ GetChannelList()

std::vector< Ptr< LoraLogicalChannel > > ns3::LoraLogicalChannelHelper::GetChannelList ( void  )

Get the list of LoraLogicalChannels currently registered on this helper.

Returns
A list of the managed channels.

Definition at line 55 of file lora-logical-channel-helper.cc.

References m_channelList.

Referenced by ns3::LorawanMacEndDevice::OnLinkAdrReq().

+ Here is the caller graph for this function:

◆ GetEnabledChannelList()

std::vector< Ptr< LoraLogicalChannel > > ns3::LoraLogicalChannelHelper::GetEnabledChannelList ( void  )

Get the list of LoraLogicalChannels currently registered on this helper that have been enabled for Uplink transmission with the channel mask.

Returns
A list of the managed channels enabled for Uplink transmission.

Definition at line 68 of file lora-logical-channel-helper.cc.

References m_channelList.

Referenced by ns3::LorawanMacEndDevice::GetChannelForTx(), and ns3::LorawanMacEndDevice::GetNextTransmissionDelay().

+ Here is the caller graph for this function:

◆ GetLoraSubBandFromChannel()

Ptr< LoraSubBand > ns3::LoraLogicalChannelHelper::GetLoraSubBandFromChannel ( Ptr< LoraLogicalChannel channel)

Get the LoraSubBand a channel belongs to.

Parameters
channelThe channel whose LoraSubBand we want to get.
Returns
The LoraSubBand the channel belongs to.

Definition at line 93 of file lora-logical-channel-helper.cc.

References GetLoraSubBandFromFrequency().

Referenced by AddEvent(), and GetWaitingTime().

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

◆ GetLoraSubBandFromFrequency()

Ptr< LoraSubBand > ns3::LoraLogicalChannelHelper::GetLoraSubBandFromFrequency ( double  frequency)

Get the LoraSubBand a frequency belongs to.

Parameters
frequencyThe frequency we want to check.
Returns
The LoraSubBand the frequency belongs to.

Definition at line 99 of file lora-logical-channel-helper.cc.

References m_subBandList.

Referenced by GetLoraSubBandFromChannel().

+ Here is the caller graph for this function:

◆ GetTxPowerForChannel()

double ns3::LoraLogicalChannelHelper::GetTxPowerForChannel ( Ptr< LoraLogicalChannel logicalChannel)

Returns the maximum transmission power [dBm] that is allowed on a channel.

Parameters
logicalChannelThe power for which to check the maximum allowed transmission power.
Returns
The power in dBm.

Definition at line 246 of file lora-logical-channel-helper.cc.

References m_subBandList.

Referenced by ns3::LorawanMacEndDevice::Send().

+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::LoraLogicalChannelHelper::GetTypeId ( void  )
static

Definition at line 36 of file lora-logical-channel-helper.cc.

◆ GetWaitingTime()

Time ns3::LoraLogicalChannelHelper::GetWaitingTime ( Ptr< LoraLogicalChannel channel)

Get the time it is necessary to wait for before transmitting on a given channel.

Remarks
This function does not take into account aggregate waiting time. Check on this should be performed before calling this function.
Parameters
channelA pointer to the channel we want to know the waiting time for.
Returns
A Time instance containing the waiting time before transmission is allowed on the channel.

Definition at line 203 of file lora-logical-channel-helper.cc.

References GetLoraSubBandFromChannel().

Referenced by ns3::LorawanMacEndDevice::GetChannelForTx(), ns3::LorawanMacEndDevice::GetNextTransmissionDelay(), ns3::LorawanMacGateway::GetWaitingTime(), and ns3::LorawanMacGateway::Send().

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

◆ RemoveChannel()

void ns3::LoraLogicalChannelHelper::RemoveChannel ( Ptr< LoraLogicalChannel channel)

Remove a channel.

Parameters
channelA pointer to the channel we want to remove.

Definition at line 173 of file lora-logical-channel-helper.cc.

References m_channelList.

◆ SetChannel()

void ns3::LoraLogicalChannelHelper::SetChannel ( uint8_t  chIndex,
Ptr< LoraLogicalChannel logicalChannel 
)

Set a new channel at a fixed index.

Parameters
chIndexThe index of the channel to substitute.
logicalChannelA pointer to the channel to add to the list.

Definition at line 142 of file lora-logical-channel-helper.cc.

References m_channelList.

Referenced by ns3::LorawanMacEndDevice::SetLogicalChannel().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_aggregatedDutyCycle

double ns3::LoraLogicalChannelHelper::m_aggregatedDutyCycle
private

transmission will be possible according to the aggregated transmission timer

The next time at which transmission will be possible

Definition at line 202 of file lora-logical-channel-helper.h.

Referenced by AddEvent().

◆ m_channelList

std::vector<Ptr<LoraLogicalChannel> > ns3::LoraLogicalChannelHelper::m_channelList
private

A vector of the LoraLogicalChannels that are currently registered within this helper.

This vector represents the node's channel mask. The first N channels are the default ones for a fixed region.

Definition at line 195 of file lora-logical-channel-helper.h.

Referenced by AddChannel(), DisableChannel(), GetChannelList(), GetEnabledChannelList(), RemoveChannel(), and SetChannel().

◆ m_nextAggregatedTransmissionTime

Time ns3::LoraLogicalChannelHelper::m_nextAggregatedTransmissionTime
private

The next time at which.

Definition at line 197 of file lora-logical-channel-helper.h.

Referenced by AddEvent(), and GetAggregatedWaitingTime().

◆ m_subBandList

std::list<Ptr<LoraSubBand> > ns3::LoraLogicalChannelHelper::m_subBandList
private

A list of the LoraSubBands that are currently registered within this helper.

Definition at line 188 of file lora-logical-channel-helper.h.

Referenced by AddLoraSubBand(), GetLoraSubBandFromFrequency(), and GetTxPowerForChannel().


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