diff --git a/src/wifi/examples/wifi-phy-test.cc b/src/wifi/examples/wifi-phy-test.cc index d3c5d55b9..9b6fac482 100644 --- a/src/wifi/examples/wifi-phy-test.cc +++ b/src/wifi/examples/wifi-phy-test.cc @@ -66,11 +66,12 @@ private: /** * Send receive function * \param psdu the PSDU - * \param snr the SNR + * \param rxSignalInfo the info on the received signal (\see RxSignalInfo) * \param txVector the wifi transmit vector * \param statusPerMpdu reception status per MPDU */ - void Receive (Ptr psdu, double snr, WifiTxVector txVector, std::vector statusPerMpdu); + void Receive (Ptr psdu, RxSignalInfo rxSignalInfo, + WifiTxVector txVector, std::vector statusPerMpdu); Ptr m_tx; ///< transmit struct Input m_input; ///< input struct Output m_output; ///< output @@ -89,7 +90,8 @@ PsrExperiment::Send (void) } void -PsrExperiment::Receive (Ptr psdu, double snr, WifiTxVector txVector, std::vector statusPerMpdu) +PsrExperiment::Receive (Ptr psdu, RxSignalInfo rxSignalInfo, + WifiTxVector txVector, std::vector statusPerMpdu) { m_output.received++; } @@ -188,11 +190,12 @@ private: /** * Receive function * \param psdu the PSDU - * \param snr the SNR + * \param rxSignalInfo the info on the received signal (\see RxSignalInfo) * \param txVector the wifi transmit vector * \param statusPerMpdu reception status per MPDU */ - void Receive (Ptr psdu, double snr, WifiTxVector txVector, std::vector statusPerMpdu); + void Receive (Ptr psdu, RxSignalInfo rxSignalInfo, + WifiTxVector txVector, std::vector statusPerMpdu); Ptr m_txA; ///< transmit A Ptr m_txB; ///< transmit B uint32_t m_flowIdA; ///< flow ID A @@ -226,7 +229,8 @@ CollisionExperiment::SendB (void) const } void -CollisionExperiment::Receive (Ptr psdu, double snr, WifiTxVector txVector, std::vector statusPerMpdu) +CollisionExperiment::Receive (Ptr psdu, RxSignalInfo rxSignalInfo, + WifiTxVector txVector, std::vector statusPerMpdu) { FlowIdTag tag; if ((*psdu->begin ())->GetPacket ()->FindFirstMatchingByteTag (tag)) diff --git a/src/wifi/model/frame-exchange-manager.cc b/src/wifi/model/frame-exchange-manager.cc index 8d6e89506..2188b4dca 100644 --- a/src/wifi/model/frame-exchange-manager.cc +++ b/src/wifi/model/frame-exchange-manager.cc @@ -172,7 +172,7 @@ FrameExchangeManager::ResetPhy (void) { m_phy->TraceDisconnectWithoutContext ("PhyRxPayloadBegin", MakeCallback (&FrameExchangeManager::RxStartIndication, this)); - m_phy->SetReceiveOkCallback (MakeNullCallback, double, WifiTxVector, std::vector> ()); + m_phy->SetReceiveOkCallback (MakeNullCallback, RxSignalInfo, WifiTxVector, std::vector> ()); m_phy = 0; } @@ -847,10 +847,10 @@ FrameExchangeManager::NotifyOffNow (void) } void -FrameExchangeManager::Receive (Ptr psdu, double rxSnr, +FrameExchangeManager::Receive (Ptr psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector perMpduStatus) { - NS_LOG_FUNCTION (this << psdu << rxSnr << txVector << perMpduStatus.size () + NS_LOG_FUNCTION (this << psdu << rxSignalInfo << txVector << perMpduStatus.size () << std::all_of (perMpduStatus.begin(), perMpduStatus.end(), [](bool v) { return v; })); if (!perMpduStatus.empty ()) @@ -870,6 +870,7 @@ FrameExchangeManager::Receive (Ptr psdu, double rxSnr, return; } + double rxSnr = rxSignalInfo.snr; if (psdu->GetNMpdus () == 1) { // if perMpduStatus is not empty (i.e., this MPDU is not included in an A-MPDU) diff --git a/src/wifi/model/frame-exchange-manager.h b/src/wifi/model/frame-exchange-manager.h index 02397710f..95e2fa223 100644 --- a/src/wifi/model/frame-exchange-manager.h +++ b/src/wifi/model/frame-exchange-manager.h @@ -73,11 +73,11 @@ public: * when receiving the individual MPDUs. * * \param psdu the received PSDU - * \param rxSnr snr of MPDU received in linear scale + * \param rxSignalInfo the info on the received signal (\see RxSignalInfo) * \param txVector TxVector of the received PSDU * \param perMpduStatus per MPDU reception status */ - void Receive (Ptr psdu, double rxSnr, + void Receive (Ptr psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector perMpduStatus); /** diff --git a/src/wifi/model/wifi-phy-state-helper.cc b/src/wifi/model/wifi-phy-state-helper.cc index 74343d1c8..cce8a66cd 100644 --- a/src/wifi/model/wifi-phy-state-helper.cc +++ b/src/wifi/model/wifi-phy-state-helper.cc @@ -26,6 +26,7 @@ #include "wifi-tx-vector.h" #include "wifi-phy-listener.h" #include "wifi-psdu.h" +#include "wifi-phy.h" namespace ns3 { @@ -464,30 +465,30 @@ WifiPhyStateHelper::SwitchToChannelSwitching (Time switchingDuration) } void -WifiPhyStateHelper::ContinueRxNextMpdu (Ptr psdu, double snr, WifiTxVector txVector) +WifiPhyStateHelper::ContinueRxNextMpdu (Ptr psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector) { - NS_LOG_FUNCTION (this << *psdu << snr << txVector); + NS_LOG_FUNCTION (this << *psdu << rxSignalInfo << txVector); std::vector statusPerMpdu; if (!m_rxOkCallback.IsNull ()) { - m_rxOkCallback (psdu, snr, txVector, statusPerMpdu); + m_rxOkCallback (psdu, rxSignalInfo, txVector, statusPerMpdu); } } void -WifiPhyStateHelper::SwitchFromRxEndOk (Ptr psdu, double snr, WifiTxVector txVector, uint16_t staId, std::vector statusPerMpdu) +WifiPhyStateHelper::SwitchFromRxEndOk (Ptr psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, uint16_t staId, std::vector statusPerMpdu) { - NS_LOG_FUNCTION (this << *psdu << snr << txVector << staId << statusPerMpdu.size () << + NS_LOG_FUNCTION (this << *psdu << rxSignalInfo << txVector << staId << statusPerMpdu.size () << std::all_of(statusPerMpdu.begin(), statusPerMpdu.end(), [](bool v) { return v; })); //returns true if all true NS_ASSERT (statusPerMpdu.size () != 0); NS_ASSERT (Abs (m_endRx - Simulator::Now ()) < MicroSeconds (1)); //1us corresponds to the maximum propagation delay (delay spread) //TODO: a better fix would be to call the function once all HE TB PPDUs are received - m_rxOkTrace (psdu->GetPacket (), snr, txVector.GetMode (staId), txVector.GetPreambleType ()); + m_rxOkTrace (psdu->GetPacket (), rxSignalInfo.snr, txVector.GetMode (staId), txVector.GetPreambleType ()); NotifyRxEndOk (); DoSwitchFromRx (); if (!m_rxOkCallback.IsNull ()) { - m_rxOkCallback (psdu, snr, txVector, statusPerMpdu); + m_rxOkCallback (psdu, rxSignalInfo, txVector, statusPerMpdu); } } diff --git a/src/wifi/model/wifi-phy-state-helper.h b/src/wifi/model/wifi-phy-state-helper.h index 14fac90bc..ab3afdf2a 100644 --- a/src/wifi/model/wifi-phy-state-helper.h +++ b/src/wifi/model/wifi-phy-state-helper.h @@ -36,6 +36,7 @@ class WifiTxVector; class WifiMode; class Packet; class WifiPsdu; +struct RxSignalInfo; /** * Callback if PSDU successfully received (i.e. if aggregate, @@ -43,11 +44,12 @@ class WifiPsdu; * considering that the per-MPDU reception status is also provided). * * arg1: PSDU received successfully - * arg2: SNR of PSDU in linear scale + * arg2: info on the received signal (\see RxSignalInfo) * arg3: TXVECTOR of PSDU * arg4: vector of per-MPDU status of reception. */ -typedef Callback, double, WifiTxVector, std::vector> RxOkCallback; +typedef Callback, RxSignalInfo, + WifiTxVector, std::vector> RxOkCallback; /** * Callback if PSDU unsuccessfully received * @@ -187,20 +189,21 @@ public: * Continue RX after the reception of an MPDU in an A-MPDU was successful. * * \param psdu the successfully received PSDU - * \param snr the SNR of the received PSDU in linear scale + * \param rxSignalInfo the info on the received signal (\see RxSignalInfo) * \param txVector TXVECTOR of the PSDU */ - void ContinueRxNextMpdu (Ptr psdu, double snr, WifiTxVector txVector); + void ContinueRxNextMpdu (Ptr psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector); /** * Switch from RX after the reception was successful. * * \param psdu the successfully received PSDU - * \param snr the SNR of the received PSDU in linear scale + * \param rxSignalInfo the info on the received signal (\see RxSignalInfo) * \param txVector TXVECTOR of the PSDU * \param staId the station ID of the PSDU (only used for MU) * \param statusPerMpdu reception status per MPDU */ - void SwitchFromRxEndOk (Ptr psdu, double snr, WifiTxVector txVector, uint16_t staId, std::vector statusPerMpdu); + void SwitchFromRxEndOk (Ptr psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, + uint16_t staId, std::vector statusPerMpdu); /** * Switch from RX after the reception failed. * diff --git a/src/wifi/model/wifi-phy.cc b/src/wifi/model/wifi-phy.cc index 584e8811c..5432e8b7d 100644 --- a/src/wifi/model/wifi-phy.cc +++ b/src/wifi/model/wifi-phy.cc @@ -3701,6 +3701,10 @@ WifiPhy::EndOfMpdu (Ptr event, Ptr psdu, size_t mpduIndex NS_ASSERT (signalNoiseIt != m_signalNoiseMap.end ()); signalNoiseIt->second = rxInfo.second; + RxSignalInfo rxSignalInfo; + rxSignalInfo.snr = snr; + rxSignalInfo.rssi = rxInfo.second.signal; + auto statusPerMpduIt = m_statusPerMpduMap.find (std::make_pair (ppdu->GetUid (), staId)); NS_ASSERT (statusPerMpduIt != m_statusPerMpduMap.end ()); statusPerMpduIt->second.push_back (rxInfo.first); @@ -3708,7 +3712,7 @@ WifiPhy::EndOfMpdu (Ptr event, Ptr psdu, size_t mpduIndex if (rxInfo.first && GetAddressedPsduInPpdu (ppdu)->GetNMpdus () > 1) { //only done for correct MPDU that is part of an A-MPDU - m_state->ContinueRxNextMpdu (Copy (psdu), snr, txVector); + m_state->ContinueRxNextMpdu (Copy (psdu), rxSignalInfo, txVector); } } @@ -3751,7 +3755,10 @@ WifiPhy::EndReceive (Ptr event) { //At least one MPDU has been successfully received NotifyMonitorSniffRx (psdu, GetFrequency (), txVector, signalNoiseIt->second, statusPerMpduIt->second, staId); - m_state->SwitchFromRxEndOk (Copy (psdu), snr, txVector, staId, statusPerMpduIt->second); + RxSignalInfo rxSignalInfo; + rxSignalInfo.snr = snr; + rxSignalInfo.rssi = signalNoiseIt->second.signal; //same information for all MPDUs + m_state->SwitchFromRxEndOk (Copy (psdu), rxSignalInfo, txVector, staId, statusPerMpduIt->second); m_previouslyRxPpduUid = event->GetPpdu ()->GetUid (); //store UID only if reception is successful (because otherwise trigger won't be read by MAC layer) } else @@ -5411,6 +5418,13 @@ WifiPhy::AssignStreams (int64_t stream) return 1; } +std::ostream& operator<< (std::ostream& os, RxSignalInfo rxSignalInfo) +{ + os << "SNR:" << RatioToDb (rxSignalInfo.snr) << " dB" + << ", RSSI:" << rxSignalInfo.rssi << " dBm"; + return os; +} + } //namespace ns3 namespace { diff --git a/src/wifi/model/wifi-phy.h b/src/wifi/model/wifi-phy.h index 559adc9dc..0d40e540e 100644 --- a/src/wifi/model/wifi-phy.h +++ b/src/wifi/model/wifi-phy.h @@ -140,6 +140,13 @@ struct HeSigAParameters uint8_t bssColor; ///< BSS color }; +/// RxSignalInfo structure containing info on the received signal +struct RxSignalInfo +{ + double snr; ///< SNR in linear scale + double rssi; ///< RSSI in dBm +}; + /** * \brief 802.11 PHY layer model * \ingroup wifi @@ -2319,6 +2326,13 @@ private: Callback m_capabilitiesChangedCallback; //!< Callback when PHY capabilities changed }; +/** + * \param os output stream + * \param rxSignalInfo received signal info to stringify + * \return output stream + */ +std::ostream& operator<< (std::ostream& os, RxSignalInfo rxSignalInfo); + } //namespace ns3 #endif /* WIFI_PHY_H */ diff --git a/src/wifi/test/spectrum-wifi-phy-test.cc b/src/wifi/test/spectrum-wifi-phy-test.cc index 046936a23..354c6b318 100644 --- a/src/wifi/test/spectrum-wifi-phy-test.cc +++ b/src/wifi/test/spectrum-wifi-phy-test.cc @@ -83,11 +83,12 @@ protected: /** * Spectrum wifi receive success function * \param psdu the PSDU - * \param snr the SNR + * \param rxSignalInfo the info on the received signal (\see RxSignalInfo) * \param txVector the transmit vector * \param statusPerMpdu reception status per MPDU */ - void SpectrumWifiPhyRxSuccess (Ptr psdu, double snr, WifiTxVector txVector, std::vector statusPerMpdu); + void SpectrumWifiPhyRxSuccess (Ptr psdu, RxSignalInfo rxSignalInfo, + WifiTxVector txVector, std::vector statusPerMpdu); /** * Spectrum wifi receive failure function * \param psdu the PSDU @@ -149,9 +150,10 @@ SpectrumWifiPhyBasicTest::SendSignal (double txPowerWatts) } void -SpectrumWifiPhyBasicTest::SpectrumWifiPhyRxSuccess (Ptr psdu, double snr, WifiTxVector txVector, std::vector statusPerMpdu) +SpectrumWifiPhyBasicTest::SpectrumWifiPhyRxSuccess (Ptr psdu, RxSignalInfo rxSignalInfo, + WifiTxVector txVector, std::vector statusPerMpdu) { - NS_LOG_FUNCTION (this << *psdu << snr << txVector); + NS_LOG_FUNCTION (this << *psdu << rxSignalInfo << txVector); m_count++; } diff --git a/src/wifi/test/wifi-phy-ofdma-test.cc b/src/wifi/test/wifi-phy-ofdma-test.cc index e0e75658b..239cf6cb4 100644 --- a/src/wifi/test/wifi-phy-ofdma-test.cc +++ b/src/wifi/test/wifi-phy-ofdma-test.cc @@ -207,27 +207,30 @@ private: /** * Receive success function for STA 1 * \param psdu the PSDU - * \param snr the SNR + * \param rxSignalInfo the info on the received signal (\see RxSignalInfo) * \param txVector the transmit vector * \param statusPerMpdu reception status per MPDU */ - void RxSuccessSta1 (Ptr psdu, double snr, WifiTxVector txVector, std::vector statusPerMpdu); + void RxSuccessSta1 (Ptr psdu, RxSignalInfo rxSignalInfo, + WifiTxVector txVector, std::vector statusPerMpdu); /** * Receive success function for STA 2 * \param psdu the PSDU - * \param snr the SNR + * \param rxSignalInfo the info on the received signal (\see RxSignalInfo) * \param txVector the transmit vector * \param statusPerMpdu reception status per MPDU */ - void RxSuccessSta2 (Ptr psdu, double snr, WifiTxVector txVector, std::vector statusPerMpdu); + void RxSuccessSta2 (Ptr psdu, RxSignalInfo rxSignalInfo, + WifiTxVector txVector, std::vector statusPerMpdu); /** * Receive success function for STA 3 * \param psdu the PSDU - * \param snr the SNR + * \param rxSignalInfo the info on the received signal (\see RxSignalInfo) * \param txVector the transmit vector * \param statusPerMpdu reception status per MPDU */ - void RxSuccessSta3 (Ptr psdu, double snr, WifiTxVector txVector, std::vector statusPerMpdu); + void RxSuccessSta3 (Ptr psdu, RxSignalInfo rxSignalInfo, + WifiTxVector txVector, std::vector statusPerMpdu); /** * Receive failure function for STA 1 @@ -450,25 +453,28 @@ TestDlOfdmaPhyTransmission::~TestDlOfdmaPhyTransmission () } void -TestDlOfdmaPhyTransmission::RxSuccessSta1 (Ptr psdu, double snr, WifiTxVector txVector, std::vector /*statusPerMpdu*/) +TestDlOfdmaPhyTransmission::RxSuccessSta1 (Ptr psdu, RxSignalInfo rxSignalInfo, + WifiTxVector txVector, std::vector /*statusPerMpdu*/) { - NS_LOG_FUNCTION (this << *psdu << snr << txVector); + NS_LOG_FUNCTION (this << *psdu << rxSignalInfo << txVector); m_countRxSuccessSta1++; m_countRxBytesSta1 += (psdu->GetSize () - 30); } void -TestDlOfdmaPhyTransmission::RxSuccessSta2 (Ptr psdu, double snr, WifiTxVector txVector, std::vector /*statusPerMpdu*/) +TestDlOfdmaPhyTransmission::RxSuccessSta2 (Ptr psdu, RxSignalInfo rxSignalInfo, + WifiTxVector txVector, std::vector /*statusPerMpdu*/) { - NS_LOG_FUNCTION (this << *psdu << snr << txVector); + NS_LOG_FUNCTION (this << *psdu << rxSignalInfo << txVector); m_countRxSuccessSta2++; m_countRxBytesSta2 += (psdu->GetSize () - 30); } void -TestDlOfdmaPhyTransmission::RxSuccessSta3 (Ptr psdu, double snr, WifiTxVector txVector, std::vector /*statusPerMpdu*/) +TestDlOfdmaPhyTransmission::RxSuccessSta3 (Ptr psdu, RxSignalInfo rxSignalInfo, + WifiTxVector txVector, std::vector /*statusPerMpdu*/) { - NS_LOG_FUNCTION (this << *psdu << snr << txVector); + NS_LOG_FUNCTION (this << *psdu << rxSignalInfo << txVector); m_countRxSuccessSta3++; m_countRxBytesSta3 += (psdu->GetSize () - 30); } @@ -1598,11 +1604,11 @@ private: /** * Receive success function * \param psdu the PSDU - * \param snr the SNR + * \param rxSignalInfo the info on the received signal (\see RxSignalInfo) * \param txVector the transmit vector * \param statusPerMpdu reception status per MPDU */ - void RxSuccess (Ptr psdu, double snr, WifiTxVector txVector, std::vector statusPerMpdu); + void RxSuccess (Ptr psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector statusPerMpdu); /** * Receive failure function @@ -1816,9 +1822,9 @@ TestUlOfdmaPhyTransmission::~TestUlOfdmaPhyTransmission () } void -TestUlOfdmaPhyTransmission::RxSuccess (Ptr psdu, double snr, WifiTxVector txVector, std::vector /*statusPerMpdu*/) +TestUlOfdmaPhyTransmission::RxSuccess (Ptr psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector /*statusPerMpdu*/) { - NS_LOG_FUNCTION (this << *psdu << psdu->GetAddr2 () << snr << txVector); + NS_LOG_FUNCTION (this << *psdu << psdu->GetAddr2 () << rxSignalInfo << txVector); if (psdu->GetAddr2 () == Mac48Address ("00:00:00:00:00:01")) { m_countRxSuccessFromSta1++; @@ -2480,11 +2486,11 @@ private: /** * Receive success function * \param psdu the PSDU - * \param snr the SNR + * \param rxSignalInfo the info on the received signal (\see RxSignalInfo) * \param txVector the transmit vector * \param statusPerMpdu reception status per MPDU */ - void RxSuccess (Ptr psdu, double snr, WifiTxVector txVector, std::vector statusPerMpdu); + void RxSuccess (Ptr psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector statusPerMpdu); /** * Receive failure function @@ -2584,9 +2590,9 @@ TestPhyPaddingExclusion::~TestPhyPaddingExclusion () } void -TestPhyPaddingExclusion::RxSuccess (Ptr psdu, double snr, WifiTxVector txVector, std::vector /*statusPerMpdu*/) +TestPhyPaddingExclusion::RxSuccess (Ptr psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector /*statusPerMpdu*/) { - NS_LOG_FUNCTION (this << *psdu << psdu->GetAddr2 () << snr << txVector); + NS_LOG_FUNCTION (this << *psdu << psdu->GetAddr2 () << rxSignalInfo << txVector); if (psdu->GetAddr2 () == Mac48Address ("00:00:00:00:00:01")) { m_countRxSuccessFromSta1++; diff --git a/src/wifi/test/wifi-phy-reception-test.cc b/src/wifi/test/wifi-phy-reception-test.cc index 7be18581f..3b1bbd5ef 100644 --- a/src/wifi/test/wifi-phy-reception-test.cc +++ b/src/wifi/test/wifi-phy-reception-test.cc @@ -70,11 +70,12 @@ protected: /** * Spectrum wifi receive success function * \param psdu the PSDU - * \param snr the SNR + * \param rxSignalInfo the info on the received signal (\see RxSignalInfo) * \param txVector the transmit vector * \param statusPerMpdu reception status per MPDU */ - void RxSuccess (Ptr psdu, double snr, WifiTxVector txVector, std::vector statusPerMpdu); + void RxSuccess (Ptr psdu, RxSignalInfo rxSignalInfo, + WifiTxVector txVector, std::vector statusPerMpdu); /** * Spectrum wifi receive failure function * \param psdu the PSDU @@ -168,9 +169,10 @@ TestThresholdPreambleDetectionWithoutFrameCapture::CheckRxPacketCount (uint32_t } void -TestThresholdPreambleDetectionWithoutFrameCapture::RxSuccess (Ptr psdu, double snr, WifiTxVector txVector, std::vector statusPerMpdu) +TestThresholdPreambleDetectionWithoutFrameCapture::RxSuccess (Ptr psdu, RxSignalInfo rxSignalInfo, + WifiTxVector txVector, std::vector statusPerMpdu) { - NS_LOG_FUNCTION (this << *psdu << snr << txVector); + NS_LOG_FUNCTION (this << *psdu << rxSignalInfo << txVector); m_countRxSuccess++; } @@ -425,11 +427,12 @@ protected: /** * Spectrum wifi receive success function * \param psdu the PSDU - * \param snr the SNR + * \param rxSignalInfo the info on the received signal (\see RxSignalInfo) * \param txVector the transmit vector * \param statusPerMpdu reception status per MPDU */ - void RxSuccess (Ptr psdu, double snr, WifiTxVector txVector, std::vector statusPerMpdu); + void RxSuccess (Ptr psdu, RxSignalInfo rxSignalInfo, + WifiTxVector txVector, std::vector statusPerMpdu); /** * Spectrum wifi receive failure function * \param psdu the PSDU @@ -523,7 +526,8 @@ TestThresholdPreambleDetectionWithFrameCapture::CheckRxPacketCount (uint32_t exp } void -TestThresholdPreambleDetectionWithFrameCapture::RxSuccess (Ptr psdu, double snr, WifiTxVector txVector, std::vector statusPerMpdu) +TestThresholdPreambleDetectionWithFrameCapture::RxSuccess (Ptr psdu, RxSignalInfo rxSignalInfo, + WifiTxVector txVector, std::vector statusPerMpdu) { NS_LOG_FUNCTION (this << *psdu << txVector); m_countRxSuccess++; @@ -928,11 +932,12 @@ private: /** * Spectrum wifi receive success function * \param psdu the PSDU - * \param snr the SNR + * \param rxSignalInfo the info on the received signal (\see RxSignalInfo) * \param txVector the transmit vector * \param statusPerMpdu reception status per MPDU */ - void RxSuccess (Ptr psdu, double snr, WifiTxVector txVector, std::vector statusPerMpdu); + void RxSuccess (Ptr psdu, RxSignalInfo rxSignalInfo, + WifiTxVector txVector, std::vector statusPerMpdu); /** * RX dropped function * \param p the packet @@ -1005,9 +1010,10 @@ TestSimpleFrameCaptureModel::SendPacket (double rxPowerDbm, uint32_t packetSize) } void -TestSimpleFrameCaptureModel::RxSuccess (Ptr psdu, double snr, WifiTxVector txVector, std::vector statusPerMpdu) +TestSimpleFrameCaptureModel::RxSuccess (Ptr psdu, RxSignalInfo rxSignalInfo, + WifiTxVector txVector, std::vector statusPerMpdu) { - NS_LOG_FUNCTION (this << *psdu << snr << txVector); + NS_LOG_FUNCTION (this << *psdu << rxSignalInfo << txVector); NS_ASSERT (!psdu->IsAggregate () || psdu->IsSingle ()); if (psdu->GetSize () == 1030) { @@ -1405,11 +1411,12 @@ private: /** * RX success function * \param psdu the PSDU - * \param snr the SNR + * \param rxSignalInfo the info on the received signal (\see RxSignalInfo) * \param txVector the transmit vector * \param statusPerMpdu reception status per MPDU */ - void RxSuccess (Ptr psdu, double snr, WifiTxVector txVector, std::vector statusPerMpdu); + void RxSuccess (Ptr psdu, RxSignalInfo rxSignalInfo, + WifiTxVector txVector, std::vector statusPerMpdu); /** * RX failure function * \param psdu the PSDU @@ -1524,9 +1531,10 @@ TestAmpduReception::ResetBitmaps() } void -TestAmpduReception::RxSuccess (Ptr psdu, double snr, WifiTxVector txVector, std::vector statusPerMpdu) +TestAmpduReception::RxSuccess (Ptr psdu, RxSignalInfo rxSignalInfo, + WifiTxVector txVector, std::vector statusPerMpdu) { - NS_LOG_FUNCTION (this << *psdu << snr << txVector); + NS_LOG_FUNCTION (this << *psdu << rxSignalInfo << txVector); if (statusPerMpdu.empty ()) //wait for the whole A-MPDU { return; diff --git a/src/wifi/test/wifi-phy-thresholds-test.cc b/src/wifi/test/wifi-phy-thresholds-test.cc index 8d54119cb..caf1646e5 100644 --- a/src/wifi/test/wifi-phy-thresholds-test.cc +++ b/src/wifi/test/wifi-phy-thresholds-test.cc @@ -80,11 +80,12 @@ protected: /** * PHY receive success callback function * \param psdu the PSDU - * \param snr the SNR + * \param rxSignalInfo the info on the received signal (\see RxSignalInfo) * \param txVector the transmit vector * \param statusPerMpdu reception status per MPDU */ - virtual void RxSuccess (Ptr psdu, double snr, WifiTxVector txVector, std::vector statusPerMpdu); + virtual void RxSuccess (Ptr psdu, RxSignalInfo rxSignalInfo, + WifiTxVector txVector, std::vector statusPerMpdu); /** * PHY receive failure callback function * \param psdu the PSDU @@ -183,9 +184,10 @@ WifiPhyThresholdsTest::SendSignal (double txPowerWatts, bool wifiSignal) } void -WifiPhyThresholdsTest::RxSuccess (Ptr psdu, double snr, WifiTxVector txVector, std::vector statusPerMpdu) +WifiPhyThresholdsTest::RxSuccess (Ptr psdu, RxSignalInfo rxSignalInfo, + WifiTxVector txVector, std::vector statusPerMpdu) { - NS_LOG_FUNCTION (this << *psdu << snr << txVector); + NS_LOG_FUNCTION (this << *psdu << rxSignalInfo << txVector); m_rxSuccess++; }