diff --git a/examples/wireless/wifi-80211n-mimo.cc b/examples/wireless/wifi-80211n-mimo.cc index 435b8b316..3aecc6aec 100644 --- a/examples/wireless/wifi-80211n-mimo.cc +++ b/examples/wireless/wifi-80211n-mimo.cc @@ -150,11 +150,11 @@ int main (int argc, char *argv[]) WifiHelper wifi; if (frequency == 5.0) { - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); } else if (frequency == 2.4) { - wifi.SetStandard (WIFI_STANDARD_80211n_2_4GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); Config::SetDefault ("ns3::LogDistancePropagationLossModel::ReferenceLoss", DoubleValue (40.046)); } else diff --git a/examples/wireless/wifi-aggregation.cc b/examples/wireless/wifi-aggregation.cc index 22b4f32a9..230fb5b11 100644 --- a/examples/wireless/wifi-aggregation.cc +++ b/examples/wireless/wifi-aggregation.cc @@ -103,7 +103,7 @@ int main (int argc, char *argv[]) phy.SetChannel (channel.Create ()); WifiHelper wifi; - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("HtMcs7"), "ControlMode", StringValue ("HtMcs0")); WifiMacHelper mac; diff --git a/examples/wireless/wifi-backward-compatibility.cc b/examples/wireless/wifi-backward-compatibility.cc index 656895662..67b792527 100644 --- a/examples/wireless/wifi-backward-compatibility.cc +++ b/examples/wireless/wifi-backward-compatibility.cc @@ -50,46 +50,56 @@ using namespace ns3; NS_LOG_COMPONENT_DEFINE ("wifi-backward-compatibility"); -WifiStandard ConvertStringToStandard (std::string version) +std::pair ConvertStringToStandardAndBand (std::string version) { WifiStandard standard = WIFI_STANDARD_80211a; + WifiPhyBand band = WIFI_PHY_BAND_5GHZ; if (version == "80211a") { standard = WIFI_STANDARD_80211a; + band = WIFI_PHY_BAND_5GHZ; } else if (version == "80211b") { standard = WIFI_STANDARD_80211b; + band = WIFI_PHY_BAND_2_4GHZ; } else if (version == "80211g") { standard = WIFI_STANDARD_80211g; + band = WIFI_PHY_BAND_2_4GHZ; } else if (version == "80211p") { standard = WIFI_STANDARD_80211p; + band = WIFI_PHY_BAND_5GHZ; } else if (version == "80211n_2_4GHZ") { - standard = WIFI_STANDARD_80211n_2_4GHZ; + standard = WIFI_STANDARD_80211n; + band = WIFI_PHY_BAND_2_4GHZ; } else if (version == "80211n_5GHZ") { - standard = WIFI_STANDARD_80211n_5GHZ; + standard = WIFI_STANDARD_80211n; + band = WIFI_PHY_BAND_5GHZ; } else if (version == "80211ac") { standard = WIFI_STANDARD_80211ac; + band = WIFI_PHY_BAND_5GHZ; } else if (version == "80211ax_2_4GHZ") { - standard = WIFI_STANDARD_80211ax_2_4GHZ; + standard = WIFI_STANDARD_80211ax; + band = WIFI_PHY_BAND_2_4GHZ; } else if (version == "80211ax_5GHZ") { - standard = WIFI_STANDARD_80211ax_5GHZ; + standard = WIFI_STANDARD_80211ax; + band = WIFI_PHY_BAND_5GHZ; } - return standard; + return {standard, band}; } int main (int argc, char *argv[]) @@ -127,7 +137,8 @@ int main (int argc, char *argv[]) Ssid ssid = Ssid ("ns3"); TupleValue channelValue; - wifi.SetStandard (ConvertStringToStandard (staVersion)); + const auto& [staStandard, staBand] = ConvertStringToStandardAndBand (staVersion); + wifi.SetStandard (staStandard); wifi.SetRemoteStationManager ("ns3::" + staRaa + "WifiManager"); mac.SetType ("ns3::StaWifiMac", @@ -136,15 +147,14 @@ int main (int argc, char *argv[]) //Workaround needed as long as we do not fully support channel bonding uint16_t width = (staVersion == "80211ac" ? 20 : 0); - auto standardIt = wifiStandards.find (ConvertStringToStandard (staVersion)); - NS_ABORT_IF (standardIt == wifiStandards.end ()); - channelValue.Set (WifiPhy::ChannelTuple {0, width, standardIt->second.phyBand, 0}); + channelValue.Set (WifiPhy::ChannelTuple {0, width, staBand, 0}); phy.Set ("ChannelSettings", channelValue); NetDeviceContainer staDevice; staDevice = wifi.Install (phy, mac, wifiStaNode); - wifi.SetStandard (ConvertStringToStandard (apVersion)); + const auto& [apStandard, apBand] = ConvertStringToStandardAndBand (apVersion); + wifi.SetStandard (apStandard); wifi.SetRemoteStationManager ("ns3::" + apRaa + "WifiManager"); mac.SetType ("ns3::ApWifiMac", @@ -153,9 +163,7 @@ int main (int argc, char *argv[]) //Workaround needed as long as we do not fully support channel bonding width = (apVersion == "80211ac" ? 20 : 0); - standardIt = wifiStandards.find (ConvertStringToStandard (apVersion)); - NS_ABORT_IF (standardIt == wifiStandards.end ()); - channelValue.Set (WifiPhy::ChannelTuple {0, width, standardIt->second.phyBand, 0}); + channelValue.Set (WifiPhy::ChannelTuple {0, width, apBand, 0}); phy.Set ("ChannelSettings", channelValue); NetDeviceContainer apDevice; diff --git a/examples/wireless/wifi-he-network.cc b/examples/wireless/wifi-he-network.cc index 5c54f30d4..5160aefe4 100644 --- a/examples/wireless/wifi-he-network.cc +++ b/examples/wireless/wifi-he-network.cc @@ -171,18 +171,18 @@ int main (int argc, char *argv[]) if (frequency == 6) { - wifi.SetStandard (WIFI_STANDARD_80211ax_6GHZ); + wifi.SetStandard (WIFI_STANDARD_80211ax); channelStr += "BAND_6GHZ, 0}"; Config::SetDefault ("ns3::LogDistancePropagationLossModel::ReferenceLoss", DoubleValue (48)); } else if (frequency == 5) { - wifi.SetStandard (WIFI_STANDARD_80211ax_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211ax); channelStr += "BAND_5GHZ, 0}"; } else if (frequency == 2.4) { - wifi.SetStandard (WIFI_STANDARD_80211ax_2_4GHZ); + wifi.SetStandard (WIFI_STANDARD_80211ax); channelStr += "BAND_2_4GHZ, 0}"; Config::SetDefault ("ns3::LogDistancePropagationLossModel::ReferenceLoss", DoubleValue (40)); } diff --git a/examples/wireless/wifi-ht-network.cc b/examples/wireless/wifi-ht-network.cc index 39b0723b6..2c2e67bc2 100644 --- a/examples/wireless/wifi-ht-network.cc +++ b/examples/wireless/wifi-ht-network.cc @@ -133,11 +133,11 @@ int main (int argc, char *argv[]) if (frequency == 5.0) { - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); } else if (frequency == 2.4) { - wifi.SetStandard (WIFI_STANDARD_80211n_2_4GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); Config::SetDefault ("ns3::LogDistancePropagationLossModel::ReferenceLoss", DoubleValue (40.046)); } else diff --git a/examples/wireless/wifi-mixed-network.cc b/examples/wireless/wifi-mixed-network.cc index 7dd943aa8..b00c2586e 100644 --- a/examples/wireless/wifi-mixed-network.cc +++ b/examples/wireless/wifi-mixed-network.cc @@ -99,7 +99,7 @@ Experiment::Run (Parameters params) { apTypeString = "WIFI_STANDARD_80211g"; } - else if (params.apType == WIFI_STANDARD_80211n_2_4GHZ) + else if (params.apType == WIFI_STANDARD_80211n) { apTypeString = "WIFI_STANDARD_80211n_2_4GHZ"; } @@ -167,7 +167,7 @@ Experiment::Run (Parameters params) gStaDevice = wifi.Install (phy, mac, wifiGStaNodes); // 802.11b/g/n STA - wifi.SetStandard (WIFI_STANDARD_80211n_2_4GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); NetDeviceContainer nStaDevice; mac.SetType ("ns3::StaWifiMac", "Ssid", SsidValue (ssid), @@ -187,7 +187,7 @@ Experiment::Run (Parameters params) apDevice = wifi.Install (phy, mac, wifiApNode); // Set TXOP limit - if (params.apType == WIFI_STANDARD_80211n_2_4GHZ) + if (params.apType == WIFI_STANDARD_80211n) { Ptr dev = wifiApNode.Get (0)->GetDevice (0); Ptr wifi_dev = DynamicCast (dev); @@ -471,7 +471,7 @@ int main (int argc, char *argv[]) params.enableErpProtection = false; params.enableShortSlotTime = false; params.enableShortPhyPreamble = false; - params.apType = WIFI_STANDARD_80211n_2_4GHZ; + params.apType = WIFI_STANDARD_80211n; params.nWifiB = 0; params.bHasTraffic = false; params.nWifiG = 0; @@ -490,7 +490,7 @@ int main (int argc, char *argv[]) params.enableErpProtection = false; params.enableShortSlotTime = false; params.enableShortPhyPreamble = false; - params.apType = WIFI_STANDARD_80211n_2_4GHZ; + params.apType = WIFI_STANDARD_80211n; params.nWifiB = 0; params.bHasTraffic = false; params.nWifiG = 1; diff --git a/examples/wireless/wifi-multi-tos.cc b/examples/wireless/wifi-multi-tos.cc index 554becbe0..b50e88a0c 100644 --- a/examples/wireless/wifi-multi-tos.cc +++ b/examples/wireless/wifi-multi-tos.cc @@ -76,7 +76,7 @@ int main (int argc, char *argv[]) WifiMacHelper mac; WifiHelper wifi; - wifi.SetStandard (WIFI_STANDARD_80211n_2_4GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); std::ostringstream oss; oss << "HtMcs" << mcs; diff --git a/examples/wireless/wifi-rate-adaptation-distance.cc b/examples/wireless/wifi-rate-adaptation-distance.cc index b93d02858..61204a9cc 100644 --- a/examples/wireless/wifi-rate-adaptation-distance.cc +++ b/examples/wireless/wifi-rate-adaptation-distance.cc @@ -236,11 +236,11 @@ int main (int argc, char *argv[]) { if (standard == "802.11n-2.4GHz") { - wifi.SetStandard (WIFI_STANDARD_80211n_2_4GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); } else if (standard == "802.11n-5GHz") { - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); } WifiMacHelper wifiMac; diff --git a/examples/wireless/wifi-simple-ht-hidden-stations.cc b/examples/wireless/wifi-simple-ht-hidden-stations.cc index 2effec8d6..8c3f90976 100644 --- a/examples/wireless/wifi-simple-ht-hidden-stations.cc +++ b/examples/wireless/wifi-simple-ht-hidden-stations.cc @@ -101,7 +101,7 @@ int main (int argc, char *argv[]) phy.Set ("ChannelSettings", StringValue ("{36, 0, BAND_5GHZ, 0}")); WifiHelper wifi; - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("HtMcs7"), "ControlMode", StringValue ("HtMcs0")); WifiMacHelper mac; diff --git a/examples/wireless/wifi-spatial-reuse.cc b/examples/wireless/wifi-spatial-reuse.cc index cfc3a19c6..b631340b1 100644 --- a/examples/wireless/wifi-spatial-reuse.cc +++ b/examples/wireless/wifi-spatial-reuse.cc @@ -153,7 +153,7 @@ main (int argc, char *argv[]) //TODO: add parameter to configure CCA-PD WifiHelper wifi; - wifi.SetStandard (WIFI_STANDARD_80211ax_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211ax); if (enableObssPd) { wifi.SetObssPdAlgorithm ("ns3::ConstantObssPdAlgorithm", diff --git a/examples/wireless/wifi-spectrum-per-example.cc b/examples/wireless/wifi-spectrum-per-example.cc index 68396f7b0..755d1b395 100644 --- a/examples/wireless/wifi-spectrum-per-example.cc +++ b/examples/wireless/wifi-spectrum-per-example.cc @@ -206,7 +206,7 @@ int main (int argc, char *argv[]) WifiHelper wifi; - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); WifiMacHelper mac; Ssid ssid = Ssid ("ns380211n"); diff --git a/examples/wireless/wifi-spectrum-per-interference.cc b/examples/wireless/wifi-spectrum-per-interference.cc index 660cb2df2..4934f75e1 100644 --- a/examples/wireless/wifi-spectrum-per-interference.cc +++ b/examples/wireless/wifi-spectrum-per-interference.cc @@ -259,7 +259,7 @@ int main (int argc, char *argv[]) } WifiHelper wifi; - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); WifiMacHelper mac; Ssid ssid = Ssid ("ns380211n"); diff --git a/examples/wireless/wifi-spectrum-saturation-example.cc b/examples/wireless/wifi-spectrum-saturation-example.cc index 1eb9f3f92..a5779e31b 100644 --- a/examples/wireless/wifi-spectrum-saturation-example.cc +++ b/examples/wireless/wifi-spectrum-saturation-example.cc @@ -224,7 +224,7 @@ int main (int argc, char *argv[]) } WifiHelper wifi; - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); WifiMacHelper mac; Ssid ssid = Ssid ("ns380211n"); diff --git a/examples/wireless/wifi-tcp.cc b/examples/wireless/wifi-tcp.cc index 2768163f5..b2b210c62 100644 --- a/examples/wireless/wifi-tcp.cc +++ b/examples/wireless/wifi-tcp.cc @@ -109,7 +109,7 @@ main (int argc, char *argv[]) WifiMacHelper wifiMac; WifiHelper wifiHelper; - wifiHelper.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifiHelper.SetStandard (WIFI_STANDARD_80211n); /* Set up Legacy Channel */ YansWifiChannelHelper wifiChannel; diff --git a/examples/wireless/wifi-timing-attributes.cc b/examples/wireless/wifi-timing-attributes.cc index ee6c0c1cc..9fba122b7 100644 --- a/examples/wireless/wifi-timing-attributes.cc +++ b/examples/wireless/wifi-timing-attributes.cc @@ -83,7 +83,7 @@ int main (int argc, char *argv[]) //Default IEEE 802.11n (2.4 GHz) WifiHelper wifi; - wifi.SetStandard (WIFI_STANDARD_80211n_2_4GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("HtMcs7"), "ControlMode", StringValue ("HtMcs0")); diff --git a/examples/wireless/wifi-txop-aggregation.cc b/examples/wireless/wifi-txop-aggregation.cc index fdec572a6..87ddf4523 100644 --- a/examples/wireless/wifi-txop-aggregation.cc +++ b/examples/wireless/wifi-txop-aggregation.cc @@ -131,7 +131,7 @@ int main (int argc, char *argv[]) phy.SetChannel (channel.Create ()); WifiHelper wifi; - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("HtMcs7"), "ControlMode", StringValue ("HtMcs0")); WifiMacHelper mac; diff --git a/src/mesh/helper/mesh-helper.cc b/src/mesh/helper/mesh-helper.cc index 5f42f22b5..4b306d2b5 100644 --- a/src/mesh/helper/mesh-helper.cc +++ b/src/mesh/helper/mesh-helper.cc @@ -179,13 +179,6 @@ MeshHelper::CreateInterface (const WifiPhyHelper &phyHelper, Ptr node, uin { Ptr device = CreateObject (); - auto it = wifiStandards.find (m_standard); - if (it == wifiStandards.end ()) - { - NS_FATAL_ERROR ("Selected standard is not defined!"); - return device; - } - // this is a const method, but we need to force the correct QoS setting ObjectFactory macObjectFactory = m_mac; macObjectFactory.Set ("QosSupported", BooleanValue (true)); // a mesh station is a QoS station @@ -210,7 +203,7 @@ MeshHelper::CreateInterface (const WifiPhyHelper &phyHelper, Ptr node, uin ackManager->SetWifiMac (wifiMac); fem->SetAckManager (ackManager); } - phy->ConfigureStandard (it->second.phyStandard); + phy->ConfigureStandard (m_standard); device->SetMac (mac); device->SetPhy (phy); device->SetRemoteStationManager (manager); diff --git a/src/test/ns3wifi/wifi-issue-211-test-suite.cc b/src/test/ns3wifi/wifi-issue-211-test-suite.cc index ec044c3b6..b35e41875 100644 --- a/src/test/ns3wifi/wifi-issue-211-test-suite.cc +++ b/src/test/ns3wifi/wifi-issue-211-test-suite.cc @@ -128,7 +128,7 @@ Issue211Test::DoRun (void) phy.SetChannel (spectrumChannel); WifiHelper wifi; - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("HtMcs0"), "ControlMode", StringValue ("HtMcs0")); diff --git a/src/wave/helper/wave-helper.cc b/src/wave/helper/wave-helper.cc index bbb9a5a5e..de6020de1 100644 --- a/src/wave/helper/wave-helper.cc +++ b/src/wave/helper/wave-helper.cc @@ -382,7 +382,7 @@ WaveHelper::Install (const WifiPhyHelper &phyHelper, const WifiMacHelper &macHe for (uint32_t j = 0; j != m_physNumber; ++j) { Ptr phy = phyHelper.Create (node, device); - phy->ConfigureStandard (WIFI_PHY_STANDARD_80211p); + phy->ConfigureStandard (WIFI_STANDARD_80211p); phy->SetOperatingChannel (WifiPhy::ChannelTuple {ChannelManager::GetCch (), 0, WIFI_PHY_BAND_5GHZ, 0}); device->AddPhy (phy); diff --git a/src/wifi/examples/wifi-bianchi.cc b/src/wifi/examples/wifi-bianchi.cc index be2efcd2e..194683c03 100644 --- a/src/wifi/examples/wifi-bianchi.cc +++ b/src/wifi/examples/wifi-bianchi.cc @@ -1210,11 +1210,11 @@ int main (int argc, char *argv[]) { if (frequency == 2.4) { - wifiStandard = WIFI_STANDARD_80211n_2_4GHZ; + wifiStandard = WIFI_STANDARD_80211n; } else if (frequency == 5) { - wifiStandard = WIFI_STANDARD_80211n_5GHZ; + wifiStandard = WIFI_STANDARD_80211n; } else { @@ -1230,15 +1230,15 @@ int main (int argc, char *argv[]) { if (frequency == 2.4) { - wifiStandard = WIFI_STANDARD_80211ax_2_4GHZ; + wifiStandard = WIFI_STANDARD_80211ax; } else if (frequency == 5) { - wifiStandard = WIFI_STANDARD_80211ax_5GHZ; + wifiStandard = WIFI_STANDARD_80211ax; } else if (frequency == 6) { - wifiStandard = WIFI_STANDARD_80211ax_6GHZ; + wifiStandard = WIFI_STANDARD_80211ax; } else { diff --git a/src/wifi/examples/wifi-manager-example.cc b/src/wifi/examples/wifi-manager-example.cc index 641cabf07..9de5f1de3 100644 --- a/src/wifi/examples/wifi-manager-example.cc +++ b/src/wifi/examples/wifi-manager-example.cc @@ -212,13 +212,13 @@ int main (int argc, char *argv[]) { if (serverChannelWidth == 0) { - serverChannelWidth = GetDefaultChannelWidth (WIFI_PHY_STANDARD_80211b, WIFI_PHY_BAND_2_4GHZ); + serverChannelWidth = GetDefaultChannelWidth (WIFI_STANDARD_80211b, WIFI_PHY_BAND_2_4GHZ); } NS_ABORT_MSG_IF (serverChannelWidth != 22 && serverChannelWidth != 22, "Invalid channel width for standard " << standard); NS_ABORT_MSG_IF (serverNss != 1, "Invalid nss for standard " << standard); if (clientChannelWidth == 0) { - clientChannelWidth = GetDefaultChannelWidth (WIFI_PHY_STANDARD_80211b, WIFI_PHY_BAND_2_4GHZ); + clientChannelWidth = GetDefaultChannelWidth (WIFI_STANDARD_80211b, WIFI_PHY_BAND_2_4GHZ); } NS_ABORT_MSG_IF (clientChannelWidth != 22 && clientChannelWidth != 22, "Invalid channel width for standard " << standard); NS_ABORT_MSG_IF (clientNss != 1, "Invalid nss for standard " << standard); @@ -227,13 +227,13 @@ int main (int argc, char *argv[]) { if (serverChannelWidth == 0) { - serverChannelWidth = GetDefaultChannelWidth (WIFI_PHY_STANDARD_80211g, WIFI_PHY_BAND_2_4GHZ); + serverChannelWidth = GetDefaultChannelWidth (WIFI_STANDARD_80211g, WIFI_PHY_BAND_2_4GHZ); } NS_ABORT_MSG_IF (serverChannelWidth != 20, "Invalid channel width for standard " << standard); NS_ABORT_MSG_IF (serverNss != 1, "Invalid nss for standard " << standard); if (clientChannelWidth == 0) { - clientChannelWidth = GetDefaultChannelWidth (WIFI_PHY_STANDARD_80211g, WIFI_PHY_BAND_2_4GHZ); + clientChannelWidth = GetDefaultChannelWidth (WIFI_STANDARD_80211g, WIFI_PHY_BAND_2_4GHZ); } NS_ABORT_MSG_IF (clientChannelWidth != 20, "Invalid channel width for standard " << standard); NS_ABORT_MSG_IF (clientNss != 1, "Invalid nss for standard " << standard); @@ -243,13 +243,13 @@ int main (int argc, char *argv[]) WifiPhyBand band = (standard == "802.11n-2.4GHz" ? WIFI_PHY_BAND_2_4GHZ : WIFI_PHY_BAND_5GHZ); if (serverChannelWidth == 0) { - serverChannelWidth = GetDefaultChannelWidth (WIFI_PHY_STANDARD_80211n, band); + serverChannelWidth = GetDefaultChannelWidth (WIFI_STANDARD_80211n, band); } NS_ABORT_MSG_IF (serverChannelWidth != 20 && serverChannelWidth != 40, "Invalid channel width for standard " << standard); NS_ABORT_MSG_IF (serverNss == 0 || serverNss > 4, "Invalid nss " << serverNss << " for standard " << standard); if (clientChannelWidth == 0) { - clientChannelWidth = GetDefaultChannelWidth (WIFI_PHY_STANDARD_80211n, band); + clientChannelWidth = GetDefaultChannelWidth (WIFI_STANDARD_80211n, band); } NS_ABORT_MSG_IF (clientChannelWidth != 20 && clientChannelWidth != 40, "Invalid channel width for standard " << standard); NS_ABORT_MSG_IF (clientNss == 0 || clientNss > 4, "Invalid nss " << clientNss << " for standard " << standard); @@ -258,13 +258,13 @@ int main (int argc, char *argv[]) { if (serverChannelWidth == 0) { - serverChannelWidth = GetDefaultChannelWidth (WIFI_PHY_STANDARD_80211ac, WIFI_PHY_BAND_5GHZ); + serverChannelWidth = GetDefaultChannelWidth (WIFI_STANDARD_80211ac, WIFI_PHY_BAND_5GHZ); } NS_ABORT_MSG_IF (serverChannelWidth != 20 && serverChannelWidth != 40 && serverChannelWidth != 80 && serverChannelWidth != 160, "Invalid channel width for standard " << standard); NS_ABORT_MSG_IF (serverNss == 0 || serverNss > 4, "Invalid nss " << serverNss << " for standard " << standard); if (clientChannelWidth == 0) { - clientChannelWidth = GetDefaultChannelWidth (WIFI_PHY_STANDARD_80211ac, WIFI_PHY_BAND_5GHZ); + clientChannelWidth = GetDefaultChannelWidth (WIFI_STANDARD_80211ac, WIFI_PHY_BAND_5GHZ); } NS_ABORT_MSG_IF (clientChannelWidth != 20 && clientChannelWidth != 40 && clientChannelWidth != 80 && clientChannelWidth != 160, "Invalid channel width for standard " << standard); NS_ABORT_MSG_IF (clientNss == 0 || clientNss > 4, "Invalid nss " << clientNss << " for standard " << standard); @@ -274,13 +274,13 @@ int main (int argc, char *argv[]) WifiPhyBand band = (standard == "802.11ax-2.4GHz" ? WIFI_PHY_BAND_2_4GHZ : standard == "802.11ax-6GHz" ? WIFI_PHY_BAND_6GHZ : WIFI_PHY_BAND_5GHZ); if (serverChannelWidth == 0) { - serverChannelWidth = GetDefaultChannelWidth (WIFI_PHY_STANDARD_80211ax, band); + serverChannelWidth = GetDefaultChannelWidth (WIFI_STANDARD_80211ax, band); } NS_ABORT_MSG_IF (serverChannelWidth != 20 && serverChannelWidth != 40 && serverChannelWidth != 80 && serverChannelWidth != 160, "Invalid channel width for standard " << standard); NS_ABORT_MSG_IF (serverNss == 0 || serverNss > 4, "Invalid nss " << serverNss << " for standard " << standard); if (clientChannelWidth == 0) { - clientChannelWidth = GetDefaultChannelWidth (WIFI_PHY_STANDARD_80211ax, band); + clientChannelWidth = GetDefaultChannelWidth (WIFI_STANDARD_80211ax, band); } NS_ABORT_MSG_IF (clientChannelWidth != 20 && clientChannelWidth != 40 && clientChannelWidth != 80 && clientChannelWidth != 160, "Invalid channel width for standard " << standard); NS_ABORT_MSG_IF (clientNss == 0 || clientNss > 4, "Invalid nss " << clientNss << " for standard " << standard); @@ -296,26 +296,26 @@ int main (int argc, char *argv[]) serverStandards.push_back (StandardInfo ("802.11a", WIFI_STANDARD_80211a, WIFI_PHY_BAND_5GHZ, 20, 3, 27, 0, 30, 60)); serverStandards.push_back (StandardInfo ("802.11b", WIFI_STANDARD_80211b, WIFI_PHY_BAND_2_4GHZ, 22, -5, 11, -6, 15, 15)); serverStandards.push_back (StandardInfo ("802.11g", WIFI_STANDARD_80211g, WIFI_PHY_BAND_2_4GHZ, 20, -5, 27, -6, 30, 60)); - serverStandards.push_back (StandardInfo ("802.11n-5GHz", WIFI_STANDARD_80211n_5GHZ, WIFI_PHY_BAND_5GHZ, serverChannelWidth, 3, 30, 0, 35, 80 * channelRateFactor)); - serverStandards.push_back (StandardInfo ("802.11n-2.4GHz", WIFI_STANDARD_80211n_2_4GHZ, WIFI_PHY_BAND_2_4GHZ, serverChannelWidth, 3, 30, 0, 35, 80 * channelRateFactor)); + serverStandards.push_back (StandardInfo ("802.11n-5GHz", WIFI_STANDARD_80211n, WIFI_PHY_BAND_5GHZ, serverChannelWidth, 3, 30, 0, 35, 80 * channelRateFactor)); + serverStandards.push_back (StandardInfo ("802.11n-2.4GHz", WIFI_STANDARD_80211n, WIFI_PHY_BAND_2_4GHZ, serverChannelWidth, 3, 30, 0, 35, 80 * channelRateFactor)); serverStandards.push_back (StandardInfo ("802.11ac", WIFI_STANDARD_80211ac, WIFI_PHY_BAND_5GHZ, serverChannelWidth, 5, 50, 0, 55, 120 * channelRateFactor)); serverStandards.push_back (StandardInfo ("802.11p-10MHz", WIFI_STANDARD_80211p, WIFI_PHY_BAND_5GHZ, 10, 3, 27, 0, 30, 60)); serverStandards.push_back (StandardInfo ("802.11p-5MHz", WIFI_STANDARD_80211p, WIFI_PHY_BAND_5GHZ, 5, 3, 27, 0, 30, 60)); - serverStandards.push_back (StandardInfo ("802.11ax-6GHz", WIFI_STANDARD_80211ax_6GHZ, WIFI_PHY_BAND_6GHZ, serverChannelWidth, 5, 55, 0, 60, 120 * channelRateFactor)); - serverStandards.push_back (StandardInfo ("802.11ax-5GHz", WIFI_STANDARD_80211ax_5GHZ, WIFI_PHY_BAND_5GHZ, serverChannelWidth, 5, 55, 0, 60, 120 * channelRateFactor)); - serverStandards.push_back (StandardInfo ("802.11ax-2.4GHz", WIFI_STANDARD_80211ax_2_4GHZ, WIFI_PHY_BAND_2_4GHZ, serverChannelWidth, 5, 55, 0, 60, 120 * channelRateFactor)); + serverStandards.push_back (StandardInfo ("802.11ax-6GHz", WIFI_STANDARD_80211ax, WIFI_PHY_BAND_6GHZ, serverChannelWidth, 5, 55, 0, 60, 120 * channelRateFactor)); + serverStandards.push_back (StandardInfo ("802.11ax-5GHz", WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ, serverChannelWidth, 5, 55, 0, 60, 120 * channelRateFactor)); + serverStandards.push_back (StandardInfo ("802.11ax-2.4GHz", WIFI_STANDARD_80211ax, WIFI_PHY_BAND_2_4GHZ, serverChannelWidth, 5, 55, 0, 60, 120 * channelRateFactor)); clientStandards.push_back (StandardInfo ("802.11a", WIFI_STANDARD_80211a, WIFI_PHY_BAND_5GHZ, 20, 3, 27, 0, 30, 60)); clientStandards.push_back (StandardInfo ("802.11b", WIFI_STANDARD_80211b, WIFI_PHY_BAND_2_4GHZ, 22, -5, 11, -6, 15, 15)); clientStandards.push_back (StandardInfo ("802.11g", WIFI_STANDARD_80211g, WIFI_PHY_BAND_2_4GHZ, 20, -5, 27, -6, 30, 60)); - clientStandards.push_back (StandardInfo ("802.11n-5GHz", WIFI_STANDARD_80211n_5GHZ, WIFI_PHY_BAND_5GHZ, clientChannelWidth, 3, 30, 0, 35, 80 * channelRateFactor)); - clientStandards.push_back (StandardInfo ("802.11n-2.4GHz", WIFI_STANDARD_80211n_2_4GHZ, WIFI_PHY_BAND_2_4GHZ, clientChannelWidth, 3, 30, 0, 35, 80 * channelRateFactor)); + clientStandards.push_back (StandardInfo ("802.11n-5GHz", WIFI_STANDARD_80211n, WIFI_PHY_BAND_5GHZ, clientChannelWidth, 3, 30, 0, 35, 80 * channelRateFactor)); + clientStandards.push_back (StandardInfo ("802.11n-2.4GHz", WIFI_STANDARD_80211n, WIFI_PHY_BAND_2_4GHZ, clientChannelWidth, 3, 30, 0, 35, 80 * channelRateFactor)); clientStandards.push_back (StandardInfo ("802.11ac", WIFI_STANDARD_80211ac, WIFI_PHY_BAND_5GHZ, clientChannelWidth, 5, 50, 0, 55, 120 * channelRateFactor)); clientStandards.push_back (StandardInfo ("802.11p-10MHz", WIFI_STANDARD_80211p, WIFI_PHY_BAND_5GHZ, 10, 3, 27, 0, 30, 60)); clientStandards.push_back (StandardInfo ("802.11p-5MHz", WIFI_STANDARD_80211p, WIFI_PHY_BAND_5GHZ, 5, 3, 27, 0, 30, 60)); - clientStandards.push_back (StandardInfo ("802.11ax-6GHz", WIFI_STANDARD_80211ax_6GHZ, WIFI_PHY_BAND_6GHZ, clientChannelWidth, 5, 55, 0, 60, 160 * channelRateFactor)); - clientStandards.push_back (StandardInfo ("802.11ax-5GHz", WIFI_STANDARD_80211ax_5GHZ, WIFI_PHY_BAND_5GHZ, clientChannelWidth, 5, 55, 0, 60, 160 * channelRateFactor)); - clientStandards.push_back (StandardInfo ("802.11ax-2.4GHz", WIFI_STANDARD_80211ax_2_4GHZ, WIFI_PHY_BAND_2_4GHZ, clientChannelWidth, 5, 55, 0, 60, 160 * channelRateFactor)); + clientStandards.push_back (StandardInfo ("802.11ax-6GHz", WIFI_STANDARD_80211ax, WIFI_PHY_BAND_6GHZ, clientChannelWidth, 5, 55, 0, 60, 160 * channelRateFactor)); + clientStandards.push_back (StandardInfo ("802.11ax-5GHz", WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ, clientChannelWidth, 5, 55, 0, 60, 160 * channelRateFactor)); + clientStandards.push_back (StandardInfo ("802.11ax-2.4GHz", WIFI_STANDARD_80211ax, WIFI_PHY_BAND_2_4GHZ, clientChannelWidth, 5, 55, 0, 60, 160 * channelRateFactor)); for (std::vector::size_type i = 0; i != serverStandards.size (); i++) { diff --git a/src/wifi/examples/wifi-phy-configuration.cc b/src/wifi/examples/wifi-phy-configuration.cc index 054c61d74..472cd039d 100644 --- a/src/wifi/examples/wifi-phy-configuration.cc +++ b/src/wifi/examples/wifi-phy-configuration.cc @@ -145,7 +145,7 @@ int main (int argc, char *argv[]) PrintAttributesIfEnabled (printAttributes); break; case 4: - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); phy.Set ("ChannelSettings", StringValue ("{0, 0, BAND_5GHZ, 0}")); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); apDevice = wifi.Install (phy, macAp, wifiApNode.Get (0)); @@ -157,7 +157,7 @@ int main (int argc, char *argv[]) PrintAttributesIfEnabled (printAttributes); break; case 5: - wifi.SetStandard (WIFI_STANDARD_80211n_2_4GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); apDevice = wifi.Install (phy, macAp, wifiApNode.Get (0)); phySta = GetYansWifiPhyPtr (staDevice); @@ -179,7 +179,7 @@ int main (int argc, char *argv[]) PrintAttributesIfEnabled (printAttributes); break; case 7: - wifi.SetStandard (WIFI_STANDARD_80211ax_2_4GHZ); + wifi.SetStandard (WIFI_STANDARD_80211ax); phy.Set ("ChannelSettings", StringValue ("{0, 0, BAND_2_4GHZ, 0}")); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); apDevice = wifi.Install (phy, macAp, wifiApNode.Get (0)); @@ -191,7 +191,7 @@ int main (int argc, char *argv[]) PrintAttributesIfEnabled (printAttributes); break; case 8: - wifi.SetStandard (WIFI_STANDARD_80211ax_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211ax); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); apDevice = wifi.Install (phy, macAp, wifiApNode.Get (0)); phySta = GetYansWifiPhyPtr (staDevice); @@ -202,7 +202,7 @@ int main (int argc, char *argv[]) PrintAttributesIfEnabled (printAttributes); break; case 9: - wifi.SetStandard (WIFI_STANDARD_80211ax_6GHZ); + wifi.SetStandard (WIFI_STANDARD_80211ax); phy.Set ("ChannelSettings", StringValue ("{0, 0, BAND_6GHZ, 0}")); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); apDevice = wifi.Install (phy, macAp, wifiApNode.Get (0)); @@ -238,7 +238,7 @@ int main (int argc, char *argv[]) PrintAttributesIfEnabled (printAttributes); break; case 12: - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); phy.Set ("ChannelSettings", StringValue ("{44, 20, BAND_5GHZ, 0}")); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); apDevice = wifi.Install (phy, macAp, wifiApNode.Get (0)); @@ -250,7 +250,7 @@ int main (int argc, char *argv[]) PrintAttributesIfEnabled (printAttributes); break; case 13: - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); phy.Set ("ChannelSettings", StringValue ("{44, 0, BAND_5GHZ, 0}")); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); apDevice = wifi.Install (phy, macAp, wifiApNode.Get (0)); @@ -265,7 +265,7 @@ int main (int argc, char *argv[]) PrintAttributesIfEnabled (printAttributes); break; case 14: - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); phy.Set ("ChannelSettings", StringValue ("{44, 0, BAND_5GHZ, 0}")); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); apDevice = wifi.Install (phy, macAp, wifiApNode.Get (0)); @@ -280,7 +280,7 @@ int main (int argc, char *argv[]) break; case 15: Config::SetDefault ("ns3::WifiPhy::ChannelSettings", StringValue ("{44, 0, BAND_5GHZ, 0}")); - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); apDevice = wifi.Install (phy, macAp, wifiApNode.Get (0)); phySta = GetYansWifiPhyPtr (staDevice); @@ -295,7 +295,7 @@ int main (int argc, char *argv[]) case 16: // Test that setting channel number to a non-standard value will throw an exception Config::SetDefault ("ns3::WifiPhy::ChannelSettings", StringValue ("{45, 0, BAND_5GHZ, 0}")); - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); exceptionThrown = false; try { @@ -322,7 +322,7 @@ int main (int argc, char *argv[]) // Test that setting Frequency to a standard value will set the // channel number correctly Config::SetDefault ("ns3::WifiPhy::ChannelSettings", StringValue ("{100, 0, BAND_5GHZ, 0}")); - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); apDevice = wifi.Install (phy, macAp, wifiApNode.Get (0)); phySta = GetYansWifiPhyPtr (staDevice); @@ -334,7 +334,7 @@ int main (int argc, char *argv[]) break; case 18: // Set a wrong channel after initialization - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); apDevice = wifi.Install (phy, macAp, wifiApNode.Get (0)); phySta = GetYansWifiPhyPtr (staDevice); @@ -352,7 +352,7 @@ int main (int argc, char *argv[]) break; case 19: // Test how channel number behaves when frequency is non-standard - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); phy.Set ("ChannelSettings", StringValue ("{44, 0, BAND_5GHZ, 0}")); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); apDevice = wifi.Install (phy, macAp, wifiApNode.Get (0)); @@ -393,7 +393,7 @@ int main (int argc, char *argv[]) case 20: // Set both channel and frequency to consistent values before initialization Config::SetDefault ("ns3::WifiPhy::ChannelSettings", StringValue ("{40, 0, BAND_5GHZ, 0}")); - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); apDevice = wifi.Install (phy, macAp, wifiApNode.Get (0)); phySta = GetYansWifiPhyPtr (staDevice); @@ -401,7 +401,7 @@ int main (int argc, char *argv[]) NS_ASSERT (phySta->GetChannelWidth () == 20); NS_ASSERT (phySta->GetFrequency () == 5200); // Set both channel and frequency to consistent values after initialization - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); apDevice = wifi.Install (phy, macAp, wifiApNode.Get (0)); phySta = GetYansWifiPhyPtr (staDevice); diff --git a/src/wifi/examples/wifi-phy-test.cc b/src/wifi/examples/wifi-phy-test.cc index 8645d04bd..4d3b7405a 100644 --- a/src/wifi/examples/wifi-phy-test.cc +++ b/src/wifi/examples/wifi-phy-test.cc @@ -134,8 +134,8 @@ PsrExperiment::Run (struct PsrExperiment::Input input) tx->SetMobility (posTx); rx->SetMobility (posRx); - tx->ConfigureStandard (WIFI_PHY_STANDARD_80211a); - rx->ConfigureStandard (WIFI_PHY_STANDARD_80211a); + tx->ConfigureStandard (WIFI_STANDARD_80211a); + rx->ConfigureStandard (WIFI_STANDARD_80211a); rx->SetReceiveOkCallback (MakeCallback (&PsrExperiment::Receive, this)); @@ -300,9 +300,9 @@ CollisionExperiment::Run (struct CollisionExperiment::Input input) txB->SetMobility (posTxB); rx->SetMobility (posRx); - txA->ConfigureStandard (WIFI_PHY_STANDARD_80211a); - txB->ConfigureStandard (WIFI_PHY_STANDARD_80211a); - rx->ConfigureStandard (WIFI_PHY_STANDARD_80211a); + txA->ConfigureStandard (WIFI_STANDARD_80211a); + txB->ConfigureStandard (WIFI_STANDARD_80211a); + rx->ConfigureStandard (WIFI_STANDARD_80211a); rx->SetReceiveOkCallback (MakeCallback (&CollisionExperiment::Receive, this)); diff --git a/src/wifi/examples/wifi-test-interference-helper.cc b/src/wifi/examples/wifi-test-interference-helper.cc index 5a7a15f0f..5fc40cbf1 100644 --- a/src/wifi/examples/wifi-test-interference-helper.cc +++ b/src/wifi/examples/wifi-test-interference-helper.cc @@ -96,7 +96,7 @@ public: uint16_t channelB; ///< channel number B uint16_t widthA; ///< channel width A uint16_t widthB; ///< channel width B - WifiPhyStandard standard; ///< standard + WifiStandard standard; ///< standard WifiPhyBand band; ///< band WifiPreamble preamble; ///< preamble bool captureEnabled; ///< whether physical layer capture is enabled @@ -202,7 +202,7 @@ InterferenceExperiment::Input::Input () channelB (36), widthA (20), widthB (20), - standard (WIFI_PHY_STANDARD_80211a), + standard (WIFI_STANDARD_80211a), band (WIFI_PHY_BAND_5GHZ), preamble (WIFI_PREAMBLE_LONG), captureEnabled (false), @@ -343,62 +343,62 @@ int main (int argc, char *argv[]) if (str_standard == "WIFI_PHY_STANDARD_80211a") { - input.standard = WIFI_PHY_STANDARD_80211a; + input.standard = WIFI_STANDARD_80211a; input.band = WIFI_PHY_BAND_5GHZ; } else if (str_standard == "WIFI_PHY_STANDARD_80211b") { - input.standard = WIFI_PHY_STANDARD_80211b; + input.standard = WIFI_STANDARD_80211b; input.band = WIFI_PHY_BAND_2_4GHZ; } else if (str_standard == "WIFI_PHY_STANDARD_80211g") { - input.standard = WIFI_PHY_STANDARD_80211g; + input.standard = WIFI_STANDARD_80211g; input.band = WIFI_PHY_BAND_2_4GHZ; } else if (str_standard == "WIFI_PHY_STANDARD_80211n_2_4GHZ") { - input.standard = WIFI_PHY_STANDARD_80211n; + input.standard = WIFI_STANDARD_80211n; input.band = WIFI_PHY_BAND_2_4GHZ; } else if (str_standard == "WIFI_PHY_STANDARD_80211n_5GHZ") { - input.standard = WIFI_PHY_STANDARD_80211n; + input.standard = WIFI_STANDARD_80211n; input.band = WIFI_PHY_BAND_5GHZ; } else if (str_standard == "WIFI_PHY_STANDARD_80211ac") { - input.standard = WIFI_PHY_STANDARD_80211ac; + input.standard = WIFI_STANDARD_80211ac; input.band = WIFI_PHY_BAND_5GHZ; } else if (str_standard == "WIFI_PHY_STANDARD_80211ax_2_4GHZ") { - input.standard = WIFI_PHY_STANDARD_80211ax; + input.standard = WIFI_STANDARD_80211ax; input.band = WIFI_PHY_BAND_2_4GHZ; } else if (str_standard == "WIFI_PHY_STANDARD_80211ax_5GHZ") { - input.standard = WIFI_PHY_STANDARD_80211ax; + input.standard = WIFI_STANDARD_80211ax; input.band = WIFI_PHY_BAND_5GHZ; } - if (str_preamble == "WIFI_PREAMBLE_LONG" && (input.standard == WIFI_PHY_STANDARD_80211a || input.standard == WIFI_PHY_STANDARD_80211b || input.standard == WIFI_PHY_STANDARD_80211g)) + if (str_preamble == "WIFI_PREAMBLE_LONG" && (input.standard == WIFI_STANDARD_80211a || input.standard == WIFI_STANDARD_80211b || input.standard == WIFI_STANDARD_80211g)) { input.preamble = WIFI_PREAMBLE_LONG; } - else if (str_preamble == "WIFI_PREAMBLE_SHORT" && (input.standard == WIFI_PHY_STANDARD_80211b || input.standard == WIFI_PHY_STANDARD_80211g)) + else if (str_preamble == "WIFI_PREAMBLE_SHORT" && (input.standard == WIFI_STANDARD_80211b || input.standard == WIFI_STANDARD_80211g)) { input.preamble = WIFI_PREAMBLE_SHORT; } - else if (str_preamble == "WIFI_PREAMBLE_HT_MF" && input.standard == WIFI_PHY_STANDARD_80211n) + else if (str_preamble == "WIFI_PREAMBLE_HT_MF" && input.standard == WIFI_STANDARD_80211n) { input.preamble = WIFI_PREAMBLE_HT_MF; } - else if (str_preamble == "WIFI_PREAMBLE_VHT_SU" && input.standard == WIFI_PHY_STANDARD_80211ac) + else if (str_preamble == "WIFI_PREAMBLE_VHT_SU" && input.standard == WIFI_STANDARD_80211ac) { input.preamble = WIFI_PREAMBLE_VHT_SU; } - else if (str_preamble == "WIFI_PREAMBLE_HE_SU" && input.standard == WIFI_PHY_STANDARD_80211ax) + else if (str_preamble == "WIFI_PREAMBLE_HE_SU" && input.standard == WIFI_STANDARD_80211ax) { input.preamble = WIFI_PREAMBLE_HE_SU; } diff --git a/src/wifi/examples/wifi-trans-example.cc b/src/wifi/examples/wifi-trans-example.cc index 4a8de9aad..023094922 100644 --- a/src/wifi/examples/wifi-trans-example.cc +++ b/src/wifi/examples/wifi-trans-example.cc @@ -114,7 +114,7 @@ int main (int argc, char** argv) } else if (standard == "11n_2_4GHZ") { - wifi.SetStandard (WIFI_STANDARD_80211n_2_4GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); ssid = Ssid ("ns380211n_2_4GHZ"); dataRate = "HtMcs0"; freq = 2402 + (bw / 2); //so as to have 2412/2422 for 20/40 @@ -128,7 +128,7 @@ int main (int argc, char** argv) } else if (standard == "11n_5GHZ") { - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); ssid = Ssid ("ns380211n_5GHZ"); dataRate = "HtMcs0"; freq = 5170 + (bw / 2); //so as to have 5180/5190 for 20/40 @@ -155,7 +155,7 @@ int main (int argc, char** argv) } else if (standard == "11ax_2_4GHZ") { - wifi.SetStandard (WIFI_STANDARD_80211ax_2_4GHZ); + wifi.SetStandard (WIFI_STANDARD_80211ax); ssid = Ssid ("ns380211ax_2_4GHZ"); dataRate = "HeMcs0"; freq = 2402 + (bw / 2); //so as to have 2412/2422/2442 for 20/40/80 @@ -169,7 +169,7 @@ int main (int argc, char** argv) } else if (standard == "11ax_5GHZ") { - wifi.SetStandard (WIFI_STANDARD_80211ax_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211ax); ssid = Ssid ("ns380211ax_5GHZ"); dataRate = "HeMcs0"; freq = 5170 + (bw / 2); //so as to have 5180/5190/5210/5250 for 20/40/80/160 diff --git a/src/wifi/helper/wifi-helper.cc b/src/wifi/helper/wifi-helper.cc index 8b3752446..21d6b8bff 100644 --- a/src/wifi/helper/wifi-helper.cc +++ b/src/wifi/helper/wifi-helper.cc @@ -794,18 +794,17 @@ WifiHelper::Install (const WifiPhyHelper &phyHelper, Ptr node = *i; Ptr device = CreateObject (); device->SetStandard (m_standard); - auto it = wifiStandards.find (m_standard); - if (it == wifiStandards.end ()) + if (m_standard == WIFI_STANDARD_UNSPECIFIED) { - NS_FATAL_ERROR ("Selected standard is not defined!"); + NS_FATAL_ERROR ("No standard specified!"); return devices; } - if (it->second.phyStandard >= WIFI_PHY_STANDARD_80211n) + if (m_standard >= WIFI_STANDARD_80211n) { Ptr htConfiguration = CreateObject (); device->SetHtConfiguration (htConfiguration); } - if (it->second.phyStandard >= WIFI_PHY_STANDARD_80211ac) + if (m_standard >= WIFI_STANDARD_80211ac) { // Create the VHT Configuration object even if the PHY band is 2.4GHz // (WifiNetDevice::GetVhtConfiguration() checks the PHY band being used). @@ -815,20 +814,20 @@ WifiHelper::Install (const WifiPhyHelper &phyHelper, Ptr vhtConfiguration = CreateObject (); device->SetVhtConfiguration (vhtConfiguration); } - if (it->second.phyStandard >= WIFI_PHY_STANDARD_80211ax) + if (m_standard >= WIFI_STANDARD_80211ax) { Ptr heConfiguration = CreateObject (); device->SetHeConfiguration (heConfiguration); } Ptr manager = m_stationManager.Create (); Ptr phy = phyHelper.Create (node, device); - phy->ConfigureStandard (it->second.phyStandard); + phy->ConfigureStandard (m_standard); device->SetPhy (phy); Ptr mac = macHelper.Create (device, m_standard); device->SetMac (mac); device->SetRemoteStationManager (manager); node->AddDevice (device); - if ((it->second.phyStandard >= WIFI_PHY_STANDARD_80211ax) && (m_obssPdAlgorithm.IsTypeIdSet ())) + if ((m_standard >= WIFI_STANDARD_80211ax) && (m_obssPdAlgorithm.IsTypeIdSet ())) { Ptr obssPdAlgorithm = m_obssPdAlgorithm.Create (); device->AggregateObject (obssPdAlgorithm); diff --git a/src/wifi/helper/wifi-mac-helper.cc b/src/wifi/helper/wifi-mac-helper.cc index 53d503588..889beb187 100644 --- a/src/wifi/helper/wifi-mac-helper.cc +++ b/src/wifi/helper/wifi-mac-helper.cc @@ -44,12 +44,11 @@ WifiMacHelper::~WifiMacHelper () Ptr WifiMacHelper::Create (Ptr device, WifiStandard standard) const { - auto standardIt = wifiStandards.find (standard); - NS_ABORT_MSG_IF (standardIt == wifiStandards.end (), "Selected standard is not defined!"); + NS_ABORT_MSG_IF (standard == WIFI_STANDARD_UNSPECIFIED, "No standard specified!"); // this is a const method, but we need to force the correct QoS setting ObjectFactory macObjectFactory = m_mac; - if (standard >= WIFI_STANDARD_80211n_2_4GHZ) + if (standard >= WIFI_STANDARD_80211n) { macObjectFactory.Set ("QosSupported", BooleanValue (true)); } @@ -74,7 +73,7 @@ WifiMacHelper::Create (Ptr device, WifiStandard standard) const // create and install the Multi User Scheduler if this is an HE AP Ptr apMac = DynamicCast (mac); - if (apMac != nullptr && standardIt->second.macStandard >= WIFI_MAC_STANDARD_80211ax + if (apMac != nullptr && standard >= WIFI_STANDARD_80211ax && m_muScheduler.IsTypeIdSet ()) { Ptr muScheduler = m_muScheduler.Create (); diff --git a/src/wifi/model/regular-wifi-mac.cc b/src/wifi/model/regular-wifi-mac.cc index 09425a8b7..030f63dfb 100644 --- a/src/wifi/model/regular-wifi-mac.cc +++ b/src/wifi/model/regular-wifi-mac.cc @@ -119,7 +119,7 @@ RegularWifiMac::SetupFrameExchangeManager (WifiStandard standard) NS_LOG_FUNCTION (this); NS_ABORT_MSG_IF (standard == WIFI_STANDARD_UNSPECIFIED, "Wifi standard not set"); - if (standard >= WIFI_STANDARD_80211ax_2_4GHZ) + if (standard >= WIFI_STANDARD_80211ax) { m_feManager = CreateObject (); } @@ -127,7 +127,7 @@ RegularWifiMac::SetupFrameExchangeManager (WifiStandard standard) { m_feManager = CreateObject (); } - else if (standard >= WIFI_STANDARD_80211n_2_4GHZ) + else if (standard >= WIFI_STANDARD_80211n) { m_feManager = CreateObject (); } @@ -1147,8 +1147,7 @@ RegularWifiMac::ConfigureStandard (WifiStandard standard) { NS_LOG_FUNCTION (this << standard); - NS_ABORT_IF (standard >= WIFI_STANDARD_80211n_2_4GHZ && !m_qosSupported); - SetDsssSupported (standard == WIFI_STANDARD_80211b); + NS_ABORT_IF (standard >= WIFI_STANDARD_80211n && !m_qosSupported); SetupFrameExchangeManager (standard); } @@ -1176,45 +1175,26 @@ RegularWifiMac::ConfigurePhyDependentParameters (void) uint32_t cwmin = 0; uint32_t cwmax = 0; - // NOTE the distinction between wifi standard and wifi PHY standard will be removed soon... - NS_ASSERT (m_phy != 0); - WifiPhyStandard phyStandard = m_phy->GetPhyStandard (); - auto standardIt = std::find_if (wifiStandards.cbegin (), wifiStandards.cend (), - [&phyStandard, &band](auto& pair) - { - return (pair.second.phyStandard == phyStandard - && pair.second.phyBand == band); - }); - NS_ASSERT (standardIt != wifiStandards.cend ()); - switch (standardIt->first) + NS_ASSERT (m_phy != 0); + WifiStandard standard = m_phy->GetStandard (); + + if (standard == WIFI_STANDARD_80211b) { - case WIFI_STANDARD_80211n_5GHZ: - case WIFI_STANDARD_80211ac: - case WIFI_STANDARD_80211ax_5GHZ: - case WIFI_STANDARD_80211ax_6GHZ: - { - cwmin = 15; - cwmax = 1023; - break; - } - case WIFI_STANDARD_80211ax_2_4GHZ: - case WIFI_STANDARD_80211n_2_4GHZ: - case WIFI_STANDARD_80211g: - SetErpSupported (true); - case WIFI_STANDARD_80211a: - case WIFI_STANDARD_80211p: - cwmin = 15; - cwmax = 1023; - break; - case WIFI_STANDARD_80211b: + SetDsssSupported (true); cwmin = 31; cwmax = 1023; - break; - default: - NS_FATAL_ERROR ("Unsupported WifiPhyStandard in RegularWifiMac::FinishConfigureStandard ()"); + return; } + if (standard >= WIFI_STANDARD_80211g && band == WIFI_PHY_BAND_2_4GHZ) + { + SetErpSupported (true); + } + + cwmin = 15; + cwmax = 1023; + ConfigureContentionWindow (cwmin, cwmax); } diff --git a/src/wifi/model/spectrum-wifi-phy.cc b/src/wifi/model/spectrum-wifi-phy.cc index 9af872e6e..c24b1ac09 100644 --- a/src/wifi/model/spectrum-wifi-phy.cc +++ b/src/wifi/model/spectrum-wifi-phy.cc @@ -161,7 +161,7 @@ SpectrumWifiPhy::UpdateInterferenceHelperBands (void) } } } - if (GetPhyStandard () >= WIFI_PHY_STANDARD_80211ax) + if (GetStandard () >= WIFI_STANDARD_80211ax) { // For a given RU type, some RUs over a channel occupy the same tones as // the corresponding RUs over a subchannel, while some others not. For instance, @@ -305,7 +305,7 @@ SpectrumWifiPhy::StartRx (Ptr rxParams) NS_LOG_DEBUG ("Signal power received after antenna gain for 20 MHz channel band " << +i << ": " << rxPowerPerBandW << " W (" << WToDbm (rxPowerPerBandW) << " dBm)"); } - if (GetPhyStandard () >= WIFI_PHY_STANDARD_80211ax) + if (GetStandard () >= WIFI_STANDARD_80211ax) { NS_ASSERT (!m_ruBands[channelWidth].empty ()); for (const auto& bandRuPair : m_ruBands[channelWidth]) @@ -431,17 +431,17 @@ uint32_t SpectrumWifiPhy::GetBandBandwidth (void) const { uint32_t bandBandwidth = 0; - switch (GetPhyStandard ()) + switch (GetStandard ()) { - case WIFI_PHY_STANDARD_80211a: - case WIFI_PHY_STANDARD_80211g: - case WIFI_PHY_STANDARD_80211b: - case WIFI_PHY_STANDARD_80211n: - case WIFI_PHY_STANDARD_80211ac: + case WIFI_STANDARD_80211a: + case WIFI_STANDARD_80211g: + case WIFI_STANDARD_80211b: + case WIFI_STANDARD_80211n: + case WIFI_STANDARD_80211ac: // Use OFDM subcarrier width of 312.5 KHz as band granularity bandBandwidth = 312500; break; - case WIFI_PHY_STANDARD_80211p: + case WIFI_STANDARD_80211p: if (GetChannelWidth () == 5) { // Use OFDM subcarrier width of 78.125 KHz as band granularity @@ -453,12 +453,12 @@ SpectrumWifiPhy::GetBandBandwidth (void) const bandBandwidth = 156250; } break; - case WIFI_PHY_STANDARD_80211ax: + case WIFI_STANDARD_80211ax: // Use OFDM subcarrier width of 78.125 KHz as band granularity bandBandwidth = 78125; break; default: - NS_FATAL_ERROR ("Standard unknown: " << GetPhyStandard ()); + NS_FATAL_ERROR ("Standard unknown: " << GetStandard ()); break; } return bandBandwidth; diff --git a/src/wifi/model/wifi-net-device.cc b/src/wifi/model/wifi-net-device.cc index 7d6ce9643..c6b483ba3 100644 --- a/src/wifi/model/wifi-net-device.cc +++ b/src/wifi/model/wifi-net-device.cc @@ -469,7 +469,7 @@ WifiNetDevice::SetHtConfiguration (Ptr htConfiguration) Ptr WifiNetDevice::GetHtConfiguration (void) const { - return (m_standard >= WIFI_STANDARD_80211n_2_4GHZ ? m_htConfiguration : nullptr); + return (m_standard >= WIFI_STANDARD_80211n ? m_htConfiguration : nullptr); } void @@ -494,7 +494,7 @@ WifiNetDevice::SetHeConfiguration (Ptr heConfiguration) Ptr WifiNetDevice::GetHeConfiguration (void) const { - return (m_standard >= WIFI_STANDARD_80211ax_2_4GHZ ? m_heConfiguration : nullptr); + return (m_standard >= WIFI_STANDARD_80211ax ? m_heConfiguration : nullptr); } } //namespace ns3 diff --git a/src/wifi/model/wifi-phy-operating-channel.cc b/src/wifi/model/wifi-phy-operating-channel.cc index 599585aa6..6b082a01d 100644 --- a/src/wifi/model/wifi-phy-operating-channel.cc +++ b/src/wifi/model/wifi-phy-operating-channel.cc @@ -284,7 +284,7 @@ WifiPhyOperatingChannel::IsSet (void) const void WifiPhyOperatingChannel::Set (uint8_t number, uint16_t frequency, uint16_t width, - WifiPhyStandard standard, WifiPhyBand band) + WifiStandard standard, WifiPhyBand band) { NS_LOG_FUNCTION (this << +number << frequency << width << standard << band); @@ -305,7 +305,7 @@ WifiPhyOperatingChannel::Set (uint8_t number, uint16_t frequency, uint16_t width } void -WifiPhyOperatingChannel::SetDefault (uint16_t width, WifiPhyStandard standard, WifiPhyBand band) +WifiPhyOperatingChannel::SetDefault (uint16_t width, WifiStandard standard, WifiPhyBand band) { NS_LOG_FUNCTION (this << width << standard << band); @@ -313,7 +313,7 @@ WifiPhyOperatingChannel::SetDefault (uint16_t width, WifiPhyStandard standard, W } uint8_t -WifiPhyOperatingChannel::GetDefaultChannelNumber (uint16_t width, WifiPhyStandard standard, WifiPhyBand band) +WifiPhyOperatingChannel::GetDefaultChannelNumber (uint16_t width, WifiStandard standard, WifiPhyBand band) { auto channelIt = FindFirst (0, 0, width, standard, band); @@ -329,7 +329,7 @@ WifiPhyOperatingChannel::GetDefaultChannelNumber (uint16_t width, WifiPhyStandar WifiPhyOperatingChannel::ConstIterator WifiPhyOperatingChannel::FindFirst (uint8_t number, uint16_t frequency, uint16_t width, - WifiPhyStandard standard, WifiPhyBand band, + WifiStandard standard, WifiPhyBand band, ConstIterator start) { // lambda used to match channels against the specified criteria diff --git a/src/wifi/model/wifi-phy-operating-channel.h b/src/wifi/model/wifi-phy-operating-channel.h index aefe0a71a..55bb17744 100644 --- a/src/wifi/model/wifi-phy-operating-channel.h +++ b/src/wifi/model/wifi-phy-operating-channel.h @@ -68,32 +68,32 @@ public: * \param number the channel number (use 0 to leave it unspecified) * \param frequency the channel center frequency in MHz (use 0 to leave it unspecified) * \param width the channel width in MHz (use 0 to leave it unspecified) - * \param standard the PHY standard + * \param standard the standard * \param band the PHY band */ void Set (uint8_t number, uint16_t frequency, uint16_t width, - WifiPhyStandard standard, WifiPhyBand band); + WifiStandard standard, WifiPhyBand band); /** - * Set the default channel of the given width and for the given PHY standard and band. + * Set the default channel of the given width and for the given standard and band. * If the channel width is a multiple of 20 MHz, the primary 20 MHz channel * is set to the 20 MHz subchannel with the lowest center frequency. * * \param width the channel width in MHz - * \param standard the PHY standard + * \param standard the standard * \param band the PHY band */ - void SetDefault (uint16_t width, WifiPhyStandard standard, WifiPhyBand band); + void SetDefault (uint16_t width, WifiStandard standard, WifiPhyBand band); /** - * Get the default channel number of the given width and for the given PHY standard + * Get the default channel number of the given width and for the given standard * and band. * * \param width the channel width in MHz - * \param standard the PHY standard + * \param standard the standard * \param band the PHY band * \return the default channel number */ - static uint8_t GetDefaultChannelNumber (uint16_t width, WifiPhyStandard standard, WifiPhyBand band); + static uint8_t GetDefaultChannelNumber (uint16_t width, WifiStandard standard, WifiPhyBand band); /** * Return the channel number identifying the whole operating channel. @@ -147,14 +147,14 @@ public: * \param number the channel number (use 0 to leave it unspecified) * \param frequency the channel center frequency in MHz (use 0 to leave it unspecified) * \param width the channel width in MHz (use 0 to leave it unspecified) - * \param standard the PHY standard + * \param standard the standard * \param band the PHY band * \param start an iterator pointing to the channel to start the search with * \return an iterator pointing to the found channel, if any, or to past-the-end * of the set of available channels */ static ConstIterator FindFirst (uint8_t number, uint16_t frequency, uint16_t width, - WifiPhyStandard standard, WifiPhyBand band, + WifiStandard standard, WifiPhyBand band, ConstIterator start = m_frequencyChannels.begin ()); private: diff --git a/src/wifi/model/wifi-phy.cc b/src/wifi/model/wifi-phy.cc index bc3850b59..32045b0a7 100644 --- a/src/wifi/model/wifi-phy.cc +++ b/src/wifi/model/wifi-phy.cc @@ -310,7 +310,7 @@ WifiPhy::WifiPhy () m_endTxEvent (), m_currentEvent (0), m_previouslyRxPpduUid (UINT64_MAX), - m_standard (WIFI_PHY_STANDARD_UNSPECIFIED), + m_standard (WIFI_STANDARD_UNSPECIFIED), m_band (WIFI_PHY_BAND_UNSPECIFIED), m_initialFrequency (0), m_initialChannelNumber (0), @@ -819,7 +819,7 @@ WifiPhy::Configure80211ax (void) } void -WifiPhy::ConfigureStandardAndBand (WifiPhyStandard standard, WifiPhyBand band) +WifiPhy::ConfigureStandardAndBand (WifiStandard standard, WifiPhyBand band) { NS_LOG_FUNCTION (this << standard << band); m_standard = standard; @@ -845,28 +845,28 @@ WifiPhy::ConfigureStandardAndBand (WifiPhyStandard standard, WifiPhyBand band) switch (standard) { - case WIFI_PHY_STANDARD_80211a: + case WIFI_STANDARD_80211a: Configure80211a (); break; - case WIFI_PHY_STANDARD_80211b: + case WIFI_STANDARD_80211b: Configure80211b (); break; - case WIFI_PHY_STANDARD_80211g: + case WIFI_STANDARD_80211g: Configure80211g (); break; - case WIFI_PHY_STANDARD_80211p: + case WIFI_STANDARD_80211p: Configure80211p (); break; - case WIFI_PHY_STANDARD_80211n: + case WIFI_STANDARD_80211n: Configure80211n (); break; - case WIFI_PHY_STANDARD_80211ac: + case WIFI_STANDARD_80211ac: Configure80211ac (); break; - case WIFI_PHY_STANDARD_80211ax: + case WIFI_STANDARD_80211ax: Configure80211ax (); break; - case WIFI_PHY_STANDARD_UNSPECIFIED: + case WIFI_STANDARD_UNSPECIFIED: default: NS_ASSERT_MSG (false, "Unsupported standard"); break; @@ -874,11 +874,11 @@ WifiPhy::ConfigureStandardAndBand (WifiPhyStandard standard, WifiPhyBand band) } void -WifiPhy::ConfigureStandard (WifiPhyStandard standard) +WifiPhy::ConfigureStandard (WifiStandard standard) { NS_LOG_FUNCTION (this << standard); - NS_ABORT_MSG_IF (m_standard != WIFI_PHY_STANDARD_UNSPECIFIED && standard != m_standard, + NS_ABORT_MSG_IF (m_standard != WIFI_STANDARD_UNSPECIFIED && standard != m_standard, "Cannot change standard"); m_standard = standard; @@ -897,28 +897,28 @@ WifiPhy::ConfigureStandard (WifiPhyStandard standard) switch (standard) { - case WIFI_PHY_STANDARD_80211a: + case WIFI_STANDARD_80211a: Configure80211a (); break; - case WIFI_PHY_STANDARD_80211b: + case WIFI_STANDARD_80211b: Configure80211b (); break; - case WIFI_PHY_STANDARD_80211g: + case WIFI_STANDARD_80211g: Configure80211g (); break; - case WIFI_PHY_STANDARD_80211p: + case WIFI_STANDARD_80211p: Configure80211p (); break; - case WIFI_PHY_STANDARD_80211n: + case WIFI_STANDARD_80211n: Configure80211n (); break; - case WIFI_PHY_STANDARD_80211ac: + case WIFI_STANDARD_80211ac: Configure80211ac (); break; - case WIFI_PHY_STANDARD_80211ax: + case WIFI_STANDARD_80211ax: Configure80211ax (); break; - case WIFI_PHY_STANDARD_UNSPECIFIED: + case WIFI_STANDARD_UNSPECIFIED: default: NS_ASSERT_MSG (false, "Unsupported standard"); break; @@ -932,8 +932,8 @@ WifiPhy::GetPhyBand (void) const } -WifiPhyStandard -WifiPhy::GetPhyStandard (void) const +WifiStandard +WifiPhy::GetStandard (void) const { return m_standard; } @@ -1117,7 +1117,7 @@ WifiPhy::SetOperatingChannel (const ChannelTuple& channelTuple) m_channelSettings = channelTuple; - if (m_standard == WIFI_PHY_STANDARD_UNSPECIFIED) + if (m_standard == WIFI_STANDARD_UNSPECIFIED) { NS_LOG_DEBUG ("Channel information will be applied when a standard is configured"); return; diff --git a/src/wifi/model/wifi-phy.h b/src/wifi/model/wifi-phy.h index 9cad5677f..6e3ff8d07 100644 --- a/src/wifi/model/wifi-phy.h +++ b/src/wifi/model/wifi-phy.h @@ -511,21 +511,21 @@ public: * \param band the Wi-Fi band */ NS_DEPRECATED_3_35 - virtual void ConfigureStandardAndBand (WifiPhyStandard standard, WifiPhyBand band); + virtual void ConfigureStandardAndBand (WifiStandard standard, WifiPhyBand band); /** * Configure the PHY-level parameters for different Wi-Fi standard. * * \param standard the Wi-Fi standard */ - virtual void ConfigureStandard (WifiPhyStandard standard); + virtual void ConfigureStandard (WifiStandard standard); /** * Get the configured Wi-Fi standard * * \return the Wi-Fi standard that has been configured */ - WifiPhyStandard GetPhyStandard (void) const; + WifiStandard GetStandard (void) const; /** * Get the configured Wi-Fi band @@ -1418,7 +1418,7 @@ private: */ static std::map > & GetStaticPhyEntities (void); - WifiPhyStandard m_standard; //!< WifiPhyStandard + WifiStandard m_standard; //!< WifiStandard WifiPhyBand m_band; //!< WifiPhyBand uint16_t m_initialFrequency; //!< Store frequency until initialization (MHz) uint8_t m_initialChannelNumber; //!< Store channel number until initialization diff --git a/src/wifi/model/wifi-standards.h b/src/wifi/model/wifi-standards.h index 0c94bd970..29580fe12 100644 --- a/src/wifi/model/wifi-standards.h +++ b/src/wifi/model/wifi-standards.h @@ -22,6 +22,7 @@ #define WIFI_STANDARD_H #include +#include #include "wifi-phy-band.h" #include "ns3/abort.h" @@ -29,98 +30,7 @@ namespace ns3 { /** * \ingroup wifi - * Identifies the PHY specification that a Wifi device is configured to use. - */ -enum WifiPhyStandard -{ - /** OFDM PHY (Clause 17) */ - WIFI_PHY_STANDARD_80211a, - /** DSSS PHY (Clause 15) and HR/DSSS PHY (Clause 18) */ - WIFI_PHY_STANDARD_80211b, - /** ERP-OFDM PHY (Clause 19, Section 19.5) */ - WIFI_PHY_STANDARD_80211g, - /** OFDM PHY (Clause 17 - amendment for 10 MHz and 5 MHz channels) */ - WIFI_PHY_STANDARD_80211p, - /** HT PHY (clause 20) */ - WIFI_PHY_STANDARD_80211n, - /** VHT PHY (clause 22) */ - WIFI_PHY_STANDARD_80211ac, - /** HE PHY (clause 26) */ - WIFI_PHY_STANDARD_80211ax, - /** Unspecified */ - WIFI_PHY_STANDARD_UNSPECIFIED -}; - -/** -* \brief Stream insertion operator. -* -* \param os the stream -* \param standard the PHY standard -* \returns a reference to the stream -*/ -inline std::ostream& operator<< (std::ostream& os, WifiPhyStandard standard) -{ - switch (standard) - { - case WIFI_PHY_STANDARD_80211a: - return (os << "802.11a"); - case WIFI_PHY_STANDARD_80211b: - return (os << "802.11b"); - case WIFI_PHY_STANDARD_80211g: - return (os << "802.11g"); - case WIFI_PHY_STANDARD_80211p: - return (os << "802.11p"); - case WIFI_PHY_STANDARD_80211n: - return (os << "802.11n"); - case WIFI_PHY_STANDARD_80211ac: - return (os << "802.11ac"); - case WIFI_PHY_STANDARD_80211ax: - return (os << "802.11ax"); - case WIFI_PHY_STANDARD_UNSPECIFIED: - default: - return (os << "UNSPECIFIED"); - } -} - -/** - * \ingroup wifi - * Identifies the MAC specification that a Wifi device is configured to use. - */ -enum WifiMacStandard -{ - WIFI_MAC_STANDARD_80211, - WIFI_MAC_STANDARD_80211n, - WIFI_MAC_STANDARD_80211ac, - WIFI_MAC_STANDARD_80211ax -}; - -/** -* \brief Stream insertion operator. -* -* \param os the stream -* \param standard the MAC standard -* \returns a reference to the stream -*/ -inline std::ostream& operator<< (std::ostream& os, WifiMacStandard standard) -{ - switch (standard) - { - case WIFI_MAC_STANDARD_80211: - return (os << "802.11"); - case WIFI_MAC_STANDARD_80211n: - return (os << "802.11n"); - case WIFI_MAC_STANDARD_80211ac: - return (os << "802.11ac"); - case WIFI_MAC_STANDARD_80211ax: - return (os << "802.11ax"); - default: - return (os << "UNSPECIFIED"); - } -} - -/** - * \ingroup wifi - * Identifies the allowed configurations that a Wifi device is configured to use. + * Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use. */ enum WifiStandard { @@ -129,12 +39,9 @@ enum WifiStandard WIFI_STANDARD_80211b, WIFI_STANDARD_80211g, WIFI_STANDARD_80211p, - WIFI_STANDARD_80211n_2_4GHZ, - WIFI_STANDARD_80211n_5GHZ, + WIFI_STANDARD_80211n, WIFI_STANDARD_80211ac, - WIFI_STANDARD_80211ax_2_4GHZ, - WIFI_STANDARD_80211ax_5GHZ, - WIFI_STANDARD_80211ax_6GHZ + WIFI_STANDARD_80211ax }; /** @@ -156,48 +63,30 @@ inline std::ostream& operator<< (std::ostream& os, WifiStandard standard) return (os << "802.11g"); case WIFI_STANDARD_80211p: return (os << "802.11p"); - case WIFI_STANDARD_80211n_2_4GHZ: - return (os << "802.11n-2.4GHz"); - case WIFI_STANDARD_80211n_5GHZ: - return (os << "802.11n-5GHz"); + case WIFI_STANDARD_80211n: + return (os << "802.11n"); case WIFI_STANDARD_80211ac: return (os << "802.11ac"); - case WIFI_STANDARD_80211ax_2_4GHZ: - return (os << "802.11ax-2.4GHz"); - case WIFI_STANDARD_80211ax_5GHZ: - return (os << "802.11ax-5GHz"); - case WIFI_STANDARD_80211ax_6GHZ: - return (os << "802.11ax-6GHz"); + case WIFI_STANDARD_80211ax: + return (os << "802.11ax"); default: return (os << "UNSPECIFIED"); } } -/** - * \brief hold PHY and MAC information based on the selected standard. - */ -struct WifiStandardInfo -{ - WifiPhyStandard phyStandard; //!< the PHY standard - WifiPhyBand phyBand; //!< the PHY band - WifiMacStandard macStandard; //!< the MAC standard -}; /** - * \brief map a given standard configured by the user to the corresponding WifiStandardInfo + * \brief map a given standard configured by the user to the allowed PHY bands */ -const std::map wifiStandards = +const std::map> wifiStandards = { - { WIFI_STANDARD_80211a, { WIFI_PHY_STANDARD_80211a, WIFI_PHY_BAND_5GHZ, WIFI_MAC_STANDARD_80211 } }, - { WIFI_STANDARD_80211b, { WIFI_PHY_STANDARD_80211b, WIFI_PHY_BAND_2_4GHZ, WIFI_MAC_STANDARD_80211 } }, - { WIFI_STANDARD_80211g, { WIFI_PHY_STANDARD_80211g, WIFI_PHY_BAND_2_4GHZ, WIFI_MAC_STANDARD_80211 } }, - { WIFI_STANDARD_80211p, { WIFI_PHY_STANDARD_80211p, WIFI_PHY_BAND_5GHZ, WIFI_MAC_STANDARD_80211 } }, - { WIFI_STANDARD_80211n_2_4GHZ, { WIFI_PHY_STANDARD_80211n, WIFI_PHY_BAND_2_4GHZ, WIFI_MAC_STANDARD_80211n } }, - { WIFI_STANDARD_80211n_5GHZ, { WIFI_PHY_STANDARD_80211n, WIFI_PHY_BAND_5GHZ, WIFI_MAC_STANDARD_80211n } }, - { WIFI_STANDARD_80211ac, { WIFI_PHY_STANDARD_80211ac, WIFI_PHY_BAND_5GHZ, WIFI_MAC_STANDARD_80211ac } }, - { WIFI_STANDARD_80211ax_2_4GHZ, { WIFI_PHY_STANDARD_80211ax, WIFI_PHY_BAND_2_4GHZ, WIFI_MAC_STANDARD_80211ax } }, - { WIFI_STANDARD_80211ax_5GHZ, { WIFI_PHY_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ, WIFI_MAC_STANDARD_80211ax } }, - { WIFI_STANDARD_80211ax_6GHZ, { WIFI_PHY_STANDARD_80211ax, WIFI_PHY_BAND_6GHZ, WIFI_MAC_STANDARD_80211ax } } + { 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_80211ax, { WIFI_PHY_BAND_2_4GHZ, WIFI_PHY_BAND_5GHZ, WIFI_PHY_BAND_6GHZ } } }; /** @@ -212,18 +101,18 @@ enum FrequencyChannelType : uint8_t }; /** - * Get the type of the frequency channel for the given PHY standard + * Get the type of the frequency channel for the given standard * - * \param standard the PHY standard - * \return the type of the frequency channel for the given PHY standard + * \param standard the standard + * \return the type of the frequency channel for the given standard */ -inline FrequencyChannelType GetFrequencyChannelType (WifiPhyStandard standard) +inline FrequencyChannelType GetFrequencyChannelType (WifiStandard standard) { switch (standard) { - case WIFI_PHY_STANDARD_80211b: + case WIFI_STANDARD_80211b: return WIFI_PHY_DSSS_CHANNEL; - case WIFI_PHY_STANDARD_80211p: + case WIFI_STANDARD_80211p: return WIFI_PHY_80211p_CHANNEL; default: return WIFI_PHY_OFDM_CHANNEL; @@ -231,26 +120,26 @@ inline FrequencyChannelType GetFrequencyChannelType (WifiPhyStandard standard) } /** - * Get the maximum channel width in MHz allowed for the given PHY standard. + * Get the maximum channel width in MHz allowed for the given standard. * - * \param standard the PHY standard - * \return the maximum channel width in MHz allowed for the given PHY standard + * \param standard the standard + * \return the maximum channel width in MHz allowed for the given standard */ -inline uint16_t GetMaximumChannelWidth (WifiPhyStandard standard) +inline uint16_t GetMaximumChannelWidth (WifiStandard standard) { switch (standard) { - case WIFI_PHY_STANDARD_80211b: + case WIFI_STANDARD_80211b: return 22; - case WIFI_PHY_STANDARD_80211p: + case WIFI_STANDARD_80211p: return 10; - case WIFI_PHY_STANDARD_80211a: - case WIFI_PHY_STANDARD_80211g: + case WIFI_STANDARD_80211a: + case WIFI_STANDARD_80211g: return 20; - case WIFI_PHY_STANDARD_80211n: + case WIFI_STANDARD_80211n: return 40; - case WIFI_PHY_STANDARD_80211ac: - case WIFI_PHY_STANDARD_80211ax: + case WIFI_STANDARD_80211ac: + case WIFI_STANDARD_80211ax: return 160; default: NS_ABORT_MSG ("Unknown standard: " << standard); @@ -261,21 +150,21 @@ inline uint16_t GetMaximumChannelWidth (WifiPhyStandard standard) /** * Get the default channel width for the given PHY standard and band. * - * \param standard the given PHY standard + * \param standard the given standard * \param band the given PHY band - * \return the default channel width (MHz) for the given PHY standard + * \return the default channel width (MHz) for the given standard */ -inline uint16_t GetDefaultChannelWidth (WifiPhyStandard standard, WifiPhyBand band) +inline uint16_t GetDefaultChannelWidth (WifiStandard standard, WifiPhyBand band) { switch (standard) { - case WIFI_PHY_STANDARD_80211b: + case WIFI_STANDARD_80211b: return 22; - case WIFI_PHY_STANDARD_80211p: + case WIFI_STANDARD_80211p: return 10; - case WIFI_PHY_STANDARD_80211ac: + case WIFI_STANDARD_80211ac: return 80; - case WIFI_PHY_STANDARD_80211ax: + case WIFI_STANDARD_80211ax: return (band == WIFI_PHY_BAND_2_4GHZ ? 20 : 80); default: return 20; @@ -283,19 +172,19 @@ inline uint16_t GetDefaultChannelWidth (WifiPhyStandard standard, WifiPhyBand ba } /** - * Get the default PHY band for the given PHY standard. + * Get the default PHY band for the given standard. * - * \param standard the given PHY standard - * \return the default PHY band for the given PHY standard + * \param standard the given standard + * \return the default PHY band for the given standard */ -inline WifiPhyBand GetDefaultPhyBand (WifiPhyStandard standard) +inline WifiPhyBand GetDefaultPhyBand (WifiStandard standard) { switch (standard) { - case WIFI_PHY_STANDARD_80211p: - case WIFI_PHY_STANDARD_80211a: - case WIFI_PHY_STANDARD_80211ac: - case WIFI_PHY_STANDARD_80211ax: + case WIFI_STANDARD_80211p: + case WIFI_STANDARD_80211a: + case WIFI_STANDARD_80211ac: + case WIFI_STANDARD_80211ax: return WIFI_PHY_BAND_5GHZ; default: return WIFI_PHY_BAND_2_4GHZ; diff --git a/src/wifi/test/block-ack-test-suite.cc b/src/wifi/test/block-ack-test-suite.cc index 9817103ec..9d6ac5d5e 100644 --- a/src/wifi/test/block-ack-test-suite.cc +++ b/src/wifi/test/block-ack-test-suite.cc @@ -1495,7 +1495,7 @@ BlockAckAggregationDisabledTest::DoRun (void) phy.SetChannel (channel.Create ()); WifiHelper wifi; - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); Config::SetDefault ("ns3::WifiDefaultAckManager::BaThreshold", DoubleValue (0.125)); wifi.SetRemoteStationManager ("ns3::IdealWifiManager"); diff --git a/src/wifi/test/inter-bss-test-suite.cc b/src/wifi/test/inter-bss-test-suite.cc index 1f3d97625..c4507a77d 100644 --- a/src/wifi/test/inter-bss-test-suite.cc +++ b/src/wifi/test/inter-bss-test-suite.cc @@ -572,7 +572,7 @@ TestInterBssConstantObssPdAlgo::RunOne (void) phy.Set ("ChannelSettings", StringValue ("{36, 20, BAND_5GHZ, 0}")); WifiHelper wifi; - wifi.SetStandard (WIFI_STANDARD_80211ax_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211ax); wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("HeMcs5"), "ControlMode", StringValue ("HeMcs0")); diff --git a/src/wifi/test/power-rate-adaptation-test.cc b/src/wifi/test/power-rate-adaptation-test.cc index 015be0b0c..9d6877a74 100644 --- a/src/wifi/test/power-rate-adaptation-test.cc +++ b/src/wifi/test/power-rate-adaptation-test.cc @@ -102,7 +102,7 @@ PowerRateAdaptationTest::ConfigureNode () phy->SetChannel (channel); phy->SetDevice (dev); phy->SetMobility (mobility); - phy->ConfigureStandard (WIFI_PHY_STANDARD_80211a); + phy->ConfigureStandard (WIFI_STANDARD_80211a); /* * Configure power control parameters. diff --git a/src/wifi/test/spectrum-wifi-phy-test.cc b/src/wifi/test/spectrum-wifi-phy-test.cc index e3a1244a6..e226f56eb 100644 --- a/src/wifi/test/spectrum-wifi-phy-test.cc +++ b/src/wifi/test/spectrum-wifi-phy-test.cc @@ -176,7 +176,7 @@ SpectrumWifiPhyBasicTest::DoSetup (void) { m_phy = CreateObject (); m_phy->SetOperatingChannel (WifiPhy::ChannelTuple {CHANNEL_NUMBER, 0, WIFI_PHY_BAND_5GHZ, 0}); - m_phy->ConfigureStandard (WIFI_PHY_STANDARD_80211n); + m_phy->ConfigureStandard (WIFI_STANDARD_80211n); Ptr error = CreateObject (); m_phy->SetErrorRateModel (error); m_phy->SetReceiveOkCallback (MakeCallback (&SpectrumWifiPhyBasicTest::SpectrumWifiPhyRxSuccess, this)); @@ -470,7 +470,7 @@ SpectrumWifiPhyFilterTest::DoSetup (void) Ptr txDev = CreateObject (); m_txPhy = CreateObject (); m_txPhy->CreateWifiSpectrumPhyInterface (txDev); - m_txPhy->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_txPhy->ConfigureStandard (WIFI_STANDARD_80211ax); Ptr error = CreateObject (); m_txPhy->SetErrorRateModel (error); m_txPhy->SetDevice (txDev); @@ -485,7 +485,7 @@ SpectrumWifiPhyFilterTest::DoSetup (void) Ptr rxDev = CreateObject (); m_rxPhy = CreateObject (); m_rxPhy->CreateWifiSpectrumPhyInterface (rxDev); - m_rxPhy->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_rxPhy->ConfigureStandard (WIFI_STANDARD_80211ax); m_rxPhy->SetErrorRateModel (error); m_rxPhy->SetChannel (spectrumChannel); Ptr sta1Mobility = CreateObject (); @@ -526,7 +526,7 @@ SpectrumWifiPhyFilterTest::RunOne (void) break; } auto txChannelNum = std::get<0> (*WifiPhyOperatingChannel::FindFirst (0, txFrequency, m_txChannelWidth, - WIFI_PHY_STANDARD_80211ax, + WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ)); m_txPhy->SetOperatingChannel (WifiPhy::ChannelTuple {txChannelNum, m_txChannelWidth, (int)(WIFI_PHY_BAND_5GHZ), 0}); @@ -549,7 +549,7 @@ SpectrumWifiPhyFilterTest::RunOne (void) break; } auto rxChannelNum = std::get<0> (*WifiPhyOperatingChannel::FindFirst (0, rxFrequency, m_rxChannelWidth, - WIFI_PHY_STANDARD_80211ax, + WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ)); m_rxPhy->SetOperatingChannel (WifiPhy::ChannelTuple {rxChannelNum, m_rxChannelWidth, (int)(WIFI_PHY_BAND_5GHZ), 0}); diff --git a/src/wifi/test/wifi-aggregation-test.cc b/src/wifi/test/wifi-aggregation-test.cc index 3678959f4..ebafd5c2f 100644 --- a/src/wifi/test/wifi-aggregation-test.cc +++ b/src/wifi/test/wifi-aggregation-test.cc @@ -103,7 +103,7 @@ AmpduAggregationTest::DoRun (void) */ m_phy = CreateObject (); m_phy->SetDevice (m_device); - m_phy->ConfigureStandard (WIFI_PHY_STANDARD_80211n); + m_phy->ConfigureStandard (WIFI_STANDARD_80211n); m_device->SetPhy (m_phy); /* @@ -123,7 +123,7 @@ AmpduAggregationTest::DoRun (void) m_mac->SetDevice (m_device); m_mac->SetWifiRemoteStationManager (m_manager); m_mac->SetAddress (Mac48Address ("00:00:00:00:00:01")); - m_mac->ConfigureStandard (WIFI_STANDARD_80211n_5GHZ); + m_mac->ConfigureStandard (WIFI_STANDARD_80211n); Ptr fem = m_mac->GetFrameExchangeManager (); Ptr protectionManager = CreateObject (); protectionManager->SetWifiMac (m_mac); @@ -342,7 +342,7 @@ TwoLevelAggregationTest::DoRun (void) * Create device and attach HT configuration. */ m_device = CreateObject (); - m_device->SetStandard (WIFI_STANDARD_80211n_5GHZ); + m_device->SetStandard (WIFI_STANDARD_80211n); Ptr htConfiguration = CreateObject (); m_device->SetHtConfiguration (htConfiguration); @@ -351,7 +351,7 @@ TwoLevelAggregationTest::DoRun (void) */ m_phy = CreateObject (); m_phy->SetDevice (m_device); - m_phy->ConfigureStandard (WIFI_PHY_STANDARD_80211n); + m_phy->ConfigureStandard (WIFI_STANDARD_80211n); m_device->SetPhy (m_phy); /* @@ -371,7 +371,7 @@ TwoLevelAggregationTest::DoRun (void) m_mac->SetDevice (m_device); m_mac->SetWifiRemoteStationManager (m_manager); m_mac->SetAddress (Mac48Address ("00:00:00:00:00:01")); - m_mac->ConfigureStandard (WIFI_STANDARD_80211n_5GHZ); + m_mac->ConfigureStandard (WIFI_STANDARD_80211n); Ptr fem = m_mac->GetFrameExchangeManager (); Ptr protectionManager = CreateObject (); protectionManager->SetWifiMac (m_mac); @@ -584,7 +584,7 @@ HeAggregationTest::DoRunSubTest (uint16_t bufferSize) */ m_phy = CreateObject (); m_phy->SetDevice (m_device); - m_phy->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_phy->ConfigureStandard (WIFI_STANDARD_80211ax); m_device->SetPhy (m_phy); /* @@ -604,7 +604,7 @@ HeAggregationTest::DoRunSubTest (uint16_t bufferSize) m_mac->SetDevice (m_device); m_mac->SetWifiRemoteStationManager (m_manager); m_mac->SetAddress (Mac48Address ("00:00:00:00:00:01")); - m_mac->ConfigureStandard (WIFI_STANDARD_80211ax_5GHZ); + m_mac->ConfigureStandard (WIFI_STANDARD_80211ax); Ptr fem = m_mac->GetFrameExchangeManager (); Ptr protectionManager = CreateObject (); protectionManager->SetWifiMac (m_mac); @@ -820,7 +820,7 @@ PreservePacketsInAmpdus::DoRun (void) phy.SetChannel (channel.Create ()); WifiHelper wifi; - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); wifi.SetRemoteStationManager ("ns3::IdealWifiManager"); WifiMacHelper mac; diff --git a/src/wifi/test/wifi-mac-ofdma-test.cc b/src/wifi/test/wifi-mac-ofdma-test.cc index 819f349b1..2b29de85d 100644 --- a/src/wifi/test/wifi-mac-ofdma-test.cc +++ b/src/wifi/test/wifi-mac-ofdma-test.cc @@ -1146,7 +1146,7 @@ OfdmaAckSequenceTest::DoRun (void) Config::SetDefault ("ns3::WifiMacQueue::MaxDelay", TimeValue (Seconds (2))); WifiHelper wifi; - wifi.SetStandard (WIFI_STANDARD_80211ax_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211ax); wifi.SetRemoteStationManager ("ns3::IdealWifiManager"); WifiMacHelper mac; diff --git a/src/wifi/test/wifi-phy-ofdma-test.cc b/src/wifi/test/wifi-phy-ofdma-test.cc index 20759c6eb..16f3ce728 100644 --- a/src/wifi/test/wifi-phy-ofdma-test.cc +++ b/src/wifi/test/wifi-phy-ofdma-test.cc @@ -655,7 +655,7 @@ TestDlOfdmaPhyTransmission::DoSetup (void) Ptr apDev = CreateObject (); m_phyAp = CreateObject (); m_phyAp->CreateWifiSpectrumPhyInterface (apDev); - m_phyAp->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_phyAp->ConfigureStandard (WIFI_STANDARD_80211ax); Ptr error = CreateObject (); m_phyAp->SetErrorRateModel (error); m_phyAp->SetDevice (apDev); @@ -670,7 +670,7 @@ TestDlOfdmaPhyTransmission::DoSetup (void) Ptr sta1Dev = CreateObject (); m_phySta1 = CreateObject (1); m_phySta1->CreateWifiSpectrumPhyInterface (sta1Dev); - m_phySta1->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_phySta1->ConfigureStandard (WIFI_STANDARD_80211ax); m_phySta1->SetErrorRateModel (error); m_phySta1->SetDevice (sta1Dev); m_phySta1->SetChannel (spectrumChannel); @@ -686,7 +686,7 @@ TestDlOfdmaPhyTransmission::DoSetup (void) Ptr sta2Dev = CreateObject (); m_phySta2 = CreateObject (2); m_phySta2->CreateWifiSpectrumPhyInterface (sta2Dev); - m_phySta2->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_phySta2->ConfigureStandard (WIFI_STANDARD_80211ax); m_phySta2->SetErrorRateModel (error); m_phySta2->SetDevice (sta2Dev); m_phySta2->SetChannel (spectrumChannel); @@ -702,7 +702,7 @@ TestDlOfdmaPhyTransmission::DoSetup (void) Ptr sta3Dev = CreateObject (); m_phySta3 = CreateObject (3); m_phySta3->CreateWifiSpectrumPhyInterface (sta3Dev); - m_phySta3->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_phySta3->ConfigureStandard (WIFI_STANDARD_80211ax); m_phySta3->SetErrorRateModel (error); m_phySta3->SetDevice (sta3Dev); m_phySta3->SetChannel (spectrumChannel); @@ -750,7 +750,7 @@ TestDlOfdmaPhyTransmission::RunOne (void) m_phySta3->AssignStreams (streamNumber); auto channelNum = std::get<0> (*WifiPhyOperatingChannel::FindFirst (0, m_frequency, m_channelWidth, - WIFI_PHY_STANDARD_80211ax, + WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ)); m_phyAp->SetOperatingChannel (WifiPhy::ChannelTuple {channelNum, m_channelWidth, @@ -1041,12 +1041,12 @@ TestUlOfdmaPpduUid::DoSetup (void) Ptr apDev = CreateObject (); m_phyAp = CreateObject (0); m_phyAp->CreateWifiSpectrumPhyInterface (apDev); - m_phyAp->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_phyAp->ConfigureStandard (WIFI_STANDARD_80211ax); Ptr error = CreateObject (); m_phyAp->SetErrorRateModel (error); auto channelNum = std::get<0> (*WifiPhyOperatingChannel::FindFirst (0, DEFAULT_FREQUENCY, DEFAULT_CHANNEL_WIDTH, - WIFI_PHY_STANDARD_80211ax, + WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ)); m_phyAp->SetOperatingChannel (WifiPhy::ChannelTuple {channelNum, DEFAULT_CHANNEL_WIDTH, (int)(WIFI_PHY_BAND_5GHZ), 0}); @@ -1063,7 +1063,7 @@ TestUlOfdmaPpduUid::DoSetup (void) Ptr sta1Dev = CreateObject (); m_phySta1 = CreateObject (1); m_phySta1->CreateWifiSpectrumPhyInterface (sta1Dev); - m_phySta1->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_phySta1->ConfigureStandard (WIFI_STANDARD_80211ax); m_phySta1->SetErrorRateModel (error); m_phySta1->SetOperatingChannel (WifiPhy::ChannelTuple {channelNum, DEFAULT_CHANNEL_WIDTH, (int)(WIFI_PHY_BAND_5GHZ), 0}); @@ -1080,7 +1080,7 @@ TestUlOfdmaPpduUid::DoSetup (void) Ptr sta2Dev = CreateObject (); m_phySta2 = CreateObject (2); m_phySta2->CreateWifiSpectrumPhyInterface (sta2Dev); - m_phySta2->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_phySta2->ConfigureStandard (WIFI_STANDARD_80211ax); m_phySta2->SetErrorRateModel (error); m_phySta2->SetOperatingChannel (WifiPhy::ChannelTuple {channelNum, DEFAULT_CHANNEL_WIDTH, (int)(WIFI_PHY_BAND_5GHZ), 0}); @@ -1509,7 +1509,7 @@ TestMultipleHeTbPreambles::DoSetup (void) { Ptr dev = CreateObject (); m_phy = CreateObject (0); - m_phy->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_phy->ConfigureStandard (WIFI_STANDARD_80211ax); Ptr error = CreateObject (); Ptr mac = CreateObject (); mac->SetAttribute ("BeaconGeneration", BooleanValue (false)); @@ -2134,13 +2134,13 @@ TestUlOfdmaPhyTransmission::DoSetup (void) Ptr apNode = CreateObject (); Ptr apDev = CreateObject (); - apDev->SetStandard (WIFI_STANDARD_80211ax_5GHZ); + apDev->SetStandard (WIFI_STANDARD_80211ax); Ptr apMac = CreateObject (); apMac->SetAttribute ("BeaconGeneration", BooleanValue (false)); apDev->SetMac (apMac); m_phyAp = CreateObject (0); m_phyAp->CreateWifiSpectrumPhyInterface (apDev); - m_phyAp->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_phyAp->ConfigureStandard (WIFI_STANDARD_80211ax); Ptr heConfiguration = CreateObject (); apDev->SetHeConfiguration (heConfiguration); Ptr error = CreateObject (); @@ -2160,7 +2160,7 @@ TestUlOfdmaPhyTransmission::DoSetup (void) Ptr sta1Dev = CreateObject (); m_phySta1 = CreateObject (1); m_phySta1->CreateWifiSpectrumPhyInterface (sta1Dev); - m_phySta1->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_phySta1->ConfigureStandard (WIFI_STANDARD_80211ax); m_phySta1->SetErrorRateModel (error); m_phySta1->SetDevice (sta1Dev); m_phySta1->SetChannel (spectrumChannel); @@ -2175,7 +2175,7 @@ TestUlOfdmaPhyTransmission::DoSetup (void) Ptr sta2Dev = CreateObject (); m_phySta2 = CreateObject (2); m_phySta2->CreateWifiSpectrumPhyInterface (sta2Dev); - m_phySta2->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_phySta2->ConfigureStandard (WIFI_STANDARD_80211ax); m_phySta2->SetErrorRateModel (error); m_phySta2->SetDevice (sta2Dev); m_phySta2->SetChannel (spectrumChannel); @@ -2190,7 +2190,7 @@ TestUlOfdmaPhyTransmission::DoSetup (void) Ptr sta3Dev = CreateObject (); m_phySta3 = CreateObject (3); m_phySta3->CreateWifiSpectrumPhyInterface (sta3Dev); - m_phySta3->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_phySta3->ConfigureStandard (WIFI_STANDARD_80211ax); m_phySta3->SetErrorRateModel (error); m_phySta3->SetDevice (sta3Dev); m_phySta3->SetChannel (spectrumChannel); @@ -2370,7 +2370,7 @@ TestUlOfdmaPhyTransmission::RunOne (void) m_phySta3->AssignStreams (streamNumber); auto channelNum = std::get<0> (*WifiPhyOperatingChannel::FindFirst (0, m_frequency, m_channelWidth, - WIFI_PHY_STANDARD_80211ax, + WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ)); m_phyAp->SetOperatingChannel (WifiPhy::ChannelTuple {channelNum, m_channelWidth, @@ -3058,7 +3058,7 @@ TestPhyPaddingExclusion::DoSetup (void) apDev->SetMac (apMac); m_phyAp = CreateObject (0); m_phyAp->CreateWifiSpectrumPhyInterface (apDev); - m_phyAp->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_phyAp->ConfigureStandard (WIFI_STANDARD_80211ax); Ptr heConfiguration = CreateObject (); apDev->SetHeConfiguration (heConfiguration); Ptr error = CreateObject (); @@ -3068,7 +3068,7 @@ TestPhyPaddingExclusion::DoSetup (void) m_phyAp->AssignStreams (streamNumber); auto channelNum = std::get<0> (*WifiPhyOperatingChannel::FindFirst (0, DEFAULT_FREQUENCY, DEFAULT_CHANNEL_WIDTH, - WIFI_PHY_STANDARD_80211ax, + WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ)); m_phyAp->SetOperatingChannel (WifiPhy::ChannelTuple {channelNum, DEFAULT_CHANNEL_WIDTH, @@ -3085,7 +3085,7 @@ TestPhyPaddingExclusion::DoSetup (void) Ptr sta1Dev = CreateObject (); m_phySta1 = CreateObject (1); m_phySta1->CreateWifiSpectrumPhyInterface (sta1Dev); - m_phySta1->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_phySta1->ConfigureStandard (WIFI_STANDARD_80211ax); m_phySta1->SetErrorRateModel (error); m_phySta1->SetDevice (sta1Dev); m_phySta1->SetChannel (spectrumChannel); @@ -3102,7 +3102,7 @@ TestPhyPaddingExclusion::DoSetup (void) Ptr sta2Dev = CreateObject (); m_phySta2 = CreateObject (2); m_phySta2->CreateWifiSpectrumPhyInterface (sta2Dev); - m_phySta2->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_phySta2->ConfigureStandard (WIFI_STANDARD_80211ax); m_phySta2->SetErrorRateModel (error); m_phySta2->SetDevice (sta2Dev); m_phySta2->SetChannel (spectrumChannel); @@ -3453,7 +3453,7 @@ TestUlOfdmaPowerControl::DoSetup (void) spectrumPhy.Set ("ChannelSettings", StringValue ("{0, 0, BAND_5GHZ, 0}")); WifiHelper wifi; - wifi.SetStandard (WIFI_STANDARD_80211ax_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211ax); wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("HeMcs7"), "ControlMode", StringValue ("HeMcs7")); diff --git a/src/wifi/test/wifi-phy-reception-test.cc b/src/wifi/test/wifi-phy-reception-test.cc index e7765c6b5..e8938fcfe 100644 --- a/src/wifi/test/wifi-phy-reception-test.cc +++ b/src/wifi/test/wifi-phy-reception-test.cc @@ -203,7 +203,7 @@ void TestThresholdPreambleDetectionWithoutFrameCapture::DoSetup (void) { m_phy = CreateObject (); - m_phy->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_phy->ConfigureStandard (WIFI_STANDARD_80211ax); Ptr error = CreateObject (); m_phy->SetErrorRateModel (error); m_phy->SetOperatingChannel (WifiPhy::ChannelTuple {CHANNEL_NUMBER, 0, WIFI_PHY_BAND_5GHZ, 0}); @@ -567,7 +567,7 @@ void TestThresholdPreambleDetectionWithFrameCapture::DoSetup (void) { m_phy = CreateObject (); - m_phy->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_phy->ConfigureStandard (WIFI_STANDARD_80211ax); Ptr error = CreateObject (); m_phy->SetErrorRateModel (error); m_phy->SetOperatingChannel (WifiPhy::ChannelTuple {CHANNEL_NUMBER, 0, WIFI_PHY_BAND_5GHZ, 0}); @@ -1105,7 +1105,7 @@ void TestSimpleFrameCaptureModel::DoSetup (void) { m_phy = CreateObject (); - m_phy->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_phy->ConfigureStandard (WIFI_STANDARD_80211ax); Ptr error = CreateObject (); m_phy->SetErrorRateModel (error); m_phy->SetOperatingChannel (WifiPhy::ChannelTuple {CHANNEL_NUMBER, 0, WIFI_PHY_BAND_5GHZ, 0}); @@ -1278,7 +1278,7 @@ void TestPhyHeadersReception::DoSetup (void) { m_phy = CreateObject (); - m_phy->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_phy->ConfigureStandard (WIFI_STANDARD_80211ax); Ptr error = CreateObject (); m_phy->SetErrorRateModel (error); m_phy->SetOperatingChannel (WifiPhy::ChannelTuple {CHANNEL_NUMBER, 0, WIFI_PHY_BAND_5GHZ, 0}); @@ -1775,7 +1775,7 @@ void TestAmpduReception::DoSetup (void) { m_phy = CreateObject (); - m_phy->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_phy->ConfigureStandard (WIFI_STANDARD_80211ax); Ptr error = CreateObject (); m_phy->SetErrorRateModel (error); m_phy->SetOperatingChannel (WifiPhy::ChannelTuple {CHANNEL_NUMBER, 0, WIFI_PHY_BAND_5GHZ, 0}); @@ -2449,12 +2449,12 @@ TestUnsupportedModulationReception::DoRun (void) mac.SetType ("ns3::StaWifiMac", "QosSupported", BooleanValue (true), "Ssid", SsidValue (Ssid ("non-existent-ssid"))); - wifi.SetStandard (WIFI_STANDARD_80211ax_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211ax); m_staDevices.Add (wifi.Install (phy, mac, wifiStaNodes.Get (0))); wifi.SetStandard (WIFI_STANDARD_80211ac); m_staDevices.Add (wifi.Install (phy, mac, wifiStaNodes.Get (1))); - wifi.SetStandard (WIFI_STANDARD_80211ax_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211ax); mac.SetType ("ns3::ApWifiMac", "QosSupported", BooleanValue (true), "Ssid", SsidValue (Ssid ("wifi-backoff-ssid")), "BeaconInterval", TimeValue (MicroSeconds (102400)), "EnableBeaconJitter", BooleanValue (false)); diff --git a/src/wifi/test/wifi-phy-thresholds-test.cc b/src/wifi/test/wifi-phy-thresholds-test.cc index 5aff42f39..6586c7d94 100644 --- a/src/wifi/test/wifi-phy-thresholds-test.cc +++ b/src/wifi/test/wifi-phy-thresholds-test.cc @@ -230,7 +230,7 @@ void WifiPhyThresholdsTest::DoSetup (void) { m_phy = CreateObject (); - m_phy->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_phy->ConfigureStandard (WIFI_STANDARD_80211ax); Ptr error = CreateObject (); m_phy->SetErrorRateModel (error); m_phy->SetOperatingChannel (WifiPhy::ChannelTuple {CHANNEL_NUMBER, 0, WIFI_PHY_BAND_5GHZ, 0}); diff --git a/src/wifi/test/wifi-primary-channels-test.cc b/src/wifi/test/wifi-primary-channels-test.cc index d1b33eba5..08bd4606c 100644 --- a/src/wifi/test/wifi-primary-channels-test.cc +++ b/src/wifi/test/wifi-primary-channels-test.cc @@ -343,7 +343,7 @@ WifiPrimaryChannelsTest::DoSetup (void) phy.SetChannel (spectrumChannel); WifiHelper wifi; - wifi.SetStandard (WIFI_STANDARD_80211ax_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211ax); wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager"); WifiMacHelper mac; diff --git a/src/wifi/test/wifi-test.cc b/src/wifi/test/wifi-test.cc index 96c9345b5..17e8d01b8 100644 --- a/src/wifi/test/wifi-test.cc +++ b/src/wifi/test/wifi-test.cc @@ -162,7 +162,7 @@ WifiTest::CreateOne (Vector pos, Ptr channel) phy->SetErrorRateModel (error); phy->SetChannel (channel); phy->SetDevice (dev); - phy->ConfigureStandard (WIFI_PHY_STANDARD_80211a); + phy->ConfigureStandard (WIFI_STANDARD_80211a); Ptr manager = m_manager.Create (); mobility->SetPosition (pos); @@ -339,7 +339,7 @@ InterferenceHelperSequenceTest::CreateOne (Vector pos, Ptr chan phy->SetChannel (channel); phy->SetDevice (dev); phy->SetMobility (mobility); - phy->ConfigureStandard (WIFI_PHY_STANDARD_80211a); + phy->ConfigureStandard (WIFI_STANDARD_80211a); Ptr manager = m_manager.Create (); mobility->SetPosition (pos); @@ -547,7 +547,7 @@ DcfImmediateAccessBroadcastTestCase::DoRun (void) txPhy->SetChannel (channel); txPhy->SetDevice (txDev); txPhy->SetMobility (txMobility); - txPhy->ConfigureStandard (WIFI_PHY_STANDARD_80211a); + txPhy->ConfigureStandard (WIFI_STANDARD_80211a); txPhy->TraceConnectWithoutContext ("PhyTxBegin", MakeCallback (&DcfImmediateAccessBroadcastTestCase::NotifyPhyTxBegin, this)); @@ -811,7 +811,7 @@ QosFragmentationTestCase::DoRun (void) phy.SetChannel (channel.Create ()); WifiHelper wifi; - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("HtMcs7")); @@ -994,7 +994,7 @@ SetChannelFrequencyTest::DoRun () // case 4: WifiHelper wifi; wifi.SetRemoteStationManager ("ns3::IdealWifiManager"); - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); phy.Set ("ChannelSettings", StringValue ("{0, 0, BAND_5GHZ, 0}")); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); phySta = GetYansWifiPhyPtr (staDevice); @@ -1007,7 +1007,7 @@ SetChannelFrequencyTest::DoRun () // case 5: WifiHelper wifi; wifi.SetRemoteStationManager ("ns3::IdealWifiManager"); - wifi.SetStandard (WIFI_STANDARD_80211n_2_4GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); phySta = GetYansWifiPhyPtr (staDevice); NS_TEST_ASSERT_MSG_EQ (phySta->GetChannelNumber (), 1, "802.11n-2.4GHz configuration"); @@ -1029,7 +1029,7 @@ SetChannelFrequencyTest::DoRun () // case 7: WifiHelper wifi; wifi.SetRemoteStationManager ("ns3::IdealWifiManager"); - wifi.SetStandard (WIFI_STANDARD_80211ax_2_4GHZ); + wifi.SetStandard (WIFI_STANDARD_80211ax); phy.Set ("ChannelSettings", StringValue ("{0, 0, BAND_2_4GHZ, 0}")); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); phySta = GetYansWifiPhyPtr (staDevice); @@ -1042,7 +1042,7 @@ SetChannelFrequencyTest::DoRun () // case 8: WifiHelper wifi; wifi.SetRemoteStationManager ("ns3::IdealWifiManager"); - wifi.SetStandard (WIFI_STANDARD_80211ax_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211ax); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); phySta = GetYansWifiPhyPtr (staDevice); NS_TEST_ASSERT_MSG_EQ (phySta->GetChannelNumber (), 42, "802.11ax-5GHz configuration"); @@ -1053,7 +1053,7 @@ SetChannelFrequencyTest::DoRun () // case 9: WifiHelper wifi; wifi.SetRemoteStationManager ("ns3::IdealWifiManager"); - wifi.SetStandard (WIFI_STANDARD_80211ax_6GHZ); + wifi.SetStandard (WIFI_STANDARD_80211ax); phy.Set ("ChannelSettings", StringValue ("{0, 0, BAND_6GHZ, 0}")); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); phySta = GetYansWifiPhyPtr (staDevice); @@ -1092,7 +1092,7 @@ SetChannelFrequencyTest::DoRun () // case 12: WifiHelper wifi; wifi.SetRemoteStationManager ("ns3::IdealWifiManager"); - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); phy.Set ("ChannelSettings", StringValue ("{44, 20, BAND_5GHZ, 0}")); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); phySta = GetYansWifiPhyPtr (staDevice); @@ -1139,7 +1139,7 @@ SetChannelFrequencyTest::DoRun () // case 15: WifiHelper wifi; wifi.SetRemoteStationManager ("ns3::IdealWifiManager"); - wifi.SetStandard (WIFI_STANDARD_80211n_2_4GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); phySta = GetYansWifiPhyPtr (staDevice); phySta->SetAttribute ("ChannelSettings", StringValue ("{3, 20, BAND_2_4GHZ, 0}")); @@ -1160,7 +1160,7 @@ SetChannelFrequencyTest::DoRun () WifiHelper wifi; wifi.SetRemoteStationManager ("ns3::IdealWifiManager"); // Test that setting Frequency to a non-standard value will throw an exception - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); phy.Set ("ChannelSettings", StringValue ("{44, 0, BAND_5GHZ, 0}")); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); phySta = GetYansWifiPhyPtr (staDevice); @@ -1180,7 +1180,7 @@ SetChannelFrequencyTest::DoRun () // case 17: WifiHelper wifi; wifi.SetRemoteStationManager ("ns3::IdealWifiManager"); - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); phy.Set ("ChannelSettings", StringValue ("{44, 0, BAND_5GHZ, 0}")); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); phySta = GetYansWifiPhyPtr (staDevice); @@ -1197,7 +1197,7 @@ SetChannelFrequencyTest::DoRun () // Set a wrong channel after initialization WifiHelper wifi; wifi.SetRemoteStationManager ("ns3::IdealWifiManager"); - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); phy.Set ("ChannelSettings", StringValue ("{44, 0, BAND_5GHZ, 0}")); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); phySta = GetYansWifiPhyPtr (staDevice); @@ -1218,7 +1218,7 @@ SetChannelFrequencyTest::DoRun () WifiHelper wifi; wifi.SetRemoteStationManager ("ns3::IdealWifiManager"); // Test how channel number behaves when frequency is non-standard - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); phy.Set ("ChannelSettings", StringValue ("{44, 0, BAND_5GHZ, 0}")); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); phySta = GetYansWifiPhyPtr (staDevice); @@ -1259,14 +1259,14 @@ SetChannelFrequencyTest::DoRun () WifiHelper wifi; wifi.SetRemoteStationManager ("ns3::IdealWifiManager"); phy.Set ("ChannelSettings", StringValue ("{40, 0, BAND_5GHZ, 0}")); - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); phySta = GetYansWifiPhyPtr (staDevice); NS_TEST_ASSERT_MSG_EQ (phySta->GetChannelNumber (), 40, "802.11 5GHz configuration"); NS_TEST_ASSERT_MSG_EQ (phySta->GetChannelWidth (), 20, "802.11 5GHz configuration"); NS_TEST_ASSERT_MSG_EQ (phySta->GetFrequency (), 5200, "802.11 5GHz configuration"); // Set both channel and frequency to consistent values after initialization - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); staDevice = wifi.Install (phy, macSta, wifiStaNode.Get (0)); phySta = GetYansWifiPhyPtr (staDevice); phySta->SetAttribute ("ChannelSettings", StringValue ("{40, 0, BAND_5GHZ, 0}")); @@ -1731,7 +1731,7 @@ Bug2831TestCase::DoRun (void) Ptr apNode = CreateObject (); Ptr apDev = CreateObject (); - apDev->SetStandard (WIFI_STANDARD_80211ax_5GHZ); + apDev->SetStandard (WIFI_STANDARD_80211ax); Ptr apHtConfiguration = CreateObject (); apDev->SetHtConfiguration (apHtConfiguration); ObjectFactory mac; @@ -1741,7 +1741,7 @@ Bug2831TestCase::DoRun (void) Ptr apMac = mac.Create (); apMac->SetDevice (apDev); apMac->SetAddress (Mac48Address::Allocate ()); - apMac->ConfigureStandard (WIFI_STANDARD_80211ax_5GHZ); + apMac->ConfigureStandard (WIFI_STANDARD_80211ax); Ptr fem = apMac->GetFrameExchangeManager (); Ptr protectionManager = CreateObject (); protectionManager->SetWifiMac (apMac); @@ -1752,14 +1752,14 @@ Bug2831TestCase::DoRun (void) Ptr staNode = CreateObject (); Ptr staDev = CreateObject (); - staDev->SetStandard (WIFI_STANDARD_80211ax_5GHZ); + staDev->SetStandard (WIFI_STANDARD_80211ax); Ptr staHtConfiguration = CreateObject (); staDev->SetHtConfiguration (staHtConfiguration); mac.SetTypeId ("ns3::StaWifiMac"); Ptr staMac = mac.Create (); staMac->SetDevice (staDev); staMac->SetAddress (Mac48Address::Allocate ()); - staMac->ConfigureStandard (WIFI_STANDARD_80211ax_5GHZ); + staMac->ConfigureStandard (WIFI_STANDARD_80211ax); fem = staMac->GetFrameExchangeManager (); protectionManager = CreateObject (); protectionManager->SetWifiMac (staMac); @@ -1778,7 +1778,7 @@ Bug2831TestCase::DoRun (void) m_apPhy->SetChannel (channel); m_apPhy->SetMobility (apMobility); m_apPhy->SetDevice (apDev); - m_apPhy->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_apPhy->ConfigureStandard (WIFI_STANDARD_80211ax); m_apPhy->SetOperatingChannel (WifiPhy::ChannelTuple {36, 20, (int)(WIFI_PHY_BAND_5GHZ), 0}); Ptr staMobility = CreateObject (); @@ -1790,7 +1790,7 @@ Bug2831TestCase::DoRun (void) m_staPhy->SetChannel (channel); m_staPhy->SetMobility (staMobility); m_staPhy->SetDevice (apDev); - m_staPhy->ConfigureStandard (WIFI_PHY_STANDARD_80211ax); + m_staPhy->ConfigureStandard (WIFI_STANDARD_80211ax); m_staPhy->SetOperatingChannel (WifiPhy::ChannelTuple {36, 20, (int)(WIFI_PHY_BAND_5GHZ), 0}); apDev->SetMac (apMac); @@ -1919,7 +1919,7 @@ StaWifiMacScanningTestCase::Setup (bool nearestApBeaconGeneration, bool staActiv phy.SetChannel (channel.Create ()); WifiHelper wifi; - wifi.SetStandard (WIFI_STANDARD_80211n_2_4GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager"); WifiMacHelper mac; @@ -2184,7 +2184,7 @@ Bug2470TestCase::RunSubtest (PointerValue apErrorModel, PointerValue staErrorMod phy.SetChannel (channel.Create ()); WifiHelper wifi; - wifi.SetStandard (WIFI_STANDARD_80211n_5GHZ); + wifi.SetStandard (WIFI_STANDARD_80211n); wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("HtMcs7"), "ControlMode", StringValue ("HtMcs7")); diff --git a/src/wifi/test/wifi-transmit-mask-test.cc b/src/wifi/test/wifi-transmit-mask-test.cc index a1b55d0e7..05369a94c 100644 --- a/src/wifi/test/wifi-transmit-mask-test.cc +++ b/src/wifi/test/wifi-transmit-mask-test.cc @@ -54,7 +54,7 @@ public: * Constructor * * \param str test reference name - * \param standard selected PHY standard + * \param standard selected standard * \param band selected PHY band * \param bw bandwidth * \param maskRefsLeft vector of expected power values and corresponding indexes of generated PSD @@ -63,7 +63,7 @@ public: * (only start and stop indexes/values given) for right guard bandwidth * \param tol tolerance (in dB) */ - WifiOfdmMaskSlopesTestCase (const char* str, WifiPhyStandard standard, WifiPhyBand band, uint8_t bw, + WifiOfdmMaskSlopesTestCase (const char* str, WifiStandard standard, WifiPhyBand band, uint8_t bw, IndexPowerVect maskRefsLeft, IndexPowerVect maskRefsRight, double tol); virtual ~WifiOfdmMaskSlopesTestCase (); @@ -89,7 +89,7 @@ private: double tol); }; -WifiOfdmMaskSlopesTestCase::WifiOfdmMaskSlopesTestCase (const char* str, WifiPhyStandard standard, WifiPhyBand band, uint8_t bw, +WifiOfdmMaskSlopesTestCase::WifiOfdmMaskSlopesTestCase (const char* str, WifiStandard standard, WifiPhyBand band, uint8_t bw, IndexPowerVect maskRefsLeft, IndexPowerVect maskRefsRight, double tol) : TestCase (std::string ("SpectrumValue ") + str) { @@ -102,23 +102,23 @@ WifiOfdmMaskSlopesTestCase::WifiOfdmMaskSlopesTestCase (const char* str, WifiPhy switch (standard) { - case WIFI_PHY_STANDARD_80211p: + case WIFI_STANDARD_80211p: NS_ASSERT ((bw == 5) || (bw == 10)); freq = 5860; m_actualSpectrum = WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity (freq, bw, refTxPowerW, bw, -20.0, -28.0, outerBandMaximumRejection); break; // 11g and 11a - case WIFI_PHY_STANDARD_80211g: + case WIFI_STANDARD_80211g: freq = 2412; // no break on purpose - case WIFI_PHY_STANDARD_80211a: + case WIFI_STANDARD_80211a: NS_ASSERT (bw == 20); m_actualSpectrum = WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity (freq, bw, refTxPowerW, bw, -20.0, -28.0, outerBandMaximumRejection); break; // 11n - case WIFI_PHY_STANDARD_80211n: + case WIFI_STANDARD_80211n: if (band == WIFI_PHY_BAND_2_4GHZ) { freq = 2402 + (bw / 2); //so as to have 2412/2422 for 20/40 @@ -129,13 +129,13 @@ WifiOfdmMaskSlopesTestCase::WifiOfdmMaskSlopesTestCase (const char* str, WifiPhy break; // 11ac - case WIFI_PHY_STANDARD_80211ac: + case WIFI_STANDARD_80211ac: NS_ASSERT (bw == 20 || bw == 40 || bw == 80 || bw == 160); m_actualSpectrum = WifiSpectrumValueHelper::CreateHtOfdmTxPowerSpectralDensity (freq, bw, refTxPowerW, bw, -20.0, -28.0, outerBandMaximumRejection); break; // 11ax - case WIFI_PHY_STANDARD_80211ax: + case WIFI_STANDARD_80211ax: if (band == WIFI_PHY_BAND_2_4GHZ) { NS_ASSERT (bw != 160); // not enough space in 2.4 GHz bands @@ -275,7 +275,7 @@ WifiTransmitMaskTestSuite::WifiTransmitMaskTestSuite () maskSlopesRight.push_back (std::make_pair (160, -28.000)); // Middle band right (stop) maskSlopesRight.push_back (std::make_pair (161, -28.375)); // Outer band right (start) maskSlopesRight.push_back (std::make_pair (192, -40.0)); // Outer band right (stop) - AddTestCase (new WifiOfdmMaskSlopesTestCase ("11p 5MHz", WIFI_PHY_STANDARD_80211p, WIFI_PHY_BAND_5GHZ, + AddTestCase (new WifiOfdmMaskSlopesTestCase ("11p 5MHz", WIFI_STANDARD_80211p, WIFI_PHY_BAND_5GHZ, 5, maskSlopesLeft, maskSlopesRight, tol), TestCase::QUICK); @@ -299,7 +299,7 @@ WifiTransmitMaskTestSuite::WifiTransmitMaskTestSuite () maskSlopesRight.push_back (std::make_pair (160, -28.000)); // Middle band right (stop) maskSlopesRight.push_back (std::make_pair (161, -28.375)); // Outer band right (start) maskSlopesRight.push_back (std::make_pair (192, -40.0)); // Outer band right (stop) - AddTestCase (new WifiOfdmMaskSlopesTestCase ("11p 10MHz", WIFI_PHY_STANDARD_80211p, WIFI_PHY_BAND_5GHZ, + AddTestCase (new WifiOfdmMaskSlopesTestCase ("11p 10MHz", WIFI_STANDARD_80211p, WIFI_PHY_BAND_5GHZ, 10, maskSlopesLeft, maskSlopesRight, tol), TestCase::QUICK); @@ -325,14 +325,14 @@ WifiTransmitMaskTestSuite::WifiTransmitMaskTestSuite () maskSlopesRight.push_back (std::make_pair (160, -28.000)); // Middle band right (stop) maskSlopesRight.push_back (std::make_pair (161, -28.375)); // Outer band right (start) maskSlopesRight.push_back (std::make_pair (192, -40.0)); // Outer band right (stop) - AddTestCase (new WifiOfdmMaskSlopesTestCase ("11a", WIFI_PHY_STANDARD_80211a, WIFI_PHY_BAND_5GHZ, + AddTestCase (new WifiOfdmMaskSlopesTestCase ("11a", WIFI_STANDARD_80211a, WIFI_PHY_BAND_5GHZ, 20, maskSlopesLeft, maskSlopesRight, tol), TestCase::QUICK); // 11g NS_LOG_FUNCTION ("Check slopes for 11g"); // same slppes as 11g - AddTestCase (new WifiOfdmMaskSlopesTestCase ("11g", WIFI_PHY_STANDARD_80211g, WIFI_PHY_BAND_2_4GHZ, + AddTestCase (new WifiOfdmMaskSlopesTestCase ("11g", WIFI_STANDARD_80211g, WIFI_PHY_BAND_2_4GHZ, 20, maskSlopesLeft, maskSlopesRight, tol), TestCase::QUICK); @@ -358,7 +358,7 @@ WifiTransmitMaskTestSuite::WifiTransmitMaskTestSuite () maskSlopesRight.push_back (std::make_pair (160, -28.000)); // Middle band right (stop) maskSlopesRight.push_back (std::make_pair (161, -28.531)); // Outer band right (start) maskSlopesRight.push_back (std::make_pair (192, -45.000)); // Outer band right (stop) - AddTestCase (new WifiOfdmMaskSlopesTestCase ("11n_2.4GHz 20MHz", WIFI_PHY_STANDARD_80211n, WIFI_PHY_BAND_2_4GHZ, + AddTestCase (new WifiOfdmMaskSlopesTestCase ("11n_2.4GHz 20MHz", WIFI_STANDARD_80211n, WIFI_PHY_BAND_2_4GHZ, 20, maskSlopesLeft, maskSlopesRight, tol), TestCase::QUICK); @@ -382,7 +382,7 @@ WifiTransmitMaskTestSuite::WifiTransmitMaskTestSuite () maskSlopesRight.push_back (std::make_pair (160, -28.000)); // Middle band right (stop) maskSlopesRight.push_back (std::make_pair (161, -28.375)); // Outer band right (start) maskSlopesRight.push_back (std::make_pair (192, -40.0)); // Outer band right (stop) - AddTestCase (new WifiOfdmMaskSlopesTestCase ("11n_5GHz 20MHz", WIFI_PHY_STANDARD_80211n, WIFI_PHY_BAND_5GHZ, + AddTestCase (new WifiOfdmMaskSlopesTestCase ("11n_5GHz 20MHz", WIFI_STANDARD_80211n, WIFI_PHY_BAND_5GHZ, 20, maskSlopesLeft, maskSlopesRight, tol), TestCase::QUICK); @@ -406,7 +406,7 @@ WifiTransmitMaskTestSuite::WifiTransmitMaskTestSuite () maskSlopesRight.push_back (std::make_pair (320, -28.000)); // Middle band right (stop) maskSlopesRight.push_back (std::make_pair (321, -28.266)); // Outer band right (start) maskSlopesRight.push_back (std::make_pair (384, -45.000)); // Outer band right (stop) - AddTestCase (new WifiOfdmMaskSlopesTestCase ("11n_2.4GHz 40MHz", WIFI_PHY_STANDARD_80211n, WIFI_PHY_BAND_2_4GHZ, + AddTestCase (new WifiOfdmMaskSlopesTestCase ("11n_2.4GHz 40MHz", WIFI_STANDARD_80211n, WIFI_PHY_BAND_2_4GHZ, 40, maskSlopesLeft, maskSlopesRight, tol), TestCase::QUICK); @@ -430,7 +430,7 @@ WifiTransmitMaskTestSuite::WifiTransmitMaskTestSuite () maskSlopesRight.push_back (std::make_pair (320, -28.000)); // Middle band right (stop) maskSlopesRight.push_back (std::make_pair (321, -28.188)); // Outer band right (start) maskSlopesRight.push_back (std::make_pair (384, -40.0)); // Outer band right (stop) - AddTestCase (new WifiOfdmMaskSlopesTestCase ("11n_5GHz 40MHz", WIFI_PHY_STANDARD_80211n, WIFI_PHY_BAND_5GHZ, + AddTestCase (new WifiOfdmMaskSlopesTestCase ("11n_5GHz 40MHz", WIFI_STANDARD_80211n, WIFI_PHY_BAND_5GHZ, 40, maskSlopesLeft, maskSlopesRight, tol), TestCase::QUICK); @@ -456,7 +456,7 @@ WifiTransmitMaskTestSuite::WifiTransmitMaskTestSuite () maskSlopesRight.push_back (std::make_pair (160, -28.000)); // Middle band right (stop) maskSlopesRight.push_back (std::make_pair (161, -28.375)); // Outer band right (start) maskSlopesRight.push_back (std::make_pair (192, -40.0)); // Outer band right (stop) - AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ac 20MHz", WIFI_PHY_STANDARD_80211ac, WIFI_PHY_BAND_5GHZ, + AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ac 20MHz", WIFI_STANDARD_80211ac, WIFI_PHY_BAND_5GHZ, 20, maskSlopesLeft, maskSlopesRight, tol), TestCase::QUICK); @@ -480,7 +480,7 @@ WifiTransmitMaskTestSuite::WifiTransmitMaskTestSuite () maskSlopesRight.push_back (std::make_pair (320, -28.000)); // Middle band right (stop) maskSlopesRight.push_back (std::make_pair (321, -28.188)); // Outer band right (start) maskSlopesRight.push_back (std::make_pair (384, -40.0)); // Outer band right (stop) - AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ac 40MHz", WIFI_PHY_STANDARD_80211ac, WIFI_PHY_BAND_5GHZ, + AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ac 40MHz", WIFI_STANDARD_80211ac, WIFI_PHY_BAND_5GHZ, 40, maskSlopesLeft, maskSlopesRight, tol), TestCase::QUICK); @@ -504,7 +504,7 @@ WifiTransmitMaskTestSuite::WifiTransmitMaskTestSuite () maskSlopesRight.push_back (std::make_pair (640, -28.000)); // Middle band right (stop) maskSlopesRight.push_back (std::make_pair (641, -28.094)); // Outer band right (start) maskSlopesRight.push_back (std::make_pair (768, -40.0)); // Outer band right (stop) - AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ac 80MHz", WIFI_PHY_STANDARD_80211ac, WIFI_PHY_BAND_5GHZ, + AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ac 80MHz", WIFI_STANDARD_80211ac, WIFI_PHY_BAND_5GHZ, 80, maskSlopesLeft, maskSlopesRight, tol), TestCase::QUICK); @@ -528,7 +528,7 @@ WifiTransmitMaskTestSuite::WifiTransmitMaskTestSuite () maskSlopesRight.push_back (std::make_pair (1280, -28.000)); // Middle band right (stop) maskSlopesRight.push_back (std::make_pair (1281, -28.047)); // Outer band right (start) maskSlopesRight.push_back (std::make_pair (1536, -40.0)); // Outer band right (stop) - AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ac 160MHz", WIFI_PHY_STANDARD_80211ac, WIFI_PHY_BAND_5GHZ, + AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ac 160MHz", WIFI_STANDARD_80211ac, WIFI_PHY_BAND_5GHZ, 160, maskSlopesLeft, maskSlopesRight, tol), TestCase::QUICK); @@ -554,7 +554,7 @@ WifiTransmitMaskTestSuite::WifiTransmitMaskTestSuite () maskSlopesRight.push_back (std::make_pair (640, -28.000)); // Middle band right (stop) maskSlopesRight.push_back (std::make_pair (641, -28.133)); // Outer band right (start) maskSlopesRight.push_back (std::make_pair (768, -45.000)); // Outer band right (stop) - AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ax_2.4GHz 20MHz", WIFI_PHY_STANDARD_80211ax, WIFI_PHY_BAND_2_4GHZ, + AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ax_2.4GHz 20MHz", WIFI_STANDARD_80211ax, WIFI_PHY_BAND_2_4GHZ, 20, maskSlopesLeft, maskSlopesRight, tol), TestCase::QUICK); @@ -578,7 +578,7 @@ WifiTransmitMaskTestSuite::WifiTransmitMaskTestSuite () maskSlopesRight.push_back (std::make_pair (640, -28.000)); // Middle band right (stop) maskSlopesRight.push_back (std::make_pair (641, -28.094)); // Outer band right (start) maskSlopesRight.push_back (std::make_pair (768, -40.0)); // Outer band right (stop) - AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ax_5GHz 20MHz", WIFI_PHY_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ, + AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ax_5GHz 20MHz", WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ, 20, maskSlopesLeft, maskSlopesRight, tol), TestCase::QUICK); @@ -602,7 +602,7 @@ WifiTransmitMaskTestSuite::WifiTransmitMaskTestSuite () maskSlopesRight.push_back (std::make_pair (1280, -28.000)); // Middle band right (stop) maskSlopesRight.push_back (std::make_pair (1281, -28.066)); // Outer band right (start) maskSlopesRight.push_back (std::make_pair (1536, -45.000)); // Outer band right (stop) - AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ax_2.4GHz 40MHz", WIFI_PHY_STANDARD_80211ax, WIFI_PHY_BAND_2_4GHZ, + AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ax_2.4GHz 40MHz", WIFI_STANDARD_80211ax, WIFI_PHY_BAND_2_4GHZ, 40, maskSlopesLeft, maskSlopesRight, tol), TestCase::QUICK); @@ -626,7 +626,7 @@ WifiTransmitMaskTestSuite::WifiTransmitMaskTestSuite () maskSlopesRight.push_back (std::make_pair (1280, -28.000)); // Middle band right (stop) maskSlopesRight.push_back (std::make_pair (1281, -28.047)); // Outer band right (start) maskSlopesRight.push_back (std::make_pair (1536, -40.0)); // Outer band right (stop) - AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ax_5GHz 40MHz", WIFI_PHY_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ, + AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ax_5GHz 40MHz", WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ, 40, maskSlopesLeft, maskSlopesRight, tol), TestCase::QUICK); @@ -650,7 +650,7 @@ WifiTransmitMaskTestSuite::WifiTransmitMaskTestSuite () maskSlopesRight.push_back (std::make_pair (2560, -28.000)); // Middle band right (stop) maskSlopesRight.push_back (std::make_pair (2561, -28.033)); // Outer band right (start) maskSlopesRight.push_back (std::make_pair (3072, -45.000)); // Outer band right (stop) - AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ax_2.4GHz 80MHz", WIFI_PHY_STANDARD_80211ax, WIFI_PHY_BAND_2_4GHZ, + AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ax_2.4GHz 80MHz", WIFI_STANDARD_80211ax, WIFI_PHY_BAND_2_4GHZ, 80, maskSlopesLeft, maskSlopesRight, tol), TestCase::QUICK); @@ -674,7 +674,7 @@ WifiTransmitMaskTestSuite::WifiTransmitMaskTestSuite () maskSlopesRight.push_back (std::make_pair (2560, -28.000)); // Middle band right (stop) maskSlopesRight.push_back (std::make_pair (2561, -28.023)); // Outer band right (start) maskSlopesRight.push_back (std::make_pair (3072, -40.0)); // Outer band right (stop) - AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ax_5GHz 80MHz", WIFI_PHY_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ, + AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ax_5GHz 80MHz", WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ, 80, maskSlopesLeft, maskSlopesRight, tol), TestCase::QUICK); @@ -700,7 +700,7 @@ WifiTransmitMaskTestSuite::WifiTransmitMaskTestSuite () maskSlopesRight.push_back (std::make_pair (5120, -28.000)); // Middle band right (stop) maskSlopesRight.push_back (std::make_pair (5121, -28.012)); // Outer band right (start) maskSlopesRight.push_back (std::make_pair (6144, -40.0)); // Outer band right (stop) - AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ax_5GHz 160MHz", WIFI_PHY_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ, + AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ax_5GHz 160MHz", WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ, 160, maskSlopesLeft, maskSlopesRight, tol), TestCase::QUICK);