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