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 * 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
15namespace ns3
16{
17namespace lorawan
18{
19
20/**
21 * \ingroup lorawan
22 *
23 * Model the transmit current as a function of the transmit power and
24 * mode.
25 */
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 */
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 */
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 */
A base class which provides memory management and object aggregation.
Definition object.h:78
a unique identifier for an interface.
Definition type-id.h:48
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.