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
lora-tx-current-model.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2017 University of Padova
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Authors: Romagnolo Stefano <romagnolostefano93@gmail.com>
18
* Davide Magrin <magrinda@dei.unipd.it>
19
*/
20
21
#ifndef LORA_TX_CURRENT_MODEL_H
22
#define LORA_TX_CURRENT_MODEL_H
23
24
#include "ns3/object.h"
25
26
namespace
ns3
27
{
28
namespace
lorawan
29
{
30
31
/**
32
* \ingroup lorawan
33
*
34
* Model the transmit current as a function of the transmit power and
35
* mode.
36
*/
37
class
LoraTxCurrentModel
:
public
Object
38
{
39
public
:
40
/**
41
* Register this type.
42
* \return The object TypeId.
43
*/
44
static
TypeId
GetTypeId
();
45
46
LoraTxCurrentModel
();
//!< Default constructor
47
~LoraTxCurrentModel
()
override
;
//!< Destructor
48
49
/**
50
* Get the current for transmission at this power.
51
*
52
* \param txPowerDbm The nominal tx power in dBm.
53
* \return The transmit current (in Ampere).
54
*/
55
virtual
double
CalcTxCurrent
(
double
txPowerDbm)
const
= 0;
56
};
57
58
/**
59
* \ingroup lorawan
60
*
61
* A linear model of the transmission current for a LoRa device, based on the
62
* WiFi model.
63
*/
64
class
LinearLoraTxCurrentModel
:
public
LoraTxCurrentModel
65
{
66
public
:
67
/**
68
* Register this type.
69
* \return The object TypeId.
70
*/
71
static
TypeId
GetTypeId
();
72
73
LinearLoraTxCurrentModel
();
//!< Default constructor
74
~LinearLoraTxCurrentModel
()
override
;
//!< Destructor
75
76
/**
77
* Set the power amplifier efficiency.
78
*
79
* \param eta The power amplifier efficiency.
80
*/
81
void
SetEta
(
double
eta);
82
83
/**
84
* Set the supply voltage.
85
*
86
* \param voltage The supply voltage [Volts].
87
*/
88
void
SetVoltage
(
double
voltage);
89
90
/**
91
* Set the current in the STANDBY state.
92
*
93
* \param idleCurrent The idle current value [Ampere].
94
*/
95
void
SetStandbyCurrent
(
double
idleCurrent);
96
97
/**
98
* Get the power amplifier efficiency.
99
*
100
* \return The power amplifier efficiency.
101
*/
102
double
GetEta
()
const
;
103
104
/**
105
* Get the supply voltage.
106
*
107
* \return The supply voltage [Volts].
108
*/
109
double
GetVoltage
()
const
;
110
111
/**
112
* Get the current in the STANDBY state.
113
*
114
* \return The idle current value [Ampere].
115
*/
116
double
GetStandbyCurrent
()
const
;
117
118
double
CalcTxCurrent
(
double
txPowerDbm)
const override
;
119
120
private
:
121
double
m_eta
;
//!< ETA
122
double
m_voltage
;
//!< Voltage
123
double
m_idleCurrent
;
//!< Standby current
124
};
125
126
/**
127
* \ingroup lorawan
128
*
129
* A constant model of the transmission current for a LoRa device, always yielding the same
130
* current independently from the transmission power provided.
131
*/
132
class
ConstantLoraTxCurrentModel
:
public
LoraTxCurrentModel
133
{
134
public
:
135
/**
136
* Register this type.
137
* \return The object TypeId.
138
*/
139
static
TypeId
GetTypeId
();
140
141
ConstantLoraTxCurrentModel
();
//!< Default constructor
142
~ConstantLoraTxCurrentModel
()
override
;
//!< Destructor
143
144
/**
145
* Set the current in the TX state.
146
*
147
* \param txCurrent The TX current value [Ampere].
148
*/
149
void
SetTxCurrent
(
double
txCurrent);
150
151
/**
152
* Get the current of the TX state.
153
*
154
* \return The TX current value.
155
*/
156
double
GetTxCurrent
()
const
;
157
158
double
CalcTxCurrent
(
double
txPowerDbm)
const override
;
159
160
private
:
161
double
m_txCurrent
;
//!< The transmission current [Ampere]
162
};
163
164
}
// namespace lorawan
165
166
}
// namespace ns3
167
#endif
/* LORA_TX_CURRENT_MODEL_H */
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::lorawan::ConstantLoraTxCurrentModel
A constant model of the transmission current for a LoRa device, always yielding the same current inde...
Definition:
lora-tx-current-model.h:133
ns3::lorawan::ConstantLoraTxCurrentModel::m_txCurrent
double m_txCurrent
The transmission current [Ampere].
Definition:
lora-tx-current-model.h:161
ns3::lorawan::ConstantLoraTxCurrentModel::CalcTxCurrent
double CalcTxCurrent(double txPowerDbm) const override
Get the current for transmission at this power.
Definition:
lora-tx-current-model.cc:182
ns3::lorawan::ConstantLoraTxCurrentModel::SetTxCurrent
void SetTxCurrent(double txCurrent)
Set the current in the TX state.
Definition:
lora-tx-current-model.cc:169
ns3::lorawan::ConstantLoraTxCurrentModel::~ConstantLoraTxCurrentModel
~ConstantLoraTxCurrentModel() override
Destructor.
Definition:
lora-tx-current-model.cc:163
ns3::lorawan::ConstantLoraTxCurrentModel::ConstantLoraTxCurrentModel
ConstantLoraTxCurrentModel()
Default constructor.
Definition:
lora-tx-current-model.cc:158
ns3::lorawan::ConstantLoraTxCurrentModel::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition:
lora-tx-current-model.cc:142
ns3::lorawan::ConstantLoraTxCurrentModel::GetTxCurrent
double GetTxCurrent() const
Get the current of the TX state.
Definition:
lora-tx-current-model.cc:176
ns3::lorawan::LinearLoraTxCurrentModel
A linear model of the transmission current for a LoRa device, based on the WiFi model.
Definition:
lora-tx-current-model.h:65
ns3::lorawan::LinearLoraTxCurrentModel::GetStandbyCurrent
double GetStandbyCurrent() const
Get the current in the STANDBY state.
Definition:
lora-tx-current-model.cc:127
ns3::lorawan::LinearLoraTxCurrentModel::m_idleCurrent
double m_idleCurrent
Standby current.
Definition:
lora-tx-current-model.h:123
ns3::lorawan::LinearLoraTxCurrentModel::SetStandbyCurrent
void SetStandbyCurrent(double idleCurrent)
Set the current in the STANDBY state.
Definition:
lora-tx-current-model.cc:108
ns3::lorawan::LinearLoraTxCurrentModel::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition:
lora-tx-current-model.cc:55
ns3::lorawan::LinearLoraTxCurrentModel::m_voltage
double m_voltage
Voltage.
Definition:
lora-tx-current-model.h:122
ns3::lorawan::LinearLoraTxCurrentModel::LinearLoraTxCurrentModel
LinearLoraTxCurrentModel()
Default constructor.
Definition:
lora-tx-current-model.cc:83
ns3::lorawan::LinearLoraTxCurrentModel::GetEta
double GetEta() const
Get the power amplifier efficiency.
Definition:
lora-tx-current-model.cc:115
ns3::lorawan::LinearLoraTxCurrentModel::SetVoltage
void SetVoltage(double voltage)
Set the supply voltage.
Definition:
lora-tx-current-model.cc:101
ns3::lorawan::LinearLoraTxCurrentModel::m_eta
double m_eta
ETA.
Definition:
lora-tx-current-model.h:121
ns3::lorawan::LinearLoraTxCurrentModel::~LinearLoraTxCurrentModel
~LinearLoraTxCurrentModel() override
Destructor.
Definition:
lora-tx-current-model.cc:88
ns3::lorawan::LinearLoraTxCurrentModel::GetVoltage
double GetVoltage() const
Get the supply voltage.
Definition:
lora-tx-current-model.cc:121
ns3::lorawan::LinearLoraTxCurrentModel::CalcTxCurrent
double CalcTxCurrent(double txPowerDbm) const override
Get the current for transmission at this power.
Definition:
lora-tx-current-model.cc:133
ns3::lorawan::LinearLoraTxCurrentModel::SetEta
void SetEta(double eta)
Set the power amplifier efficiency.
Definition:
lora-tx-current-model.cc:94
ns3::lorawan::LoraTxCurrentModel
Model the transmit current as a function of the transmit power and mode.
Definition:
lora-tx-current-model.h:38
ns3::lorawan::LoraTxCurrentModel::LoraTxCurrentModel
LoraTxCurrentModel()
Default constructor.
Definition:
lora-tx-current-model.cc:43
ns3::lorawan::LoraTxCurrentModel::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition:
lora-tx-current-model.cc:37
ns3::lorawan::LoraTxCurrentModel::CalcTxCurrent
virtual double CalcTxCurrent(double txPowerDbm) const =0
Get the current for transmission at this power.
ns3::lorawan::LoraTxCurrentModel::~LoraTxCurrentModel
~LoraTxCurrentModel() override
Destructor.
Definition:
lora-tx-current-model.cc:47
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lorawan
model
lora-tx-current-model.h
Generated on Mon Aug 12 2024 11:16:15 for ns-3 by
1.9.6