A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::lorawan::LogicalLoraChannelHelper 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 SubBands. More...

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

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

Public Member Functions

 LogicalLoraChannelHelper ()
 Default constructor.
 
 ~LogicalLoraChannelHelper () override
 Destructor.
 
void AddChannel (double frequency)
 Add a new channel to the list.
 
void AddChannel (Ptr< LogicalLoraChannel > logicalChannel)
 Add a new channel to the list.
 
void AddEvent (Time duration, Ptr< LogicalLoraChannel > channel)
 Register the transmission of a packet.
 
void AddSubBand (double firstFrequency, double lastFrequency, double dutyCycle, double maxTxPowerDbm)
 Add a new SubBand to this helper.
 
void AddSubBand (Ptr< SubBand > subBand)
 Add a new SubBand.
 
void DisableChannel (int index)
 Disable the channel at a specified index.
 
Time GetAggregatedWaitingTime ()
 Get the time it is necessary to wait before transmitting again, according to the aggregate duty cycle timer.
 
std::vector< Ptr< LogicalLoraChannel > > GetChannelList ()
 Get the list of LogicalLoraChannels currently registered on this helper.
 
std::vector< Ptr< LogicalLoraChannel > > GetEnabledChannelList ()
 Get the list of LogicalLoraChannels currently registered on this helper that have been enabled for Uplink transmission with the channel mask.
 
Ptr< SubBandGetSubBandFromChannel (Ptr< LogicalLoraChannel > channel)
 Get the SubBand a channel belongs to.
 
Ptr< SubBandGetSubBandFromFrequency (double frequency)
 Get the SubBand a frequency belongs to.
 
double GetTxPowerForChannel (Ptr< LogicalLoraChannel > logicalChannel)
 Returns the maximum transmission power [dBm] that is allowed on a channel.
 
Time GetWaitingTime (Ptr< LogicalLoraChannel > channel)
 Get the time it is necessary to wait for before transmitting on a given channel.
 
void RemoveChannel (Ptr< LogicalLoraChannel > channel)
 Remove a channel.
 
void SetChannel (uint8_t chIndex, Ptr< LogicalLoraChannel > logicalChannel)
 Set a new channel at a fixed index.
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
virtual TypeId GetInstanceTypeId () const =0
 Get the most derived TypeId for this Object.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Private Attributes

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

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void DoDispose ()
 Destructor implementation.
 
virtual void DoInitialize ()
 Initialize() implementation.
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 

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

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

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

Constructor & Destructor Documentation

◆ LogicalLoraChannelHelper()

ns3::lorawan::LogicalLoraChannelHelper::LogicalLoraChannelHelper ( )

Default constructor.

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

References NS_LOG_FUNCTION.

◆ ~LogicalLoraChannelHelper()

ns3::lorawan::LogicalLoraChannelHelper::~LogicalLoraChannelHelper ( )
override

Destructor.

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

References NS_LOG_FUNCTION.

Member Function Documentation

◆ AddChannel() [1/2]

void ns3::lorawan::LogicalLoraChannelHelper::AddChannel ( double  frequency)

Add a new channel to the list.

Parameters
frequencyThe frequency of the channel to create.

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

References m_channelList, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by ns3::lorawan::EndDeviceLorawanMac::AddLogicalChannel(), ns3::lorawan::LorawanMacHelper::ApplyCommonAlohaConfigurations(), ns3::lorawan::LorawanMacHelper::ApplyCommonEuConfigurations(), and ns3::lorawan::LorawanMacHelper::ApplyCommonSingleChannelConfigurations().

+ Here is the caller graph for this function:

◆ AddChannel() [2/2]

void ns3::lorawan::LogicalLoraChannelHelper::AddChannel ( Ptr< LogicalLoraChannel logicalChannel)

Add a new channel to the list.

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

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

References m_channelList, and NS_LOG_FUNCTION.

◆ AddEvent()

void ns3::lorawan::LogicalLoraChannelHelper::AddEvent ( Time  duration,
Ptr< LogicalLoraChannel channel 
)

Register the transmission of a packet.

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

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

References ns3::Time::GetSeconds(), GetSubBandFromChannel(), m_aggregatedDutyCycle, m_nextAggregatedTransmissionTime, ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::Seconds().

Referenced by ns3::lorawan::GatewayLorawanMac::Send(), and ns3::lorawan::ClassAEndDeviceLorawanMac::SendToPhy().

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

◆ AddSubBand() [1/2]

void ns3::lorawan::LogicalLoraChannelHelper::AddSubBand ( double  firstFrequency,
double  lastFrequency,
double  dutyCycle,
double  maxTxPowerDbm 
)

Add a new SubBand 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 SubBand.

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

References m_subBandList, and NS_LOG_FUNCTION.

Referenced by ns3::lorawan::EndDeviceLorawanMac::AddSubBand(), ns3::lorawan::LorawanMacHelper::ApplyCommonAlohaConfigurations(), ns3::lorawan::LorawanMacHelper::ApplyCommonEuConfigurations(), and ns3::lorawan::LorawanMacHelper::ApplyCommonSingleChannelConfigurations().

+ Here is the caller graph for this function:

◆ AddSubBand() [2/2]

void ns3::lorawan::LogicalLoraChannelHelper::AddSubBand ( Ptr< SubBand subBand)

Add a new SubBand.

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

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

References m_subBandList, and NS_LOG_FUNCTION.

◆ DisableChannel()

void ns3::lorawan::LogicalLoraChannelHelper::DisableChannel ( int  index)

Disable the channel at a specified index.

Parameters
indexThe index of the channel to disable.

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

References m_channelList, and NS_LOG_FUNCTION.

◆ GetAggregatedWaitingTime()

Time ns3::lorawan::LogicalLoraChannelHelper::GetAggregatedWaitingTime ( )

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 187 of file logical-lora-channel-helper.cc.

References ns3::Time::GetSeconds(), m_nextAggregatedTransmissionTime, ns3::Simulator::Now(), NS_LOG_DEBUG, and ns3::Seconds().

+ Here is the call graph for this function:

◆ GetChannelList()

std::vector< Ptr< LogicalLoraChannel > > ns3::lorawan::LogicalLoraChannelHelper::GetChannelList ( )

Get the list of LogicalLoraChannels currently registered on this helper.

Returns
A list of the managed channels.

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

References m_channelList, and NS_LOG_FUNCTION.

Referenced by ns3::lorawan::EndDeviceLorawanMac::OnLinkAdrReq().

+ Here is the caller graph for this function:

◆ GetEnabledChannelList()

std::vector< Ptr< LogicalLoraChannel > > ns3::lorawan::LogicalLoraChannelHelper::GetEnabledChannelList ( )

Get the list of LogicalLoraChannels 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 logical-lora-channel-helper.cc.

References m_channelList, and NS_LOG_FUNCTION.

Referenced by ns3::lorawan::EndDeviceLorawanMac::GetChannelForTx(), and ns3::lorawan::EndDeviceLorawanMac::GetNextTransmissionDelay().

+ Here is the caller graph for this function:

◆ GetSubBandFromChannel()

Ptr< SubBand > ns3::lorawan::LogicalLoraChannelHelper::GetSubBandFromChannel ( Ptr< LogicalLoraChannel channel)

Get the SubBand a channel belongs to.

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

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

References GetSubBandFromFrequency().

Referenced by AddEvent(), and GetWaitingTime().

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

◆ GetSubBandFromFrequency()

Ptr< SubBand > ns3::lorawan::LogicalLoraChannelHelper::GetSubBandFromFrequency ( double  frequency)

Get the SubBand a frequency belongs to.

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

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

References m_subBandList, NS_ABORT_MSG, and NS_LOG_ERROR.

Referenced by GetSubBandFromChannel().

+ Here is the caller graph for this function:

◆ GetTxPowerForChannel()

double ns3::lorawan::LogicalLoraChannelHelper::GetTxPowerForChannel ( Ptr< LogicalLoraChannel 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 244 of file logical-lora-channel-helper.cc.

References m_subBandList, NS_ABORT_MSG, and NS_LOG_FUNCTION_NOARGS.

Referenced by ns3::lorawan::EndDeviceLorawanMac::Send(), and ns3::lorawan::GatewayLorawanMac::Send().

+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::lorawan::LogicalLoraChannelHelper::GetTypeId ( )
static

Register this type.

Returns
The object TypeId.

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

References ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ GetWaitingTime()

Time ns3::lorawan::LogicalLoraChannelHelper::GetWaitingTime ( Ptr< LogicalLoraChannel 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 201 of file logical-lora-channel-helper.cc.

References ns3::Time::GetSeconds(), GetSubBandFromChannel(), ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::Seconds().

Referenced by ns3::lorawan::EndDeviceLorawanMac::GetChannelForTx(), ns3::lorawan::EndDeviceLorawanMac::GetNextTransmissionDelay(), ns3::lorawan::GatewayLorawanMac::GetWaitingTime(), and ns3::lorawan::GatewayLorawanMac::Send().

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

◆ RemoveChannel()

void ns3::lorawan::LogicalLoraChannelHelper::RemoveChannel ( Ptr< LogicalLoraChannel channel)

Remove a channel.

Parameters
channelA pointer to the channel we want to remove.

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

References m_channelList.

◆ SetChannel()

void ns3::lorawan::LogicalLoraChannelHelper::SetChannel ( uint8_t  chIndex,
Ptr< LogicalLoraChannel 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 141 of file logical-lora-channel-helper.cc.

References m_channelList, and NS_LOG_FUNCTION.

Referenced by ns3::lorawan::EndDeviceLorawanMac::SetLogicalChannel().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_aggregatedDutyCycle

double ns3::lorawan::LogicalLoraChannelHelper::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 207 of file logical-lora-channel-helper.h.

Referenced by AddEvent().

◆ m_channelList

std::vector<Ptr<LogicalLoraChannel> > ns3::lorawan::LogicalLoraChannelHelper::m_channelList
private

A vector of the LogicalLoraChannels 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 200 of file logical-lora-channel-helper.h.

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

◆ m_nextAggregatedTransmissionTime

Time ns3::lorawan::LogicalLoraChannelHelper::m_nextAggregatedTransmissionTime
private

The next time at which.

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

Referenced by AddEvent(), and GetAggregatedWaitingTime().

◆ m_subBandList

std::list<Ptr<SubBand> > ns3::lorawan::LogicalLoraChannelHelper::m_subBandList
private

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

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

Referenced by AddSubBand(), GetSubBandFromFrequency(), and GetTxPowerForChannel().


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