A Discrete-Event Network Simulator
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
26namespace ns3
27{
28namespace lorawan
29{
30
31/**
32 * \ingroup lorawan
33 *
34 * Model the transmit current as a function of the transmit power and
35 * mode.
36 */
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 */
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 */
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 */
A base class which provides memory management and object aggregation.
Definition: object.h:89
a unique identifier for an interface.
Definition: type-id.h:59
A constant model of the transmission current for a LoRa device, always yielding the same current inde...
double m_txCurrent
The transmission current [Ampere].
double CalcTxCurrent(double txPowerDbm) const override
Get the current for transmission at this power.
void SetTxCurrent(double txCurrent)
Set the current in the TX state.
static TypeId GetTypeId()
Register this type.
double GetTxCurrent() const
Get the current of the TX state.
A linear model of the transmission current for a LoRa device, based on the WiFi model.
double GetStandbyCurrent() const
Get the current in the STANDBY state.
void SetStandbyCurrent(double idleCurrent)
Set the current in the STANDBY state.
static TypeId GetTypeId()
Register this type.
double GetEta() const
Get the power amplifier efficiency.
void SetVoltage(double voltage)
Set the supply voltage.
double GetVoltage() const
Get the supply voltage.
double CalcTxCurrent(double txPowerDbm) const override
Get the current for transmission at this power.
void SetEta(double eta)
Set the power amplifier efficiency.
Model the transmit current as a function of the transmit power and mode.
static TypeId GetTypeId()
Register this type.
virtual double CalcTxCurrent(double txPowerDbm) const =0
Get the current for transmission at this power.
Every class exported by the ns3 library is enclosed in the ns3 namespace.