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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Davide Magrin <magrinda@dei.unipd.it>
7 */
8
9#ifndef GATEWAY_STATUS_H
10#define GATEWAY_STATUS_H
11
12#include "gateway-lorawan-mac.h"
13
14#include "ns3/address.h"
15#include "ns3/net-device.h"
16#include "ns3/object.h"
17
18namespace ns3
19{
20namespace lorawan
21{
22
23/**
24 * \ingroup lorawan
25 *
26 * This class represents the network server's knowledge about a gateway in
27 * the LoRaWAN network it is administering.
28 *
29 * The network server's NetworkStatus component contains a list of instances of
30 * this class, one for gateway in the network. Each instance contains all
31 * the parameters and information of the gateway. This class is used by the network server for
32 * downlink scheduling and sending purposes. That is, to check the gateway's availability for radio
33 * transmission, and then to retrieve the correct Net Device to send the packet through.
34 */
35class GatewayStatus : public Object
36{
37 public:
38 /**
39 * Register this type.
40 * \return The object TypeId.
41 */
42 static TypeId GetTypeId();
43
44 GatewayStatus(); //!< Default constructor
45 ~GatewayStatus() override; //!< Destructor
46
47 /**
48 * Construct a new GatewayStatus object with values.
49 *
50 * \param address The Address of the P2PNetDevice of the gateway connected to the network
51 * server. \param netDevice A pointer to the NetDevice through which to reach this gateway from
52 * the server. \param gwMac A pointer to the MAC layer of the gateway.
53 */
55
56 /**
57 * Get this gateway's P2P link address.
58 *
59 * \return The Address instance.
60 */
62
63 /**
64 * Set this gateway's P2P link address.
65 *
66 * \param address The Address instance.
67 */
68 void SetAddress(Address address);
69
70 /**
71 * Get the NetDevice through which it's possible to contact this gateway from the server.
72 *
73 * \return A pointer to the NetDevice.
74 */
76
77 /**
78 * Set the NetDevice through which it's possible to contact this gateway from the server.
79 *
80 * \param netDevice A pointer to the NetDevice.
81 */
82 void SetNetDevice(Ptr<NetDevice> netDevice);
83
84 /**
85 * Get a pointer to this gateway's MAC instance.
86 *
87 * \return A pointer to the MAC layer object.
88 */
90
91 ///**
92 // * Set a pointer to this gateway's MAC instance.
93 // */
94 // void SetGatewayMac (Ptr<GatewayLorawanMac> gwMac);
95
96 /**
97 * Query whether or not this gateway is available for immediate transmission
98 * on this frequency.
99 *
100 * \param frequency The frequency at which the gateway's availability should be queried.
101 * \return True if the gateway's available, false otherwise.
102 */
103 bool IsAvailableForTransmission(double frequency);
104
105 /**
106 * Set the time of the next scheduled transmission for the gateway.
107 *
108 * \param nextTransmissionTime The Time value.
109 */
110 void SetNextTransmissionTime(Time nextTransmissionTime);
111 // Time GetNextTransmissionTime ();
112
113 private:
114 Address m_address; //!< The Address of the P2PNetDevice of this gateway
115
117 m_netDevice; //!< The NetDevice through which to reach this gateway from the server
118
119 Ptr<GatewayLorawanMac> m_gatewayMac; //!< The Mac layer of the gateway
120
121 Time m_nextTransmissionTime; //!< This gateway's next transmission time
122};
123} // namespace lorawan
124
125} // namespace ns3
126#endif /* DEVICE_STATUS_H */
a polymophic address class
Definition address.h:90
A base class which provides memory management and object aggregation.
Definition object.h:78
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
a unique identifier for an interface.
Definition type-id.h:48
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)
Set a pointer to this gateway's MAC instance.
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.