This class generates sequential LoraDeviceAddress instances. More...
#include "lora-device-address-generator.h"
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... | |
This class generates sequential LoraDeviceAddress instances.
Definition at line 38 of file lora-device-address-generator.h.
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.
nwkId | The first network id. |
nwkAddr | The 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().
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
Definition at line 72 of file lora-device-address-generator.cc.
References ns3::NwkID::Get(), ns3::NwkAddr::Get(), m_currentNwkAddr, and m_currentNwkId.
|
static |
Definition at line 33 of file lora-device-address-generator.cc.
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.
Definition at line 61 of file lora-device-address-generator.cc.
References ns3::NwkAddr::Get(), m_currentNwkAddr, m_currentNwkId, and ns3::NwkAddr::Set().
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.
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().
|
private |
The current Network Address value.
Definition at line 89 of file lora-device-address-generator.h.
Referenced by LoraDeviceAddressGenerator(), GetNextAddress(), NextAddress(), and NextNetwork().
|
private |
The current Network Id value.
Definition at line 88 of file lora-device-address-generator.h.
Referenced by LoraDeviceAddressGenerator(), GetNextAddress(), NextAddress(), and NextNetwork().