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
11#include "sub-band.h"
12
13#include "ns3/log.h"
14
15namespace ns3
16{
17namespace lorawan
18{
19
20NS_LOG_COMPONENT_DEFINE("LogicalLoraChannel");
21
23 uint8_t minDataRate,
24 uint8_t maxDataRate)
25 : m_frequencyHz(frequencyHz),
26 m_minDataRate(minDataRate),
27 m_maxDataRate(maxDataRate),
28 m_enabledForUplink(true)
29{
30 NS_LOG_FUNCTION(this);
31}
32
38
39uint8_t
44
45uint8_t
50
51void
56
57void
62
63bool
68
69bool
71{
72 uint32_t thisFreq = first->GetFrequency();
73 uint32_t otherFreq = second->GetFrequency();
74
75 NS_LOG_DEBUG("Checking equality between logical lora channels: " << thisFreq << " "
76 << otherFreq);
77
78 NS_LOG_DEBUG("Result:" << (thisFreq == otherFreq));
79 return (thisFreq == otherFreq);
80}
81
82bool
87
88} // namespace lorawan
89} // namespace ns3
Smart pointer class similar to boost::intrusive_ptr.
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:191
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition log.h:257
#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.