A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lora-utils.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 * Author: Romagnolo Stefano <romagnolostefano93@gmail.com>
7 */
8
9#ifndef LORA_UTILS_H
10#define LORA_UTILS_H
11
12namespace ns3
13{
14namespace lorawan
15{
16
17/**
18 * Convert from dBm to Watts.
19 *
20 * @param dbm The power in dBm.
21 *
22 * @return The equivalent Watts for the given dBm value.
23 */
24double DbmToW(double dbm);
25/**
26 * Convert from dB to ratio.
27 *
28 * @param db The dB value.
29 *
30 * @return The equivalent ratio from the given dB value.
31 */
32double DbToRatio(double db);
33/**
34 * Convert from Watts to dBm.
35 *
36 * @param w The power in Watts.
37 *
38 * @return The equivalent dBm for the given Watts.
39 */
40double WToDbm(double w);
41/**
42 * Convert from ratio to dB.
43 *
44 * @param ratio The ratio value.
45 *
46 * @return The equivalent dB from the given ratio value.
47 */
48double RatioToDb(double ratio);
49
50} // namespace lorawan
51} // namespace ns3
52
53#endif /* LORA_UTILS_H */
double DbmToW(double dBm)
Convert from dBm to Watts.
Definition lora-utils.cc:26
double WToDbm(double w)
Convert from Watts to dBm.
Definition lora-utils.cc:33
double RatioToDb(double ratio)
Convert from ratio to dB.
Definition lora-utils.cc:39
double DbToRatio(double dB)
Convert from dB to ratio.
Definition lora-utils.cc:19
Every class exported by the ns3 library is enclosed in the ns3 namespace.