A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
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
15
namespace
ns3
16
{
17
namespace
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
*/
31
class
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
*/
91
bool
operator==
(
const
Ptr<LogicalLoraChannel>
&
first
,
const
Ptr<LogicalLoraChannel>
&
second
);
92
93
/**
94
* Overload the != operator to compare different instances of the same LogicalLoraChannel
95
*/
96
bool
operator!=
(
const
Ptr<LogicalLoraChannel>
&
first
,
const
Ptr<LogicalLoraChannel>
&
second
);
97
98
}
// namespace lorawan
99
100
}
// namespace ns3
101
#endif
/* LOGICAL_LORA_CHANNEL_H */
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::SimpleRefCount
A template-based reference counting class.
Definition
simple-ref-count.h:70
ns3::lorawan::LogicalLoraChannel
This class represents a logical LoRaWAN channel.
Definition
logical-lora-channel.h:32
ns3::lorawan::LogicalLoraChannel::m_minDataRate
uint8_t m_minDataRate
The minimum data rate that is allowed on this channel.
Definition
logical-lora-channel.h:83
ns3::lorawan::LogicalLoraChannel::GetFrequency
uint32_t GetFrequency() const
Get the frequency (Hz).
Definition
logical-lora-channel.cc:34
ns3::lorawan::LogicalLoraChannel::GetMaximumDataRate
uint8_t GetMaximumDataRate() const
Get the maximum data rate that is allowed on this channel.
Definition
logical-lora-channel.cc:46
ns3::lorawan::LogicalLoraChannel::LogicalLoraChannel
LogicalLoraChannel(uint32_t frequencyHz, uint8_t minDataRate, uint8_t maxDataRate)
Constructor providing initialization of frequency and data rate limits.
Definition
logical-lora-channel.cc:22
ns3::lorawan::LogicalLoraChannel::DisableForUplink
void DisableForUplink()
Set this channel as disabled for uplink.
Definition
logical-lora-channel.cc:58
ns3::lorawan::LogicalLoraChannel::m_frequencyHz
uint32_t m_frequencyHz
The central frequency of this channel, in Hz.
Definition
logical-lora-channel.h:82
ns3::lorawan::LogicalLoraChannel::IsEnabledForUplink
bool IsEnabledForUplink() const
Test whether this channel is marked as enabled for uplink.
Definition
logical-lora-channel.cc:64
ns3::lorawan::LogicalLoraChannel::m_enabledForUplink
bool m_enabledForUplink
Whether this channel can be used for uplink or not.
Definition
logical-lora-channel.h:85
ns3::lorawan::LogicalLoraChannel::EnableForUplink
void EnableForUplink()
Set this channel as enabled for uplink.
Definition
logical-lora-channel.cc:52
ns3::lorawan::LogicalLoraChannel::GetMinimumDataRate
uint8_t GetMinimumDataRate() const
Get the minimum data rate that is allowed on this channel.
Definition
logical-lora-channel.cc:40
ns3::lorawan::LogicalLoraChannel::m_maxDataRate
uint8_t m_maxDataRate
The maximum data rate that is allowed on this channel.
Definition
logical-lora-channel.h:84
uint32_t
first
Definition
first.py:1
ns3::lorawan::operator!=
bool operator!=(const Ptr< LogicalLoraChannel > &first, const Ptr< LogicalLoraChannel > &second)
Overload the != operator to compare different instances of the same LogicalLoraChannel.
Definition
logical-lora-channel.cc:83
ns3::lorawan::operator==
bool operator==(const Ptr< LogicalLoraChannel > &first, const Ptr< LogicalLoraChannel > &second)
Overload of the == operator to compare different instances of the same LogicalLoraChannel.
Definition
logical-lora-channel.cc:70
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
second
Definition
second.py:1
src
lorawan
model
logical-lora-channel.h
Generated on Mon May 19 2025 15:51:16 for ns-3 by
1.11.0