A Discrete-Event Network Simulator
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
16namespace ns3
17{
18namespace 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 */
28{
29 public:
30 /**
31 * Enum for the type of device: End Device (ED) or Gateway (GW).
32 */
34 {
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 */
uint32_t v
Hold a value for an Attribute.
Definition attribute.h:59
Instantiate subclasses of ns3::Object.
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
a unique identifier for an interface.
Definition type-id.h:50
void SetDeviceType(enum DeviceType dt)
Set the kind of PHY this helper will create.
DeviceType
Enum for the type of device: End Device (ED) or Gateway (GW).
Ptr< LoraChannel > m_channel
The channel instance the PHYs will be connected to.
TypeId GetDeviceType() const
Get the TypeId of the object to be created with LoraPhyHelper.
Ptr< LoraPhy > Install(Ptr< Node > node, Ptr< NetDevice > device) const
Create a LoraPhy and connect it to a device on a node.
void SetMaxReceptionPaths(int maxReceptionPaths)
Set the maximum number of gateway receive paths.
void Set(std::string name, const AttributeValue &v)
Set an attribute of the underlying PHY object.
LoraPhyHelper()
Default constructor.
bool m_txPriority
Whether to give priority to downlink transmission over reception at the gateways.
void SetGatewayTransmissionPriority(bool txPriority)
Set if giving priority to downlink transmission over reception at the gateways.
void SetChannel(Ptr< LoraChannel > channel)
Set the LoraChannel to connect the PHYs to.
int m_maxReceptionPaths
The maximum number of receive paths at the gateway.
ObjectFactory m_phy
The PHY layer factory object.
Every class exported by the ns3 library is enclosed in the ns3 namespace.