From fe60645362cc244def54598a9c13ba6dd226c97e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Sun, 14 Aug 2022 11:40:47 +0200 Subject: [PATCH] wifi: Fix band stop index when DC subcarrier is skipped --- src/wifi/model/spectrum-wifi-phy.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wifi/model/spectrum-wifi-phy.cc b/src/wifi/model/spectrum-wifi-phy.cc index 84d3fd6e3..2fccfed08 100644 --- a/src/wifi/model/spectrum-wifi-phy.cc +++ b/src/wifi/model/spectrum-wifi-phy.cc @@ -497,12 +497,12 @@ SpectrumWifiPhy::GetBand (uint16_t bandWidth, uint8_t bandIndex) NS_ASSERT_MSG ((bandIndex * bandWidth) < channelWidth, "Band index is out of bound"); WifiSpectrumBand band; band.first = ((totalNumBands - numBandsInChannel) / 2) + (bandIndex * numBandsInBand); + band.second = band.first + numBandsInBand - 1; if (band.first >= totalNumBands / 2) { //step past DC band.first += 1; } - band.second = band.first + numBandsInBand - 1; return band; }