Loading...
Searching...
No Matches
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"
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#include <stdint.h>
42
43namespace ns3
44{
45
53class LoraNetworkServer : public Application
54{
55 public:
56 static TypeId GetTypeId(void);
57
59 virtual ~LoraNetworkServer();
60
64 void StartApplication(void);
65
69 void StopApplication(void);
70
77 void AddNodes(NodeContainer nodes);
78
84 void AddNode(Ptr<Node> node);
85
90 void AddGateway(Ptr<Node> gateway, Ptr<NetDevice> netDevice);
91
95 void AddComponent(Ptr<LoraNetworkControllerComponent> component);
96
101 bool Receive(Ptr<NetDevice> device,
102 Ptr<const Packet> packet,
103 uint16_t protocol,
104 const Address& address);
105
106 Ptr<LoraNetworkStatus> GetNetworkStatus(void);
107
108 protected:
109 Ptr<LoraNetworkStatus> m_status;
110 Ptr<LoraNetworkController> m_controller;
111 Ptr<LoraNetworkScheduler> m_scheduler;
112
113 TracedCallback<Ptr<const Packet>> m_receivedPacket;
114};
115
116} // namespace ns3
117#endif /* LORA_NETWORK_SERVER_H */
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.