A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
gateway-lorawan-mac.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 University of Padova
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Davide Magrin <magrinda@dei.unipd.it>
18 */
19
20#ifndef GATEWAY_LORAWAN_MAC_H
21#define GATEWAY_LORAWAN_MAC_H
22
23#include "lora-tag.h"
24#include "lorawan-mac.h"
25
26namespace ns3
27{
28namespace lorawan
29{
30
31/**
32 * \ingroup lorawan
33 *
34 * Class representing the MAC layer of a LoRaWAN gateway.
35 */
37{
38 public:
39 /**
40 * Register this type.
41 * \return The object TypeId.
42 */
43 static TypeId GetTypeId();
44
45 GatewayLorawanMac(); //!< Default constructor
46 ~GatewayLorawanMac() override; //!< Destructor
47
48 // Implementation of the LorawanMac interface
49 void Send(Ptr<Packet> packet) override;
50
51 /**
52 * Check whether the underlying PHY layer of the gateway is currently transmitting.
53 *
54 * \return True if it is transmitting, false otherwise.
55 */
56 bool IsTransmitting();
57
58 // Implementation of the LorawanMac interface
59 void Receive(Ptr<const Packet> packet) override;
60
61 // Implementation of the LorawanMac interface
62 void FailedReception(Ptr<const Packet> packet) override;
63
64 // Implementation of the LorawanMac interface
65 void TxFinished(Ptr<const Packet> packet) override;
66
67 /**
68 * Return the next time at which we will be able to transmit on the specified frequency.
69 *
70 * \param frequency The frequency value [MHz].
71 * \return The next transmission time.
72 */
73 Time GetWaitingTime(double frequency);
74
75 private:
76 protected:
77};
78
79} // namespace lorawan
80
81} // namespace ns3
82#endif /* GATEWAY_LORAWAN_MAC_H */
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:59
Class representing the MAC layer of a LoRaWAN gateway.
bool IsTransmitting()
Check whether the underlying PHY layer of the gateway is currently transmitting.
~GatewayLorawanMac() override
Destructor.
static TypeId GetTypeId()
Register this type.
void FailedReception(Ptr< const Packet > packet) override
Function called by lower layers to inform this layer that reception of a packet we were locked on fai...
void Send(Ptr< Packet > packet) override
Send a packet.
void TxFinished(Ptr< const Packet > packet) override
Perform actions after sending a packet.
Time GetWaitingTime(double frequency)
Return the next time at which we will be able to transmit on the specified frequency.
void Receive(Ptr< const Packet > packet) override
Receive a packet from the lower layer.
GatewayLorawanMac()
Default constructor.
Class representing the LoRaWAN MAC layer.
Definition: lorawan-mac.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.