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
sub-band.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 SUB_BAND_H
10
#define SUB_BAND_H
11
12
#include "
logical-lora-channel.h
"
13
14
#include "ns3/nstime.h"
15
#include "ns3/simple-ref-count.h"
16
17
namespace
ns3
18
{
19
namespace
lorawan
20
{
21
22
/**
23
* @ingroup lorawan
24
*
25
* Class representing a SubBand, i.e., a frequency band subject to some
26
* regulations on duty cycle and transmission power.
27
*/
28
class
SubBand
:
public
SimpleRefCount
<SubBand>
29
{
30
public
:
31
/**
32
* Create a new SubBand by specifying all of its properties.
33
*
34
* @param firstFrequencyHz The SubBand's lowest frequency [Hz].
35
* @param lastFrequencyHz The SubBand's highest frequency [Hz].
36
* @param dutyCycle The duty cycle (as a fraction) allowed on this SubBand.
37
* @param maxTxPowerDbm The maximum transmission power [dBm] allowed on this SubBand.
38
*/
39
SubBand
(
uint32_t
firstFrequencyHz,
40
uint32_t
lastFrequencyHz,
41
double
dutyCycle,
42
double
maxTxPowerDbm);
43
44
/**
45
* Get the lowest frequency of the SubBand.
46
*
47
* @return The lowest frequency [Hz] of the SubBand.
48
*/
49
uint32_t
GetFirstFrequency
()
const
;
50
51
/**
52
* Get the highest frequency of the SubBand.
53
*
54
* @return The highest frequency [Hz] of the SubBand.
55
*/
56
uint32_t
GetLastFrequency
()
const
;
57
58
/**
59
* Get the duty cycle of the subband.
60
*
61
* @return The duty cycle (as a fraction) that needs to be enforced on this
62
* SubBand.
63
*/
64
double
GetDutyCycle
()
const
;
65
66
/**
67
* Update the next transmission time.
68
*
69
* This function is used by LogicalLoraChannelHelper, which computes the time
70
* based on the SubBand's duty cycle and on the transmission duration.
71
*
72
* @param nextTime The future time from which transmission should be allowed
73
* again.
74
*/
75
void
SetNextTransmissionTime
(
Time
nextTime);
76
77
/**
78
* Returns the next time from which transmission on this subband will be
79
* possible.
80
*
81
* @return The next time at which transmission in this SubBand will be
82
* allowed.
83
*/
84
Time
GetNextTransmissionTime
();
85
86
/**
87
* Return whether or not a frequency belongs to this SubBand.
88
*
89
* @param frequencyHz The frequency [Hz] we want to test against the current subband.
90
* @return True if the frequency is between firstFrequencyHz and lastFrequencyHz,
91
* false otherwise.
92
*/
93
bool
Contains
(
uint32_t
frequencyHz)
const
;
94
95
/**
96
* Return whether or not a channel belongs to this SubBand.
97
*
98
* @param channel The channel we want to test against the current subband.
99
* @return Whether the channel's center frequency is between the first and last frequency of the
100
* sub-band, margins excluded.
101
*/
102
bool
Contains
(
Ptr<const LogicalLoraChannel>
channel)
const
;
103
104
/**
105
* Set the maximum transmission power that is allowed on this SubBand.
106
*
107
* @param maxTxPowerDbm The maximum transmission power [dBm] to set.
108
*/
109
void
SetMaxTxPowerDbm
(
double
maxTxPowerDbm);
110
111
/**
112
* Return the maximum transmission power that is allowed on this SubBand.
113
*
114
* @return The maximum transmission power, in dBm.
115
*/
116
double
GetMaxTxPowerDbm
()
const
;
117
118
private
:
119
uint32_t
m_firstFrequencyHz
;
//!< Starting frequency of the subband, in Hz
120
uint32_t
m_lastFrequencyHz
;
//!< Ending frequency of the subband, in Hz
121
double
m_dutyCycle
;
//!< The duty cycle that needs to be enforced on this subband
122
Time
m_nextTransmissionTime
;
//!< The next time a transmission will be allowed in this subband
123
double
m_maxTxPowerDbm
;
//!< The maximum transmission power that is admitted on this subband
124
};
125
}
// namespace lorawan
126
}
// namespace ns3
127
#endif
/* SUB_BAND_H */
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:66
ns3::SimpleRefCount< SubBand >::SimpleRefCount
SimpleRefCount()
Definition
simple-ref-count.h:73
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
ns3::lorawan::SubBand::GetDutyCycle
double GetDutyCycle() const
Get the duty cycle of the subband.
Definition
sub-band.cc:44
ns3::lorawan::SubBand::Contains
bool Contains(uint32_t frequencyHz) const
Return whether or not a frequency belongs to this SubBand.
Definition
sub-band.cc:50
ns3::lorawan::SubBand::GetNextTransmissionTime
Time GetNextTransmissionTime()
Returns the next time from which transmission on this subband will be possible.
Definition
sub-band.cc:68
ns3::lorawan::SubBand::m_nextTransmissionTime
Time m_nextTransmissionTime
The next time a transmission will be allowed in this subband.
Definition
sub-band.h:122
ns3::lorawan::SubBand::m_dutyCycle
double m_dutyCycle
The duty cycle that needs to be enforced on this subband.
Definition
sub-band.h:121
ns3::lorawan::SubBand::SetNextTransmissionTime
void SetNextTransmissionTime(Time nextTime)
Update the next transmission time.
Definition
sub-band.cc:62
ns3::lorawan::SubBand::GetFirstFrequency
uint32_t GetFirstFrequency() const
Get the lowest frequency of the SubBand.
Definition
sub-band.cc:32
ns3::lorawan::SubBand::m_firstFrequencyHz
uint32_t m_firstFrequencyHz
Starting frequency of the subband, in Hz.
Definition
sub-band.h:119
ns3::lorawan::SubBand::GetMaxTxPowerDbm
double GetMaxTxPowerDbm() const
Return the maximum transmission power that is allowed on this SubBand.
Definition
sub-band.cc:80
ns3::lorawan::SubBand::m_lastFrequencyHz
uint32_t m_lastFrequencyHz
Ending frequency of the subband, in Hz.
Definition
sub-band.h:120
ns3::lorawan::SubBand::SubBand
SubBand(uint32_t firstFrequencyHz, uint32_t lastFrequencyHz, double dutyCycle, double maxTxPowerDbm)
Create a new SubBand by specifying all of its properties.
Definition
sub-band.cc:18
ns3::lorawan::SubBand::GetLastFrequency
uint32_t GetLastFrequency() const
Get the highest frequency of the SubBand.
Definition
sub-band.cc:38
ns3::lorawan::SubBand::SetMaxTxPowerDbm
void SetMaxTxPowerDbm(double maxTxPowerDbm)
Set the maximum transmission power that is allowed on this SubBand.
Definition
sub-band.cc:74
ns3::lorawan::SubBand::m_maxTxPowerDbm
double m_maxTxPowerDbm
The maximum transmission power that is admitted on this subband.
Definition
sub-band.h:123
uint32_t
logical-lora-channel.h
ns3::lorawan
Definition
forwarder-helper.cc:25
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lorawan
model
sub-band.h
Generated on Wed Jun 11 2025 13:15:32 for ns-3 by
1.13.2