From d620b68e63742148d28766cde484beaad618cd4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Fri, 4 Nov 2022 12:08:02 +0100 Subject: [PATCH] wifi: Rename WifiPpdu::CanBeReceived to WifiPpdu::DoesCoverChannel --- src/wifi/model/phy-entity.cc | 2 +- src/wifi/model/wifi-ppdu.cc | 3 +-- src/wifi/model/wifi-ppdu.h | 8 +++----- src/wifi/test/wifi-phy-reception-test.cc | 4 ++-- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/wifi/model/phy-entity.cc b/src/wifi/model/phy-entity.cc index 04a58e08f..4cfa1524b 100644 --- a/src/wifi/model/phy-entity.cc +++ b/src/wifi/model/phy-entity.cc @@ -1349,7 +1349,7 @@ PhyEntity::CanStartRx(Ptr ppdu) const const auto p20MinFreq = p20CenterFreq - (primaryWidth / 2); const auto p20MaxFreq = p20CenterFreq + (primaryWidth / 2); - return ppdu->CanBeReceived(p20MinFreq, p20MaxFreq); + return ppdu->DoesCoverChannel(p20MinFreq, p20MaxFreq); } } // namespace ns3 diff --git a/src/wifi/model/wifi-ppdu.cc b/src/wifi/model/wifi-ppdu.cc index b9482d459..89a18f210 100644 --- a/src/wifi/model/wifi-ppdu.cc +++ b/src/wifi/model/wifi-ppdu.cc @@ -174,7 +174,7 @@ WifiPpdu::DoesOverlapChannel(uint16_t minFreq, uint16_t maxFreq) const } bool -WifiPpdu::CanBeReceived(uint16_t p20MinFreq, uint16_t p20MaxFreq) const +WifiPpdu::DoesCoverChannel(uint16_t p20MinFreq, uint16_t p20MaxFreq) const { NS_LOG_FUNCTION(this << p20MinFreq << p20MaxFreq); uint16_t txChannelWidth = GetTxVector().GetChannelWidth(); @@ -182,7 +182,6 @@ WifiPpdu::CanBeReceived(uint16_t p20MinFreq, uint16_t p20MaxFreq) const uint16_t maxTxFreq = m_txCenterFreq + txChannelWidth / 2; if (p20MinFreq < minTxFreq || p20MaxFreq > maxTxFreq) { - NS_LOG_INFO("Received PPDU does not cover the whole primary20 channel"); return false; } return true; diff --git a/src/wifi/model/wifi-ppdu.h b/src/wifi/model/wifi-ppdu.h index f07218985..baca03afb 100644 --- a/src/wifi/model/wifi-ppdu.h +++ b/src/wifi/model/wifi-ppdu.h @@ -137,15 +137,13 @@ class WifiPpdu : public SimpleRefCount bool DoesOverlapChannel(uint16_t minFreq, uint16_t maxFreq) const; /** - * Check whether the given PPDU can be received on the specified primary - * channel. Normally, a PPDU can be received if it is transmitted over a - * channel that overlaps the primary20 channel of a PHY entity. + * Check whether the given PPDU covers the whole channel. * * \param p20MinFreq the minimum frequency (MHz) of the primary channel * \param p20MaxFreq the maximum frequency (MHz) of the primary channel - * \return true if this PPDU can be received, false otherwise + * \return true if this PPDU covers the whole channel, false otherwise */ - bool CanBeReceived(uint16_t p20MinFreq, uint16_t p20MaxFreq) const; + bool DoesCoverChannel(uint16_t p20MinFreq, uint16_t p20MaxFreq) const; /** * Get the modulation used for the PPDU. diff --git a/src/wifi/test/wifi-phy-reception-test.cc b/src/wifi/test/wifi-phy-reception-test.cc index 8d61205df..4cb45d93d 100644 --- a/src/wifi/test/wifi-phy-reception-test.cc +++ b/src/wifi/test/wifi-phy-reception-test.cc @@ -4567,7 +4567,7 @@ TestUnsupportedBandwidthReception::DoRun() * * \brief Primary 20 MHz Covered By Ppdu Test * This test checks whether the functions WifiPpdu::DoesOverlapChannel and - * WifiPpdu::CanBeReceived are returning the expected results. + * WifiPpdu::DoesCoverChannel are returning the expected results. */ class TestPrimary20CoveredByPpdu : public TestCase { @@ -4675,7 +4675,7 @@ TestPrimary20CoveredByPpdu::RunOne(WifiPhyBand band, expectedP20Overlap, "PPDU is not expected to overlap with the P20"); - auto p20Covered = ppdu->CanBeReceived(p20MinFreq, p20MaxFreq); + auto p20Covered = ppdu->DoesCoverChannel(p20MinFreq, p20MaxFreq); NS_ASSERT(p20Covered == expectedP20Covered); NS_TEST_ASSERT_MSG_EQ(p20Covered, expectedP20Covered,