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"
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< LoraSubBand > | GetLoraSubBandFromChannel (Ptr< LoraLogicalChannel > channel) |
Get the LoraSubBand a channel belongs to. More... | |
Ptr< LoraSubBand > | GetLoraSubBandFromFrequency (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... | |
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 50 of file lora-logical-channel-helper.h.
ns3::LoraLogicalChannelHelper::LoraLogicalChannelHelper | ( | ) |
Definition at line 47 of file lora-logical-channel-helper.cc.
|
virtual |
Definition at line 54 of file lora-logical-channel-helper.cc.
void ns3::LoraLogicalChannelHelper::AddChannel | ( | double | frequency | ) |
Add a new channel to the list.
frequency | The frequency of the channel to create. |
Definition at line 124 of file lora-logical-channel-helper.cc.
References m_channelList.
Referenced by ns3::LorawanMacEndDevice::AddLogicalChannel(), ns3::SatLoraConf::SetEu863_870Conf(), and ns3::SatLoraConf::SetSatelliteConf().
void ns3::LoraLogicalChannelHelper::AddChannel | ( | Ptr< LoraLogicalChannel > | logicalChannel | ) |
Add a new channel to the list.
logicalChannel | A pointer to the channel to add to the list. |
Definition at line 138 of file lora-logical-channel-helper.cc.
References m_channelList.
void ns3::LoraLogicalChannelHelper::AddEvent | ( | Time | duration, |
Ptr< LoraLogicalChannel > | channel | ||
) |
Register the transmission of a packet.
duration | The duration of the transmission event. |
channel | The channel the transmission was made on. |
Definition at line 225 of file lora-logical-channel-helper.cc.
References GetLoraSubBandFromChannel(), m_aggregatedDutyCycle, and m_nextAggregatedTransmissionTime.
Referenced by ns3::LorawanGroundMacGateway::Send(), ns3::LorawanOrbiterMacGateway::Send(), ns3::LorawanMacGateway::Send(), and ns3::LorawanMacEndDeviceClassA::SendToPhy().
void ns3::LoraLogicalChannelHelper::AddLoraSubBand | ( | double | firstFrequency, |
double | lastFrequency, | ||
double | dutyCycle, | ||
double | maxTxPowerDbm | ||
) |
Add a new LoraSubBand to this helper.
firstFrequency | The first frequency of the subband, in MHz. |
lastFrequency | The last frequency of the subband, in MHz. |
dutyCycle | The duty cycle that needs to be enforced on this subband. |
maxTxPowerDbm | The maximum transmission power [dBm] that can be used on this LoraSubBand. |
Definition at line 156 of file lora-logical-channel-helper.cc.
References m_subBandList.
Referenced by ns3::LorawanMacEndDevice::AddLoraSubBand(), ns3::SatLoraConf::SetEu863_870Conf(), and ns3::SatLoraConf::SetSatelliteConf().
void ns3::LoraLogicalChannelHelper::AddLoraSubBand | ( | Ptr< LoraSubBand > | subBand | ) |
Add a new LoraSubBand.
subBand | A pointer to the LoraSubBand that needs to be added. |
Definition at line 170 of file lora-logical-channel-helper.cc.
References m_subBandList.
void ns3::LoraLogicalChannelHelper::DisableChannel | ( | int | index | ) |
Disable the channel at a specified index.
index | The index of the channel to disable. |
Definition at line 271 of file lora-logical-channel-helper.cc.
References m_channelList.
Time ns3::LoraLogicalChannelHelper::GetAggregatedWaitingTime | ( | void | ) |
Get the time it is necessary to wait before transmitting again, according to the aggregate duty cycle timer.
Definition at line 194 of file lora-logical-channel-helper.cc.
References m_nextAggregatedTransmissionTime.
std::vector< Ptr< LoraLogicalChannel > > ns3::LoraLogicalChannelHelper::GetChannelList | ( | void | ) |
Get the list of LoraLogicalChannels currently registered on this helper.
Definition at line 60 of file lora-logical-channel-helper.cc.
References m_channelList.
Referenced by ns3::LorawanMacEndDevice::OnLinkAdrReq().
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.
Definition at line 73 of file lora-logical-channel-helper.cc.
References m_channelList.
Referenced by ns3::LorawanMacEndDevice::GetChannelForTx(), and ns3::LorawanMacEndDevice::GetNextTransmissionDelay().
Ptr< LoraSubBand > ns3::LoraLogicalChannelHelper::GetLoraSubBandFromChannel | ( | Ptr< LoraLogicalChannel > | channel | ) |
Get the LoraSubBand a channel belongs to.
channel | The channel whose LoraSubBand we want to get. |
Definition at line 98 of file lora-logical-channel-helper.cc.
References GetLoraSubBandFromFrequency().
Referenced by AddEvent(), and GetWaitingTime().
Ptr< LoraSubBand > ns3::LoraLogicalChannelHelper::GetLoraSubBandFromFrequency | ( | double | frequency | ) |
Get the LoraSubBand a frequency belongs to.
frequency | The frequency we want to check. |
Definition at line 104 of file lora-logical-channel-helper.cc.
References m_subBandList.
Referenced by GetLoraSubBandFromChannel().
double ns3::LoraLogicalChannelHelper::GetTxPowerForChannel | ( | Ptr< LoraLogicalChannel > | logicalChannel | ) |
Returns the maximum transmission power [dBm] that is allowed on a channel.
logicalChannel | The power for which to check the maximum allowed transmission power. |
Definition at line 251 of file lora-logical-channel-helper.cc.
References m_subBandList.
Referenced by ns3::LorawanMacEndDevice::Send().
|
static |
Definition at line 41 of file lora-logical-channel-helper.cc.
Time ns3::LoraLogicalChannelHelper::GetWaitingTime | ( | Ptr< LoraLogicalChannel > | channel | ) |
Get the time it is necessary to wait for before transmitting on a given channel.
channel | A pointer to the channel we want to know the waiting time for. |
Definition at line 208 of file lora-logical-channel-helper.cc.
References GetLoraSubBandFromChannel().
Referenced by ns3::LorawanMacEndDevice::GetChannelForTx(), ns3::LorawanMacEndDevice::GetNextTransmissionDelay(), ns3::LorawanMacGateway::GetWaitingTime(), ns3::LorawanGroundMacGateway::Send(), ns3::LorawanOrbiterMacGateway::Send(), and ns3::LorawanMacGateway::Send().
void ns3::LoraLogicalChannelHelper::RemoveChannel | ( | Ptr< LoraLogicalChannel > | channel | ) |
Remove a channel.
channel | A pointer to the channel we want to remove. |
Definition at line 178 of file lora-logical-channel-helper.cc.
References m_channelList.
void ns3::LoraLogicalChannelHelper::SetChannel | ( | uint8_t | chIndex, |
Ptr< LoraLogicalChannel > | logicalChannel | ||
) |
Set a new channel at a fixed index.
chIndex | The index of the channel to substitute. |
logicalChannel | A pointer to the channel to add to the list. |
Definition at line 147 of file lora-logical-channel-helper.cc.
References m_channelList.
Referenced by ns3::LorawanMacEndDevice::SetLogicalChannel().
|
private |
transmission will be possible according to the aggregated transmission timer
The next time at which transmission will be possible
Definition at line 203 of file lora-logical-channel-helper.h.
Referenced by AddEvent().
|
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 196 of file lora-logical-channel-helper.h.
Referenced by AddChannel(), DisableChannel(), GetChannelList(), GetEnabledChannelList(), RemoveChannel(), and SetChannel().
|
private |
The next time at which.
Definition at line 198 of file lora-logical-channel-helper.h.
Referenced by AddEvent(), and GetAggregatedWaitingTime().
|
private |
A list of the LoraSubBands that are currently registered within this helper.
Definition at line 189 of file lora-logical-channel-helper.h.
Referenced by AddLoraSubBand(), GetLoraSubBandFromFrequency(), and GetTxPowerForChannel().