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