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 "
sub-band.h
"
13
14
#include "ns3/object.h"
15
16
namespace
ns3
17
{
18
namespace
lorawan
19
{
20
21
class
SubBand;
22
23
/**
24
* \ingroup lorawan
25
*
26
* This class represents a logical LoRaWAN channel.
27
*
28
* A logical channel is characterized by a central frequency and a range of data
29
* rates that can be sent on it.
30
*
31
* Furthermore, a LogicalLoraChannel can be marked as enabled or disabled for
32
* uplink transmission.
33
*/
34
class
LogicalLoraChannel
:
public
Object
35
{
36
public
:
37
/**
38
* Register this type.
39
* \return The object TypeId.
40
*/
41
static
TypeId
GetTypeId
();
42
43
LogicalLoraChannel
();
//!< Default constructor
44
~LogicalLoraChannel
()
override
;
//!< Destructor
45
46
/**
47
* Construct a new LogicalLoraChannel object initializing the carrier frequency.
48
*
49
* \param frequency The carrier frequency [MHz].
50
*/
51
LogicalLoraChannel
(
double
frequency);
52
53
/**
54
* Constructor providing initialization of frequency and data rate limits.
55
*
56
* \param frequency This channel's frequency [MHz].
57
* \param minDataRate This channel's minimum data rate.
58
* \param maxDataRate This channel's maximum data rate.
59
*/
60
LogicalLoraChannel
(
double
frequency, uint8_t minDataRate, uint8_t maxDataRate);
61
62
/**
63
* Get the frequency (MHz).
64
*
65
* \return The center frequency of this channel.
66
*/
67
double
GetFrequency
()
const
;
68
69
// void SetFrequency (double frequencyMHz);
70
71
/**
72
* Set the minimum data rate that is allowed on this channel.
73
*
74
* \param minDataRate The minimum data rate value.
75
*/
76
void
SetMinimumDataRate
(uint8_t minDataRate);
77
78
/**
79
* Set the maximum data rate that is allowed on this channel.
80
*
81
* \param maxDataRate The maximum data rate value.
82
*/
83
void
SetMaximumDataRate
(uint8_t maxDataRate);
84
85
/**
86
* Get the minimum data rate that is allowed on this channel.
87
*
88
* \return The minimum data rate value.
89
*/
90
uint8_t
GetMinimumDataRate
()
const
;
91
92
/**
93
* Get the maximum data rate that is allowed on this channel.
94
*
95
* \return The maximum data rate value.
96
*/
97
uint8_t
GetMaximumDataRate
()
const
;
98
99
/**
100
* Set this channel as enabled for uplink.
101
*/
102
void
SetEnabledForUplink
();
103
104
/**
105
* Set this channel as disabled for uplink.
106
*/
107
void
DisableForUplink
();
108
109
/**
110
* Test whether this channel is marked as enabled for uplink.
111
*
112
* \return True if the channel can be used for uplink, false otherwise.
113
*/
114
bool
IsEnabledForUplink
()
const
;
115
116
private
:
117
double
m_frequency
;
//!< The central frequency of this channel, in MHz.
118
uint8_t
m_minDataRate
;
//!< The minimum data rate that is allowed on this channel.
119
uint8_t
m_maxDataRate
;
//!< The maximum data rate that is allowed on this channel.
120
bool
m_enabledForUplink
;
//!< Whether this channel can be used for uplink or not.
121
};
122
123
/**
124
* Overload of the == operator to compare different instances of the same LogicalLoraChannel
125
*/
126
bool
operator==
(
const
Ptr<LogicalLoraChannel>
&
first
,
const
Ptr<LogicalLoraChannel>
&
second
);
127
128
/**
129
* Overload the != operator to compare different instances of the same LogicalLoraChannel
130
*/
131
bool
operator!=
(
const
Ptr<LogicalLoraChannel>
&
first
,
const
Ptr<LogicalLoraChannel>
&
second
);
132
133
}
// namespace lorawan
134
135
}
// namespace ns3
136
#endif
/* LOGICAL_LORA_CHANNEL_H */
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3::lorawan::LogicalLoraChannel
This class represents a logical LoRaWAN channel.
Definition
logical-lora-channel.h:35
ns3::lorawan::LogicalLoraChannel::m_minDataRate
uint8_t m_minDataRate
The minimum data rate that is allowed on this channel.
Definition
logical-lora-channel.h:118
ns3::lorawan::LogicalLoraChannel::GetMaximumDataRate
uint8_t GetMaximumDataRate() const
Get the maximum data rate that is allowed on this channel.
Definition
logical-lora-channel.cc:85
ns3::lorawan::LogicalLoraChannel::LogicalLoraChannel
LogicalLoraChannel()
Default constructor.
Definition
logical-lora-channel.cc:30
ns3::lorawan::LogicalLoraChannel::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition
logical-lora-channel.cc:23
ns3::lorawan::LogicalLoraChannel::SetMinimumDataRate
void SetMinimumDataRate(uint8_t minDataRate)
Set the minimum data rate that is allowed on this channel.
Definition
logical-lora-channel.cc:67
ns3::lorawan::LogicalLoraChannel::GetFrequency
double GetFrequency() const
Get the frequency (MHz).
Definition
logical-lora-channel.cc:61
ns3::lorawan::LogicalLoraChannel::~LogicalLoraChannel
~LogicalLoraChannel() override
Destructor.
Definition
logical-lora-channel.cc:39
ns3::lorawan::LogicalLoraChannel::m_frequency
double m_frequency
The central frequency of this channel, in MHz.
Definition
logical-lora-channel.h:117
ns3::lorawan::LogicalLoraChannel::SetEnabledForUplink
void SetEnabledForUplink()
Set this channel as enabled for uplink.
Definition
logical-lora-channel.cc:91
ns3::lorawan::LogicalLoraChannel::DisableForUplink
void DisableForUplink()
Set this channel as disabled for uplink.
Definition
logical-lora-channel.cc:97
ns3::lorawan::LogicalLoraChannel::SetMaximumDataRate
void SetMaximumDataRate(uint8_t maxDataRate)
Set the maximum data rate that is allowed on this channel.
Definition
logical-lora-channel.cc:73
ns3::lorawan::LogicalLoraChannel::IsEnabledForUplink
bool IsEnabledForUplink() const
Test whether this channel is marked as enabled for uplink.
Definition
logical-lora-channel.cc:103
ns3::lorawan::LogicalLoraChannel::m_enabledForUplink
bool m_enabledForUplink
Whether this channel can be used for uplink or not.
Definition
logical-lora-channel.h:120
ns3::lorawan::LogicalLoraChannel::GetMinimumDataRate
uint8_t GetMinimumDataRate() const
Get the minimum data rate that is allowed on this channel.
Definition
logical-lora-channel.cc:79
ns3::lorawan::LogicalLoraChannel::m_maxDataRate
uint8_t m_maxDataRate
The maximum data rate that is allowed on this channel.
Definition
logical-lora-channel.h:119
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:122
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:109
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
second
Definition
second.py:1
sub-band.h
src
lorawan
model
logical-lora-channel.h
Generated on Fri Nov 8 2024 13:59:02 for ns-3 by
1.11.0