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/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
20namespace ns3
21{
22namespace 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 */
32{
33 public:
34 /**
35 * Enum for the type of device: End Device (ED) or Gateway (GW).
36 */
38 {
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 */
Hold a value for an Attribute.
Definition attribute.h:59
Instantiate subclasses of ns3::Object.
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
Definition type-id.h:48
Helper to install LoraPhy instances on multiple Nodes.
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 > Create(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.