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 namespace ns3
29 {
30 
40 class LoraLogicalChannel : public Object
41 {
42  public:
43  static TypeId GetTypeId(void);
44 
46  virtual ~LoraLogicalChannel();
47 
48  LoraLogicalChannel(double frequency);
49 
57  LoraLogicalChannel(double frequency, uint8_t minDataRate, uint8_t maxDataRate);
58 
64  double GetFrequency(void) const;
65 
71  // void SetFrequency (double frequencyMHz);
72 
76  void SetMinimumDataRate(uint8_t minDataRate);
77 
81  void SetMaximumDataRate(uint8_t maxDataRate);
82 
86  uint8_t GetMinimumDataRate(void);
87 
91  uint8_t GetMaximumDataRate(void);
92 
96  void SetEnabledForUplink(void);
97 
101  void DisableForUplink(void);
102 
106  bool IsEnabledForUplink(void);
107 
108  private:
112  double m_frequency;
113 
117  uint8_t m_minDataRate;
118 
122  uint8_t m_maxDataRate;
123 
128 };
129 
133 bool operator==(const Ptr<LoraLogicalChannel>& first, const Ptr<LoraLogicalChannel>& second);
134 
138 bool operator!=(const Ptr<LoraLogicalChannel>& first, const Ptr<LoraLogicalChannel>& second);
139 
140 } // namespace ns3
141 
142 #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.