lora-network-scheduler.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_NETWORK_SCHEDULER_H
24 #define LORA_NETWORK_SCHEDULER_H
25 
26 #include "lora-device-address.h"
27 #include "lora-frame-header.h"
29 #include "lora-network-status.h"
30 #include "lorawan-mac-header.h"
31 
32 #include <ns3/core-module.h>
33 #include <ns3/object.h>
34 #include <ns3/packet.h>
35 
36 namespace ns3
37 {
38 
39 class LoraNetworkStatus; // Forward declaration
40 class LoraNetworkController; // Forward declaration
41 
42 class LoraNetworkScheduler : public Object
43 {
44  public:
45  static TypeId GetTypeId(void);
46 
47  TypeId GetInstanceTypeId(void) const;
48 
50  LoraNetworkScheduler(Ptr<LoraNetworkStatus> status, Ptr<LoraNetworkController> controller);
51  virtual ~LoraNetworkScheduler();
52 
58  void OnReceivedPacket(Ptr<const Packet> packet);
59 
64  void OnReceiveWindowOpportunity(LoraDeviceAddress deviceAddress, int window);
65 
66  private:
67  TracedCallback<Ptr<const Packet>> m_receiveWindowOpened;
68  Ptr<LoraNetworkStatus> m_status;
69  Ptr<LoraNetworkController> m_controller;
70 
76 
82 };
83 
84 } /* namespace ns3 */
85 
86 #endif /* LORA_NETWORK_SCHEDULER_H */
This class represents the device address of a LoraWAN End Device.
Time m_secondWindowAnswerDelay
Delay to wait between end of reception of paquet and sending of anwser, to be in second window opport...
Ptr< LoraNetworkStatus > m_status
void OnReceivedPacket(Ptr< const Packet > packet)
Method called by NetworkServer to inform the Scheduler of a newly arrived uplink packet.
Time m_firstWindowAnswerDelay
Delay to wait between end of reception of paquet and sending of anwser, to be in first window opportu...
TypeId GetInstanceTypeId(void) const
void OnReceiveWindowOpportunity(LoraDeviceAddress deviceAddress, int window)
Method that is scheduled after packet arrivals in order to act on receive windows 1 and 2 seconds lat...
Ptr< LoraNetworkController > m_controller
TracedCallback< Ptr< const Packet > > m_receiveWindowOpened
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.