A Discrete-Event Network Simulator
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
18namespace ns3
19{
20namespace lorawan
21{
22
23/**
24 * \ingroup lorawan
25 *
26 * Stores the main elements of a simulated LoRaWAN network
27 */
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
37
39
41
43
44template <typename T>
47{
48 return DynamicCast<T>(DynamicCast<LoraNetDevice>(n->GetDevice(0))->GetMac());
49}
50
51NetworkComponents InitializeNetwork(int nDevices, int nGateways);
52} // namespace lorawan
53
54} // namespace ns3
55#endif
Helper class used to assign positions and mobility models to nodes.
keep track of a set of node pointers.
Smart pointer class similar to boost::intrusive_ptr.
int nDevices
Number of end device nodes to create.
int nGateways
Number of gateway nodes to create.
Ptr< Node > CreateNetworkServer(NodeContainer endDevices, NodeContainer gateways)
Definition utilities.cc:85
Ptr< LoraChannel > CreateChannel()
Definition utilities.cc:17
NodeContainer CreateGateways(int nGateways, MobilityHelper mobility, Ptr< LoraChannel > channel)
Definition utilities.cc:58
NetworkComponents InitializeNetwork(int nDevices, int nGateways)
Definition utilities.cc:117
Ptr< T > GetMacLayerFromNode(Ptr< Node > n)
Definition utilities.h:46
NodeContainer CreateEndDevices(int nDevices, MobilityHelper mobility, Ptr< LoraChannel > channel)
Definition utilities.cc:30
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
Definition ptr.h:580
Stores the main elements of a simulated LoRaWAN network.
Definition utilities.h:29
Ptr< Node > nsNode
A pointer to the network server Node.
Definition utilities.h:33
Ptr< LoraChannel > channel
A pointer to the LoraChannel object.
Definition utilities.h:30
NodeContainer endDevices
Container of the end device nodes.
Definition utilities.h:31
NodeContainer gateways
Container of the gateway nodes.
Definition utilities.h:32