ns3::LoraDeviceAddressGenerator Class Reference

This class generates sequential LoraDeviceAddress instances. More...

#include "lora-device-address-generator.h"

+ Inheritance diagram for ns3::LoraDeviceAddressGenerator:
+ Collaboration diagram for ns3::LoraDeviceAddressGenerator:

Public Member Functions

 LoraDeviceAddressGenerator (const uint8_t nwkId=0, const uint32_t nwkAddr=0)
 Initialise the base NwkID and the first NwkAddr to be used by the generator. More...
 
LoraDeviceAddress GetNextAddress (void)
 Get the LoraDeviceAddress that will be allocated upon a call to NextAddress. More...
 
LoraDeviceAddress NextAddress (void)
 Allocate the next LoraDeviceAddress. More...
 
LoraDeviceAddress NextNetwork (void)
 Get the first address from the next network. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 

Private Attributes

NwkAddr m_currentNwkAddr
 The current Network Address value. More...
 
NwkID m_currentNwkId
 The current Network Id value. More...
 

Detailed Description

This class generates sequential LoraDeviceAddress instances.

Definition at line 35 of file lora-device-address-generator.h.

Constructor & Destructor Documentation

◆ LoraDeviceAddressGenerator()

ns3::LoraDeviceAddressGenerator::LoraDeviceAddressGenerator ( const uint8_t  nwkId = 0,
const uint32_t  nwkAddr = 0 
)

Initialise the base NwkID and the first NwkAddr to be used by the generator.

The first call to NextAddress() or GetAddress() will return these values.

Parameters
nwkIdThe first network id.
nwkAddrThe first address.

Definition at line 41 of file lora-device-address-generator.cc.

References m_currentNwkAddr, m_currentNwkId, ns3::NwkAddr::Set(), and ns3::NwkID::Set().

+ Here is the call graph for this function:

Member Function Documentation

◆ GetNextAddress()

LoraDeviceAddress ns3::LoraDeviceAddressGenerator::GetNextAddress ( void  )

Get the LoraDeviceAddress that will be allocated upon a call to NextAddress.

Does not change the internal state; is just used to peek at the next address that will be allocated upon a call to NextAddress

Returns
the LoraDeviceAddress

Definition at line 72 of file lora-device-address-generator.cc.

References ns3::NwkID::Get(), ns3::NwkAddr::Get(), m_currentNwkAddr, and m_currentNwkId.

+ Here is the call graph for this function:

◆ GetTypeId()

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

Definition at line 33 of file lora-device-address-generator.cc.

◆ NextAddress()

LoraDeviceAddress ns3::LoraDeviceAddressGenerator::NextAddress ( void  )

Allocate the next LoraDeviceAddress.

This operation is a post-increment, meaning that the first address allocated will be the one that was initially configured.

This keeps the nwkId constant, only incrementing nwkAddr.

Returns
the LoraDeviceAddress address

Definition at line 61 of file lora-device-address-generator.cc.

References ns3::NwkAddr::Get(), m_currentNwkAddr, m_currentNwkId, and ns3::NwkAddr::Set().

+ Here is the call graph for this function:

◆ NextNetwork()

LoraDeviceAddress ns3::LoraDeviceAddressGenerator::NextNetwork ( void  )

Get the first address from the next network.

This resets the address to the base address that was used for initialization.

Returns
the LoraDeviceAddress address of the next network

Definition at line 50 of file lora-device-address-generator.cc.

References ns3::NwkID::Get(), m_currentNwkAddr, m_currentNwkId, ns3::NwkAddr::Set(), and ns3::NwkID::Set().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_currentNwkAddr

NwkAddr ns3::LoraDeviceAddressGenerator::m_currentNwkAddr
private

The current Network Address value.

Definition at line 86 of file lora-device-address-generator.h.

Referenced by LoraDeviceAddressGenerator(), GetNextAddress(), NextAddress(), and NextNetwork().

◆ m_currentNwkId

NwkID ns3::LoraDeviceAddressGenerator::m_currentNwkId
private

The current Network Id value.

Definition at line 85 of file lora-device-address-generator.h.

Referenced by LoraDeviceAddressGenerator(), GetNextAddress(), NextAddress(), and NextNetwork().


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