34 NS_LOG_COMPONENT_DEFINE(
"LoraDeviceAddress");
50 NS_LOG_WARN(
"Attempting to set too big a network ID. Will only consider the 7 least "
76 NS_LOG_WARN(
"Attempting to set too big a network address. Will only consider the 25 least "
93 NS_LOG_FUNCTION_NOARGS();
98 NS_LOG_FUNCTION(
this << address);
105 NS_LOG_FUNCTION(
this <<
unsigned(nwkId) << nwkAddr);
113 NS_LOG_FUNCTION(
this <<
unsigned(nwkId.
Get()) << nwkAddr.
Get());
122 NS_LOG_FUNCTION(
this << &buf);
124 uint32_t address =
Get();
126 buf[0] = (address >> 24) & 0xff;
127 buf[1] = (address >> 16) & 0xff;
128 buf[2] = (address >> 8) & 0xff;
129 buf[3] = (address >> 0) & 0xff;
135 NS_LOG_FUNCTION(&buf);
138 uint32_t address = 0;
153 NS_LOG_FUNCTION(
this);
155 uint8_t addressBuffer[4];
157 return Address(
GetType(), addressBuffer, 4);
165 uint8_t addressBuffer[4];
169 NS_ASSERT(address.CheckCompatible(
GetType(), 4));
170 address.CopyTo(addressBuffer);
178 NS_LOG_FUNCTION_NOARGS();
180 static uint8_t type = Address::Register();
187 NS_LOG_FUNCTION_NOARGS();
189 uint32_t address = 0;
190 uint32_t nwkId = uint32_t(
m_nwkId.
Get() << 25);
192 NS_LOG_DEBUG(
"m_nwkId + m_nwkAddr = " << std::bitset<32>(address));
200 NS_LOG_FUNCTION_NOARGS();
209 NS_LOG_FUNCTION_NOARGS();
217 NS_LOG_FUNCTION_NOARGS();
225 NS_LOG_FUNCTION(
this <<
unsigned(nwkId));
233 NS_LOG_FUNCTION(
this << nwkAddr);
241 NS_LOG_FUNCTION_NOARGS();
244 result += std::bitset<7>(
m_nwkId.
Get()).to_string();
253 return this->
Get() == other.
Get();
259 return this->
Get() != other.
Get();
265 return this->
Get() < other.
Get();
271 return !(this->
Get() < other.
Get());
277 os << address.
Print();
This class represents the device address of a LoraWAN End Device.
NwkID m_nwkId
The network Id of this address.
static LoraDeviceAddress Deserialize(const uint8_t buf[4])
Convert the input buffer into a new address.
Address ConvertTo(void) const
Convert this instance of LoraDeviceAddress to an Address.
bool operator>(const LoraDeviceAddress &other) const
static LoraDeviceAddress ConvertFrom(const Address &address)
Convert from an ordinary address to a LoraDeviceAddress instance.
void Set(uint32_t address)
Set the address as a 32 bit integer.
uint32_t GetNwkAddr(void)
Get the NwkAddr of this device.
void Serialize(uint8_t buf[4]) const
Convert this address to a buffer.
bool operator!=(const LoraDeviceAddress &other) const
bool operator==(const LoraDeviceAddress &other) const
void SetNwkID(uint8_t nwkId)
Set the NwkID of this device.
uint32_t Get(void) const
Get the address in 32-bit integer form.
uint8_t GetNwkID(void)
Get the NwkID of this device.
static uint8_t GetType(void)
void SetNwkAddr(uint32_t nwkAddr)
Set the NwkAddr of this device.
std::string Print(void) const
Print the address bit-by-bit to a human-readable string.
NwkAddr m_nwkAddr
The network address of this address.
bool operator<(const LoraDeviceAddress &other) const
Class representing the Network Address component of a LoraDeviceAddress (25 bits)
NwkAddr(uint32_t nwkId=0)
void Set(uint32_t nwkAddr)
Set the NwkAddr, starting from a 32-bit representation of a 25-bit integer.
uint32_t Get(void) const
Get an uint32_t representation of the 25-bit network address.
uint32_t m_nwkAddr
8-bit integer representation of the network id
Class representing the NetworkId component of a LoraDeviceAddress (7 bits).
uint8_t m_nwkId
8-bit integer representation of the network id
uint8_t Get(void) 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.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
std::ostream & operator<<(std::ostream &os, const GeoCoordinate &coordinate)