wifi: Check primary 20 MHz channel is not punctured

This commit is contained in:
Sebastien Deronne
2022-07-16 10:58:37 +02:00
parent 4d3bcef366
commit 3e7e735c25

View File

@@ -1163,6 +1163,14 @@ HePhy::GetTxPowerSpectralDensity (double txPowerW, Ptr<const WifiPpdu> ppdu) con
uint16_t centerFrequency = GetCenterFrequencyForChannelWidth (txVector);
uint16_t channelWidth = txVector.GetChannelWidth ();
NS_LOG_FUNCTION (this << centerFrequency << channelWidth << txPowerW);
const auto& puncturedSubchannels = txVector.GetInactiveSubchannels ();
if (!puncturedSubchannels.empty ())
{
const auto p20Index = m_wifiPhy->GetOperatingChannel ().GetPrimaryChannelIndex (20);
const auto& indices = m_wifiPhy->GetOperatingChannel ().GetAll20MHzChannelIndicesInPrimary (channelWidth);
const auto p20IndexInBitmap = p20Index - *(indices.cbegin ());
NS_ASSERT (!puncturedSubchannels.at (p20IndexInBitmap)); //the primary channel cannot be punctured
}
auto hePpdu = DynamicCast<const HePpdu> (ppdu);
NS_ASSERT (hePpdu);
HePpdu::TxPsdFlag flag = hePpdu->GetTxPsdFlag ();