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
utilities.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018 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
* Authors: Davide Magrin <magrinda@dei.unipd.it>
18
*/
19
20
#ifndef TEST_UTILITIES_H
21
#define TEST_UTILITIES_H
22
23
#include "ns3/forwarder-helper.h"
24
#include "ns3/lora-helper.h"
25
#include "ns3/mobility-helper.h"
26
#include "ns3/network-server-helper.h"
27
#include "ns3/position-allocator.h"
28
29
namespace
ns3
30
{
31
namespace
lorawan
32
{
33
34
/**
35
* \ingroup lorawan
36
*
37
* Stores the main elements of a simulated LoRaWAN network
38
*/
39
struct
NetworkComponents
40
{
41
Ptr<LoraChannel>
channel
;
//!< A pointer to the LoraChannel object.
42
NodeContainer
endDevices
;
//!< Container of the end device nodes.
43
NodeContainer
gateways
;
//!< Container of the gateway nodes.
44
Ptr<Node>
nsNode
;
//!< A pointer to the network server Node.
45
};
46
47
Ptr<LoraChannel>
CreateChannel
();
48
49
NodeContainer
CreateEndDevices
(
int
nDevices
,
MobilityHelper
mobility,
Ptr<LoraChannel>
channel);
50
51
NodeContainer
CreateGateways
(
int
nGateways
,
MobilityHelper
mobility,
Ptr<LoraChannel>
channel);
52
53
Ptr<Node>
CreateNetworkServer
(
NodeContainer
endDevices,
NodeContainer
gateways);
54
55
template
<
typename
T>
56
Ptr<T>
57
GetMacLayerFromNode
(
Ptr<Node>
n)
58
{
59
return
n->GetDevice(0)->GetObject<
LoraNetDevice
>()->GetMac()->
GetObject
<T>();
60
}
61
62
NetworkComponents
InitializeNetwork
(
int
nDevices
,
int
nGateways
);
63
}
// namespace lorawan
64
65
}
// namespace ns3
66
#endif
ns3::MobilityHelper
Helper class used to assign positions and mobility models to nodes.
Definition:
mobility-helper.h:44
ns3::NodeContainer
keep track of a set of node pointers.
Definition:
node-container.h:40
ns3::Object::GetObject
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
Definition:
object.h:522
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::lorawan::LoraNetDevice
Hold together all LoRa related objects.
Definition:
lora-net-device.h:56
nDevices
int nDevices
Number of end device nodes to create.
Definition:
aloha-throughput.cc:58
nGateways
int nGateways
Number of gateway nodes to create.
Definition:
aloha-throughput.cc:59
ns3::lorawan::CreateNetworkServer
Ptr< Node > CreateNetworkServer(NodeContainer endDevices, NodeContainer gateways)
Definition:
utilities.cc:96
ns3::lorawan::CreateChannel
Ptr< LoraChannel > CreateChannel()
Definition:
utilities.cc:28
ns3::lorawan::CreateGateways
NodeContainer CreateGateways(int nGateways, MobilityHelper mobility, Ptr< LoraChannel > channel)
Definition:
utilities.cc:69
ns3::lorawan::InitializeNetwork
NetworkComponents InitializeNetwork(int nDevices, int nGateways)
Definition:
utilities.cc:128
ns3::lorawan::GetMacLayerFromNode
Ptr< T > GetMacLayerFromNode(Ptr< Node > n)
Definition:
utilities.h:57
ns3::lorawan::CreateEndDevices
NodeContainer CreateEndDevices(int nDevices, MobilityHelper mobility, Ptr< LoraChannel > channel)
Definition:
utilities.cc:41
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::lorawan::NetworkComponents
Stores the main elements of a simulated LoRaWAN network.
Definition:
utilities.h:40
ns3::lorawan::NetworkComponents::nsNode
Ptr< Node > nsNode
A pointer to the network server Node.
Definition:
utilities.h:44
ns3::lorawan::NetworkComponents::channel
Ptr< LoraChannel > channel
A pointer to the LoraChannel object.
Definition:
utilities.h:41
ns3::lorawan::NetworkComponents::endDevices
NodeContainer endDevices
Container of the end device nodes.
Definition:
utilities.h:42
ns3::lorawan::NetworkComponents::gateways
NodeContainer gateways
Container of the gateway nodes.
Definition:
utilities.h:43
src
lorawan
test
utilities.h
Generated on Mon Aug 12 2024 11:16:15 for ns-3 by
1.9.6