A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
gateway-status.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 University of Padova
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Davide Magrin <magrinda@dei.unipd.it>
18 */
19
20#ifndef GATEWAY_STATUS_H
21#define GATEWAY_STATUS_H
22
23#include "gateway-lorawan-mac.h"
24
25#include "ns3/address.h"
26#include "ns3/net-device.h"
27#include "ns3/object.h"
28
29namespace ns3
30{
31namespace lorawan
32{
33
34/**
35 * \ingroup lorawan
36 *
37 * This class represents the network server's knowledge about a gateway in
38 * the LoRaWAN network it is administering.
39 *
40 * The network server's NetworkStatus component contains a list of instances of
41 * this class, one for gateway in the network. Each instance contains all
42 * the parameters and information of the gateway. This class is used by the network server for
43 * downlink scheduling and sending purposes. That is, to check the gateway's availability for radio
44 * transmission, and then to retrieve the correct Net Device to send the packet through.
45 */
46class GatewayStatus : public Object
47{
48 public:
49 /**
50 * Register this type.
51 * \return The object TypeId.
52 */
53 static TypeId GetTypeId();
54
55 GatewayStatus(); //!< Default constructor
56 ~GatewayStatus() override; //!< Destructor
57
58 /**
59 * Construct a new GatewayStatus object with values.
60 *
61 * \param address The Address of the P2PNetDevice of the gateway connected to the network
62 * server. \param netDevice A pointer to the NetDevice through which to reach this gateway from
63 * the server. \param gwMac A pointer to the MAC layer of the gateway.
64 */
66
67 /**
68 * Get this gateway's P2P link address.
69 *
70 * \return The Address instance.
71 */
73
74 /**
75 * Set this gateway's P2P link address.
76 *
77 * \param address The Address instance.
78 */
79 void SetAddress(Address address);
80
81 /**
82 * Get the NetDevice through which it's possible to contact this gateway from the server.
83 *
84 * \return A pointer to the NetDevice.
85 */
87
88 /**
89 * Set the NetDevice through which it's possible to contact this gateway from the server.
90 *
91 * \param netDevice A pointer to the NetDevice.
92 */
93 void SetNetDevice(Ptr<NetDevice> netDevice);
94
95 /**
96 * Get a pointer to this gateway's MAC instance.
97 *
98 * \return A pointer to the MAC layer object.
99 */
101
102 ///**
103 // * Set a pointer to this gateway's MAC instance.
104 // */
105 // void SetGatewayMac (Ptr<GatewayLorawanMac> gwMac);
106
107 /**
108 * Query whether or not this gateway is available for immediate transmission
109 * on this frequency.
110 *
111 * \param frequency The frequency at which the gateway's availability should be queried.
112 * \return True if the gateway's available, false otherwise.
113 */
114 bool IsAvailableForTransmission(double frequency);
115
116 /**
117 * Set the time of the next scheduled transmission for the gateway.
118 *
119 * \param nextTransmissionTime The Time value.
120 */
121 void SetNextTransmissionTime(Time nextTransmissionTime);
122 // Time GetNextTransmissionTime ();
123
124 private:
125 Address m_address; //!< The Address of the P2PNetDevice of this gateway
126
128 m_netDevice; //!< The NetDevice through which to reach this gateway from the server
129
130 Ptr<GatewayLorawanMac> m_gatewayMac; //!< The Mac layer of the gateway
131
132 Time m_nextTransmissionTime; //!< This gateway's next transmission time
133};
134} // namespace lorawan
135
136} // namespace ns3
137#endif /* DEVICE_STATUS_H */
a polymophic address class
Definition: address.h:101
A base class which provides memory management and object aggregation.
Definition: object.h:89
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:59
This class represents the network server's knowledge about a gateway in the LoRaWAN network it is adm...
void SetAddress(Address address)
Set this gateway's P2P link address.
~GatewayStatus() override
Destructor.
bool IsAvailableForTransmission(double frequency)
‍**
Address GetAddress()
Get this gateway's P2P link address.
Ptr< NetDevice > m_netDevice
The NetDevice through which to reach this gateway from the server.
Time m_nextTransmissionTime
This gateway's next transmission time.
void SetNextTransmissionTime(Time nextTransmissionTime)
Set the time of the next scheduled transmission for the gateway.
Ptr< GatewayLorawanMac > GetGatewayMac()
Get a pointer to this gateway's MAC instance.
Ptr< GatewayLorawanMac > m_gatewayMac
The Mac layer of the gateway.
static TypeId GetTypeId()
Register this type.
Ptr< NetDevice > GetNetDevice()
Get the NetDevice through which it's possible to contact this gateway from the server.
Address m_address
The Address of the P2PNetDevice of this gateway.
GatewayStatus()
Default constructor.
void SetNetDevice(Ptr< NetDevice > netDevice)
Set the NetDevice through which it's possible to contact this gateway from the server.
Every class exported by the ns3 library is enclosed in the ns3 namespace.