A Discrete-Event Network Simulator
API
wifi-utils.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2016
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Sébastien Deronne <sebastien.deronne@gmail.com>
19  */
20 
21 #ifndef WIFI_UTILS_H
22 #define WIFI_UTILS_H
23 
24 #include "wifi-mode.h"
25 #include "ns3/nstime.h"
26 #include "ns3/uinteger.h"
27 
28 namespace ns3 {
29 
37  double Log2 (double val);
45 double DbmToW (double dbm);
53 double DbToRatio (double db);
61 double WToDbm (double w);
69 double RatioToDb (double ratio);
79 uint16_t ConvertGuardIntervalToNanoSeconds (WifiMode mode, bool htShortGuardInterval, Time heGuardInterval);
80 
81 } // namespace ns3
82 
83 #endif /* WIFI_UTILS_H */
uint16_t ConvertGuardIntervalToNanoSeconds(WifiMode mode, bool htShortGuardInterval, Time heGuardInterval)
Convert the guard interval to nanoseconds based on the wifimode.
Definition: wifi-utils.cc:60
double DbmToW(double dBm)
Convert from dBm to Watts.
Definition: wifi-utils.cc:41
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Definition: nstime.h:719
Every class exported by the ns3 library is enclosed in the ns3 namespace.
double WToDbm(double w)
Convert from Watts to dBm.
Definition: wifi-utils.cc:48
double DbToRatio(double dB)
Convert from dB to ratio.
Definition: wifi-utils.cc:34
double RatioToDb(double ratio)
Convert from ratio to dB.
Definition: wifi-utils.cc:54
SpectrumValue Log2(const SpectrumValue &arg)