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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Authors: Romagnolo Stefano <romagnolostefano93@gmail.com>
7
* Davide Magrin <magrinda@dei.unipd.it>
8
*/
9
10
#ifndef LORA_TX_CURRENT_MODEL_H
11
#define LORA_TX_CURRENT_MODEL_H
12
13
#include "ns3/object.h"
14
15
namespace
ns3
16
{
17
namespace
lorawan
18
{
19
20
/**
21
* \ingroup lorawan
22
*
23
* Model the transmit current as a function of the transmit power and
24
* mode.
25
*/
26
class
LoraTxCurrentModel
:
public
Object
27
{
28
public
:
29
/**
30
* Register this type.
31
* \return The object TypeId.
32
*/
33
static
TypeId
GetTypeId
();
34
35
LoraTxCurrentModel
();
//!< Default constructor
36
~LoraTxCurrentModel
()
override
;
//!< Destructor
37
38
/**
39
* Get the current for transmission at this power.
40
*
41
* \param txPowerDbm The nominal tx power in dBm.
42
* \return The transmit current (in Ampere).
43
*/
44
virtual
double
CalcTxCurrent
(
double
txPowerDbm)
const
= 0;
45
};
46
47
/**
48
* \ingroup lorawan
49
*
50
* A linear model of the transmission current for a LoRa device, based on the
51
* WiFi model.
52
*/
53
class
LinearLoraTxCurrentModel
:
public
LoraTxCurrentModel
54
{
55
public
:
56
/**
57
* Register this type.
58
* \return The object TypeId.
59
*/
60
static
TypeId
GetTypeId
();
61
62
LinearLoraTxCurrentModel
();
//!< Default constructor
63
~LinearLoraTxCurrentModel
()
override
;
//!< Destructor
64
65
/**
66
* Set the power amplifier efficiency.
67
*
68
* \param eta The power amplifier efficiency.
69
*/
70
void
SetEta
(
double
eta);
71
72
/**
73
* Set the supply voltage.
74
*
75
* \param voltage The supply voltage [Volts].
76
*/
77
void
SetVoltage
(
double
voltage);
78
79
/**
80
* Set the current in the STANDBY state.
81
*
82
* \param idleCurrent The idle current value [Ampere].
83
*/
84
void
SetStandbyCurrent
(
double
idleCurrent);
85
86
/**
87
* Get the power amplifier efficiency.
88
*
89
* \return The power amplifier efficiency.
90
*/
91
double
GetEta
()
const
;
92
93
/**
94
* Get the supply voltage.
95
*
96
* \return The supply voltage [Volts].
97
*/
98
double
GetVoltage
()
const
;
99
100
/**
101
* Get the current in the STANDBY state.
102
*
103
* \return The idle current value [Ampere].
104
*/
105
double
GetStandbyCurrent
()
const
;
106
107
double
CalcTxCurrent
(
double
txPowerDbm)
const override
;
108
109
private
:
110
double
m_eta
;
//!< ETA
111
double
m_voltage
;
//!< Voltage
112
double
m_idleCurrent
;
//!< Standby current
113
};
114
115
/**
116
* \ingroup lorawan
117
*
118
* A constant model of the transmission current for a LoRa device, always yielding the same
119
* current independently from the transmission power provided.
120
*/
121
class
ConstantLoraTxCurrentModel
:
public
LoraTxCurrentModel
122
{
123
public
:
124
/**
125
* Register this type.
126
* \return The object TypeId.
127
*/
128
static
TypeId
GetTypeId
();
129
130
ConstantLoraTxCurrentModel
();
//!< Default constructor
131
~ConstantLoraTxCurrentModel
()
override
;
//!< Destructor
132
133
/**
134
* Set the current in the TX state.
135
*
136
* \param txCurrent The TX current value [Ampere].
137
*/
138
void
SetTxCurrent
(
double
txCurrent);
139
140
/**
141
* Get the current of the TX state.
142
*
143
* \return The TX current value.
144
*/
145
double
GetTxCurrent
()
const
;
146
147
double
CalcTxCurrent
(
double
txPowerDbm)
const override
;
148
149
private
:
150
double
m_txCurrent
;
//!< The transmission current [Ampere]
151
};
152
153
}
// namespace lorawan
154
155
}
// namespace ns3
156
#endif
/* LORA_TX_CURRENT_MODEL_H */
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
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:122
ns3::lorawan::ConstantLoraTxCurrentModel::m_txCurrent
double m_txCurrent
The transmission current [Ampere].
Definition
lora-tx-current-model.h:150
ns3::lorawan::ConstantLoraTxCurrentModel::CalcTxCurrent
double CalcTxCurrent(double txPowerDbm) const override
Get the current for transmission at this power.
Definition
lora-tx-current-model.cc:171
ns3::lorawan::ConstantLoraTxCurrentModel::SetTxCurrent
void SetTxCurrent(double txCurrent)
Set the current in the TX state.
Definition
lora-tx-current-model.cc:158
ns3::lorawan::ConstantLoraTxCurrentModel::~ConstantLoraTxCurrentModel
~ConstantLoraTxCurrentModel() override
Destructor.
Definition
lora-tx-current-model.cc:152
ns3::lorawan::ConstantLoraTxCurrentModel::ConstantLoraTxCurrentModel
ConstantLoraTxCurrentModel()
Default constructor.
Definition
lora-tx-current-model.cc:147
ns3::lorawan::ConstantLoraTxCurrentModel::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition
lora-tx-current-model.cc:131
ns3::lorawan::ConstantLoraTxCurrentModel::GetTxCurrent
double GetTxCurrent() const
Get the current of the TX state.
Definition
lora-tx-current-model.cc:165
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:54
ns3::lorawan::LinearLoraTxCurrentModel::GetStandbyCurrent
double GetStandbyCurrent() const
Get the current in the STANDBY state.
Definition
lora-tx-current-model.cc:116
ns3::lorawan::LinearLoraTxCurrentModel::m_idleCurrent
double m_idleCurrent
Standby current.
Definition
lora-tx-current-model.h:112
ns3::lorawan::LinearLoraTxCurrentModel::SetStandbyCurrent
void SetStandbyCurrent(double idleCurrent)
Set the current in the STANDBY state.
Definition
lora-tx-current-model.cc:97
ns3::lorawan::LinearLoraTxCurrentModel::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition
lora-tx-current-model.cc:44
ns3::lorawan::LinearLoraTxCurrentModel::m_voltage
double m_voltage
Voltage.
Definition
lora-tx-current-model.h:111
ns3::lorawan::LinearLoraTxCurrentModel::LinearLoraTxCurrentModel
LinearLoraTxCurrentModel()
Default constructor.
Definition
lora-tx-current-model.cc:72
ns3::lorawan::LinearLoraTxCurrentModel::GetEta
double GetEta() const
Get the power amplifier efficiency.
Definition
lora-tx-current-model.cc:104
ns3::lorawan::LinearLoraTxCurrentModel::SetVoltage
void SetVoltage(double voltage)
Set the supply voltage.
Definition
lora-tx-current-model.cc:90
ns3::lorawan::LinearLoraTxCurrentModel::m_eta
double m_eta
ETA.
Definition
lora-tx-current-model.h:110
ns3::lorawan::LinearLoraTxCurrentModel::~LinearLoraTxCurrentModel
~LinearLoraTxCurrentModel() override
Destructor.
Definition
lora-tx-current-model.cc:77
ns3::lorawan::LinearLoraTxCurrentModel::GetVoltage
double GetVoltage() const
Get the supply voltage.
Definition
lora-tx-current-model.cc:110
ns3::lorawan::LinearLoraTxCurrentModel::CalcTxCurrent
double CalcTxCurrent(double txPowerDbm) const override
Get the current for transmission at this power.
Definition
lora-tx-current-model.cc:122
ns3::lorawan::LinearLoraTxCurrentModel::SetEta
void SetEta(double eta)
Set the power amplifier efficiency.
Definition
lora-tx-current-model.cc:83
ns3::lorawan::LoraTxCurrentModel
Model the transmit current as a function of the transmit power and mode.
Definition
lora-tx-current-model.h:27
ns3::lorawan::LoraTxCurrentModel::LoraTxCurrentModel
LoraTxCurrentModel()
Default constructor.
Definition
lora-tx-current-model.cc:32
ns3::lorawan::LoraTxCurrentModel::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition
lora-tx-current-model.cc:26
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:36
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lorawan
model
lora-tx-current-model.h
Generated on Fri Nov 8 2024 13:59:02 for ns-3 by
1.11.0