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/forwarder-helper.h"
13
#include "ns3/lora-helper.h"
14
#include "ns3/mobility-helper.h"
15
#include "ns3/network-server-helper.h"
16
#include "ns3/position-allocator.h"
17
18
namespace
ns3
19
{
20
namespace
lorawan
21
{
22
23
/**
24
* \ingroup lorawan
25
*
26
* Stores the main elements of a simulated LoRaWAN network
27
*/
28
struct
NetworkComponents
29
{
30
Ptr<LoraChannel>
channel
;
//!< A pointer to the LoraChannel object.
31
NodeContainer
endDevices
;
//!< Container of the end device nodes.
32
NodeContainer
gateways
;
//!< Container of the gateway nodes.
33
Ptr<Node>
nsNode
;
//!< A pointer to the network server Node.
34
};
35
36
Ptr<LoraChannel>
CreateChannel
();
37
38
NodeContainer
CreateEndDevices
(
int
nDevices
,
MobilityHelper
mobility,
Ptr<LoraChannel>
channel);
39
40
NodeContainer
CreateGateways
(
int
nGateways
,
MobilityHelper
mobility,
Ptr<LoraChannel>
channel);
41
42
Ptr<Node>
CreateNetworkServer
(
NodeContainer
endDevices,
NodeContainer
gateways);
43
44
template
<
typename
T>
45
Ptr<T>
46
GetMacLayerFromNode
(
Ptr<Node>
n)
47
{
48
return
DynamicCast<T>
(
DynamicCast<LoraNetDevice>
(n->GetDevice(0))->GetMac());
49
}
50
51
NetworkComponents
InitializeNetwork
(
int
nDevices
,
int
nGateways
);
52
}
// namespace lorawan
53
54
}
// namespace ns3
55
#endif
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
mpi-test-fixtures.h:37
nDevices
int nDevices
Number of end device nodes to create.
Definition
aloha-throughput.cc:47
nGateways
int nGateways
Number of gateway nodes to create.
Definition
aloha-throughput.cc:48
ns3::lorawan::CreateNetworkServer
Ptr< Node > CreateNetworkServer(NodeContainer endDevices, NodeContainer gateways)
Definition
utilities.cc:85
ns3::lorawan::CreateChannel
Ptr< LoraChannel > CreateChannel()
Definition
utilities.cc:17
ns3::lorawan::CreateGateways
NodeContainer CreateGateways(int nGateways, MobilityHelper mobility, Ptr< LoraChannel > channel)
Definition
utilities.cc:58
ns3::lorawan::InitializeNetwork
NetworkComponents InitializeNetwork(int nDevices, int nGateways)
Definition
utilities.cc:117
ns3::lorawan::GetMacLayerFromNode
Ptr< T > GetMacLayerFromNode(Ptr< Node > n)
Definition
utilities.h:46
ns3::lorawan::CreateEndDevices
NodeContainer CreateEndDevices(int nDevices, MobilityHelper mobility, Ptr< LoraChannel > channel)
Definition
utilities.cc:30
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:580
ns3::lorawan::NetworkComponents
Stores the main elements of a simulated LoRaWAN network.
Definition
utilities.h:29
ns3::lorawan::NetworkComponents::nsNode
Ptr< Node > nsNode
A pointer to the network server Node.
Definition
utilities.h:33
ns3::lorawan::NetworkComponents::channel
Ptr< LoraChannel > channel
A pointer to the LoraChannel object.
Definition
utilities.h:30
ns3::lorawan::NetworkComponents::endDevices
NodeContainer endDevices
Container of the end device nodes.
Definition
utilities.h:31
ns3::lorawan::NetworkComponents::gateways
NodeContainer gateways
Container of the gateway nodes.
Definition
utilities.h:32
src
lorawan
test
utilities.h
Generated on Fri Nov 8 2024 13:59:02 for ns-3 by
1.11.0