A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-tx-current-model.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2014 Universita' degli Studi di Napoli "Federico II"
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Stefano Avallone <stefano.avallone@unina.it>
7 */
8
10
11#include "wifi-utils.h"
12
13#include "ns3/double.h"
14#include "ns3/log.h"
15
16namespace ns3
17{
18
19NS_LOG_COMPONENT_DEFINE("WifiTxCurrentModel");
20
21NS_OBJECT_ENSURE_REGISTERED(WifiTxCurrentModel);
22
23TypeId
25{
26 static TypeId tid = TypeId("ns3::WifiTxCurrentModel").SetParent<Object>().SetGroupName("Wifi");
27 return tid;
28}
29
33
37
39
42{
43 static TypeId tid =
44 TypeId("ns3::LinearWifiTxCurrentModel")
46 .SetGroupName("Wifi")
47 .AddConstructor<LinearWifiTxCurrentModel>()
48 .AddAttribute("Eta",
49 "The efficiency of the power amplifier.",
50 DoubleValue(0.10),
53 .AddAttribute("Voltage",
54 "The supply voltage (in Volts).",
55 DoubleValue(3.0),
58 .AddAttribute("IdleCurrent",
59 "The current in the IDLE state (in Ampere).",
60 DoubleValue(0.273333),
63 return tid;
64}
65
70
75
78{
79 NS_LOG_FUNCTION(this << txPower);
80 return DbmToW(txPower) / (m_voltage * m_eta) + m_idleCurrent;
81}
82
83} // namespace ns3
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition double.h:31
a linear model of the Wifi transmit current
static TypeId GetTypeId()
Get the type ID.
ampere_u CalcTxCurrent(dBm_u txPower) const override
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
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
Model the transmit current as a function of the transmit power and mode.
static TypeId GetTypeId()
Get the type ID.
Ptr< const AttributeChecker > MakeDoubleChecker()
Definition double.h:82
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition double.h:32
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Every class exported by the ns3 library is enclosed in the ns3 namespace.
double ampere_u
ampere weak type
Definition wifi-units.h:33
Watt_u DbmToW(dBm_u val)
Convert from dBm to Watts.
Definition wifi-utils.cc:31