From f16877ee06998d1057f167ca86ebaa28794ae2b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Sun, 4 Sep 2022 10:37:02 +0200 Subject: [PATCH] wifi: Rename SpectrumWifiPhy::SetChannel to SpectrumWifiPhy::AddChannel --- .../examples/wifi-test-interference-helper.cc | 6 ++-- src/wifi/helper/spectrum-wifi-helper.cc | 2 +- src/wifi/model/spectrum-wifi-phy.cc | 21 +++++++++-- src/wifi/model/spectrum-wifi-phy.h | 8 +++-- src/wifi/test/channel-access-manager-test.cc | 4 +-- src/wifi/test/spectrum-wifi-phy-test.cc | 6 ++-- src/wifi/test/wifi-non-ht-dup-test.cc | 8 ++--- src/wifi/test/wifi-phy-cca-test.cc | 6 ++-- src/wifi/test/wifi-phy-ofdma-test.cc | 36 +++++++++---------- src/wifi/test/wifi-phy-reception-test.cc | 10 +++--- src/wifi/test/wifi-phy-thresholds-test.cc | 2 +- 11 files changed, 63 insertions(+), 46 deletions(-) diff --git a/src/wifi/examples/wifi-test-interference-helper.cc b/src/wifi/examples/wifi-test-interference-helper.cc index 558f8fce3..96e566b44 100644 --- a/src/wifi/examples/wifi-test-interference-helper.cc +++ b/src/wifi/examples/wifi-test-interference-helper.cc @@ -263,9 +263,9 @@ InterferenceExperiment::Run(struct InterferenceExperiment::Input input) rx->SetInterferenceHelper(interferenceRx); Ptr errorRx = CreateObject(); rx->SetErrorRateModel(errorRx); - m_txA->SetChannel(channel); - m_txB->SetChannel(channel); - rx->SetChannel(channel); + m_txA->AddChannel(channel); + m_txB->AddChannel(channel); + rx->AddChannel(channel); m_txA->SetMobility(posTxA); m_txB->SetMobility(posTxB); rx->SetMobility(posRx); diff --git a/src/wifi/helper/spectrum-wifi-helper.cc b/src/wifi/helper/spectrum-wifi-helper.cc index c0838ce64..711ecef5f 100644 --- a/src/wifi/helper/spectrum-wifi-helper.cc +++ b/src/wifi/helper/spectrum-wifi-helper.cc @@ -104,7 +104,7 @@ SpectrumWifiPhyHelper::Create(Ptr node, Ptr device) const m_preambleDetectionModel.at(i).Create(); phy->SetPreambleDetectionModel(preambleDetection); } - phy->SetChannel(m_channels.at(i)); + phy->AddChannel(m_channels.at(i)); phy->SetDevice(device); phy->SetMobility(node->GetObject()); ret.emplace_back(phy); diff --git a/src/wifi/model/spectrum-wifi-phy.cc b/src/wifi/model/spectrum-wifi-phy.cc index 204586cc7..9f9acf38c 100644 --- a/src/wifi/model/spectrum-wifi-phy.cc +++ b/src/wifi/model/spectrum-wifi-phy.cc @@ -196,9 +196,24 @@ SpectrumWifiPhy::GetChannel() const } void -SpectrumWifiPhy::SetChannel(const Ptr channel) +SpectrumWifiPhy::AddChannel(const Ptr channel, const FrequencyRange& freqRange) { - NS_LOG_FUNCTION(this << channel); + NS_LOG_FUNCTION(this << channel << freqRange); + + const auto foundOverlappingChannel = + std::any_of(m_spectrumPhyInterfaces.cbegin(), + m_spectrumPhyInterfaces.cend(), + [freqRange, channel](const auto& item) { + const auto spectrumRange = item.first; + const auto noOverlap = + ((freqRange.minFrequency >= spectrumRange.maxFrequency) || + (freqRange.maxFrequency <= spectrumRange.minFrequency)); + return (!noOverlap); + }); + NS_ABORT_MSG_IF(foundOverlappingChannel, + "Added a wifi spectrum channel that overlaps with another existing wifi " + "spectrum channel"); + auto wifiSpectrumPhyInterface = CreateObject(); wifiSpectrumPhyInterface->SetSpectrumWifiPhy(this); wifiSpectrumPhyInterface->SetChannel(channel); @@ -206,7 +221,7 @@ SpectrumWifiPhy::SetChannel(const Ptr channel) { wifiSpectrumPhyInterface->SetDevice(GetDevice()); } - m_spectrumPhyInterfaces.insert({WHOLE_WIFI_SPECTRUM, wifiSpectrumPhyInterface}); + m_spectrumPhyInterfaces.emplace(freqRange, wifiSpectrumPhyInterface); } void diff --git a/src/wifi/model/spectrum-wifi-phy.h b/src/wifi/model/spectrum-wifi-phy.h index 9dd821d67..751996fad 100644 --- a/src/wifi/model/spectrum-wifi-phy.h +++ b/src/wifi/model/spectrum-wifi-phy.h @@ -76,11 +76,13 @@ class SpectrumWifiPhy : public WifiPhy std::tuple GetTxMaskRejectionParams() const override; /** - * Set the SpectrumChannel this SpectrumWifiPhy is to be connected to. + * Attach a SpectrumChannel to use for a given frequency range. * - * \param channel the SpectrumChannel this SpectrumWifiPhy is to be connected to + * \param channel the SpectrumChannel to attach + * \param freqRange the frequency range, bounded by a minFrequency and a maxFrequency in MHz */ - void SetChannel(const Ptr channel); + void AddChannel(const Ptr channel, + const FrequencyRange& freqRange = WHOLE_WIFI_SPECTRUM); /** * Input method for delivering a signal from the spectrum channel diff --git a/src/wifi/test/channel-access-manager-test.cc b/src/wifi/test/channel-access-manager-test.cc index 4e2d95c9e..e82a1da29 100644 --- a/src/wifi/test/channel-access-manager-test.cc +++ b/src/wifi/test/channel-access-manager-test.cc @@ -623,7 +623,7 @@ ChannelAccessManagerTest::StartTest(uint64_t slotTime, // to initialize m_phy = CreateObject(); m_phy->SetInterferenceHelper(CreateObject()); - m_phy->SetChannel(CreateObject()); + m_phy->AddChannel(CreateObject()); m_phy->SetOperatingChannel(WifiPhy::ChannelTuple{0, chWidth, WIFI_PHY_BAND_UNSPECIFIED, 0}); m_phy->ConfigureStandard(WIFI_STANDARD_80211ac); // required to use 160 MHz channels m_ChannelAccessManager->SetupPhyListener(m_phy); @@ -1500,7 +1500,7 @@ LargestIdlePrimaryChannelTest::DoRun() // create a new PHY operating on a channel of the current width m_phy = CreateObject(); m_phy->SetInterferenceHelper(CreateObject()); - m_phy->SetChannel(CreateObject()); + m_phy->AddChannel(CreateObject()); m_phy->SetOperatingChannel( WifiPhy::ChannelTuple{0, chWidth, WIFI_PHY_BAND_5GHZ, 0}); m_phy->ConfigureStandard(WIFI_STANDARD_80211ax); diff --git a/src/wifi/test/spectrum-wifi-phy-test.cc b/src/wifi/test/spectrum-wifi-phy-test.cc index 1b1383df5..2519c5aaf 100644 --- a/src/wifi/test/spectrum-wifi-phy-test.cc +++ b/src/wifi/test/spectrum-wifi-phy-test.cc @@ -202,7 +202,7 @@ SpectrumWifiPhyBasicTest::DoSetup() Ptr error = CreateObject(); m_phy->SetErrorRateModel(error); m_phy->SetDevice(dev); - m_phy->SetChannel(spectrumChannel); + m_phy->AddChannel(spectrumChannel); m_phy->SetOperatingChannel(WifiPhy::ChannelTuple{CHANNEL_NUMBER, 0, WIFI_PHY_BAND_5GHZ, 0}); m_phy->ConfigureStandard(WIFI_STANDARD_80211n); m_phy->SetReceiveOkCallback( @@ -550,7 +550,7 @@ SpectrumWifiPhyFilterTest::DoSetup() Ptr txErrorModel = CreateObject(); m_txPhy->SetErrorRateModel(txErrorModel); m_txPhy->SetDevice(txDev); - m_txPhy->SetChannel(spectrumChannel); + m_txPhy->AddChannel(spectrumChannel); m_txPhy->ConfigureStandard(WIFI_STANDARD_80211ax); Ptr apMobility = CreateObject(); m_txPhy->SetMobility(apMobility); @@ -565,7 +565,7 @@ SpectrumWifiPhyFilterTest::DoSetup() m_rxPhy->SetInterferenceHelper(rxInterferenceHelper); Ptr rxErrorModel = CreateObject(); m_rxPhy->SetErrorRateModel(rxErrorModel); - m_rxPhy->SetChannel(spectrumChannel); + m_rxPhy->AddChannel(spectrumChannel); m_rxPhy->ConfigureStandard(WIFI_STANDARD_80211ax); Ptr sta1Mobility = CreateObject(); m_rxPhy->SetMobility(sta1Mobility); diff --git a/src/wifi/test/wifi-non-ht-dup-test.cc b/src/wifi/test/wifi-non-ht-dup-test.cc index bf2e672d1..975c8dbd6 100644 --- a/src/wifi/test/wifi-non-ht-dup-test.cc +++ b/src/wifi/test/wifi-non-ht-dup-test.cc @@ -430,7 +430,7 @@ TestNonHtDuplicatePhyReception::DoSetup() auto apErrorModel = CreateObject(); m_phyAp->SetErrorRateModel(apErrorModel); m_phyAp->SetDevice(apDev); - m_phyAp->SetChannel(spectrumChannel); + m_phyAp->AddChannel(spectrumChannel); m_phyAp->ConfigureStandard(WIFI_STANDARD_80211ax); auto apMobility = CreateObject(); m_phyAp->SetMobility(apMobility); @@ -448,7 +448,7 @@ TestNonHtDuplicatePhyReception::DoSetup() auto sta1ErrorModel = CreateObject(); staPhy->SetErrorRateModel(sta1ErrorModel); staPhy->SetDevice(staDev); - staPhy->SetChannel(spectrumChannel); + staPhy->AddChannel(spectrumChannel); staPhy->ConfigureStandard(std::get<0>(staParams)); staPhy->SetReceiveOkCallback( MakeCallback(&TestNonHtDuplicatePhyReception::RxSuccess, this).Bind(m_phyStas.size())); @@ -803,7 +803,7 @@ TestMultipleCtsResponsesFromMuRts::DoSetup() auto apErrorModel = CreateObject(); m_phyAp->SetErrorRateModel(apErrorModel); m_phyAp->SetDevice(apDev); - m_phyAp->SetChannel(spectrumChannel); + m_phyAp->AddChannel(spectrumChannel); m_phyAp->ConfigureStandard(WIFI_STANDARD_80211ax); m_phyAp->AssignStreams(streamNumber); @@ -837,7 +837,7 @@ TestMultipleCtsResponsesFromMuRts::DoSetup() auto staErrorModel = CreateObject(); phySta->SetErrorRateModel(staErrorModel); phySta->SetDevice(staDev); - phySta->SetChannel(spectrumChannel); + phySta->AddChannel(spectrumChannel); phySta->ConfigureStandard(WIFI_STANDARD_80211ax); phySta->AssignStreams(streamNumber); phySta->SetTxPowerStart(m_stasTxPowerDbm); diff --git a/src/wifi/test/wifi-phy-cca-test.cc b/src/wifi/test/wifi-phy-cca-test.cc index acb113407..3f7ba0dbd 100644 --- a/src/wifi/test/wifi-phy-cca-test.cc +++ b/src/wifi/test/wifi-phy-cca-test.cc @@ -244,7 +244,7 @@ WifiPhyCcaThresholdsTest::DoSetup() m_phy->SetDevice(m_device); m_device->SetPhy(m_phy); m_phy->SetInterferenceHelper(CreateObject()); - m_phy->SetChannel(CreateObject()); + m_phy->AddChannel(CreateObject()); auto channelNum = std::get<0>( *WifiPhyOperatingChannel::FindFirst(0, 0, 160, WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ)); @@ -1026,7 +1026,7 @@ WifiPhyCcaIndicationTest::DoSetup() Ptr preambleDetectionModel = CreateObject(); m_rxPhy->SetPreambleDetectionModel(preambleDetectionModel); - m_rxPhy->SetChannel(spectrumChannel); + m_rxPhy->AddChannel(spectrumChannel); m_rxPhy->ConfigureStandard(WIFI_STANDARD_80211ax); m_rxPhy->SetDevice(rxDev); rxDev->SetPhy(m_rxPhy); @@ -1040,7 +1040,7 @@ WifiPhyCcaIndicationTest::DoSetup() m_txPhy->SetInterferenceHelper(txInterferenceHelper); Ptr txErrorModel = CreateObject(); m_txPhy->SetErrorRateModel(txErrorModel); - m_txPhy->SetChannel(spectrumChannel); + m_txPhy->AddChannel(spectrumChannel); m_txPhy->ConfigureStandard(WIFI_STANDARD_80211ax); m_txPhy->SetDevice(txDev); txDev->SetPhy(m_txPhy); diff --git a/src/wifi/test/wifi-phy-ofdma-test.cc b/src/wifi/test/wifi-phy-ofdma-test.cc index 9386140f7..b55095486 100644 --- a/src/wifi/test/wifi-phy-ofdma-test.cc +++ b/src/wifi/test/wifi-phy-ofdma-test.cc @@ -714,7 +714,7 @@ TestDlOfdmaPhyTransmission::DoSetup() Ptr apErrorModel = CreateObject(); m_phyAp->SetErrorRateModel(apErrorModel); m_phyAp->SetDevice(apDev); - m_phyAp->SetChannel(spectrumChannel); + m_phyAp->AddChannel(spectrumChannel); m_phyAp->ConfigureStandard(WIFI_STANDARD_80211ax); Ptr apMobility = CreateObject(); m_phyAp->SetMobility(apMobility); @@ -730,7 +730,7 @@ TestDlOfdmaPhyTransmission::DoSetup() Ptr sta1ErrorModel = CreateObject(); m_phySta1->SetErrorRateModel(sta1ErrorModel); m_phySta1->SetDevice(sta1Dev); - m_phySta1->SetChannel(spectrumChannel); + m_phySta1->AddChannel(spectrumChannel); m_phySta1->ConfigureStandard(WIFI_STANDARD_80211ax); m_phySta1->SetReceiveOkCallback(MakeCallback(&TestDlOfdmaPhyTransmission::RxSuccessSta1, this)); m_phySta1->SetReceiveErrorCallback( @@ -749,7 +749,7 @@ TestDlOfdmaPhyTransmission::DoSetup() Ptr sta2ErrorModel = CreateObject(); m_phySta2->SetErrorRateModel(sta2ErrorModel); m_phySta2->SetDevice(sta2Dev); - m_phySta2->SetChannel(spectrumChannel); + m_phySta2->AddChannel(spectrumChannel); m_phySta2->ConfigureStandard(WIFI_STANDARD_80211ax); m_phySta2->SetReceiveOkCallback(MakeCallback(&TestDlOfdmaPhyTransmission::RxSuccessSta2, this)); m_phySta2->SetReceiveErrorCallback( @@ -768,7 +768,7 @@ TestDlOfdmaPhyTransmission::DoSetup() Ptr sta3ErrorModel = CreateObject(); m_phySta3->SetErrorRateModel(sta3ErrorModel); m_phySta3->SetDevice(sta3Dev); - m_phySta3->SetChannel(spectrumChannel); + m_phySta3->AddChannel(spectrumChannel); m_phySta3->ConfigureStandard(WIFI_STANDARD_80211ax); m_phySta3->SetReceiveOkCallback(MakeCallback(&TestDlOfdmaPhyTransmission::RxSuccessSta3, this)); m_phySta3->SetReceiveErrorCallback( @@ -1556,7 +1556,7 @@ TestDlOfdmaPhyPuncturing::DoSetup() Ptr apErrorModel = CreateObject(); m_phyAp->SetErrorRateModel(apErrorModel); m_phyAp->SetDevice(apDev); - m_phyAp->SetChannel(spectrumChannel); + m_phyAp->AddChannel(spectrumChannel); m_phyAp->ConfigureStandard(WIFI_STANDARD_80211ax); Ptr apMobility = CreateObject(); m_phyAp->SetMobility(apMobility); @@ -1572,7 +1572,7 @@ TestDlOfdmaPhyPuncturing::DoSetup() Ptr sta1ErrorModel = CreateObject(); m_phySta1->SetErrorRateModel(sta1ErrorModel); m_phySta1->SetDevice(sta1Dev); - m_phySta1->SetChannel(spectrumChannel); + m_phySta1->AddChannel(spectrumChannel); m_phySta1->ConfigureStandard(WIFI_STANDARD_80211ax); m_phySta1->SetReceiveOkCallback(MakeCallback(&TestDlOfdmaPhyPuncturing::RxSuccessSta1, this)); m_phySta1->SetReceiveErrorCallback( @@ -1591,7 +1591,7 @@ TestDlOfdmaPhyPuncturing::DoSetup() Ptr sta2ErrorModel = CreateObject(); m_phySta2->SetErrorRateModel(sta2ErrorModel); m_phySta2->SetDevice(sta2Dev); - m_phySta2->SetChannel(spectrumChannel); + m_phySta2->AddChannel(spectrumChannel); m_phySta2->ConfigureStandard(WIFI_STANDARD_80211ax); m_phySta2->SetReceiveOkCallback(MakeCallback(&TestDlOfdmaPhyPuncturing::RxSuccessSta2, this)); m_phySta2->SetReceiveErrorCallback( @@ -1913,7 +1913,7 @@ TestUlOfdmaPpduUid::DoSetup() m_phyAp->SetInterferenceHelper(apInterferenceHelper); Ptr apErrorModel = CreateObject(); m_phyAp->SetErrorRateModel(apErrorModel); - m_phyAp->SetChannel(spectrumChannel); + m_phyAp->AddChannel(spectrumChannel); m_phyAp->ConfigureStandard(WIFI_STANDARD_80211ax); auto channelNum = std::get<0>(*WifiPhyOperatingChannel::FindFirst(0, DEFAULT_FREQUENCY, @@ -1940,7 +1940,7 @@ TestUlOfdmaPpduUid::DoSetup() m_phySta1->SetInterferenceHelper(sta1InterferenceHelper); Ptr sta1ErrorModel = CreateObject(); m_phySta1->SetErrorRateModel(sta1ErrorModel); - m_phySta1->SetChannel(spectrumChannel); + m_phySta1->AddChannel(spectrumChannel); m_phySta1->ConfigureStandard(WIFI_STANDARD_80211ax); m_phySta1->SetOperatingChannel( WifiPhy::ChannelTuple{channelNum, DEFAULT_CHANNEL_WIDTH, (int)(WIFI_PHY_BAND_5GHZ), 0}); @@ -1960,7 +1960,7 @@ TestUlOfdmaPpduUid::DoSetup() m_phySta2->SetInterferenceHelper(sta2InterferenceHelper); Ptr sta2ErrorModel = CreateObject(); m_phySta2->SetErrorRateModel(sta2ErrorModel); - m_phySta2->SetChannel(spectrumChannel); + m_phySta2->AddChannel(spectrumChannel); m_phySta2->ConfigureStandard(WIFI_STANDARD_80211ax); m_phySta2->SetOperatingChannel( WifiPhy::ChannelTuple{channelNum, DEFAULT_CHANNEL_WIDTH, (int)(WIFI_PHY_BAND_5GHZ), 0}); @@ -2508,7 +2508,7 @@ TestMultipleHeTbPreambles::DoSetup() dev->SetMac(mac); m_phy->SetInterferenceHelper(interferenceHelper); m_phy->SetErrorRateModel(error); - m_phy->SetChannel(spectrumChannel); + m_phy->AddChannel(spectrumChannel); m_phy->ConfigureStandard(WIFI_STANDARD_80211ax); m_phy->SetOperatingChannel(WifiPhy::ChannelTuple{DEFAULT_CHANNEL_NUMBER, DEFAULT_CHANNEL_WIDTH, @@ -3729,7 +3729,7 @@ TestUlOfdmaPhyTransmission::DoSetup() Ptr apErrorModel = CreateObject(); m_phyAp->SetErrorRateModel(apErrorModel); m_phyAp->SetDevice(apDev); - m_phyAp->SetChannel(spectrumChannel); + m_phyAp->AddChannel(spectrumChannel); m_phyAp->ConfigureStandard(WIFI_STANDARD_80211ax); m_phyAp->SetReceiveOkCallback(MakeCallback(&TestUlOfdmaPhyTransmission::RxSuccess, this)); m_phyAp->SetReceiveErrorCallback(MakeCallback(&TestUlOfdmaPhyTransmission::RxFailure, this)); @@ -3753,7 +3753,7 @@ TestUlOfdmaPhyTransmission::DoSetup() Ptr sta1ErrorModel = CreateObject(); m_phySta1->SetErrorRateModel(sta1ErrorModel); m_phySta1->SetDevice(sta1Dev); - m_phySta1->SetChannel(spectrumChannel); + m_phySta1->AddChannel(spectrumChannel); m_phySta1->ConfigureStandard(WIFI_STANDARD_80211ax); m_phySta1->SetPreambleDetectionModel(preambleDetectionModel); Ptr sta1Mobility = CreateObject(); @@ -3772,7 +3772,7 @@ TestUlOfdmaPhyTransmission::DoSetup() Ptr sta2ErrorModel = CreateObject(); m_phySta2->SetErrorRateModel(sta2ErrorModel); m_phySta2->SetDevice(sta2Dev); - m_phySta2->SetChannel(spectrumChannel); + m_phySta2->AddChannel(spectrumChannel); m_phySta2->ConfigureStandard(WIFI_STANDARD_80211ax); m_phySta2->SetPreambleDetectionModel(preambleDetectionModel); Ptr sta2Mobility = CreateObject(); @@ -3791,7 +3791,7 @@ TestUlOfdmaPhyTransmission::DoSetup() Ptr sta3ErrorModel = CreateObject(); m_phySta3->SetErrorRateModel(sta3ErrorModel); m_phySta3->SetDevice(sta3Dev); - m_phySta3->SetChannel(spectrumChannel); + m_phySta3->AddChannel(spectrumChannel); m_phySta3->ConfigureStandard(WIFI_STANDARD_80211ax); m_phySta3->SetPreambleDetectionModel(preambleDetectionModel); Ptr sta3Mobility = CreateObject(); @@ -5087,7 +5087,7 @@ TestPhyPaddingExclusion::DoSetup() Ptr apErrorModel = CreateObject(); m_phyAp->SetErrorRateModel(apErrorModel); m_phyAp->SetDevice(apDev); - m_phyAp->SetChannel(spectrumChannel); + m_phyAp->AddChannel(spectrumChannel); m_phyAp->ConfigureStandard(WIFI_STANDARD_80211ax); m_phyAp->AssignStreams(streamNumber); auto channelNum = std::get<0>(*WifiPhyOperatingChannel::FindFirst(0, @@ -5117,7 +5117,7 @@ TestPhyPaddingExclusion::DoSetup() Ptr sta1ErrorModel = CreateObject(); m_phySta1->SetErrorRateModel(sta1ErrorModel); m_phySta1->SetDevice(sta1Dev); - m_phySta1->SetChannel(spectrumChannel); + m_phySta1->AddChannel(spectrumChannel); m_phySta1->ConfigureStandard(WIFI_STANDARD_80211ax); m_phySta1->AssignStreams(streamNumber); m_phySta1->SetOperatingChannel( @@ -5138,7 +5138,7 @@ TestPhyPaddingExclusion::DoSetup() Ptr sta2ErrorModel = CreateObject(); m_phySta2->SetErrorRateModel(sta2ErrorModel); m_phySta2->SetDevice(sta2Dev); - m_phySta2->SetChannel(spectrumChannel); + m_phySta2->AddChannel(spectrumChannel); m_phySta2->ConfigureStandard(WIFI_STANDARD_80211ax); m_phySta2->AssignStreams(streamNumber); m_phySta2->SetOperatingChannel( diff --git a/src/wifi/test/wifi-phy-reception-test.cc b/src/wifi/test/wifi-phy-reception-test.cc index 9c5a270ef..a4ef99bef 100644 --- a/src/wifi/test/wifi-phy-reception-test.cc +++ b/src/wifi/test/wifi-phy-reception-test.cc @@ -182,7 +182,7 @@ WifiPhyReceptionTest::DoSetup() Ptr error = CreateObject(); m_phy->SetErrorRateModel(error); m_phy->SetDevice(dev); - m_phy->SetChannel(spectrumChannel); + m_phy->AddChannel(spectrumChannel); m_phy->SetOperatingChannel(WifiPhy::ChannelTuple{CHANNEL_NUMBER, 0, WIFI_PHY_BAND_5GHZ, 0}); m_phy->ConfigureStandard(WIFI_STANDARD_80211ax); dev->SetPhy(m_phy); @@ -4418,7 +4418,7 @@ TestUnsupportedBandwidthReception::DoSetup() auto rxErrorRateModel = CreateObject(); m_rxPhy->SetErrorRateModel(rxErrorRateModel); m_rxPhy->SetDevice(dev); - m_rxPhy->SetChannel(spectrumChannel); + m_rxPhy->AddChannel(spectrumChannel); m_rxPhy->ConfigureStandard(WIFI_STANDARD_80211ax); dev->SetPhy(m_rxPhy); node->AddDevice(dev); @@ -4436,7 +4436,7 @@ TestUnsupportedBandwidthReception::DoSetup() m_txPhy->SetInterferenceHelper(txInterferenceHelper); auto txErrorRateModel = CreateObject(); m_txPhy->SetErrorRateModel(txErrorRateModel); - m_txPhy->SetChannel(spectrumChannel); + m_txPhy->AddChannel(spectrumChannel); m_txPhy->ConfigureStandard(WIFI_STANDARD_80211ax); } @@ -4570,7 +4570,7 @@ TestPrimary20CoveredByPpdu::DoSetup() m_rxPhy->SetInterferenceHelper(rxInterferenceHelper); auto rxErrorRateModel = CreateObject(); m_rxPhy->SetErrorRateModel(rxErrorRateModel); - m_rxPhy->SetChannel(CreateObject()); + m_rxPhy->AddChannel(CreateObject()); m_rxPhy->ConfigureStandard(WIFI_STANDARD_80211ax); m_txPhy = CreateObject(); @@ -4578,7 +4578,7 @@ TestPrimary20CoveredByPpdu::DoSetup() m_txPhy->SetInterferenceHelper(txInterferenceHelper); auto txErrorRateModel = CreateObject(); m_txPhy->SetErrorRateModel(txErrorRateModel); - m_txPhy->SetChannel(CreateObject()); + m_txPhy->AddChannel(CreateObject()); m_txPhy->ConfigureStandard(WIFI_STANDARD_80211ax); } diff --git a/src/wifi/test/wifi-phy-thresholds-test.cc b/src/wifi/test/wifi-phy-thresholds-test.cc index 716cabec7..205099028 100644 --- a/src/wifi/test/wifi-phy-thresholds-test.cc +++ b/src/wifi/test/wifi-phy-thresholds-test.cc @@ -265,7 +265,7 @@ WifiPhyThresholdsTest::DoSetup() Ptr error = CreateObject(); m_phy->SetErrorRateModel(error); m_phy->SetDevice(dev); - m_phy->SetChannel(spectrumChannel); + m_phy->AddChannel(spectrumChannel); m_phy->SetOperatingChannel(WifiPhy::ChannelTuple{CHANNEL_NUMBER, 0, WIFI_PHY_BAND_5GHZ, 0}); m_phy->ConfigureStandard(WIFI_STANDARD_80211ax); m_phy->SetReceiveOkCallback(MakeCallback(&WifiPhyThresholdsTest::RxSuccess, this));