lora-tag.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_TAG_H
24 #define LORA_TAG_H
25 
26 #include "satellite-enums.h"
27 
28 #include <ns3/tag.h>
29 
30 namespace ns3
31 {
32 
37 class LoraTag : public Tag
38 {
39  public:
40  static TypeId GetTypeId(void);
41  virtual TypeId GetInstanceTypeId(void) const;
42 
49  LoraTag(uint8_t sf = 0, uint8_t destroyedBy = 0);
50 
51  virtual ~LoraTag();
52 
53  virtual void Serialize(TagBuffer i) const;
54  virtual void Deserialize(TagBuffer i);
55  virtual uint32_t GetSerializedSize() const;
56  virtual void Print(std::ostream& os) const;
57 
63  uint8_t GetSpreadingFactor() const;
64 
70  uint8_t GetDestroyedBy() const;
71 
77  double GetReceivePower() const;
78 
84  void SetSpreadingFactor(uint8_t sf);
85 
91  void SetDestroyedBy(uint8_t sf);
92 
98  void SetReceivePower(double receivePower);
99 
109  void SetFrequency(double frequency);
110 
114  double GetFrequency(void);
115 
121  uint8_t GetDataRate(void);
122 
128  void SetDataRate(uint8_t dataRate);
129 
135  uint8_t GetModcod(void);
136 
142  void SetModcod(uint8_t modcod);
143 
144  private:
145  uint8_t m_sf;
146  uint8_t m_modcod;
147  uint8_t m_destroyedBy;
148  double m_receivePower;
149  uint8_t m_dataRate;
151  double m_frequency;
152 };
153 } // namespace ns3
154 
155 #endif
Tag used to save various data about a packet, like its Spreading Factor and data about interference.
Definition: lora-tag.h:38
uint8_t m_sf
The Spreading Factor used by the packet.
Definition: lora-tag.h:145
double GetFrequency(void)
Get the frequency of the packet.
Definition: lora-tag.cc:140
uint8_t m_modcod
The Modcod ID used by the packet.
Definition: lora-tag.h:146
void SetSpreadingFactor(uint8_t sf)
Set which Spreading Factor this packet was transmitted with.
Definition: lora-tag.cc:122
static TypeId GetTypeId(void)
Definition: lora-tag.cc:34
virtual ~LoraTag()
Definition: lora-tag.cc:56
uint8_t m_dataRate
The Data Rate that needs to be used to send this.
Definition: lora-tag.h:149
uint8_t GetSpreadingFactor() const
Read which Spreading Factor this packet was transmitted with.
Definition: lora-tag.cc:98
double m_receivePower
The reception power of this packet.
Definition: lora-tag.h:148
void SetDestroyedBy(uint8_t sf)
Set which Spreading Factor this packet was destroyed by.
Definition: lora-tag.cc:116
uint8_t GetDataRate(void)
Get the data rate for this packet.
Definition: lora-tag.cc:146
virtual TypeId GetInstanceTypeId(void) const
Definition: lora-tag.cc:41
virtual uint32_t GetSerializedSize() const
Definition: lora-tag.cc:61
void SetDataRate(uint8_t dataRate)
Set the data rate for this packet.
Definition: lora-tag.cc:152
uint8_t GetModcod(void)
Get the modcod for this packet.
Definition: lora-tag.cc:158
virtual void Serialize(TagBuffer i) const
Definition: lora-tag.cc:69
void SetFrequency(double frequency)
Set the frequency of the packet.
Definition: lora-tag.cc:134
double GetReceivePower() const
Read the power this packet arrived with.
Definition: lora-tag.cc:110
virtual void Deserialize(TagBuffer i)
Definition: lora-tag.cc:80
void SetReceivePower(double receivePower)
Set the power this packet was received with.
Definition: lora-tag.cc:128
virtual void Print(std::ostream &os) const
Definition: lora-tag.cc:91
double m_frequency
packet.
Definition: lora-tag.h:151
void SetModcod(uint8_t modcod)
Set the modcod for this packet.
Definition: lora-tag.cc:164
LoraTag(uint8_t sf=0, uint8_t destroyedBy=0)
Create a LoraTag with a given spreading factor and collision.
Definition: lora-tag.cc:46
uint8_t GetDestroyedBy() const
Read which Spreading Factor this packet was destroyed by.
Definition: lora-tag.cc:104
uint8_t m_destroyedBy
The Spreading Factor that destroyed the packet.
Definition: lora-tag.h:147
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.