lora-logical-channel.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2017 University of Padova
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Davide Magrin <magrinda@dei.unipd.it>
19  *
20  * Modified by: Bastien Tauran <bastien.tauran@viveris.fr>
21  */
22 
23 #ifndef LORA_LOGICAL_CHANNEL_H
24 #define LORA_LOGICAL_CHANNEL_H
25 
26 #include <ns3/object.h>
27 
28 #include <stdint.h>
29 
30 namespace ns3
31 {
32 
42 class LoraLogicalChannel : public Object
43 {
44  public:
45  static TypeId GetTypeId(void);
46 
48  virtual ~LoraLogicalChannel();
49 
50  LoraLogicalChannel(double frequency);
51 
59  LoraLogicalChannel(double frequency, uint8_t minDataRate, uint8_t maxDataRate);
60 
66  double GetFrequency(void) const;
67 
73  // void SetFrequency (double frequencyMHz);
74 
78  void SetMinimumDataRate(uint8_t minDataRate);
79 
83  void SetMaximumDataRate(uint8_t maxDataRate);
84 
88  uint8_t GetMinimumDataRate(void);
89 
93  uint8_t GetMaximumDataRate(void);
94 
98  void SetEnabledForUplink(void);
99 
103  void DisableForUplink(void);
104 
108  bool IsEnabledForUplink(void);
109 
110  private:
114  double m_frequency;
115 
119  uint8_t m_minDataRate;
120 
124  uint8_t m_maxDataRate;
125 
130 };
131 
135 bool operator==(const Ptr<LoraLogicalChannel>& first, const Ptr<LoraLogicalChannel>& second);
136 
140 bool operator!=(const Ptr<LoraLogicalChannel>& first, const Ptr<LoraLogicalChannel>& second);
141 
142 } // namespace ns3
143 
144 #endif /* LORA_LOGICAL_CHANNEL_H */
This class represents a logical LoRaWAN channel.
bool m_enabledForUplink
Whether this channel can be used for uplink or not.
uint8_t GetMaximumDataRate(void)
Get the maximum Data Rate that is allowed on this channel.
static TypeId GetTypeId(void)
bool IsEnabledForUplink(void)
Test whether this channel is marked as enabled for uplink.
void SetEnabledForUplink(void)
Set this channel as enabled for uplink.
void SetMinimumDataRate(uint8_t minDataRate)
Set the frequency (MHz).
uint8_t GetMinimumDataRate(void)
Get the minimum Data Rate that is allowed on this channel.
uint8_t m_maxDataRate
The maximum Data Rate that is allowed on this channel.
double GetFrequency(void) const
Get the frequency (MHz).
void DisableForUplink(void)
Set this channel as disabled for uplink.
double m_frequency
The central frequency of this channel, in MHz.
uint8_t m_minDataRate
The minimum Data Rate that is allowed on this channel.
void SetMaximumDataRate(uint8_t maxDataRate)
Set the maximum Data Rate that is allowed on this channel.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
bool operator==(const Ptr< LoraLogicalChannel > &first, const Ptr< LoraLogicalChannel > &second)
Overload of the == operator to compare different instances of the same LoraLogicalChannel.
bool operator!=(const Ptr< LoraLogicalChannel > &first, const Ptr< LoraLogicalChannel > &second)
Overload the != operator to compare different instances of the same LoraLogicalChannel.