lora-logical-channel-helper.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_HELPER_H
24 #define LORA_LOGICAL_CHANNEL_HELPER_H
25 
26 #include "lora-logical-channel.h"
27 #include "lora-sub-band.h"
28 
29 #include <ns3/nstime.h>
30 #include <ns3/object.h>
31 #include <ns3/packet.h>
32 
33 #include <iterator>
34 #include <list>
35 #include <vector>
36 
37 namespace ns3
38 {
39 
49 class LoraLogicalChannelHelper : public Object
50 {
51  public:
52  static TypeId GetTypeId(void);
53 
55  virtual ~LoraLogicalChannelHelper();
56 
63  Time GetAggregatedWaitingTime(void);
64 
77  Time GetWaitingTime(Ptr<LoraLogicalChannel> channel);
78 
85  void AddEvent(Time duration, Ptr<LoraLogicalChannel> channel);
86 
92  std::vector<Ptr<LoraLogicalChannel>> GetChannelList(void);
93 
100  std::vector<Ptr<LoraLogicalChannel>> GetEnabledChannelList(void);
101 
107  void AddChannel(double frequency);
108 
114  void AddChannel(Ptr<LoraLogicalChannel> logicalChannel);
115 
122  void SetChannel(uint8_t chIndex, Ptr<LoraLogicalChannel> logicalChannel);
123 
133  void AddLoraSubBand(double firstFrequency,
134  double lastFrequency,
135  double dutyCycle,
136  double maxTxPowerDbm);
137 
143  void AddLoraSubBand(Ptr<LoraSubBand> subBand);
144 
150  void RemoveChannel(Ptr<LoraLogicalChannel> channel);
151 
159  double GetTxPowerForChannel(Ptr<LoraLogicalChannel> logicalChannel);
160 
167  Ptr<LoraSubBand> GetLoraSubBandFromChannel(Ptr<LoraLogicalChannel> channel);
168 
175  Ptr<LoraSubBand> GetLoraSubBandFromFrequency(double frequency);
176 
182  void DisableChannel(int index);
183 
184  private:
188  std::list<Ptr<LoraSubBand>> m_subBandList;
189 
195  std::vector<Ptr<LoraLogicalChannel>> m_channelList;
196 
201 
206 };
207 } // namespace ns3
208 
209 #endif /* LORA_LOGICAL_CHANNEL_HELPER_H */
This class supports LorawanMac instances by managing a list of the logical channels that the device i...
Time GetWaitingTime(Ptr< LoraLogicalChannel > channel)
Get the time it is necessary to wait for before transmitting on a given channel.
Ptr< LoraSubBand > GetLoraSubBandFromChannel(Ptr< LoraLogicalChannel > channel)
Get the LoraSubBand a channel belongs to.
void RemoveChannel(Ptr< LoraLogicalChannel > channel)
Remove a channel.
std::vector< Ptr< LoraLogicalChannel > > m_channelList
A vector of the LoraLogicalChannels that are currently registered within this helper.
void AddLoraSubBand(double firstFrequency, double lastFrequency, double dutyCycle, double maxTxPowerDbm)
Add a new LoraSubBand to this helper.
std::list< Ptr< LoraSubBand > > m_subBandList
A list of the LoraSubBands that are currently registered within this helper.
Ptr< LoraSubBand > GetLoraSubBandFromFrequency(double frequency)
Get the LoraSubBand a frequency belongs to.
void AddEvent(Time duration, Ptr< LoraLogicalChannel > channel)
Register the transmission of a packet.
Time m_nextAggregatedTransmissionTime
The next time at which.
void SetChannel(uint8_t chIndex, Ptr< LoraLogicalChannel > logicalChannel)
Set a new channel at a fixed index.
void DisableChannel(int index)
Disable the channel at a specified index.
void AddChannel(double frequency)
Add a new channel to the list.
std::vector< Ptr< LoraLogicalChannel > > GetChannelList(void)
Get the list of LoraLogicalChannels currently registered on this helper.
Time GetAggregatedWaitingTime(void)
Get the time it is necessary to wait before transmitting again, according to the aggregate duty cycle...
std::vector< Ptr< LoraLogicalChannel > > GetEnabledChannelList(void)
Get the list of LoraLogicalChannels currently registered on this helper that have been enabled for Up...
double GetTxPowerForChannel(Ptr< LoraLogicalChannel > logicalChannel)
Returns the maximum transmission power [dBm] that is allowed on a channel.
double m_aggregatedDutyCycle
transmission will be possible according to the aggregated transmission timer
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.