wifi: Specify units of magic numbers

This commit is contained in:
Sébastien Deronne
2024-12-07 08:14:30 +01:00
parent 4cf22a3c55
commit 544086503f
95 changed files with 4043 additions and 3670 deletions

View File

@@ -204,7 +204,7 @@ main(int argc, char* argv[])
/* Setting applications */
const auto maxLoad = HtPhy::GetDataRate(i,
channelBonding ? 40 : 20,
channelBonding ? MHz_u{40} : MHz_u{20},
NanoSeconds(shortGuardInterval ? 400 : 800),
nStreams);
ApplicationContainer serverApp;

View File

@@ -578,18 +578,18 @@ main(int argc, char* argv[])
Ptr<WifiPhy> wifiPhyPtr = staDevicePtr->GetObject<WifiNetDevice>()->GetPhy();
if (i <= 15)
{
NS_ABORT_MSG_IF(wifiPhyPtr->GetChannelWidth() != 20,
NS_ABORT_MSG_IF(wifiPhyPtr->GetChannelWidth() != MHz_u{20},
"Error: Channel width must be 20 MHz if MCS index <= 15");
NS_ABORT_MSG_IF(
wifiPhyPtr->GetFrequency() != 5180,
wifiPhyPtr->GetFrequency() != MHz_u{5180},
"Error: Wi-Fi nodes must be tuned to 5180 MHz to match the waveform generator");
}
else
{
NS_ABORT_MSG_IF(wifiPhyPtr->GetChannelWidth() != 40,
NS_ABORT_MSG_IF(wifiPhyPtr->GetChannelWidth() != MHz_u{40},
"Error: Channel width must be 40 MHz if MCS index > 15");
NS_ABORT_MSG_IF(
wifiPhyPtr->GetFrequency() != 5190,
wifiPhyPtr->GetFrequency() != MHz_u{5190},
"Error: Wi-Fi nodes must be tuned to 5190 MHz to match the waveform generator");
}