From 5d40873e2bdec7b48b4b9cc8d03937b9072b4cc1 Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Wed, 30 Oct 2024 20:16:03 +0000 Subject: [PATCH] Fix clang-tidy readability-static-accessed-through-instance warnings Detected by clang-tidy-19 --- .../wifi-power-adaptation-distance.cc | 2 +- .../wifi-power-adaptation-interference.cc | 2 +- src/mesh/model/dot11s/airtime-metric.cc | 6 +- src/network/utils/lollipop-counter.h | 2 +- src/network/utils/packet-socket.cc | 2 +- src/stats/helper/gnuplot-helper.cc | 2 +- src/stats/model/sqlite-data-output.cc | 32 ++++----- .../test/codel-queue-disc-test-suite.cc | 4 +- src/wifi/model/eht/default-emlsr-manager.cc | 6 +- src/wifi/model/frame-exchange-manager.cc | 68 ++++++++++--------- .../model/he/he-frame-exchange-manager.cc | 8 +-- .../model/ht/ht-frame-exchange-manager.cc | 2 +- src/wifi/model/phy-entity.cc | 20 +++--- .../rate-control/minstrel-wifi-manager.cc | 2 +- .../model/rate-control/rraa-wifi-manager.cc | 4 +- .../model/rate-control/rrpaa-wifi-manager.cc | 4 +- src/wifi/test/spectrum-wifi-phy-test.cc | 2 +- src/wifi/test/tx-duration-test.cc | 6 +- src/wifi/test/wifi-non-ht-dup-test.cc | 2 +- src/wifi/test/wifi-phy-mu-mimo-test.cc | 6 +- src/wifi/test/wifi-phy-ofdma-test.cc | 36 +++++----- src/wifi/test/wifi-phy-reception-test.cc | 11 +-- .../test/wifi-phy-rx-trace-helper-test.cc | 24 +++---- src/wifi/test/wifi-phy-thresholds-test.cc | 2 +- utils/print-introspected-doxygen.cc | 2 +- 25 files changed, 135 insertions(+), 122 deletions(-) diff --git a/examples/wireless/wifi-power-adaptation-distance.cc b/examples/wireless/wifi-power-adaptation-distance.cc index e03ac21c7..27ee2f6c3 100644 --- a/examples/wireless/wifi-power-adaptation-distance.cc +++ b/examples/wireless/wifi-power-adaptation-distance.cc @@ -243,7 +243,7 @@ NodeStatistics::SetupPhy(Ptr phy) txVector.SetPreambleType(WIFI_PREAMBLE_LONG); txVector.SetChannelWidth(phy->GetChannelWidth()); DataRate dataRate(mode.GetDataRate(phy->GetChannelWidth())); - Time time = phy->CalculateTxDuration(packetSize, txVector, phy->GetPhyBand()); + Time time = WifiPhy::CalculateTxDuration(packetSize, txVector, phy->GetPhyBand()); NS_LOG_DEBUG(mode.GetUniqueName() << " " << time.GetSeconds() << " " << dataRate); m_timeTable.emplace_back(time, dataRate); } diff --git a/examples/wireless/wifi-power-adaptation-interference.cc b/examples/wireless/wifi-power-adaptation-interference.cc index 9988f2174..5e56fb844 100644 --- a/examples/wireless/wifi-power-adaptation-interference.cc +++ b/examples/wireless/wifi-power-adaptation-interference.cc @@ -264,7 +264,7 @@ NodeStatistics::SetupPhy(Ptr phy) txVector.SetPreambleType(WIFI_PREAMBLE_LONG); txVector.SetChannelWidth(phy->GetChannelWidth()); DataRate dataRate(mode.GetDataRate(phy->GetChannelWidth())); - Time time = phy->CalculateTxDuration(packetSize, txVector, phy->GetPhyBand()); + Time time = WifiPhy::CalculateTxDuration(packetSize, txVector, phy->GetPhyBand()); NS_LOG_DEBUG(mode.GetUniqueName() << " " << time.GetSeconds() << " " << dataRate); m_timeTable.emplace_back(time, dataRate); } diff --git a/src/mesh/model/dot11s/airtime-metric.cc b/src/mesh/model/dot11s/airtime-metric.cc index bdfc133bd..21ab6366c 100644 --- a/src/mesh/model/dot11s/airtime-metric.cc +++ b/src/mesh/model/dot11s/airtime-metric.cc @@ -93,9 +93,9 @@ AirtimeLinkMetricCalculator::CalculateMetric(Mac48Address peerAddress, // DIFS + SIFS + AckTxTime = 2 * SIFS + 2 * SLOT + AckTxTime 2 * mac->GetWifiPhy()->GetSifs() + 2 * mac->GetWifiPhy()->GetSlot() + mac->GetWifiPhy()->GetAckTxTime() + - mac->GetWifiPhy()->CalculateTxDuration(m_testFrame->GetSize(), - txVector, - mac->GetWifiPhy()->GetPhyBand())) + WifiPhy::CalculateTxDuration(m_testFrame->GetSize(), + txVector, + mac->GetWifiPhy()->GetPhyBand())) .GetMicroSeconds() / (10.24 * (1.0 - failAvg))); return metric; diff --git a/src/network/utils/lollipop-counter.h b/src/network/utils/lollipop-counter.h index a927e8bac..24f5227a2 100644 --- a/src/network/utils/lollipop-counter.h +++ b/src/network/utils/lollipop-counter.h @@ -285,7 +285,7 @@ class LollipopCounter { val.m_value++; - if (val.m_value == val.m_circularRegion + 1) + if (val.m_value == m_circularRegion + 1) { val.m_value = 0; } diff --git a/src/network/utils/packet-socket.cc b/src/network/utils/packet-socket.cc index ac6242ae2..8e9a7a735 100644 --- a/src/network/utils/packet-socket.cc +++ b/src/network/utils/packet-socket.cc @@ -397,7 +397,7 @@ PacketSocket::ForwardUp(Ptr device, { Ptr copy = packet->Copy(); DeviceNameTag dnt; - dnt.SetDeviceName(device->GetTypeId().GetName()); + dnt.SetDeviceName(NetDevice::GetTypeId().GetName()); PacketSocketTag pst; pst.SetPacketType(packetType); pst.SetDestAddress(to); diff --git a/src/stats/helper/gnuplot-helper.cc b/src/stats/helper/gnuplot-helper.cc index c416ca1f2..7d7330b4c 100644 --- a/src/stats/helper/gnuplot-helper.cc +++ b/src/stats/helper/gnuplot-helper.cc @@ -107,7 +107,7 @@ GnuplotHelper::PlotProbe(const std::string& typeId, aggregator->SetTitle(m_title + " \\n\\nTrace Source Path: " + path); // Set the default dataset plotting style for the values. - aggregator->Set2dDatasetDefaultStyle(Gnuplot2dDataset::LINES_POINTS); + GnuplotAggregator::Set2dDatasetDefaultStyle(Gnuplot2dDataset::LINES_POINTS); // Set the location of the key in the plot. aggregator->SetKeyLocation(keyLocation); diff --git a/src/stats/model/sqlite-data-output.cc b/src/stats/model/sqlite-data-output.cc index 4d3991d4a..847bcd09f 100644 --- a/src/stats/model/sqlite-data-output.cc +++ b/src/stats/model/sqlite-data-output.cc @@ -90,9 +90,9 @@ SqliteDataOutput::Output(DataCollector& dc) res = m_sqliteOut->Bind(stmt, 5, description); NS_ASSERT(res); - res = m_sqliteOut->SpinStep(stmt); + res = SQLiteOutput::SpinStep(stmt); NS_ASSERT(res); - res = m_sqliteOut->SpinFinalize(stmt); + res = SQLiteOutput::SpinFinalize(stmt); NS_ASSERT(res == 0); res = m_sqliteOut->WaitExec("CREATE TABLE IF NOT EXISTS " @@ -108,14 +108,14 @@ SqliteDataOutput::Output(DataCollector& dc) for (auto i = dc.MetadataBegin(); i != dc.MetadataEnd(); i++) { std::pair blob = (*i); - m_sqliteOut->SpinReset(stmt); + SQLiteOutput::SpinReset(stmt); m_sqliteOut->Bind(stmt, 1, run); m_sqliteOut->Bind(stmt, 2, blob.first); m_sqliteOut->Bind(stmt, 3, blob.second); - m_sqliteOut->SpinStep(stmt); + SQLiteOutput::SpinStep(stmt); } - m_sqliteOut->SpinFinalize(stmt); + SQLiteOutput::SpinFinalize(stmt); m_sqliteOut->SpinExec("BEGIN"); SqliteOutputCallback callback(m_sqliteOut, run); @@ -147,7 +147,7 @@ SqliteDataOutput::SqliteOutputCallback::SqliteOutputCallback(const PtrSpinFinalize(m_insertSingletonStatement); + SQLiteOutput::SpinFinalize(m_insertSingletonStatement); } void @@ -187,11 +187,11 @@ SqliteDataOutput::SqliteOutputCallback::OutputSingleton(std::string key, { NS_LOG_FUNCTION(this << key << variable << val); - m_db->SpinReset(m_insertSingletonStatement); + SQLiteOutput::SpinReset(m_insertSingletonStatement); m_db->Bind(m_insertSingletonStatement, 2, key); m_db->Bind(m_insertSingletonStatement, 3, variable); m_db->Bind(m_insertSingletonStatement, 4, val); - m_db->SpinStep(m_insertSingletonStatement); + SQLiteOutput::SpinStep(m_insertSingletonStatement); } void @@ -201,11 +201,11 @@ SqliteDataOutput::SqliteOutputCallback::OutputSingleton(std::string key, { NS_LOG_FUNCTION(this << key << variable << val); - m_db->SpinReset(m_insertSingletonStatement); + SQLiteOutput::SpinReset(m_insertSingletonStatement); m_db->Bind(m_insertSingletonStatement, 2, key); m_db->Bind(m_insertSingletonStatement, 3, variable); m_db->Bind(m_insertSingletonStatement, 4, val); - m_db->SpinStep(m_insertSingletonStatement); + SQLiteOutput::SpinStep(m_insertSingletonStatement); } void @@ -215,11 +215,11 @@ SqliteDataOutput::SqliteOutputCallback::OutputSingleton(std::string key, { NS_LOG_FUNCTION(this << key << variable << val); - m_db->SpinReset(m_insertSingletonStatement); + SQLiteOutput::SpinReset(m_insertSingletonStatement); m_db->Bind(m_insertSingletonStatement, 2, key); m_db->Bind(m_insertSingletonStatement, 3, variable); m_db->Bind(m_insertSingletonStatement, 4, val); - m_db->SpinStep(m_insertSingletonStatement); + SQLiteOutput::SpinStep(m_insertSingletonStatement); } void @@ -229,11 +229,11 @@ SqliteDataOutput::SqliteOutputCallback::OutputSingleton(std::string key, { NS_LOG_FUNCTION(this << key << variable << val); - m_db->SpinReset(m_insertSingletonStatement); + SQLiteOutput::SpinReset(m_insertSingletonStatement); m_db->Bind(m_insertSingletonStatement, 2, key); m_db->Bind(m_insertSingletonStatement, 3, variable); m_db->Bind(m_insertSingletonStatement, 4, val); - m_db->SpinStep(m_insertSingletonStatement); + SQLiteOutput::SpinStep(m_insertSingletonStatement); } void @@ -243,11 +243,11 @@ SqliteDataOutput::SqliteOutputCallback::OutputSingleton(std::string key, { NS_LOG_FUNCTION(this << key << variable << val); - m_db->SpinReset(m_insertSingletonStatement); + SQLiteOutput::SpinReset(m_insertSingletonStatement); m_db->Bind(m_insertSingletonStatement, 2, key); m_db->Bind(m_insertSingletonStatement, 3, variable); m_db->Bind(m_insertSingletonStatement, 4, val.GetTimeStep()); - m_db->SpinStep(m_insertSingletonStatement); + SQLiteOutput::SpinStep(m_insertSingletonStatement); } } // namespace ns3 diff --git a/src/traffic-control/test/codel-queue-disc-test-suite.cc b/src/traffic-control/test/codel-queue-disc-test-suite.cc index fa38900c2..7b115e47c 100644 --- a/src/traffic-control/test/codel-queue-disc-test-suite.cc +++ b/src/traffic-control/test/codel-queue-disc-test-suite.cc @@ -378,7 +378,7 @@ CoDelQueueDiscNewtonStepTest::DoRun() { for (uint32_t count = 1; count < 0xff; count *= 2) { - result = queue->NewtonStep(recInvSqrt, count); + result = CoDelQueueDisc::NewtonStep(recInvSqrt, count); // Test that ns-3 value is exactly the same as the Linux value NS_TEST_ASSERT_MSG_EQ(_codel_Newton_step(recInvSqrt, count), result, @@ -436,7 +436,7 @@ CoDelQueueDiscControlLawTest::DoRun() for (uint16_t recInvSqrt = 0xff; recInvSqrt > 0; recInvSqrt /= 2) { codelTimeVal = queue->Time2CoDel(timeVal); - uint32_t ns3Result = queue->ControlLaw(codelTimeVal, interval, recInvSqrt); + uint32_t ns3Result = CoDelQueueDisc::ControlLaw(codelTimeVal, interval, recInvSqrt); uint32_t linuxResult = _codel_control_law(codelTimeVal, interval, recInvSqrt); NS_TEST_ASSERT_MSG_EQ(ns3Result, linuxResult, diff --git a/src/wifi/model/eht/default-emlsr-manager.cc b/src/wifi/model/eht/default-emlsr-manager.cc index 07b2fbade..0e5a70998 100644 --- a/src/wifi/model/eht/default-emlsr-manager.cc +++ b/src/wifi/model/eht/default-emlsr-manager.cc @@ -273,8 +273,10 @@ DefaultEmlsrManager::GetTimeToCtsEnd(uint8_t linkId, const WifiTxVector& rtsTxVe const auto bssid = GetEhtFem(linkId)->GetBssid(); const auto ctsTxVector = stationManager->GetCtsTxVector(bssid, rtsTxVector.GetMode()); - const auto rtsTxTime = phy->CalculateTxDuration(GetRtsSize(), rtsTxVector, phy->GetPhyBand()); - const auto ctsTxTime = phy->CalculateTxDuration(GetCtsSize(), ctsTxVector, phy->GetPhyBand()); + const auto rtsTxTime = + WifiPhy::CalculateTxDuration(GetRtsSize(), rtsTxVector, phy->GetPhyBand()); + const auto ctsTxTime = + WifiPhy::CalculateTxDuration(GetCtsSize(), ctsTxVector, phy->GetPhyBand()); // the main PHY shall terminate the channel switch at the end of CTS reception; // the time remaining to the end of CTS reception includes two propagation delays diff --git a/src/wifi/model/frame-exchange-manager.cc b/src/wifi/model/frame-exchange-manager.cc index 6b3b7383f..68295a056 100644 --- a/src/wifi/model/frame-exchange-manager.cc +++ b/src/wifi/model/frame-exchange-manager.cc @@ -516,9 +516,9 @@ FrameExchangeManager::SendMpdu() { NS_LOG_FUNCTION(this); - Time txDuration = m_phy->CalculateTxDuration(GetPsduSize(m_mpdu, m_txParams.m_txVector), - m_txParams.m_txVector, - m_phy->GetPhyBand()); + Time txDuration = WifiPhy::CalculateTxDuration(GetPsduSize(m_mpdu, m_txParams.m_txVector), + m_txParams.m_txVector, + m_phy->GetPhyBand()); NS_ASSERT(m_txParams.m_acknowledgment); @@ -577,7 +577,7 @@ FrameExchangeManager::SendMpdu() Time timeout = txDuration + m_phy->GetSifs() + m_phy->GetSlot() + - m_phy->CalculatePhyPreambleAndHeaderDuration(normalAcknowledgment->ackTxVector); + WifiPhy::CalculatePhyPreambleAndHeaderDuration(normalAcknowledgment->ackTxVector); NS_ASSERT(!m_txTimer.IsRunning()); m_txTimer.Set(WifiTxTimer::WAIT_NORMAL_ACK, timeout, @@ -683,21 +683,22 @@ FrameExchangeManager::CalculateProtectionTime(WifiProtection* protection) const else if (protection->method == WifiProtection::RTS_CTS) { auto rtsCtsProtection = static_cast(protection); - rtsCtsProtection->protectionTime = m_phy->CalculateTxDuration(GetRtsSize(), - rtsCtsProtection->rtsTxVector, - m_phy->GetPhyBand()) + - m_phy->CalculateTxDuration(GetCtsSize(), - rtsCtsProtection->ctsTxVector, - m_phy->GetPhyBand()) + - 2 * m_phy->GetSifs(); + rtsCtsProtection->protectionTime = + WifiPhy::CalculateTxDuration(GetRtsSize(), + rtsCtsProtection->rtsTxVector, + m_phy->GetPhyBand()) + + WifiPhy::CalculateTxDuration(GetCtsSize(), + rtsCtsProtection->ctsTxVector, + m_phy->GetPhyBand()) + + 2 * m_phy->GetSifs(); } else if (protection->method == WifiProtection::CTS_TO_SELF) { auto ctsToSelfProtection = static_cast(protection); ctsToSelfProtection->protectionTime = - m_phy->CalculateTxDuration(GetCtsSize(), - ctsToSelfProtection->ctsTxVector, - m_phy->GetPhyBand()) + + WifiPhy::CalculateTxDuration(GetCtsSize(), + ctsToSelfProtection->ctsTxVector, + m_phy->GetPhyBand()) + m_phy->GetSifs(); } } @@ -716,9 +717,9 @@ FrameExchangeManager::CalculateAcknowledgmentTime(WifiAcknowledgment* acknowledg { auto normalAcknowledgment = static_cast(acknowledgment); normalAcknowledgment->acknowledgmentTime = - m_phy->GetSifs() + m_phy->CalculateTxDuration(GetAckSize(), - normalAcknowledgment->ackTxVector, - m_phy->GetPhyBand()); + m_phy->GetSifs() + WifiPhy::CalculateTxDuration(GetAckSize(), + normalAcknowledgment->ackTxVector, + m_phy->GetPhyBand()); } } @@ -727,7 +728,7 @@ FrameExchangeManager::GetTxDuration(uint32_t ppduPayloadSize, Mac48Address receiver, const WifiTxParameters& txParams) const { - return m_phy->CalculateTxDuration(ppduPayloadSize, txParams.m_txVector, m_phy->GetPhyBand()); + return WifiPhy::CalculateTxDuration(ppduPayloadSize, txParams.m_txVector, m_phy->GetPhyBand()); } void @@ -759,10 +760,11 @@ FrameExchangeManager::GetFrameDurationId(const WifiMacHeader& header, WifiTxVector ackTxVector = GetWifiRemoteStationManager()->GetAckTxVector(header.GetAddr1(), txParams.m_txVector); - durationId += - 2 * m_phy->GetSifs() + - m_phy->CalculateTxDuration(GetAckSize(), ackTxVector, m_phy->GetPhyBand()) + - m_phy->CalculateTxDuration(nextFragmentSize, txParams.m_txVector, m_phy->GetPhyBand()); + durationId += 2 * m_phy->GetSifs() + + WifiPhy::CalculateTxDuration(GetAckSize(), ackTxVector, m_phy->GetPhyBand()) + + WifiPhy::CalculateTxDuration(nextFragmentSize, + txParams.m_txVector, + m_phy->GetPhyBand()); } return durationId; } @@ -778,7 +780,7 @@ FrameExchangeManager::GetRtsDurationId(const WifiTxVector& rtsTxVector, ctsTxVector = GetWifiRemoteStationManager()->GetCtsTxVector(m_self, rtsTxVector.GetMode()); return m_phy->GetSifs() + - m_phy->CalculateTxDuration(GetCtsSize(), ctsTxVector, m_phy->GetPhyBand()) /* CTS */ + WifiPhy::CalculateTxDuration(GetCtsSize(), ctsTxVector, m_phy->GetPhyBand()) /* CTS */ + m_phy->GetSifs() + txDuration + response; } @@ -814,11 +816,11 @@ FrameExchangeManager::SendRts(const WifiTxParameters& txParams) // After transmitting an RTS frame, the STA shall wait for a CTSTimeout interval with // a value of aSIFSTime + aSlotTime + aRxPHYStartDelay (IEEE 802.11-2016 sec. 10.3.2.7). // aRxPHYStartDelay equals the time to transmit the PHY header. - Time timeout = m_phy->CalculateTxDuration(GetRtsSize(), - rtsCtsProtection->rtsTxVector, - m_phy->GetPhyBand()) + + Time timeout = WifiPhy::CalculateTxDuration(GetRtsSize(), + rtsCtsProtection->rtsTxVector, + m_phy->GetPhyBand()) + m_phy->GetSifs() + m_phy->GetSlot() + - m_phy->CalculatePhyPreambleAndHeaderDuration(rtsCtsProtection->ctsTxVector); + WifiPhy::CalculatePhyPreambleAndHeaderDuration(rtsCtsProtection->ctsTxVector); NS_ASSERT(!m_txTimer.IsRunning()); m_txTimer.Set(WifiTxTimer::WAIT_CTS, timeout, @@ -849,7 +851,7 @@ FrameExchangeManager::DoSendCtsAfterRts(const WifiMacHeader& rtsHdr, cts.SetNoRetry(); cts.SetAddr1(rtsHdr.GetAddr2()); Time duration = rtsHdr.GetDuration() - m_phy->GetSifs() - - m_phy->CalculateTxDuration(GetCtsSize(), ctsTxVector, m_phy->GetPhyBand()); + WifiPhy::CalculateTxDuration(GetCtsSize(), ctsTxVector, m_phy->GetPhyBand()); // The TXOP holder may exceed the TXOP limit in some situations (Sec. 10.22.2.8 of 802.11-2016) if (duration.IsStrictlyNegative()) { @@ -914,9 +916,9 @@ FrameExchangeManager::SendCtsToSelf(const WifiTxParameters& txParams) ForwardMpduDown(Create(Create(), cts), ctsToSelfProtection->ctsTxVector); - Time ctsDuration = m_phy->CalculateTxDuration(GetCtsSize(), - ctsToSelfProtection->ctsTxVector, - m_phy->GetPhyBand()); + Time ctsDuration = WifiPhy::CalculateTxDuration(GetCtsSize(), + ctsToSelfProtection->ctsTxVector, + m_phy->GetPhyBand()); Simulator::Schedule(ctsDuration, &FrameExchangeManager::ProtectionCompleted, this); } @@ -939,7 +941,7 @@ FrameExchangeManager::SendNormalAck(const WifiMacHeader& hdr, // 802.11-2016, Section 9.2.5.7: Duration/ID is received duration value // minus the time to transmit the Ack frame and its SIFS interval Time duration = hdr.GetDuration() - m_phy->GetSifs() - - m_phy->CalculateTxDuration(GetAckSize(), ackTxVector, m_phy->GetPhyBand()); + WifiPhy::CalculateTxDuration(GetAckSize(), ackTxVector, m_phy->GetPhyBand()); // The TXOP holder may exceed the TXOP limit in some situations (Sec. 10.22.2.8 of 802.11-2016) if (duration.IsStrictlyNegative()) { @@ -1321,7 +1323,7 @@ FrameExchangeManager::UpdateNav(Ptr psdu, const WifiTxVector& tx Time navResetDelay = 2 * m_phy->GetSifs() + WifiPhy::CalculateTxDuration(GetCtsSize(), ctsTxVector, m_phy->GetPhyBand()) + - m_phy->CalculatePhyPreambleAndHeaderDuration(ctsTxVector) + 2 * m_phy->GetSlot(); + WifiPhy::CalculatePhyPreambleAndHeaderDuration(ctsTxVector) + 2 * m_phy->GetSlot(); m_navResetEvent = Simulator::Schedule(navResetDelay, &FrameExchangeManager::NavResetTimeout, this); } diff --git a/src/wifi/model/he/he-frame-exchange-manager.cc b/src/wifi/model/he/he-frame-exchange-manager.cc index f2f92385c..49e6986e7 100644 --- a/src/wifi/model/he/he-frame-exchange-manager.cc +++ b/src/wifi/model/he/he-frame-exchange-manager.cc @@ -393,7 +393,7 @@ HeFrameExchangeManager::SendMuRts(const WifiTxParameters& txParams) protection->muRtsTxVector, m_phy->GetPhyBand()) + m_phy->GetSifs() + m_phy->GetSlot() + - m_phy->CalculatePhyPreambleAndHeaderDuration(ctsTxVector); + WifiPhy::CalculatePhyPreambleAndHeaderDuration(ctsTxVector); NS_ASSERT(!m_txTimer.IsRunning()); m_txTimer.Set(WifiTxTimer::WAIT_CTS_AFTER_MU_RTS, @@ -662,7 +662,7 @@ HeFrameExchangeManager::SendPsduMap() responseTxVector = &acknowledgment->stationsReplyingWithBlockAck.begin()->second.blockAckTxVector; Time timeout = txDuration + m_phy->GetSifs() + m_phy->GetSlot() + - m_phy->CalculatePhyPreambleAndHeaderDuration(*responseTxVector); + WifiPhy::CalculatePhyPreambleAndHeaderDuration(*responseTxVector); m_txTimer.Set(WifiTxTimer::WAIT_BLOCK_ACKS_IN_TB_PPDU, timeout, @@ -856,7 +856,7 @@ HeFrameExchangeManager::SendPsduMap() else { Time timeout = txDuration + m_phy->GetSifs() + m_phy->GetSlot() + - m_phy->CalculatePhyPreambleAndHeaderDuration(*responseTxVector); + WifiPhy::CalculatePhyPreambleAndHeaderDuration(*responseTxVector); m_channelAccessManager->NotifyAckTimeoutStartNow(timeout); // start timer @@ -2131,7 +2131,7 @@ HeFrameExchangeManager::UpdateNav(Ptr psdu, const WifiTxVector& auto navResetDelay = 2 * m_phy->GetSifs() + WifiPhy::CalculateTxDuration(GetCtsSize(), ctsTxVector, m_phy->GetPhyBand()) + - m_phy->CalculatePhyPreambleAndHeaderDuration(ctsTxVector) + 2 * m_phy->GetSlot(); + WifiPhy::CalculatePhyPreambleAndHeaderDuration(ctsTxVector) + 2 * m_phy->GetSlot(); m_intraBssNavResetEvent = Simulator::Schedule(navResetDelay, &HeFrameExchangeManager::IntraBssNavResetTimeout, diff --git a/src/wifi/model/ht/ht-frame-exchange-manager.cc b/src/wifi/model/ht/ht-frame-exchange-manager.cc index c739e2a73..cc5c83c7f 100644 --- a/src/wifi/model/ht/ht-frame-exchange-manager.cc +++ b/src/wifi/model/ht/ht-frame-exchange-manager.cc @@ -1193,7 +1193,7 @@ HtFrameExchangeManager::SendPsdu() Time timeout = txDuration + m_phy->GetSifs() + m_phy->GetSlot() + - m_phy->CalculatePhyPreambleAndHeaderDuration(blockAcknowledgment->blockAckTxVector); + WifiPhy::CalculatePhyPreambleAndHeaderDuration(blockAcknowledgment->blockAckTxVector); NS_ASSERT(!m_txTimer.IsRunning()); m_txTimer.Set(WifiTxTimer::WAIT_BLOCK_ACK, timeout, diff --git a/src/wifi/model/phy-entity.cc b/src/wifi/model/phy-entity.cc index dd269acf6..668cbf06f 100644 --- a/src/wifi/model/phy-entity.cc +++ b/src/wifi/model/phy-entity.cc @@ -630,14 +630,14 @@ PhyEntity::ScheduleEndOfMpdus(Ptr event) } uint32_t size = (mpduType == NORMAL_MPDU) ? psdu->GetSize() : psdu->GetAmpduSubframeSize(i); - Time mpduDuration = m_wifiPhy->GetPayloadDuration(size, - txVector, - m_wifiPhy->GetPhyBand(), - mpduType, - true, - totalAmpduSize, - totalAmpduNumSymbols, - staId); + Time mpduDuration = WifiPhy::GetPayloadDuration(size, + txVector, + m_wifiPhy->GetPhyBand(), + mpduType, + true, + totalAmpduSize, + totalAmpduNumSymbols, + staId); remainingAmpduDuration -= mpduDuration; if (i == (nMpdus - 1) && !remainingAmpduDuration.IsZero()) // no more MPDUs coming @@ -975,7 +975,7 @@ PhyEntity::StartPreambleDetectionPeriod(Ptr event) m_wifiPhy->GetCurrentFrequencyRange()); // We need to notify it now so that it starts // recording events m_endPreambleDetectionEvents.push_back( - Simulator::Schedule(m_wifiPhy->GetPreambleDetectionDuration(), + Simulator::Schedule(WifiPhy::GetPreambleDetectionDuration(), &PhyEntity::EndPreambleDetectionPeriod, this, event)); @@ -1090,7 +1090,7 @@ PhyEntity::EndPreambleDetectionPeriod(Ptr event) // Continue receiving preamble const auto durationTillEnd = GetDuration(WIFI_PPDU_FIELD_PREAMBLE, event->GetPpdu()->GetTxVector()) - - m_wifiPhy->GetPreambleDetectionDuration(); + WifiPhy::GetPreambleDetectionDuration(); m_wifiPhy->NotifyCcaBusy(event->GetPpdu(), durationTillEnd); // will be prolonged by next field m_wifiPhy->m_endPhyRxEvent = Simulator::Schedule(durationTillEnd, diff --git a/src/wifi/model/rate-control/minstrel-wifi-manager.cc b/src/wifi/model/rate-control/minstrel-wifi-manager.cc index 8f2215c7c..55980805a 100644 --- a/src/wifi/model/rate-control/minstrel-wifi-manager.cc +++ b/src/wifi/model/rate-control/minstrel-wifi-manager.cc @@ -111,7 +111,7 @@ MinstrelWifiManager::SetupPhy(const Ptr phy) WifiTxVector txVector; txVector.SetMode(mode); txVector.SetPreambleType(WIFI_PREAMBLE_LONG); - AddCalcTxTime(mode, phy->CalculateTxDuration(m_pktLen, txVector, phy->GetPhyBand())); + AddCalcTxTime(mode, WifiPhy::CalculateTxDuration(m_pktLen, txVector, phy->GetPhyBand())); } WifiRemoteStationManager::SetupPhy(phy); } diff --git a/src/wifi/model/rate-control/rraa-wifi-manager.cc b/src/wifi/model/rate-control/rraa-wifi-manager.cc index dd502f30b..91dd8ecf8 100644 --- a/src/wifi/model/rate-control/rraa-wifi-manager.cc +++ b/src/wifi/model/rate-control/rraa-wifi-manager.cc @@ -120,8 +120,8 @@ RraaWifiManager::SetupPhy(const Ptr phy) txVector.SetMode(mode); txVector.SetPreambleType(WIFI_PREAMBLE_LONG); /* Calculate the TX Time of the Data and the corresponding Ack */ - Time dataTxTime = phy->CalculateTxDuration(m_frameLength, txVector, phy->GetPhyBand()); - Time ackTxTime = phy->CalculateTxDuration(m_ackLength, txVector, phy->GetPhyBand()); + Time dataTxTime = WifiPhy::CalculateTxDuration(m_frameLength, txVector, phy->GetPhyBand()); + Time ackTxTime = WifiPhy::CalculateTxDuration(m_ackLength, txVector, phy->GetPhyBand()); NS_LOG_DEBUG("Calculating TX times: Mode= " << mode << " DataTxTime= " << dataTxTime << " AckTxTime= " << ackTxTime); AddCalcTxTime(mode, dataTxTime + ackTxTime); diff --git a/src/wifi/model/rate-control/rrpaa-wifi-manager.cc b/src/wifi/model/rate-control/rrpaa-wifi-manager.cc index c94822a10..86c164fa0 100644 --- a/src/wifi/model/rate-control/rrpaa-wifi-manager.cc +++ b/src/wifi/model/rate-control/rrpaa-wifi-manager.cc @@ -149,8 +149,8 @@ RrpaaWifiManager::SetupPhy(const Ptr phy) txVector.SetMode(mode); txVector.SetPreambleType(WIFI_PREAMBLE_LONG); /* Calculate the TX Time of the Data and the corresponding Ack */ - Time dataTxTime = phy->CalculateTxDuration(m_frameLength, txVector, phy->GetPhyBand()); - Time ackTxTime = phy->CalculateTxDuration(m_ackLength, txVector, phy->GetPhyBand()); + Time dataTxTime = WifiPhy::CalculateTxDuration(m_frameLength, txVector, phy->GetPhyBand()); + Time ackTxTime = WifiPhy::CalculateTxDuration(m_ackLength, txVector, phy->GetPhyBand()); NS_LOG_DEBUG("Calculating TX times: Mode= " << mode << " DataTxTime= " << dataTxTime << " AckTxTime= " << ackTxTime); AddCalcTxTime(mode, dataTxTime + ackTxTime); diff --git a/src/wifi/test/spectrum-wifi-phy-test.cc b/src/wifi/test/spectrum-wifi-phy-test.cc index 84f87f278..b9b7bbdfb 100644 --- a/src/wifi/test/spectrum-wifi-phy-test.cc +++ b/src/wifi/test/spectrum-wifi-phy-test.cc @@ -197,7 +197,7 @@ SpectrumWifiPhyBasicTest::MakeSignal(Watt_u txPower, const WifiPhyOperatingChann auto psdu = Create(pkt, hdr); const auto txDuration = - m_phy->CalculateTxDuration(psdu->GetSize(), txVector, m_phy->GetPhyBand()); + SpectrumWifiPhy::CalculateTxDuration(psdu->GetSize(), txVector, m_phy->GetPhyBand()); auto ppdu = Create(psdu, txVector, channel, m_uid++); diff --git a/src/wifi/test/tx-duration-test.cc b/src/wifi/test/tx-duration-test.cc index d763468e0..5ed23a35a 100644 --- a/src/wifi/test/tx-duration-test.cc +++ b/src/wifi/test/tx-duration-test.cc @@ -167,7 +167,7 @@ TxDurationTest::CheckPayloadDuration(uint32_t size, knownDuration += MicroSeconds(6); // 2.4 GHz band should be at the end of the bands to test } - Time calculatedDuration = phy->GetPayloadDuration(size, txVector, testedBand); + Time calculatedDuration = YansWifiPhy::GetPayloadDuration(size, txVector, testedBand); if (calculatedDuration != knownDuration) { std::cerr << "size=" << size << " band=" << testedBand << " mode=" << payloadMode @@ -219,7 +219,7 @@ TxDurationTest::CheckTxDuration(uint32_t size, knownDuration += MicroSeconds(6); // 2.4 GHz band should be at the end of the bands to test } - Time calculatedDuration = phy->CalculateTxDuration(size, txVector, testedBand); + Time calculatedDuration = YansWifiPhy::CalculateTxDuration(size, txVector, testedBand); Time calculatedDurationUsingList = CalculateTxDurationUsingList(std::list{size}, std::list{SU_STA_ID}, @@ -299,7 +299,7 @@ TxDurationTest::CheckMuTxDuration(std::list sizes, for (auto& size : sizes) { Time ppduDurationForSta = - phy->CalculateTxDuration(size, txVector, testedBand, *iterStaId); + YansWifiPhy::CalculateTxDuration(size, txVector, testedBand, *iterStaId); if (ppduDurationForSta > calculatedDuration) { calculatedDuration = ppduDurationForSta; diff --git a/src/wifi/test/wifi-non-ht-dup-test.cc b/src/wifi/test/wifi-non-ht-dup-test.cc index 54d50f22c..0882b3fa7 100644 --- a/src/wifi/test/wifi-non-ht-dup-test.cc +++ b/src/wifi/test/wifi-non-ht-dup-test.cc @@ -343,7 +343,7 @@ TestNonHtDuplicatePhyReception::SendNonHtDuplicatePpdu(MHz_u channelWidth) Ptr psdu = Create(pkt, hdr); Time txDuration = - m_phyAp->CalculateTxDuration(psdu->GetSize(), txVector, m_phyAp->GetPhyBand()); + SpectrumWifiPhy::CalculateTxDuration(psdu->GetSize(), txVector, m_phyAp->GetPhyBand()); m_phyAp->Send(WifiConstPsduMap({std::make_pair(SU_STA_ID, psdu)}), txVector); } diff --git a/src/wifi/test/wifi-phy-mu-mimo-test.cc b/src/wifi/test/wifi-phy-mu-mimo-test.cc index 918865326..eb56ea0a4 100644 --- a/src/wifi/test/wifi-phy-mu-mimo-test.cc +++ b/src/wifi/test/wifi-phy-mu-mimo-test.cc @@ -1395,8 +1395,10 @@ TestUlMuMimoPhyTransmission::SendHeTbPpdu(uint16_t txStaId, psdus.insert(std::make_pair(txStaId, psdu)); Ptr phy = m_phyStas.at(txStaId - 1); - Time txDuration = - phy->CalculateTxDuration(psdu->GetSize(), txVector, phy->GetPhyBand(), txStaId); + Time txDuration = MuMimoSpectrumWifiPhy::CalculateTxDuration(psdu->GetSize(), + txVector, + phy->GetPhyBand(), + txStaId); txVector.SetLength( HePhy::ConvertHeTbPpduDurationToLSigLength(txDuration, txVector, phy->GetPhyBand()).first); diff --git a/src/wifi/test/wifi-phy-ofdma-test.cc b/src/wifi/test/wifi-phy-ofdma-test.cc index deef628bf..bb7932672 100644 --- a/src/wifi/test/wifi-phy-ofdma-test.cc +++ b/src/wifi/test/wifi-phy-ofdma-test.cc @@ -2144,14 +2144,14 @@ TestUlOfdmaPpduUid::SendTbPpdu() auto psdu2 = Create(pkt2, hdr2); psdus2.insert(std::make_pair(rxStaId2, psdu2)); - const auto txDuration1 = m_phySta1->CalculateTxDuration(psdu1->GetSize(), - txVector1, - m_phySta1->GetPhyBand(), - rxStaId1); - const auto txDuration2 = m_phySta2->CalculateTxDuration(psdu2->GetSize(), - txVector2, - m_phySta1->GetPhyBand(), - rxStaId2); + const auto txDuration1 = OfdmaSpectrumWifiPhy::CalculateTxDuration(psdu1->GetSize(), + txVector1, + m_phySta1->GetPhyBand(), + rxStaId1); + const auto txDuration2 = OfdmaSpectrumWifiPhy::CalculateTxDuration(psdu2->GetSize(), + txVector2, + m_phySta1->GetPhyBand(), + rxStaId2); const auto txDuration = std::max(txDuration1, txDuration2); txVector1.SetLength( @@ -2417,8 +2417,10 @@ TestMultipleHeTbPreambles::RxHeTbPpdu(uint64_t uid, auto psdu = Create(pkt, hdr); psdus.insert(std::make_pair(staId, psdu)); - auto ppduDuration = - m_phy->CalculateTxDuration(psdu->GetSize(), txVector, m_phy->GetPhyBand(), staId); + auto ppduDuration = OfdmaSpectrumWifiPhy::CalculateTxDuration(psdu->GetSize(), + txVector, + m_phy->GetPhyBand(), + staId); auto ppdu = Create(psdus, txVector, m_phy->GetOperatingChannel(), @@ -3433,8 +3435,10 @@ TestUlOfdmaPhyTransmission::SendHeTbPpdu(uint16_t txStaId, phy = m_phySta3; } - Time txDuration = - phy->CalculateTxDuration(psdu->GetSize(), txVector, phy->GetPhyBand(), txStaId); + Time txDuration = OfdmaSpectrumWifiPhy::CalculateTxDuration(psdu->GetSize(), + txVector, + phy->GetPhyBand(), + txStaId); txVector.SetLength( HePhy::ConvertHeTbPpduDurationToLSigLength(txDuration, txVector, phy->GetPhyBand()).first); @@ -5544,10 +5548,10 @@ TestUlOfdmaPowerControl::SendMuBar(std::vector staIds) auto nav = m_apDev->GetPhy()->GetSifs(); const auto staId = staIds.front(); // either will do - nav += m_phyAp->CalculateTxDuration(GetBlockAckSize(BlockAckType::COMPRESSED), - tbTxVector, - DEFAULT_WIFI_BAND, - staId); + nav += SpectrumWifiPhy::CalculateTxDuration(GetBlockAckSize(BlockAckType::COMPRESSED), + tbTxVector, + DEFAULT_WIFI_BAND, + staId); psdu->SetDuration(nav); psdus.insert(std::make_pair(SU_STA_ID, psdu)); diff --git a/src/wifi/test/wifi-phy-reception-test.cc b/src/wifi/test/wifi-phy-reception-test.cc index 84dbf7843..f15fa2664 100644 --- a/src/wifi/test/wifi-phy-reception-test.cc +++ b/src/wifi/test/wifi-phy-reception-test.cc @@ -124,7 +124,8 @@ WifiPhyReceptionTest::SendPacket(dBm_u rxPower, uint32_t packetSize, uint8_t mcs hdr.SetQosTid(0); Ptr psdu = Create(pkt, hdr); - Time txDuration = m_phy->CalculateTxDuration(psdu->GetSize(), txVector, m_phy->GetPhyBand()); + Time txDuration = + SpectrumWifiPhy::CalculateTxDuration(psdu->GetSize(), txVector, m_phy->GetPhyBand()); Ptr ppdu = Create(psdu, txVector, m_phy->GetOperatingChannel(), txDuration, m_uid++); @@ -2750,7 +2751,8 @@ TestAmpduReception::SendAmpduWithThreeMpdus(dBm_u rxPower, uint32_t referencePac } Ptr psdu = Create(mpduList); - Time txDuration = m_phy->CalculateTxDuration(psdu->GetSize(), txVector, m_phy->GetPhyBand()); + Time txDuration = + SpectrumWifiPhy::CalculateTxDuration(psdu->GetSize(), txVector, m_phy->GetPhyBand()); Ptr ppdu = Create(psdu, txVector, m_phy->GetOperatingChannel(), txDuration, m_uid++); @@ -4280,7 +4282,7 @@ TestUnsupportedBandwidthReception::SendPpdu(MHz_u centerFreq, MHz_u bandwidth) Ptr psdu = Create(pkt, hdr); Time txDuration = - m_rxPhy->CalculateTxDuration(psdu->GetSize(), txVector, m_rxPhy->GetPhyBand()); + SpectrumWifiPhy::CalculateTxDuration(psdu->GetSize(), txVector, m_rxPhy->GetPhyBand()); auto ppdu = Create(psdu, txVector, m_txPhy->GetOperatingChannel(), txDuration, 0); @@ -4537,7 +4539,8 @@ TestPrimary20CoveredByPpdu::CreatePpdu(MHz_u ppduCenterFreq) WifiMacHeader hdr(WIFI_MAC_QOSDATA); auto psdu = Create(pkt, hdr); - auto txDuration = m_txPhy->CalculateTxDuration(psdu->GetSize(), txVector, channelInfo.band); + auto txDuration = + SpectrumWifiPhy::CalculateTxDuration(psdu->GetSize(), txVector, channelInfo.band); return Create(psdu, txVector, m_txPhy->GetOperatingChannel(), txDuration, 0); } diff --git a/src/wifi/test/wifi-phy-rx-trace-helper-test.cc b/src/wifi/test/wifi-phy-rx-trace-helper-test.cc index f028d50e1..c27a90061 100644 --- a/src/wifi/test/wifi-phy-rx-trace-helper-test.cc +++ b/src/wifi/test/wifi-phy-rx-trace-helper-test.cc @@ -1916,12 +1916,12 @@ TestWifiPhyRxTraceHelperYans::SendPpduWithTwoMpdus(dBm_u rxPower, mpduList.emplace_back(Create(p2, hdr2)); auto psdu = Create(mpduList); - auto ppdu = - Create(psdu, - txVector, - tx_phy->GetOperatingChannel(), - tx_phy->CalculateTxDuration(psdu->GetSize(), txVector, tx_phy->GetPhyBand()), - m_uid); + auto ppdu = Create( + psdu, + txVector, + tx_phy->GetOperatingChannel(), + YansWifiPhy::CalculateTxDuration(psdu->GetSize(), txVector, tx_phy->GetPhyBand()), + m_uid); m_uid++; @@ -1955,12 +1955,12 @@ TestWifiPhyRxTraceHelperYans::SendPpduWithOneMpdu(dBm_u rxPower, mpduList.emplace_back(Create(p1, hdr1)); auto psdu = Create(mpduList); - auto ppdu = - Create(psdu, - txVector, - tx_phy->GetOperatingChannel(), - tx_phy->CalculateTxDuration(psdu->GetSize(), txVector, tx_phy->GetPhyBand()), - m_uid); + auto ppdu = Create( + psdu, + txVector, + tx_phy->GetOperatingChannel(), + YansWifiPhy::CalculateTxDuration(psdu->GetSize(), txVector, tx_phy->GetPhyBand()), + m_uid); m_uid++; diff --git a/src/wifi/test/wifi-phy-thresholds-test.cc b/src/wifi/test/wifi-phy-thresholds-test.cc index 8cbea8e7c..978ee2d8b 100644 --- a/src/wifi/test/wifi-phy-thresholds-test.cc +++ b/src/wifi/test/wifi-phy-thresholds-test.cc @@ -146,7 +146,7 @@ WifiPhyThresholdsTest::MakeWifiSignal(Watt_u txPower, const WifiPhyOperatingChan auto psdu = Create(pkt, hdr); const auto txDuration = - m_phy->CalculateTxDuration(psdu->GetSize(), txVector, m_phy->GetPhyBand()); + SpectrumWifiPhy::CalculateTxDuration(psdu->GetSize(), txVector, m_phy->GetPhyBand()); auto ppdu = Create(psdu, txVector, channel, 0); diff --git a/utils/print-introspected-doxygen.cc b/utils/print-introspected-doxygen.cc index 7dffe9921..ba90cbb4d 100644 --- a/utils/print-introspected-doxygen.cc +++ b/utils/print-introspected-doxygen.cc @@ -453,7 +453,7 @@ StaticInformation::DoGather(TypeId tid) // See if this is a pointer to an Object. Ptr object = CreateObject(); - TypeId objectTypeId = object->GetTypeId(); + TypeId objectTypeId = Object::GetTypeId(); if (objectTypeId == pointee) { // Stop the recursion at this attribute if it is a