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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Authors: Davide Magrin <magrinda@dei.unipd.it>
7
*/
8
9
#ifndef TEST_UTILITIES_H
10
#define TEST_UTILITIES_H
11
12
#include "ns3/lora-channel.h"
13
#include "ns3/lora-net-device.h"
14
#include "ns3/mobility-helper.h"
15
#include "ns3/node-container.h"
16
17
namespace
ns3
18
{
19
namespace
lorawan
20
{
21
22
/**
23
* @ingroup lorawan
24
*
25
* Stores the main elements of a simulated LoRaWAN network
26
*/
27
struct
NetworkComponents
28
{
29
Ptr<LoraChannel>
channel
;
//!< A pointer to the LoraChannel object.
30
NodeContainer
endDevices
;
//!< Container of the end device nodes.
31
NodeContainer
gateways
;
//!< Container of the gateway nodes.
32
Ptr<Node>
nsNode
;
//!< A pointer to the network server Node.
33
};
34
35
Ptr<LoraChannel>
CreateChannel
();
36
37
NodeContainer
CreateEndDevices
(
int
nDevices
,
MobilityHelper
mobility,
Ptr<LoraChannel>
channel);
38
39
NodeContainer
CreateGateways
(
int
nGateways
,
MobilityHelper
mobility,
Ptr<LoraChannel>
channel);
40
41
Ptr<Node>
CreateNetworkServer
(
NodeContainer
endDevices,
NodeContainer
gateways);
42
43
template
<
typename
T>
44
Ptr<T>
45
GetMacLayerFromNode
(
Ptr<Node>
n)
46
{
47
return
DynamicCast<T>
(
DynamicCast<LoraNetDevice>
(n->GetDevice(0))->GetMac());
48
}
49
50
NetworkComponents
InitializeNetwork
(
int
nDevices
,
int
nGateways
);
51
52
}
// namespace lorawan
53
}
// namespace ns3
54
55
#endif
/* TEST_UTILITIES_H */
ns3::MobilityHelper
Helper class used to assign positions and mobility models to nodes.
Definition
mobility-helper.h:33
ns3::NodeContainer
keep track of a set of node pointers.
Definition
node-container.h:29
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:70
nDevices
int nDevices
Number of end device nodes to create.
Definition
aloha-throughput.cc:20
nGateways
int nGateways
Number of gateway nodes to create.
Definition
aloha-throughput.cc:21
ns3::lorawan
Definition
forwarder-helper.cc:19
ns3::lorawan::CreateNetworkServer
Ptr< Node > CreateNetworkServer(NodeContainer endDevices, NodeContainer gateways)
Definition
utilities.cc:92
ns3::lorawan::CreateChannel
Ptr< LoraChannel > CreateChannel()
Definition
utilities.cc:24
ns3::lorawan::CreateGateways
NodeContainer CreateGateways(int nGateways, MobilityHelper mobility, Ptr< LoraChannel > channel)
Definition
utilities.cc:65
ns3::lorawan::InitializeNetwork
NetworkComponents InitializeNetwork(int nDevices, int nGateways)
Definition
utilities.cc:124
ns3::lorawan::GetMacLayerFromNode
Ptr< T > GetMacLayerFromNode(Ptr< Node > n)
Definition
utilities.h:45
ns3::lorawan::CreateEndDevices
NodeContainer CreateEndDevices(int nDevices, MobilityHelper mobility, Ptr< LoraChannel > channel)
Definition
utilities.cc:37
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::DynamicCast
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
Definition
ptr.h:605
ns3::lorawan::NetworkComponents
Stores the main elements of a simulated LoRaWAN network.
Definition
utilities.h:28
ns3::lorawan::NetworkComponents::nsNode
Ptr< Node > nsNode
A pointer to the network server Node.
Definition
utilities.h:32
ns3::lorawan::NetworkComponents::channel
Ptr< LoraChannel > channel
A pointer to the LoraChannel object.
Definition
utilities.h:29
ns3::lorawan::NetworkComponents::endDevices
NodeContainer endDevices
Container of the end device nodes.
Definition
utilities.h:30
ns3::lorawan::NetworkComponents::gateways
NodeContainer gateways
Container of the gateway nodes.
Definition
utilities.h:31
src
lorawan
test
utilities.h
Generated on
for ns-3 by
1.15.0