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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Davide Magrin <magrinda@dei.unipd.it>
7 */
8
9#ifndef GATEWAY_LORAWAN_MAC_H
10#define GATEWAY_LORAWAN_MAC_H
11
12#include "lora-tag.h"
13#include "lorawan-mac.h"
14
15namespace ns3
16{
17namespace lorawan
18{
19
20/**
21 * \ingroup lorawan
22 *
23 * Class representing the MAC layer of a LoRaWAN gateway.
24 */
26{
27 public:
28 /**
29 * Register this type.
30 * \return The object TypeId.
31 */
32 static TypeId GetTypeId();
33
34 GatewayLorawanMac(); //!< Default constructor
35 ~GatewayLorawanMac() override; //!< Destructor
36
37 // Implementation of the LorawanMac interface
38 void Send(Ptr<Packet> packet) override;
39
40 /**
41 * Check whether the underlying PHY layer of the gateway is currently transmitting.
42 *
43 * \return True if it is transmitting, false otherwise.
44 */
45 bool IsTransmitting();
46
47 // Implementation of the LorawanMac interface
48 void Receive(Ptr<const Packet> packet) override;
49
50 // Implementation of the LorawanMac interface
51 void FailedReception(Ptr<const Packet> packet) override;
52
53 // Implementation of the LorawanMac interface
54 void TxFinished(Ptr<const Packet> packet) override;
55
56 /**
57 * Return the next time at which we will be able to transmit on the specified frequency.
58 *
59 * \param frequency The frequency value [MHz].
60 * \return The next transmission time.
61 */
62 Time GetWaitingTime(double frequency);
63
64 private:
65 protected:
66};
67
68} // namespace lorawan
69
70} // namespace ns3
71#endif /* GATEWAY_LORAWAN_MAC_H */
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
a unique identifier for an interface.
Definition type-id.h:48
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:37
Every class exported by the ns3 library is enclosed in the ns3 namespace.