ns3::LoraDeviceAddress Class Reference

This class represents the device address of a LoraWAN End Device. More...

#include "lora-device-address.h"

+ Collaboration diagram for ns3::LoraDeviceAddress:

Public Member Functions

 LoraDeviceAddress ()
 
 LoraDeviceAddress (NwkID nwkId, NwkAddr nwkAddr)
 Build a new address from a network id and network address. More...
 
 LoraDeviceAddress (uint32_t address)
 Build a new address from a 32-bit integer. More...
 
 LoraDeviceAddress (uint8_t nwkId, uint32_t nwkAddr)
 Build a new address from a network id and network address. More...
 
uint32_t Get (void) const
 Get the address in 32-bit integer form. More...
 
uint32_t GetNwkAddr (void)
 Get the NwkAddr of this device. More...
 
uint8_t GetNwkID (void)
 Get the NwkID of this device. More...
 
bool operator!= (const LoraDeviceAddress &other) const
 
bool operator< (const LoraDeviceAddress &other) const
 
bool operator== (const LoraDeviceAddress &other) const
 
bool operator> (const LoraDeviceAddress &other) const
 
std::string Print (void) const
 Print the address bit-by-bit to a human-readable string. More...
 
void Serialize (uint8_t buf[4]) const
 Convert this address to a buffer. More...
 
void Set (uint32_t address)
 Set the address as a 32 bit integer. More...
 
void Set (uint8_t nwkId, uint32_t nwkAddr)
 Set the address, combining a network id and a network address. More...
 
void SetNwkAddr (uint32_t nwkAddr)
 Set the NwkAddr of this device. More...
 
void SetNwkID (uint8_t nwkId)
 Set the NwkID of this device. More...
 

Static Public Member Functions

static LoraDeviceAddress ConvertFrom (const Address &address)
 Convert from an ordinary address to a LoraDeviceAddress instance. More...
 
static LoraDeviceAddress Deserialize (const uint8_t buf[4])
 Convert the input buffer into a new address. More...
 

Private Member Functions

Address ConvertTo (void) const
 Convert this instance of LoraDeviceAddress to an Address. More...
 

Static Private Member Functions

static uint8_t GetType (void)
 

Private Attributes

NwkAddr m_nwkAddr
 The network address of this address. More...
 
NwkID m_nwkId
 The network Id of this address. More...
 

Detailed Description

This class represents the device address of a LoraWAN End Device.

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

Constructor & Destructor Documentation

◆ LoraDeviceAddress() [1/4]

ns3::LoraDeviceAddress::LoraDeviceAddress ( )

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

Referenced by Deserialize().

+ Here is the caller graph for this function:

◆ LoraDeviceAddress() [2/4]

ns3::LoraDeviceAddress::LoraDeviceAddress ( uint32_t  address)

Build a new address from a 32-bit integer.

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

References Set().

+ Here is the call graph for this function:

◆ LoraDeviceAddress() [3/4]

ns3::LoraDeviceAddress::LoraDeviceAddress ( uint8_t  nwkId,
uint32_t  nwkAddr 
)

Build a new address from a network id and network address.

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

References m_nwkAddr, m_nwkId, ns3::NwkAddr::Set(), and ns3::NwkID::Set().

+ Here is the call graph for this function:

◆ LoraDeviceAddress() [4/4]

ns3::LoraDeviceAddress::LoraDeviceAddress ( NwkID  nwkId,
NwkAddr  nwkAddr 
)

Build a new address from a network id and network address.

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

References ns3::NwkID::Get(), ns3::NwkAddr::Get(), m_nwkAddr, and m_nwkId.

+ Here is the call graph for this function:

Member Function Documentation

◆ ConvertFrom()

LoraDeviceAddress ns3::LoraDeviceAddress::ConvertFrom ( const Address &  address)
static

Convert from an ordinary address to a LoraDeviceAddress instance.

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

References Deserialize(), and GetType().

+ Here is the call graph for this function:

◆ ConvertTo()

Address ns3::LoraDeviceAddress::ConvertTo ( void  ) const
private

Convert this instance of LoraDeviceAddress to an Address.

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

References GetType(), and Serialize().

+ Here is the call graph for this function:

◆ Deserialize()

LoraDeviceAddress ns3::LoraDeviceAddress::Deserialize ( const uint8_t  buf[4])
static

Convert the input buffer into a new address.

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

References LoraDeviceAddress().

Referenced by ConvertFrom().

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

◆ Get()

uint32_t ns3::LoraDeviceAddress::Get ( void  ) const

Get the address in 32-bit integer form.

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

References ns3::NwkID::Get(), ns3::NwkAddr::Get(), m_nwkAddr, and m_nwkId.

Referenced by operator!=(), operator<(), operator==(), operator>(), ns3::LoraFrameHeader::Serialize(), and Serialize().

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

◆ GetNwkAddr()

uint32_t ns3::LoraDeviceAddress::GetNwkAddr ( void  )

Get the NwkAddr of this device.

Remarks
The NwkAddr will be contained on the 25 least significant bits of the uint32_t.
Returns
A 32-bit representation of the Network Address of this Device Address.

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

References ns3::NwkAddr::Get(), and m_nwkAddr.

+ Here is the call graph for this function:

◆ GetNwkID()

uint8_t ns3::LoraDeviceAddress::GetNwkID ( void  )

Get the NwkID of this device.

Remarks
The NwkID bit-by-bit representation will be contained in the 7 least significant bits of the returned uint8_t.
Returns
An 8-bit representation of the Network Id of this Device Address.

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

References ns3::NwkID::Get(), and m_nwkId.

+ Here is the call graph for this function:

◆ GetType()

uint8_t ns3::LoraDeviceAddress::GetType ( void  )
staticprivate

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

Referenced by ConvertFrom(), and ConvertTo().

+ Here is the caller graph for this function:

◆ operator!=()

bool ns3::LoraDeviceAddress::operator!= ( const LoraDeviceAddress other) const

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

References Get().

+ Here is the call graph for this function:

◆ operator<()

bool ns3::LoraDeviceAddress::operator< ( const LoraDeviceAddress other) const

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

References Get().

+ Here is the call graph for this function:

◆ operator==()

bool ns3::LoraDeviceAddress::operator== ( const LoraDeviceAddress other) const

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

References Get().

+ Here is the call graph for this function:

◆ operator>()

bool ns3::LoraDeviceAddress::operator> ( const LoraDeviceAddress other) const

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

References Get().

+ Here is the call graph for this function:

◆ Print()

std::string ns3::LoraDeviceAddress::Print ( void  ) const

Print the address bit-by-bit to a human-readable string.

Returns
The string containing the network address.

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

References ns3::NwkID::Get(), ns3::NwkAddr::Get(), m_nwkAddr, and m_nwkId.

Referenced by ns3::LoraNetworkStatus::AddNode(), ns3::LoraFrameHeader::Deserialize(), ns3::operator<<(), and ns3::LoraFrameHeader::Print().

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

◆ Serialize()

void ns3::LoraDeviceAddress::Serialize ( uint8_t  buf[4]) const

Convert this address to a buffer.

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

References Get().

Referenced by ConvertTo().

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

◆ Set() [1/2]

void ns3::LoraDeviceAddress::Set ( uint32_t  address)

Set the address as a 32 bit integer.

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

References m_nwkAddr, m_nwkId, ns3::NwkAddr::Set(), and ns3::NwkID::Set().

Referenced by LoraDeviceAddress(), and ns3::LoraFrameHeader::Deserialize().

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

◆ Set() [2/2]

void ns3::LoraDeviceAddress::Set ( uint8_t  nwkId,
uint32_t  nwkAddr 
)

Set the address, combining a network id and a network address.

Note that nwkId is 7 bits long, and this function expects the 7 least significant bits to contain the nwkId. Similarly for the nwkAddr, the 25 least signficant bits of the uint32 are those that are expected to contain the nwkAddr.

◆ SetNwkAddr()

void ns3::LoraDeviceAddress::SetNwkAddr ( uint32_t  nwkAddr)

Set the NwkAddr of this device.

Remarks
The NwkAddr is expected to be contained on the least significant bits of the uint32_t.
Parameters
nwkAddrThe network address to set.

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

References m_nwkAddr, and ns3::NwkAddr::Set().

+ Here is the call graph for this function:

◆ SetNwkID()

void ns3::LoraDeviceAddress::SetNwkID ( uint8_t  nwkId)

Set the NwkID of this device.

Remarks
The NwkID is expected to be contained on the 7 least significant bits of the uint8_t.
Parameters
nwkIdThe network id to set.

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

References m_nwkId, and ns3::NwkID::Set().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_nwkAddr

NwkAddr ns3::LoraDeviceAddress::m_nwkAddr
private

The network address of this address.

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

Referenced by LoraDeviceAddress(), Get(), GetNwkAddr(), Print(), Set(), and SetNwkAddr().

◆ m_nwkId

NwkID ns3::LoraDeviceAddress::m_nwkId
private

The network Id of this address.

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

Referenced by LoraDeviceAddress(), Get(), GetNwkID(), Print(), Set(), and SetNwkID().


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