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-phy-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2017 University of Padova
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Davide Magrin <magrinda@dei.unipd.it>
7
*/
8
9
#ifndef LORA_PHY_HELPER_H
10
#define LORA_PHY_HELPER_H
11
12
#include "ns3/lora-channel.h"
13
#include "ns3/lora-phy.h"
14
#include "ns3/lorawan-mac.h"
15
#include "ns3/net-device.h"
16
#include "ns3/object-factory.h"
17
#include "ns3/simple-end-device-lora-phy.h"
18
#include "ns3/simple-gateway-lora-phy.h"
19
20
namespace
ns3
21
{
22
namespace
lorawan
23
{
24
25
/**
26
* \ingroup lorawan
27
*
28
* Helper to install LoraPhy instances on multiple Nodes. The
29
* user must set all parameters before calling Install on nodes.
30
*/
31
class
LoraPhyHelper
32
{
33
public
:
34
/**
35
* Enum for the type of device: End Device (ED) or Gateway (GW).
36
*/
37
enum
DeviceType
38
{
39
GW
,
40
ED
41
};
42
43
LoraPhyHelper
();
//!< Default constructor
44
45
/**
46
* Set the LoraChannel to connect the PHYs to.
47
*
48
* Every PHY created by a call to Install is associated to this channel.
49
*
50
* \param channel The channel to associate to this helper.
51
*/
52
void
SetChannel
(
Ptr<LoraChannel>
channel);
53
54
/**
55
* Set the kind of PHY this helper will create.
56
*
57
* \param dt The device type.
58
*/
59
void
SetDeviceType
(
enum
DeviceType
dt);
60
61
/**
62
* Get the TypeId of the object to be created with LoraPhyHelper.
63
*
64
* \return The TypeId instance.
65
*/
66
TypeId
GetDeviceType
()
const
;
67
68
/**
69
* Set an attribute of the underlying PHY object.
70
*
71
* \param name The name of the attribute to set.
72
* \param v The value of the attribute.
73
*/
74
void
Set
(std::string name,
const
AttributeValue
& v);
75
76
/**
77
* Create a LoraPhy and connect it to a device on a node.
78
*
79
* \param node The node on which we wish to create a wifi PHY.
80
* \param device The device within which this PHY will be created.
81
* \return A newly-created PHY object.
82
*/
83
Ptr<LoraPhy>
Create
(
Ptr<Node>
node,
Ptr<NetDevice>
device)
const
;
84
85
/**
86
* Set the maximum number of gateway receive paths.
87
*
88
* \param maxReceptionPaths The maximum number of reception paths at
89
* the gateway.
90
*/
91
void
SetMaxReceptionPaths
(
int
maxReceptionPaths);
92
93
/**
94
* Set if giving priority to downlink transmission over reception at
95
* the gateways.
96
*
97
* \param txPriority Whether gateway transmission interrupt all receptions for their duration.
98
*/
99
void
SetGatewayTransmissionPriority
(
bool
txPriority);
100
101
private
:
102
ObjectFactory
m_phy
;
//!< The PHY layer factory object.
103
Ptr<LoraChannel>
m_channel
;
//!< The channel instance the PHYs will be connected to.
104
int
m_maxReceptionPaths
;
//!< The maximum number of receive paths at the gateway.
105
bool
m_txPriority
;
//!< Whether to give priority to downlink transmission over reception at the
106
//!< gateways. \todo This parameter does nothing, to be removed.
107
};
108
109
}
// namespace lorawan
110
111
}
// namespace ns3
112
#endif
/* LORA_PHY_HELPER_H */
ns3::AttributeValue
Hold a value for an Attribute.
Definition
attribute.h:59
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition
object-factory.h:37
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3::lorawan::LoraPhyHelper
Helper to install LoraPhy instances on multiple Nodes.
Definition
lora-phy-helper.h:32
ns3::lorawan::LoraPhyHelper::SetDeviceType
void SetDeviceType(enum DeviceType dt)
Set the kind of PHY this helper will create.
Definition
lora-phy-helper.cc:35
ns3::lorawan::LoraPhyHelper::DeviceType
DeviceType
Enum for the type of device: End Device (ED) or Gateway (GW).
Definition
lora-phy-helper.h:38
ns3::lorawan::LoraPhyHelper::GW
@ GW
Definition
lora-phy-helper.h:39
ns3::lorawan::LoraPhyHelper::ED
@ ED
Definition
lora-phy-helper.h:40
ns3::lorawan::LoraPhyHelper::m_channel
Ptr< LoraChannel > m_channel
The channel instance the PHYs will be connected to.
Definition
lora-phy-helper.h:103
ns3::lorawan::LoraPhyHelper::GetDeviceType
TypeId GetDeviceType() const
Get the TypeId of the object to be created with LoraPhyHelper.
Definition
lora-phy-helper.cc:50
ns3::lorawan::LoraPhyHelper::Create
Ptr< LoraPhy > Create(Ptr< Node > node, Ptr< NetDevice > device) const
Create a LoraPhy and connect it to a device on a node.
Definition
lora-phy-helper.cc:63
ns3::lorawan::LoraPhyHelper::SetMaxReceptionPaths
void SetMaxReceptionPaths(int maxReceptionPaths)
Set the maximum number of gateway receive paths.
Definition
lora-phy-helper.cc:122
ns3::lorawan::LoraPhyHelper::Set
void Set(std::string name, const AttributeValue &v)
Set an attribute of the underlying PHY object.
Definition
lora-phy-helper.cc:57
ns3::lorawan::LoraPhyHelper::LoraPhyHelper
LoraPhyHelper()
Default constructor.
Definition
lora-phy-helper.cc:21
ns3::lorawan::LoraPhyHelper::m_txPriority
bool m_txPriority
Whether to give priority to downlink transmission over reception at the gateways.
Definition
lora-phy-helper.h:105
ns3::lorawan::LoraPhyHelper::SetGatewayTransmissionPriority
void SetGatewayTransmissionPriority(bool txPriority)
Set if giving priority to downlink transmission over reception at the gateways.
Definition
lora-phy-helper.cc:129
ns3::lorawan::LoraPhyHelper::SetChannel
void SetChannel(Ptr< LoraChannel > channel)
Set the LoraChannel to connect the PHYs to.
Definition
lora-phy-helper.cc:29
ns3::lorawan::LoraPhyHelper::m_maxReceptionPaths
int m_maxReceptionPaths
The maximum number of receive paths at the gateway.
Definition
lora-phy-helper.h:104
ns3::lorawan::LoraPhyHelper::m_phy
ObjectFactory m_phy
The PHY layer factory object.
Definition
lora-phy-helper.h:102
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lorawan
helper
lora-phy-helper.h
Generated on Fri Nov 8 2024 13:59:02 for ns-3 by
1.11.0