Loading...
Searching...
No Matches
lora-forwarder.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_FORWARDER_H
24#define LORA_FORWARDER_H
25
27
28#include "ns3/application.h"
29#include "ns3/attribute.h"
30#include "ns3/nstime.h"
31#include "ns3/point-to-point-net-device.h"
32
33#include <map>
34#include <stdint.h>
35
36namespace ns3
37{
38
43class LoraForwarder : public Application
44{
45 public:
48
49 static TypeId GetTypeId(void);
50
57 void SetLoraNetDevice(uint8_t beamId, Ptr<SatLorawanNetDevice> loraNetDevice);
58
64 void SetPointToPointNetDevice(Ptr<PointToPointNetDevice> pointToPointNetDevice);
65
75 bool ReceiveFromLora(Ptr<SatLorawanNetDevice> loraNetDevice,
76 Ptr<const Packet> packet,
77 uint16_t protocol,
78 const Address& sender);
79
83 bool ReceiveFromPointToPoint(Ptr<NetDevice> pointToPointNetDevice,
84 Ptr<const Packet> packet,
85 uint16_t protocol,
86 const Address& sender);
87
91 void StartApplication(void);
92
96 void StopApplication(void);
97
98 private:
99 std::map<uint8_t, Ptr<SatLorawanNetDevice>>
102
103 Ptr<PointToPointNetDevice> m_pointToPointNetDevice;
106};
107
108} // namespace ns3
109
110#endif /* LORA_FORWARDER_H */
Ptr< PointToPointNetDevice > m_pointToPointNetDevice
Pointer to the P2PNetDevice we use to.
bool ReceiveFromLora(Ptr< SatLorawanNetDevice > loraNetDevice, Ptr< const Packet > packet, uint16_t protocol, const Address &sender)
Receive a packet from the LoraNetDevice.
std::map< uint8_t, Ptr< SatLorawanNetDevice > > m_satLorawanNetDevices
Map between beam ID and pointer to the node's SatLorawanNetDevice.
static TypeId GetTypeId(void)
void StartApplication(void)
Start the application.
void StopApplication(void)
Stop the application.
void SetLoraNetDevice(uint8_t beamId, Ptr< SatLorawanNetDevice > loraNetDevice)
Sets the device to use to communicate with the EDs.
bool ReceiveFromPointToPoint(Ptr< NetDevice > pointToPointNetDevice, Ptr< const Packet > packet, uint16_t protocol, const Address &sender)
Receive a packet from the PointToPointNetDevice.
void SetPointToPointNetDevice(Ptr< PointToPointNetDevice > pointToPointNetDevice)
Sets the P2P device to use to communicate with the NS.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.