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

Class representing the NetworkId component of a LoraDeviceAddress (7 bits). More...

#include "lora-device-address.h"

+ Collaboration diagram for ns3::lorawan::NwkID:

Public Member Functions

 NwkID (uint8_t nwkId=0)
 Construct a new NwkID object.
 
uint8_t Get () const
 Get an uint8_t representation of the 7-bit network ID.
 
void Set (uint8_t nwkId)
 Set the NwkID, starting from a 8-bit representation of a 7-bit integer.
 

Private Attributes

uint8_t m_nwkId
 8-bit integer representation of the network id
 

Detailed Description

Class representing the NetworkId component of a LoraDeviceAddress (7 bits).

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

Constructor & Destructor Documentation

◆ NwkID()

ns3::lorawan::NwkID::NwkID ( uint8_t  nwkId = 0)

Construct a new NwkID object.

Parameters
nwkIdThe network id value [0:127].
Todo:
Add warning as in Set().

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

Member Function Documentation

◆ Get()

uint8_t ns3::lorawan::NwkID::Get ( ) const

Get an uint8_t representation of the 7-bit network ID.

Returns
The Network Id.

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

References m_nwkId.

Referenced by ns3::lorawan::LoraDeviceAddress::LoraDeviceAddress(), ns3::lorawan::LoraDeviceAddress::Get(), ns3::lorawan::LoraDeviceAddressGenerator::GetNextAddress(), ns3::lorawan::LoraDeviceAddress::GetNwkID(), ns3::lorawan::LoraDeviceAddressGenerator::NextNetwork(), and ns3::lorawan::LoraDeviceAddress::Print().

+ Here is the caller graph for this function:

◆ Set()

void ns3::lorawan::NwkID::Set ( uint8_t  nwkId)

Set the NwkID, starting from a 8-bit representation of a 7-bit integer.

This method will ignore the most significant bit of the argument. This means that all arguments such that nwkId > 127 will actually be considered as nwkId mod 127.

Parameters
nwkIdThe Network Id value to set.

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

References m_nwkId, and NS_LOG_WARN.

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

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_nwkId

uint8_t ns3::lorawan::NwkID::m_nwkId
private

8-bit integer representation of the network id

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

Referenced by Get(), and Set().


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