wifi: Add RSSI information in RxOkCallback

Done through a RxSignalInfo structure so as to facilitate future additions of other signal parameters
This commit is contained in:
Rediet
2019-07-24 15:46:45 +02:00
committed by Sébastien Deronne
parent fb1d6fa4b6
commit 201fa54d8b
11 changed files with 124 additions and 69 deletions

View File

@@ -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<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> statusPerMpdu);
void Receive (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> statusPerMpdu);
Ptr<WifiPhy> m_tx; ///< transmit
struct Input m_input; ///< input
struct Output m_output; ///< output
@@ -89,7 +90,8 @@ PsrExperiment::Send (void)
}
void
PsrExperiment::Receive (Ptr<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> statusPerMpdu)
PsrExperiment::Receive (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> 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<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> statusPerMpdu);
void Receive (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> statusPerMpdu);
Ptr<WifiPhy> m_txA; ///< transmit A
Ptr<WifiPhy> m_txB; ///< transmit B
uint32_t m_flowIdA; ///< flow ID A
@@ -226,7 +229,8 @@ CollisionExperiment::SendB (void) const
}
void
CollisionExperiment::Receive (Ptr<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> statusPerMpdu)
CollisionExperiment::Receive (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> statusPerMpdu)
{
FlowIdTag tag;
if ((*psdu->begin ())->GetPacket ()->FindFirstMatchingByteTag (tag))

View File

@@ -172,7 +172,7 @@ FrameExchangeManager::ResetPhy (void)
{
m_phy->TraceDisconnectWithoutContext ("PhyRxPayloadBegin",
MakeCallback (&FrameExchangeManager::RxStartIndication, this));
m_phy->SetReceiveOkCallback (MakeNullCallback<void, Ptr<WifiPsdu>, double, WifiTxVector, std::vector<bool>> ());
m_phy->SetReceiveOkCallback (MakeNullCallback<void, Ptr<WifiPsdu>, RxSignalInfo, WifiTxVector, std::vector<bool>> ());
m_phy = 0;
}
@@ -847,10 +847,10 @@ FrameExchangeManager::NotifyOffNow (void)
}
void
FrameExchangeManager::Receive (Ptr<WifiPsdu> psdu, double rxSnr,
FrameExchangeManager::Receive (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> 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<WifiPsdu> 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)

View File

@@ -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<WifiPsdu> psdu, double rxSnr,
void Receive (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> perMpduStatus);
/**

View File

@@ -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<WifiPsdu> psdu, double snr, WifiTxVector txVector)
WifiPhyStateHelper::ContinueRxNextMpdu (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector)
{
NS_LOG_FUNCTION (this << *psdu << snr << txVector);
NS_LOG_FUNCTION (this << *psdu << rxSignalInfo << txVector);
std::vector<bool> statusPerMpdu;
if (!m_rxOkCallback.IsNull ())
{
m_rxOkCallback (psdu, snr, txVector, statusPerMpdu);
m_rxOkCallback (psdu, rxSignalInfo, txVector, statusPerMpdu);
}
}
void
WifiPhyStateHelper::SwitchFromRxEndOk (Ptr<WifiPsdu> psdu, double snr, WifiTxVector txVector, uint16_t staId, std::vector<bool> statusPerMpdu)
WifiPhyStateHelper::SwitchFromRxEndOk (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, uint16_t staId, std::vector<bool> 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);
}
}

View File

@@ -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<void, Ptr<WifiPsdu>, double, WifiTxVector, std::vector<bool>> RxOkCallback;
typedef Callback<void, Ptr<WifiPsdu>, RxSignalInfo,
WifiTxVector, std::vector<bool>> 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<WifiPsdu> psdu, double snr, WifiTxVector txVector);
void ContinueRxNextMpdu (Ptr<WifiPsdu> 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<WifiPsdu> psdu, double snr, WifiTxVector txVector, uint16_t staId, std::vector<bool> statusPerMpdu);
void SwitchFromRxEndOk (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector,
uint16_t staId, std::vector<bool> statusPerMpdu);
/**
* Switch from RX after the reception failed.
*

View File

@@ -3701,6 +3701,10 @@ WifiPhy::EndOfMpdu (Ptr<Event> event, Ptr<const WifiPsdu> 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> event, Ptr<const WifiPsdu> 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> 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 {

View File

@@ -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<void> 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 */

View File

@@ -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<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> statusPerMpdu);
void SpectrumWifiPhyRxSuccess (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> statusPerMpdu);
/**
* Spectrum wifi receive failure function
* \param psdu the PSDU
@@ -149,9 +150,10 @@ SpectrumWifiPhyBasicTest::SendSignal (double txPowerWatts)
}
void
SpectrumWifiPhyBasicTest::SpectrumWifiPhyRxSuccess (Ptr<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> statusPerMpdu)
SpectrumWifiPhyBasicTest::SpectrumWifiPhyRxSuccess (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> statusPerMpdu)
{
NS_LOG_FUNCTION (this << *psdu << snr << txVector);
NS_LOG_FUNCTION (this << *psdu << rxSignalInfo << txVector);
m_count++;
}

View File

@@ -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<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> statusPerMpdu);
void RxSuccessSta1 (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> 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<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> statusPerMpdu);
void RxSuccessSta2 (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> 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<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> statusPerMpdu);
void RxSuccessSta3 (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> statusPerMpdu);
/**
* Receive failure function for STA 1
@@ -450,25 +453,28 @@ TestDlOfdmaPhyTransmission::~TestDlOfdmaPhyTransmission ()
}
void
TestDlOfdmaPhyTransmission::RxSuccessSta1 (Ptr<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> /*statusPerMpdu*/)
TestDlOfdmaPhyTransmission::RxSuccessSta1 (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> /*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<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> /*statusPerMpdu*/)
TestDlOfdmaPhyTransmission::RxSuccessSta2 (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> /*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<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> /*statusPerMpdu*/)
TestDlOfdmaPhyTransmission::RxSuccessSta3 (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> /*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<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> statusPerMpdu);
void RxSuccess (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector<bool> statusPerMpdu);
/**
* Receive failure function
@@ -1816,9 +1822,9 @@ TestUlOfdmaPhyTransmission::~TestUlOfdmaPhyTransmission ()
}
void
TestUlOfdmaPhyTransmission::RxSuccess (Ptr<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> /*statusPerMpdu*/)
TestUlOfdmaPhyTransmission::RxSuccess (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector<bool> /*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<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> statusPerMpdu);
void RxSuccess (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector<bool> statusPerMpdu);
/**
* Receive failure function
@@ -2584,9 +2590,9 @@ TestPhyPaddingExclusion::~TestPhyPaddingExclusion ()
}
void
TestPhyPaddingExclusion::RxSuccess (Ptr<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> /*statusPerMpdu*/)
TestPhyPaddingExclusion::RxSuccess (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector<bool> /*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++;

View File

@@ -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<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> statusPerMpdu);
void RxSuccess (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> statusPerMpdu);
/**
* Spectrum wifi receive failure function
* \param psdu the PSDU
@@ -168,9 +169,10 @@ TestThresholdPreambleDetectionWithoutFrameCapture::CheckRxPacketCount (uint32_t
}
void
TestThresholdPreambleDetectionWithoutFrameCapture::RxSuccess (Ptr<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> statusPerMpdu)
TestThresholdPreambleDetectionWithoutFrameCapture::RxSuccess (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> 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<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> statusPerMpdu);
void RxSuccess (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> statusPerMpdu);
/**
* Spectrum wifi receive failure function
* \param psdu the PSDU
@@ -523,7 +526,8 @@ TestThresholdPreambleDetectionWithFrameCapture::CheckRxPacketCount (uint32_t exp
}
void
TestThresholdPreambleDetectionWithFrameCapture::RxSuccess (Ptr<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> statusPerMpdu)
TestThresholdPreambleDetectionWithFrameCapture::RxSuccess (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> 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<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> statusPerMpdu);
void RxSuccess (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> statusPerMpdu);
/**
* RX dropped function
* \param p the packet
@@ -1005,9 +1010,10 @@ TestSimpleFrameCaptureModel::SendPacket (double rxPowerDbm, uint32_t packetSize)
}
void
TestSimpleFrameCaptureModel::RxSuccess (Ptr<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> statusPerMpdu)
TestSimpleFrameCaptureModel::RxSuccess (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> 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<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> statusPerMpdu);
void RxSuccess (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> statusPerMpdu);
/**
* RX failure function
* \param psdu the PSDU
@@ -1524,9 +1531,10 @@ TestAmpduReception::ResetBitmaps()
}
void
TestAmpduReception::RxSuccess (Ptr<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> statusPerMpdu)
TestAmpduReception::RxSuccess (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> 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;

View File

@@ -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<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> statusPerMpdu);
virtual void RxSuccess (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> statusPerMpdu);
/**
* PHY receive failure callback function
* \param psdu the PSDU
@@ -183,9 +184,10 @@ WifiPhyThresholdsTest::SendSignal (double txPowerWatts, bool wifiSignal)
}
void
WifiPhyThresholdsTest::RxSuccess (Ptr<WifiPsdu> psdu, double snr, WifiTxVector txVector, std::vector<bool> statusPerMpdu)
WifiPhyThresholdsTest::RxSuccess (Ptr<WifiPsdu> psdu, RxSignalInfo rxSignalInfo,
WifiTxVector txVector, std::vector<bool> statusPerMpdu)
{
NS_LOG_FUNCTION (this << *psdu << snr << txVector);
NS_LOG_FUNCTION (this << *psdu << rxSignalInfo << txVector);
m_rxSuccess++;
}