A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
lora-device-address-generator.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2017 University of Padova
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Davide Magrin <magrinda@dei.unipd.it>
7
*/
8
9
#ifndef LORA_DEVICE_ADDRESS_GENERATOR_H
10
#define LORA_DEVICE_ADDRESS_GENERATOR_H
11
12
#include "
lora-device-address.h
"
13
14
#include "ns3/object.h"
15
16
namespace
ns3
17
{
18
namespace
lorawan
19
{
20
21
/**
22
* \ingroup lorawan
23
*
24
* This class generates sequential LoraDeviceAddress instances.
25
*/
26
class
LoraDeviceAddressGenerator
:
public
Object
27
{
28
public
:
29
/**
30
* Register this type.
31
* \return The object TypeId.
32
*/
33
static
TypeId
GetTypeId
();
34
35
/**
36
* Initialise the base NwkID and the first NwkAddr to be used by the
37
* generator.
38
*
39
* The first call to NextAddress() or GetAddress() will return these values.
40
*
41
* \param nwkId The first network id.
42
* \param nwkAddr The first address.
43
*/
44
LoraDeviceAddressGenerator
(
const
uint8_t nwkId = 0,
const
uint32_t
nwkAddr = 0);
45
46
/**
47
* Get the first address from the next network.
48
*
49
* This resets the address to the base address that was used for
50
* initialization.
51
*
52
* \return The LoraDeviceAddress address of the next network.
53
*/
54
LoraDeviceAddress
NextNetwork
();
55
56
/**
57
* Allocate the next LoraDeviceAddress.
58
*
59
* This operation is a post-increment, meaning that the first address
60
* allocated will be the one that was initially configured.
61
*
62
* This keeps the nwkId constant, only incrementing nwkAddr.
63
*
64
* \return The LoraDeviceAddress address.
65
*/
66
LoraDeviceAddress
NextAddress
();
67
68
/**
69
* Get the LoraDeviceAddress that will be allocated upon a call to
70
* NextAddress.
71
*
72
* Does not change the internal state; is just used to peek at the next
73
* address that will be allocated upon a call to NextAddress.
74
*
75
* \return The LoraDeviceAddress.
76
*/
77
LoraDeviceAddress
GetNextAddress
();
78
79
private
:
80
NwkID
m_currentNwkId
;
//!< The current Network Id value
81
NwkAddr
m_currentNwkAddr
;
//!< The current Network Address value
82
};
83
}
// namespace lorawan
84
}
// namespace ns3
85
#endif
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3::lorawan::LoraDeviceAddressGenerator
This class generates sequential LoraDeviceAddress instances.
Definition
lora-device-address-generator.h:27
ns3::lorawan::LoraDeviceAddressGenerator::NextAddress
LoraDeviceAddress NextAddress()
Allocate the next LoraDeviceAddress.
Definition
lora-device-address-generator.cc:50
ns3::lorawan::LoraDeviceAddressGenerator::m_currentNwkAddr
NwkAddr m_currentNwkAddr
The current Network Address value.
Definition
lora-device-address-generator.h:81
ns3::lorawan::LoraDeviceAddressGenerator::m_currentNwkId
NwkID m_currentNwkId
The current Network Id value.
Definition
lora-device-address-generator.h:80
ns3::lorawan::LoraDeviceAddressGenerator::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition
lora-device-address-generator.cc:21
ns3::lorawan::LoraDeviceAddressGenerator::GetNextAddress
LoraDeviceAddress GetNextAddress()
Get the LoraDeviceAddress that will be allocated upon a call to NextAddress.
Definition
lora-device-address-generator.cc:61
ns3::lorawan::LoraDeviceAddressGenerator::NextNetwork
LoraDeviceAddress NextNetwork()
Get the first address from the next network.
Definition
lora-device-address-generator.cc:39
ns3::lorawan::LoraDeviceAddressGenerator::LoraDeviceAddressGenerator
LoraDeviceAddressGenerator(const uint8_t nwkId=0, const uint32_t nwkAddr=0)
Initialise the base NwkID and the first NwkAddr to be used by the generator.
Definition
lora-device-address-generator.cc:30
ns3::lorawan::LoraDeviceAddress
This class represents the device address of a LoraWAN end device.
Definition
lora-device-address.h:106
ns3::lorawan::NwkAddr
Class representing the Network Address component of a LoraDeviceAddress (25 bits)
Definition
lora-device-address.h:67
ns3::lorawan::NwkID
Class representing the NetworkId component of a LoraDeviceAddress (7 bits).
Definition
lora-device-address.h:27
uint32_t
lora-device-address.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lorawan
model
lora-device-address-generator.h
Generated on Fri Nov 8 2024 13:59:02 for ns-3 by
1.11.0