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
12#include "ns3/nstime.h"
13#include "ns3/uinteger.h"
14
15namespace ns3
16{
17namespace lorawan
18{
19
20/**
21 * Convert from dBm to Watts.
22 *
23 * \param dbm The power in dBm.
24 *
25 * \return The equivalent Watts for the given dBm value.
26 */
27double DbmToW(double dbm);
28/**
29 * Convert from dB to ratio.
30 *
31 * \param db The dB value.
32 *
33 * \return The equivalent ratio from the given dB value.
34 */
35double DbToRatio(double db);
36/**
37 * Convert from Watts to dBm.
38 *
39 * \param w The power in Watts.
40 *
41 * \return The equivalent dBm for the given Watts.
42 */
43double WToDbm(double w);
44/**
45 * Convert from ratio to dB.
46 *
47 * \param ratio The ratio value.
48 *
49 * \return The equivalent dB from the given ratio value.
50 */
51double RatioToDb(double ratio);
52
53} // namespace lorawan
54
55} // namespace ns3
56#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.