From bf4f425ba90ce46a06865832748976e65d8fe090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Tue, 8 May 2018 08:32:27 +0200 Subject: [PATCH] wifi: Change returned type for GetCenterFrequencyForChannelWidth --- src/wifi/model/spectrum-wifi-phy.cc | 8 ++++---- src/wifi/model/spectrum-wifi-phy.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/wifi/model/spectrum-wifi-phy.cc b/src/wifi/model/spectrum-wifi-phy.cc index 6f52b6c47..70e94ba24 100644 --- a/src/wifi/model/spectrum-wifi-phy.cc +++ b/src/wifi/model/spectrum-wifi-phy.cc @@ -314,17 +314,17 @@ SpectrumWifiPhy::GetTxPowerSpectralDensity (uint16_t centerFrequency, uint16_t c return v; } -uint32_t +uint16_t SpectrumWifiPhy::GetCenterFrequencyForChannelWidth (WifiTxVector txVector) const { NS_LOG_FUNCTION (this << txVector); - uint32_t centerFrequencyForSupportedWidth = GetFrequency (); + uint16_t centerFrequencyForSupportedWidth = GetFrequency (); uint16_t supportedWidth = GetChannelWidth (); uint16_t currentWidth = txVector.GetChannelWidth (); if (currentWidth != supportedWidth) { - uint32_t startingFrequency = centerFrequencyForSupportedWidth - static_cast (supportedWidth / 2); - return startingFrequency + static_cast (currentWidth / 2); // primary channel is in the lower part (for the time being) + uint16_t startingFrequency = centerFrequencyForSupportedWidth - (supportedWidth / 2); + return startingFrequency + (currentWidth / 2); // primary channel is in the lower part (for the time being) } return centerFrequencyForSupportedWidth; } diff --git a/src/wifi/model/spectrum-wifi-phy.h b/src/wifi/model/spectrum-wifi-phy.h index 36ad6bfdb..1dcebf56c 100644 --- a/src/wifi/model/spectrum-wifi-phy.h +++ b/src/wifi/model/spectrum-wifi-phy.h @@ -109,7 +109,7 @@ public: * \param txVector the TXVECTOR that has the channel width that is to be used * \return the center frequency corresponding to the channel width to be used */ - uint32_t GetCenterFrequencyForChannelWidth (WifiTxVector txVector) const; + uint16_t GetCenterFrequencyForChannelWidth (WifiTxVector txVector) const; /** * Method to encapsulate the creation of the WifiSpectrumPhyInterface