A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::lorawan::NwkAddr Class Reference

Class representing the Network Address component of a LoraDeviceAddress (25 bits) More...

#include "lora-device-address.h"

+ Collaboration diagram for ns3::lorawan::NwkAddr:

Public Member Functions

 NwkAddr (uint32_t nwkId=0)
 Construct a new NwkAddr object.
 
uint32_t Get () const
 Get an uint32_t representation of the 25-bit network address.
 
void Set (uint32_t nwkAddr)
 Set the NwkAddr, starting from a 32-bit representation of a 25-bit integer.
 

Private Attributes

uint32_t m_nwkAddr
 8-bit integer representation of the network id
 

Detailed Description

Class representing the Network Address component of a LoraDeviceAddress (25 bits)

Definition at line 77 of file lora-device-address.h.

Constructor & Destructor Documentation

◆ NwkAddr()

ns3::lorawan::NwkAddr::NwkAddr ( uint32_t  nwkId = 0)

Construct a new NwkAddr object.

Parameters
nwkIdNetwork addr value [0:2^25-1].
Todo:
Add warning as in Set().

Definition at line 62 of file lora-device-address.cc.

Member Function Documentation

◆ Get()

uint32_t ns3::lorawan::NwkAddr::Get ( ) const

Get an uint32_t representation of the 25-bit network address.

Returns
The Network Address.

Definition at line 80 of file lora-device-address.cc.

References m_nwkAddr.

Referenced by ns3::lorawan::LoraDeviceAddress::LoraDeviceAddress(), ns3::lorawan::LoraDeviceAddress::Get(), ns3::lorawan::LoraDeviceAddressGenerator::GetNextAddress(), ns3::lorawan::LoraDeviceAddress::GetNwkAddr(), ns3::lorawan::LoraDeviceAddressGenerator::NextAddress(), and ns3::lorawan::LoraDeviceAddress::Print().

+ Here is the caller graph for this function:

◆ Set()

void ns3::lorawan::NwkAddr::Set ( uint32_t  nwkAddr)

Set the NwkAddr, starting from a 32-bit representation of a 25-bit integer.

This method will ignore the most significant bits of the argument. This means that all arguments such that nwkAddr > 2^25-1 will actually be considered as nwkAddr mod 2^25-1.

Parameters
nwkAddrThe Network Address to set.

Definition at line 68 of file lora-device-address.cc.

References m_nwkAddr, and NS_LOG_WARN.

Referenced by ns3::lorawan::LoraDeviceAddress::LoraDeviceAddress(), ns3::lorawan::LoraDeviceAddressGenerator::LoraDeviceAddressGenerator(), ns3::lorawan::LoraDeviceAddressGenerator::NextAddress(), ns3::lorawan::LoraDeviceAddressGenerator::NextNetwork(), ns3::lorawan::LoraDeviceAddress::Set(), and ns3::lorawan::LoraDeviceAddress::SetNwkAddr().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_nwkAddr

uint32_t ns3::lorawan::NwkAddr::m_nwkAddr
private

8-bit integer representation of the network id

Definition at line 108 of file lora-device-address.h.

Referenced by Get(), and Set().


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