9#ifndef LORA_DEVICE_ADDRESS_H
10#define LORA_DEVICE_ADDRESS_H
12#include "ns3/address.h"
36 NwkID(uint8_t nwkId = 0);
47 void Set(uint8_t nwkId);
230 std::string
Print()
const;
a polymophic address class
This class represents the device address of a LoraWAN end device.
void SetNwkID(uint8_t nwkId)
Set the NwkID of this device.
LoraDeviceAddress()
Default constructor.
NwkAddr m_nwkAddr
The network address of this address.
static LoraDeviceAddress Deserialize(const uint8_t buf[4])
Convert the input buffer into a new address.
static LoraDeviceAddress ConvertFrom(const Address &address)
Convert from an ordinary address to a LoraDeviceAddress instance.
NwkID m_nwkId
The network Id of this address.
uint32_t GetNwkAddr()
Get the NwkAddr of this device.
uint32_t Get() const
Get the address in 32-bit integer form.
void Set(uint32_t address)
Set the address as a 32 bit integer.
void SetNwkAddr(uint32_t nwkAddr)
Set the NwkAddr of this device.
static uint8_t GetType()
Get a new address type id.
std::string Print() const
Print the address bit-by-bit to a human-readable string.
void Serialize(uint8_t buf[4]) const
Convert this address to a buffer.
bool operator>(const LoraDeviceAddress &other) const
Greater-then comparison operator.
bool operator<(const LoraDeviceAddress &other) const
Less-then comparison operator.
uint8_t GetNwkID()
Get the NwkID of this device.
bool operator!=(const LoraDeviceAddress &other) const
Inequality comparison operator.
Address ConvertTo() const
Convert this instance of LoraDeviceAddress to an Address.
bool operator==(const LoraDeviceAddress &other) const
Equality comparison operator.
void Set(uint8_t nwkId, uint32_t nwkAddr)
Set the address, combining a network id and a network address.
Class representing the Network Address component of a LoraDeviceAddress (25 bits)
uint32_t m_nwkAddr
8-bit integer representation of the network id
void Set(uint32_t nwkAddr)
Set the NwkAddr, starting from a 32-bit representation of a 25-bit integer.
uint32_t Get() const
Get an uint32_t representation of the 25-bit network address.
NwkAddr(uint32_t nwkId=0)
Construct a new NwkAddr object.
Class representing the NetworkId component of a LoraDeviceAddress (7 bits).
uint8_t m_nwkId
8-bit integer representation of the network id
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.
std::ostream & operator<<(std::ostream &os, const EndDeviceStatus &status)
Every class exported by the ns3 library is enclosed in the ns3 namespace.