diff --git a/src/wifi/CMakeLists.txt b/src/wifi/CMakeLists.txt index 54a0079de..f3a2068cc 100644 --- a/src/wifi/CMakeLists.txt +++ b/src/wifi/CMakeLists.txt @@ -151,6 +151,7 @@ set(source_files model/wifi-remote-station-manager.cc model/wifi-spectrum-phy-interface.cc model/wifi-spectrum-signal-parameters.cc + model/wifi-standards.cc model/wifi-tx-current-model.cc model/wifi-tx-parameters.cc model/wifi-tx-timer.cc diff --git a/src/wifi/model/wifi-standards.cc b/src/wifi/model/wifi-standards.cc new file mode 100644 index 000000000..29b182f78 --- /dev/null +++ b/src/wifi/model/wifi-standards.cc @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2007 INRIA + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Mathieu Lacage + */ + +#include "wifi-standards.h" + +namespace ns3 +{ + +const std::map> wifiStandards = { + {WIFI_STANDARD_80211a, {WIFI_PHY_BAND_5GHZ}}, + {WIFI_STANDARD_80211b, {WIFI_PHY_BAND_2_4GHZ}}, + {WIFI_STANDARD_80211g, {WIFI_PHY_BAND_2_4GHZ}}, + {WIFI_STANDARD_80211p, {WIFI_PHY_BAND_5GHZ}}, + {WIFI_STANDARD_80211n, {WIFI_PHY_BAND_2_4GHZ, WIFI_PHY_BAND_5GHZ}}, + {WIFI_STANDARD_80211ac, {WIFI_PHY_BAND_5GHZ}}, + {WIFI_STANDARD_80211ad, {WIFI_PHY_BAND_60GHZ}}, + {WIFI_STANDARD_80211ax, {WIFI_PHY_BAND_2_4GHZ, WIFI_PHY_BAND_5GHZ, WIFI_PHY_BAND_6GHZ}}, + {WIFI_STANDARD_80211be, {WIFI_PHY_BAND_2_4GHZ, WIFI_PHY_BAND_5GHZ, WIFI_PHY_BAND_6GHZ}}, +}; + +} // namespace ns3 diff --git a/src/wifi/model/wifi-standards.h b/src/wifi/model/wifi-standards.h index 9227d4348..e5de37157 100644 --- a/src/wifi/model/wifi-standards.h +++ b/src/wifi/model/wifi-standards.h @@ -86,17 +86,7 @@ operator<<(std::ostream& os, WifiStandard standard) /** * \brief map a given standard configured by the user to the allowed PHY bands */ -const std::map> wifiStandards = { - {WIFI_STANDARD_80211a, {WIFI_PHY_BAND_5GHZ}}, - {WIFI_STANDARD_80211b, {WIFI_PHY_BAND_2_4GHZ}}, - {WIFI_STANDARD_80211g, {WIFI_PHY_BAND_2_4GHZ}}, - {WIFI_STANDARD_80211p, {WIFI_PHY_BAND_5GHZ}}, - {WIFI_STANDARD_80211n, {WIFI_PHY_BAND_2_4GHZ, WIFI_PHY_BAND_5GHZ}}, - {WIFI_STANDARD_80211ac, {WIFI_PHY_BAND_5GHZ}}, - {WIFI_STANDARD_80211ad, {WIFI_PHY_BAND_60GHZ}}, - {WIFI_STANDARD_80211ax, {WIFI_PHY_BAND_2_4GHZ, WIFI_PHY_BAND_5GHZ, WIFI_PHY_BAND_6GHZ}}, - {WIFI_STANDARD_80211be, {WIFI_PHY_BAND_2_4GHZ, WIFI_PHY_BAND_5GHZ, WIFI_PHY_BAND_6GHZ}}, -}; +extern const std::map> wifiStandards; /** * \ingroup wifi diff --git a/src/wifi/model/wifi-utils.cc b/src/wifi/model/wifi-utils.cc index 10721c0af..eff922bc2 100644 --- a/src/wifi/model/wifi-utils.cc +++ b/src/wifi/model/wifi-utils.cc @@ -30,6 +30,8 @@ namespace ns3 { +const Time WIFI_TU = MicroSeconds(1024); + double DbToRatio(double dB) { diff --git a/src/wifi/model/wifi-utils.h b/src/wifi/model/wifi-utils.h index 9f98c05a1..0d01203a6 100644 --- a/src/wifi/model/wifi-utils.h +++ b/src/wifi/model/wifi-utils.h @@ -196,7 +196,7 @@ static constexpr uint8_t SINGLE_LINK_OP_ID = 0; static constexpr uint8_t WIFI_LINKID_UNDEFINED = 0xff; /// Wi-Fi Time Unit (see IEEE 802.11-2020 sec. 3.1) -static const Time WIFI_TU = MicroSeconds(1024); +extern const Time WIFI_TU; } // namespace ns3