satellite-lora-phy-rx.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 
21 #ifndef SAT_LORA_PHY_RX_H
22 #define SAT_LORA_PHY_RX_H
23 
24 #include "satellite-lora-phy-tx.h"
25 #include "satellite-phy-rx.h"
26 
27 #include <ns3/nstime.h>
28 #include <ns3/object.h>
29 #include <ns3/packet.h>
30 
31 namespace ns3
32 {
33 
39 class SatLoraPhyRx : public SatPhyRx
40 {
41  public:
42  enum State
43  {
49 
56 
62  TX,
63 
69  RX
70  };
71 
72  // TypeId
73  static TypeId GetTypeId(void);
74 
78  SatLoraPhyRx();
79  virtual ~SatLoraPhyRx();
80 
86  virtual void StartRx(Ptr<SatSignalParameters> rxParams);
87 
94  bool IsTransmitting(void);
95 
103  bool IsOnFrequency(double frequency);
104 
108  void SwitchToStandby(void);
109 
113  void SwitchToSleep(void);
114 
118  void SwitchToRx();
119 
123  void SwitchToTx();
124 
133  void SetFrequency(double frequencyMHz);
134 
143  void SetSpreadingFactor(uint8_t sf);
144 
145  State GetState();
146 
147  protected:
148  private:
149  // The state this PHY is currently in.
151 
152  // The frequency this device is listening on
153  double m_frequency;
154 
155  // The Spreading Factor this device is listening for
156  uint8_t m_sf;
157 };
158 
159 } /* namespace ns3 */
160 
161 #endif /* SAT_LORA_PHY_RX_H */
Class adding methods linked to Lora, needed to be used in a satellite context.
virtual void StartRx(Ptr< SatSignalParameters > rxParams)
Start receiving a packet.
void SetSpreadingFactor(uint8_t sf)
Set the Spreading Factor this EndDevice will listen for.
void SetFrequency(double frequencyMHz)
Set the frequency this EndDevice will listen on.
SatLoraPhyRx()
Constructor and destructor.
@ SLEEP
The PHY layer is sleeping.
@ TX
The PHY layer is sending a packet.
@ RX
The PHY layer is receiving a packet.
@ STANDBY
The PHY layer is in STANDBY.
bool IsOnFrequency(double frequency)
Whether this device is listening on the specified frequency or not.
void SwitchToSleep(void)
Switch to the SLEEP state.
void SwitchToStandby(void)
Switch to the STANDBY state.
void SwitchToRx()
Switch to the RX state.
bool IsTransmitting(void)
Whether this device is transmitting or not.
static TypeId GetTypeId(void)
void SwitchToTx()
Switch to the TX state.
The SatPhyRx models the physical layer receiver of satellite system.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.