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
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Davide Magrin <magrinda@dei.unipd.it>
18
*/
19
20
#ifndef LORA_DEVICE_ADDRESS_GENERATOR_H
21
#define LORA_DEVICE_ADDRESS_GENERATOR_H
22
23
#include "
lora-device-address.h
"
24
25
#include "ns3/object.h"
26
27
namespace
ns3
28
{
29
namespace
lorawan
30
{
31
32
/**
33
* \ingroup lorawan
34
*
35
* This class generates sequential LoraDeviceAddress instances.
36
*/
37
class
LoraDeviceAddressGenerator
:
public
Object
38
{
39
public
:
40
/**
41
* Register this type.
42
* \return The object TypeId.
43
*/
44
static
TypeId
GetTypeId
();
45
46
/**
47
* Initialise the base NwkID and the first NwkAddr to be used by the
48
* generator.
49
*
50
* The first call to NextAddress() or GetAddress() will return these values.
51
*
52
* \param nwkId The first network id.
53
* \param nwkAddr The first address.
54
*/
55
LoraDeviceAddressGenerator
(
const
uint8_t nwkId = 0,
const
uint32_t
nwkAddr = 0);
56
57
/**
58
* Get the first address from the next network.
59
*
60
* This resets the address to the base address that was used for
61
* initialization.
62
*
63
* \return The LoraDeviceAddress address of the next network.
64
*/
65
LoraDeviceAddress
NextNetwork
();
66
67
/**
68
* Allocate the next LoraDeviceAddress.
69
*
70
* This operation is a post-increment, meaning that the first address
71
* allocated will be the one that was initially configured.
72
*
73
* This keeps the nwkId constant, only incrementing nwkAddr.
74
*
75
* \return The LoraDeviceAddress address.
76
*/
77
LoraDeviceAddress
NextAddress
();
78
79
/**
80
* Get the LoraDeviceAddress that will be allocated upon a call to
81
* NextAddress.
82
*
83
* Does not change the internal state; is just used to peek at the next
84
* address that will be allocated upon a call to NextAddress.
85
*
86
* \return The LoraDeviceAddress.
87
*/
88
LoraDeviceAddress
GetNextAddress
();
89
90
private
:
91
NwkID
m_currentNwkId
;
//!< The current Network Id value
92
NwkAddr
m_currentNwkAddr
;
//!< The current Network Address value
93
};
94
}
// namespace lorawan
95
}
// namespace ns3
96
#endif
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::lorawan::LoraDeviceAddressGenerator
This class generates sequential LoraDeviceAddress instances.
Definition:
lora-device-address-generator.h:38
ns3::lorawan::LoraDeviceAddressGenerator::NextAddress
LoraDeviceAddress NextAddress()
Allocate the next LoraDeviceAddress.
Definition:
lora-device-address-generator.cc:61
ns3::lorawan::LoraDeviceAddressGenerator::m_currentNwkAddr
NwkAddr m_currentNwkAddr
The current Network Address value.
Definition:
lora-device-address-generator.h:92
ns3::lorawan::LoraDeviceAddressGenerator::m_currentNwkId
NwkID m_currentNwkId
The current Network Id value.
Definition:
lora-device-address-generator.h:91
ns3::lorawan::LoraDeviceAddressGenerator::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition:
lora-device-address-generator.cc:32
ns3::lorawan::LoraDeviceAddressGenerator::GetNextAddress
LoraDeviceAddress GetNextAddress()
Get the LoraDeviceAddress that will be allocated upon a call to NextAddress.
Definition:
lora-device-address-generator.cc:72
ns3::lorawan::LoraDeviceAddressGenerator::NextNetwork
LoraDeviceAddress NextNetwork()
Get the first address from the next network.
Definition:
lora-device-address-generator.cc:50
ns3::lorawan::LoraDeviceAddress
This class represents the device address of a LoraWAN end device.
Definition:
lora-device-address.h:117
ns3::lorawan::NwkAddr
Class representing the Network Address component of a LoraDeviceAddress (25 bits)
Definition:
lora-device-address.h:78
ns3::lorawan::NwkID
Class representing the NetworkId component of a LoraDeviceAddress (7 bits).
Definition:
lora-device-address.h:38
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 Mon Aug 12 2024 11:16:15 for ns-3 by
1.9.6