lora-network-server.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2018 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  * Authors: Davide Magrin <magrinda@dei.unipd.it>
19  * Martina Capuzzo <capuzzom@dei.unipd.it>
20  *
21  * Modified by: Bastien Tauran <bastien.tauran@viveris.fr>
22  */
23 
24 #ifndef LORA_NETWORK_SERVER_H
25 #define LORA_NETWORK_SERVER_H
26 
27 #include "lora-device-address.h"
28 #include "lora-gateway-status.h"
30 #include "lora-network-scheduler.h"
31 #include "lora-network-status.h"
33 
34 #include <ns3/application.h>
35 #include <ns3/net-device.h>
36 #include <ns3/node-container.h>
37 #include <ns3/object.h>
38 #include <ns3/packet.h>
39 #include <ns3/point-to-point-net-device.h>
40 
41 namespace ns3
42 {
43 
51 class LoraNetworkServer : public Application
52 {
53  public:
54  static TypeId GetTypeId(void);
55 
57  virtual ~LoraNetworkServer();
58 
62  void StartApplication(void);
63 
67  void StopApplication(void);
68 
75  void AddNodes(NodeContainer nodes);
76 
82  void AddNode(Ptr<Node> node);
83 
88  void AddGateway(Ptr<Node> gateway, Ptr<NetDevice> netDevice);
89 
93  void AddComponent(Ptr<LoraNetworkControllerComponent> component);
94 
99  bool Receive(Ptr<NetDevice> device,
100  Ptr<const Packet> packet,
101  uint16_t protocol,
102  const Address& address);
103 
104  Ptr<LoraNetworkStatus> GetNetworkStatus(void);
105 
106  protected:
107  Ptr<LoraNetworkStatus> m_status;
108  Ptr<LoraNetworkController> m_controller;
109  Ptr<LoraNetworkScheduler> m_scheduler;
110 
111  TracedCallback<Ptr<const Packet>> m_receivedPacket;
112 };
113 
114 } // namespace ns3
115 #endif /* LORA_NETWORK_SERVER_H */
The LoraNetworkServer is an application standing on top of a node equipped with links that connect it...
bool Receive(Ptr< NetDevice > device, Ptr< const Packet > packet, uint16_t protocol, const Address &address)
Receive a packet from a gateway.
TracedCallback< Ptr< const Packet > > m_receivedPacket
static TypeId GetTypeId(void)
void StartApplication(void)
Start the NS application.
void AddGateway(Ptr< Node > gateway, Ptr< NetDevice > netDevice)
Add this gateway to the list of gateways connected to this NS.
Ptr< LoraNetworkStatus > m_status
void AddNodes(NodeContainer nodes)
Inform the LoraNetworkServer that these nodes are connected to the network.
Ptr< LoraNetworkScheduler > m_scheduler
void AddNode(Ptr< Node > node)
Inform the LoraNetworkServer that this node is connected to the network.
void StopApplication(void)
Stop the NS application.
void AddComponent(Ptr< LoraNetworkControllerComponent > component)
A NetworkControllerComponent to this LoraNetworkServer instance.
Ptr< LoraNetworkController > m_controller
Ptr< LoraNetworkStatus > GetNetworkStatus(void)
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.