wifi: Add tests for A-MPDU reception

This commit is contained in:
Sébastien Deronne
2018-12-31 13:53:15 +01:00
parent 8004dd72ea
commit 57e69a5366
7 changed files with 1015 additions and 20 deletions

View File

@@ -269,7 +269,7 @@ void
MacLow::ResetPhy (void)
{
m_phy->SetReceiveOkCallback (MakeNullCallback<void, Ptr<Packet>, double, WifiTxVector> ());
m_phy->SetReceiveErrorCallback (MakeNullCallback<void> ());
m_phy->SetReceiveErrorCallback (MakeNullCallback<void, Ptr<Packet>> ());
RemovePhyMacLowListener (m_phy);
m_phy = 0;
}
@@ -651,9 +651,9 @@ MacLow::NeedCtsToSelf (void) const
}
void
MacLow::ReceiveError (void)
MacLow::ReceiveError (Ptr<Packet> packet)
{
NS_LOG_FUNCTION (this);
NS_LOG_FUNCTION (this << packet);
NS_LOG_DEBUG ("rx failed");
if (IsCfPeriod () && m_currentHdr.IsCfPoll ())
{

View File

@@ -334,10 +334,12 @@ public:
*/
void ReceiveOk (Ptr<Packet> packet, double rxSnr, WifiTxVector txVector, bool ampduSubframe);
/**
* \param packet packet received.
*
* This method is typically invoked by the lower PHY layer to notify
* the MAC layer that a packet was unsuccessfully received.
*/
void ReceiveError (void);
void ReceiveError (Ptr<Packet> packet);
/**
* \param duration switching delay duration.
*

View File

@@ -480,7 +480,7 @@ WifiPhyStateHelper::SwitchFromRxEndError (Ptr<Packet> packet, double snr)
DoSwitchFromRx ();
if (!m_rxErrorCallback.IsNull ())
{
m_rxErrorCallback ();
m_rxErrorCallback (packet);
}
}

View File

@@ -46,8 +46,10 @@ class Packet;
typedef Callback<void, Ptr<Packet>, double, WifiTxVector> RxOkCallback;
/**
* Callback if packet unsuccessfully received
*
* arg1: packet received unsuccessfully
*/
typedef Callback<void> RxErrorCallback;
typedef Callback<void, Ptr<Packet>> RxErrorCallback;
/**
* \ingroup wifi

View File

@@ -79,8 +79,9 @@ protected:
void SpectrumWifiPhyRxSuccess (Ptr<Packet> p, double snr, WifiTxVector txVector);
/**
* Spectrum wifi receive failure function
*/
void SpectrumWifiPhyRxFailure (void);
* \param p the packet
- */
void SpectrumWifiPhyRxFailure (Ptr<Packet> p);
uint32_t m_count; ///< count
private:
@@ -144,9 +145,9 @@ SpectrumWifiPhyBasicTest::SpectrumWifiPhyRxSuccess (Ptr<Packet> p, double snr, W
}
void
SpectrumWifiPhyBasicTest::SpectrumWifiPhyRxFailure (void)
SpectrumWifiPhyBasicTest::SpectrumWifiPhyRxFailure (Ptr<Packet> p)
{
NS_LOG_FUNCTION (this);
NS_LOG_FUNCTION (this << p);
m_count++;
}

File diff suppressed because it is too large Load Diff

View File

@@ -78,8 +78,9 @@ protected:
virtual void RxSuccess (Ptr<Packet> p, double snr, WifiTxVector txVector);
/**
* PHY receive failure callback function
* \param p the packet
*/
virtual void RxFailure (void);
virtual void RxFailure (Ptr<Packet> p);
/**
* PHY dropped packet callback function
* \param p the packet
@@ -183,9 +184,9 @@ WifiPhyThresholdsTest::RxSuccess (Ptr<Packet> p, double snr, WifiTxVector txVect
}
void
WifiPhyThresholdsTest::RxFailure (void)
WifiPhyThresholdsTest::RxFailure (Ptr<Packet> p)
{
NS_LOG_FUNCTION (this);
NS_LOG_FUNCTION (this << p);
m_rxFailure++;
}