A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
logical-lora-channel.cc
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
10
11namespace ns3
12{
13namespace lorawan
14{
15
16NS_LOG_COMPONENT_DEFINE("LogicalLoraChannel");
17
19 uint8_t minDataRate,
20 uint8_t maxDataRate)
21 : m_frequencyHz(frequencyHz),
22 m_minDataRate(minDataRate),
23 m_maxDataRate(maxDataRate),
25{
26 NS_LOG_FUNCTION(this);
27}
28
34
35uint8_t
40
41uint8_t
46
47void
52
53void
58
59bool
64
65bool
67{
68 uint32_t thisFreq = first->GetFrequency();
69 uint32_t otherFreq = second->GetFrequency();
70
71 NS_LOG_DEBUG("Checking equality between logical lora channels: " << thisFreq << " "
72 << otherFreq);
73
74 NS_LOG_DEBUG("Result:" << (thisFreq == otherFreq));
75 return (thisFreq == otherFreq);
76}
77
78bool
83
84} // namespace lorawan
85} // namespace ns3
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
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.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:194
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition log.h:260
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
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.