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
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
29
namespace
ns3
30
{
31
namespace
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
*/
46
class
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
*/
65
GatewayStatus
(
Address
address,
Ptr<NetDevice>
netDevice,
Ptr<GatewayLorawanMac>
gwMac);
66
67
/**
68
* Get this gateway's P2P link address.
69
*
70
* \return The Address instance.
71
*/
72
Address
GetAddress
();
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
*/
86
Ptr<NetDevice>
GetNetDevice
();
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
*/
100
Ptr<GatewayLorawanMac>
GetGatewayMac
();
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
127
Ptr<NetDevice>
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 */
ns3::Address
a polymophic address class
Definition:
address.h:101
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:105
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::lorawan::GatewayStatus
This class represents the network server's knowledge about a gateway in the LoRaWAN network it is adm...
Definition:
gateway-status.h:47
ns3::lorawan::GatewayStatus::SetAddress
void SetAddress(Address address)
Set this gateway's P2P link address.
Definition:
gateway-status.cc:69
ns3::lorawan::GatewayStatus::~GatewayStatus
~GatewayStatus() override
Destructor.
Definition:
gateway-status.cc:44
ns3::lorawan::GatewayStatus::IsAvailableForTransmission
bool IsAvailableForTransmission(double frequency)
**
Definition:
gateway-status.cc:95
ns3::lorawan::GatewayStatus::GetAddress
Address GetAddress()
Get this gateway's P2P link address.
Definition:
gateway-status.cc:61
ns3::lorawan::GatewayStatus::m_netDevice
Ptr< NetDevice > m_netDevice
The NetDevice through which to reach this gateway from the server.
Definition:
gateway-status.h:128
ns3::lorawan::GatewayStatus::m_nextTransmissionTime
Time m_nextTransmissionTime
This gateway's next transmission time.
Definition:
gateway-status.h:132
ns3::lorawan::GatewayStatus::SetNextTransmissionTime
void SetNextTransmissionTime(Time nextTransmissionTime)
Set the time of the next scheduled transmission for the gateway.
Definition:
gateway-status.cc:127
ns3::lorawan::GatewayStatus::GetGatewayMac
Ptr< GatewayLorawanMac > GetGatewayMac()
Get a pointer to this gateway's MAC instance.
Definition:
gateway-status.cc:89
ns3::lorawan::GatewayStatus::m_gatewayMac
Ptr< GatewayLorawanMac > m_gatewayMac
The Mac layer of the gateway.
Definition:
gateway-status.h:130
ns3::lorawan::GatewayStatus::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition:
gateway-status.cc:32
ns3::lorawan::GatewayStatus::GetNetDevice
Ptr< NetDevice > GetNetDevice()
Get the NetDevice through which it's possible to contact this gateway from the server.
Definition:
gateway-status.cc:77
ns3::lorawan::GatewayStatus::m_address
Address m_address
The Address of the P2PNetDevice of this gateway.
Definition:
gateway-status.h:125
ns3::lorawan::GatewayStatus::GatewayStatus
GatewayStatus()
Default constructor.
Definition:
gateway-status.cc:39
ns3::lorawan::GatewayStatus::SetNetDevice
void SetNetDevice(Ptr< NetDevice > netDevice)
Set the NetDevice through which it's possible to contact this gateway from the server.
Definition:
gateway-status.cc:83
gateway-lorawan-mac.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lorawan
model
gateway-status.h
Generated on Mon Aug 12 2024 11:16:15 for ns-3 by
1.9.6