A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
logical-lora-channel.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 LOGICAL_LORA_CHANNEL_H
10#define LOGICAL_LORA_CHANNEL_H
11
12#include "ns3/ptr.h"
13#include "ns3/simple-ref-count.h"
14
15namespace ns3
16{
17namespace lorawan
18{
19
20/**
21 * @ingroup lorawan
22 *
23 * This class represents a logical LoRaWAN channel.
24 *
25 * A logical channel is characterized by a central frequency and a range of data
26 * rates that can be sent on it.
27 *
28 * Furthermore, a LogicalLoraChannel can be marked as enabled or disabled for
29 * uplink transmission.
30 */
31class LogicalLoraChannel : public SimpleRefCount<LogicalLoraChannel>
32{
33 public:
34 /**
35 * Constructor providing initialization of frequency and data rate limits.
36 *
37 * @param frequencyHz This channel's frequency [Hz].
38 * @param minDataRate This channel's minimum data rate.
39 * @param maxDataRate This channel's maximum data rate.
40 */
41 LogicalLoraChannel(uint32_t frequencyHz, uint8_t minDataRate, uint8_t maxDataRate);
42
43 /**
44 * Get the frequency (Hz).
45 *
46 * @return The center frequency of this channel.
47 */
48 uint32_t GetFrequency() const;
49
50 /**
51 * Get the minimum data rate that is allowed on this channel.
52 *
53 * @return The minimum data rate value.
54 */
55 uint8_t GetMinimumDataRate() const;
56
57 /**
58 * Get the maximum data rate that is allowed on this channel.
59 *
60 * @return The maximum data rate value.
61 */
62 uint8_t GetMaximumDataRate() const;
63
64 /**
65 * Set this channel as enabled for uplink.
66 */
67 void EnableForUplink();
68
69 /**
70 * Set this channel as disabled for uplink.
71 */
72 void DisableForUplink();
73
74 /**
75 * Test whether this channel is marked as enabled for uplink.
76 *
77 * @return True if the channel can be used for uplink, false otherwise.
78 */
79 bool IsEnabledForUplink() const;
80
81 private:
82 uint32_t m_frequencyHz; //!< The central frequency of this channel, in Hz.
83 uint8_t m_minDataRate; //!< The minimum data rate that is allowed on this channel.
84 uint8_t m_maxDataRate; //!< The maximum data rate that is allowed on this channel.
85 bool m_enabledForUplink; //!< Whether this channel can be used for uplink or not.
86};
87
88/**
89 * Overload of the == operator to compare different instances of the same LogicalLoraChannel
90 */
92
93/**
94 * Overload the != operator to compare different instances of the same LogicalLoraChannel
95 */
97
98} // namespace lorawan
99
100} // namespace ns3
101#endif /* LOGICAL_LORA_CHANNEL_H */
Smart pointer class similar to boost::intrusive_ptr.
A template-based reference counting class.
This class represents a logical LoRaWAN channel.
uint8_t m_minDataRate
The minimum data rate that is allowed on this channel.
uint32_t GetFrequency() const
Get the frequency (Hz).
uint8_t GetMaximumDataRate() const
Get the maximum data rate that is allowed on this channel.
LogicalLoraChannel(uint32_t frequencyHz, uint8_t minDataRate, uint8_t maxDataRate)
Constructor providing initialization of frequency and data rate limits.
void DisableForUplink()
Set this channel as disabled for uplink.
uint32_t m_frequencyHz
The central frequency of this channel, in Hz.
bool IsEnabledForUplink() const
Test whether this channel is marked as enabled for uplink.
bool m_enabledForUplink
Whether this channel can be used for uplink or not.
void EnableForUplink()
Set this channel as enabled for uplink.
uint8_t GetMinimumDataRate() const
Get the minimum data rate that is allowed on this channel.
uint8_t m_maxDataRate
The maximum data rate that is allowed on this channel.
Definition first.py:1
bool operator!=(const Ptr< LogicalLoraChannel > &first, const Ptr< LogicalLoraChannel > &second)
Overload the != operator to compare different instances of the same LogicalLoraChannel.
bool operator==(const Ptr< LogicalLoraChannel > &first, const Ptr< LogicalLoraChannel > &second)
Overload of the == operator to compare different instances of the same LogicalLoraChannel.
Every class exported by the ns3 library is enclosed in the ns3 namespace.