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 void Send(Ptr<Packet> packet) override;
37
38 /**
39 * Check whether the underlying PHY layer of the gateway is currently transmitting.
40 *
41 * @return True if it is transmitting, false otherwise.
42 */
43 bool IsTransmitting();
44
45 /**
46 * Return the next time at which we will be able to transmit on the specified frequency.
47 *
48 * @param frequencyHz The frequency value [Hz].
49 * @return The next transmission time.
50 */
51 Time GetWaitTime(uint32_t frequencyHz);
52
53 private:
54 void TxFinished(Ptr<const Packet> packet) override;
55 void Receive(Ptr<const Packet> packet) override;
56 void FailedReception(Ptr<const Packet> packet) override;
57};
58
59} // namespace lorawan
60} // namespace ns3
61
62#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
Inform this layer that reception of a packet we were locked on failed.
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.