This class represents the device address of a LoraWAN End Device. More...
#include "lora-device-address.h"
Public Member Functions | |
| LoraDeviceAddress () | |
| LoraDeviceAddress (NwkID nwkId, NwkAddr nwkAddr) | |
| Build a new address from a network id and network address. | |
| LoraDeviceAddress (uint32_t address) | |
| Build a new address from a 32-bit integer. | |
| LoraDeviceAddress (uint8_t nwkId, uint32_t nwkAddr) | |
| Build a new address from a network id and network address. | |
| uint32_t | Get (void) const |
| Get the address in 32-bit integer form. | |
| uint32_t | GetNwkAddr (void) |
| Get the NwkAddr of this device. | |
| uint8_t | GetNwkID (void) |
| Get the NwkID of this device. | |
| 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. | |
| void | Serialize (uint8_t buf[4]) const |
| Convert this address to a buffer. | |
| void | Set (uint32_t address) |
| Set the address as a 32 bit integer. | |
| void | Set (uint8_t nwkId, uint32_t nwkAddr) |
| Set the address, combining a network id and a network address. | |
| void | SetNwkAddr (uint32_t nwkAddr) |
| Set the NwkAddr of this device. | |
| void | SetNwkID (uint8_t nwkId) |
| Set the NwkID of this device. | |
Static Public Member Functions | |
| static LoraDeviceAddress | ConvertFrom (const Address &address) |
| Convert from an ordinary address to a LoraDeviceAddress instance. | |
| static LoraDeviceAddress | Deserialize (const uint8_t buf[4]) |
| Convert the input buffer into a new address. | |
Private Member Functions | |
| Address | ConvertTo (void) const |
| Convert this instance of LoraDeviceAddress to an Address. | |
Static Private Member Functions | |
| static uint8_t | GetType (void) |
Private Attributes | |
| NwkAddr | m_nwkAddr |
| The network address of this address. | |
| NwkID | m_nwkId |
| The network Id of this address. | |
This class represents the device address of a LoraWAN End Device.
Definition at line 99 of file lora-device-address.h.
| ns3::LoraDeviceAddress::LoraDeviceAddress | ( | ) |
Definition at line 91 of file lora-device-address.cc.
Referenced by ConvertFrom(), Deserialize(), operator!=(), operator<(), operator==(), operator>(), and Set().
| ns3::LoraDeviceAddress::LoraDeviceAddress | ( | uint32_t | address | ) |
Build a new address from a 32-bit integer.
Definition at line 96 of file lora-device-address.cc.
References Set().
| ns3::LoraDeviceAddress::LoraDeviceAddress | ( | uint8_t | nwkId, |
| uint32_t | nwkAddr ) |
Build a new address from a network id and network address.
Definition at line 103 of file lora-device-address.cc.
Build a new address from a network id and network address.
Definition at line 111 of file lora-device-address.cc.
References ns3::NwkAddr::Get(), ns3::NwkID::Get(), m_nwkAddr, and m_nwkId.
|
static |
Convert from an ordinary address to a LoraDeviceAddress instance.
Definition at line 161 of file lora-device-address.cc.
References LoraDeviceAddress(), Deserialize(), and GetType().
|
private |
Convert this instance of LoraDeviceAddress to an Address.
Definition at line 151 of file lora-device-address.cc.
References GetType(), and Serialize().
|
static |
Convert the input buffer into a new address.
Definition at line 133 of file lora-device-address.cc.
References LoraDeviceAddress().
Referenced by ConvertFrom().
| uint32_t ns3::LoraDeviceAddress::Get | ( | void | ) | const |
Get the address in 32-bit integer form.
Definition at line 185 of file lora-device-address.cc.
References m_nwkAddr, and m_nwkId.
Referenced by operator!=(), operator<(), operator==(), operator>(), and Serialize().
| uint32_t ns3::LoraDeviceAddress::GetNwkAddr | ( | void | ) |
Get the NwkAddr of this device.
Definition at line 215 of file lora-device-address.cc.
References m_nwkAddr.
| uint8_t ns3::LoraDeviceAddress::GetNwkID | ( | void | ) |
Get the NwkID of this device.
Definition at line 207 of file lora-device-address.cc.
References m_nwkId.
|
staticprivate |
Definition at line 176 of file lora-device-address.cc.
Referenced by ConvertFrom(), and ConvertTo().
| bool ns3::LoraDeviceAddress::operator!= | ( | const LoraDeviceAddress & | other | ) | const |
Definition at line 257 of file lora-device-address.cc.
References LoraDeviceAddress(), and Get().
| bool ns3::LoraDeviceAddress::operator< | ( | const LoraDeviceAddress & | other | ) | const |
Definition at line 262 of file lora-device-address.cc.
References LoraDeviceAddress(), and Get().
| bool ns3::LoraDeviceAddress::operator== | ( | const LoraDeviceAddress & | other | ) | const |
Definition at line 251 of file lora-device-address.cc.
References LoraDeviceAddress(), and Get().
| bool ns3::LoraDeviceAddress::operator> | ( | const LoraDeviceAddress & | other | ) | const |
Definition at line 269 of file lora-device-address.cc.
References LoraDeviceAddress(), and Get().
| std::string ns3::LoraDeviceAddress::Print | ( | void | ) | const |
Print the address bit-by-bit to a human-readable string.
Definition at line 239 of file lora-device-address.cc.
References m_nwkAddr, and m_nwkId.
Referenced by ns3::LoraNetworkStatus::AddNode(), and ns3::operator<<().
| void ns3::LoraDeviceAddress::Serialize | ( | uint8_t | buf[4] | ) | const |
Convert this address to a buffer.
Definition at line 120 of file lora-device-address.cc.
References Get().
Referenced by ConvertTo().
| void ns3::LoraDeviceAddress::Set | ( | uint32_t | address | ) |
Set the address as a 32 bit integer.
Definition at line 198 of file lora-device-address.cc.
References m_nwkAddr, and m_nwkId.
Referenced by LoraDeviceAddress().
| 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.
References LoraDeviceAddress().
| void ns3::LoraDeviceAddress::SetNwkAddr | ( | uint32_t | nwkAddr | ) |
Set the NwkAddr of this device.
| nwkAddr | The network address to set. |
Definition at line 231 of file lora-device-address.cc.
References m_nwkAddr.
| void ns3::LoraDeviceAddress::SetNwkID | ( | uint8_t | nwkId | ) |
Set the NwkID of this device.
| nwkId | The network id to set. |
Definition at line 223 of file lora-device-address.cc.
References m_nwkId.
|
private |
The network address of this address.
Definition at line 213 of file lora-device-address.h.
Referenced by LoraDeviceAddress(), LoraDeviceAddress(), Get(), GetNwkAddr(), Print(), Set(), and SetNwkAddr().
|
private |
The network Id of this address.
Definition at line 212 of file lora-device-address.h.
Referenced by LoraDeviceAddress(), LoraDeviceAddress(), Get(), GetNwkID(), Print(), Set(), and SetNwkID().