Loading...
Searching...
No Matches
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
25#include "satellite-phy-rx.h"
26
27#include "ns3/nstime.h"
28#include "ns3/object.h"
29#include "ns3/packet.h"
30
31#include <stdint.h>
32
33namespace ns3
34{
35
41class SatLoraPhyRx : public SatPhyRx
42{
43 public:
44 enum State
45 {
51
58
65
72 };
73
74 // TypeId
75 static TypeId GetTypeId(void);
76
81 virtual ~SatLoraPhyRx();
82
88 virtual void StartRx(Ptr<SatSignalParameters> rxParams);
89
96 bool IsTransmitting(void);
97
105 bool IsOnFrequency(double frequency);
106
110 void SwitchToStandby(void);
111
115 void SwitchToSleep(void);
116
120 void SwitchToRx();
121
125 void SwitchToTx();
126
135 void SetFrequency(double frequencyMHz);
136
145 void SetSpreadingFactor(uint8_t sf);
146
147 State GetState();
148
149 protected:
150 private:
151 // The state this PHY is currently in.
153
154 // The frequency this device is listening on
156
157 // The Spreading Factor this device is listening for
158 uint8_t m_sf;
159};
160
161} /* namespace ns3 */
162
163#endif /* SAT_LORA_PHY_RX_H */
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.
SatPhyRx()
Default constructor.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.