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 * @brief Model the transmit current as a function of the transmit power and mode
24 */
26{
27 public:
28 /**
29 * Register this type.
30 * @return The object TypeId.
31 */
32 static TypeId GetTypeId();
33
34 LoraTxCurrentModel(); //!< Default constructor
35 ~LoraTxCurrentModel() override; //!< Destructor
36
37 /**
38 * Get the current for transmission at this power.
39 *
40 * @param txPowerDbm The nominal tx power in dBm.
41 * @return The transmit current (in Ampere).
42 */
43 virtual double CalcTxCurrent(double txPowerDbm) const = 0;
44};
45
46/**
47 * @ingroup lorawan
48 *
49 * @brief A linear model of the transmission current for a LoRa device
50 *
51 * This model assumes that the transmit current is a linear function of the nominal transmit power
52 * used to send the frame. Adapted from LinearWifiTxCurrentModel, the default values are obtained by
53 * line interpolation of the (7dBm, 18mA) and (13dBm, 28mA) values for TX power (converted to Watt)
54 * and respective current found in the SX1272/73 Datasheet, Rev. 4, Jan. 2019.
55 */
57{
58 public:
59 /**
60 * Register this type.
61 * @return The object TypeId.
62 */
63 static TypeId GetTypeId();
64
65 LinearLoraTxCurrentModel(); //!< Default constructor
66 ~LinearLoraTxCurrentModel() override; //!< Destructor
67
68 double CalcTxCurrent(double txPowerDbm) const override;
69
70 private:
71 double m_eta; //!< ETA
72 double m_voltage; //!< Voltage
73 double m_baseCurrent; //!< Base current
74};
75
76} // namespace lorawan
77} // namespace ns3
78
79#endif /* LORA_TX_CURRENT_MODEL_H */
Object()
Caller graph was not generated because of its size.
Definition object.cc:93
a unique identifier for an interface.
Definition type-id.h:50
static TypeId GetTypeId()
Register this type.
double CalcTxCurrent(double txPowerDbm) const override
Get the current for transmission at this power.
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.