wifi: Fix use of YansErrorRateModel for PHY headers

This commit is contained in:
Sébastien Deronne
2021-03-07 18:10:25 +01:00
parent 7a65a32345
commit bc0a99c19b
3 changed files with 20 additions and 2 deletions

View File

@@ -32,6 +32,11 @@ bool operator == (const WifiMode &a, const WifiMode &b)
return a.GetUid () == b.GetUid ();
}
bool operator != (const WifiMode &a, const WifiMode &b)
{
return a.GetUid () != b.GetUid ();
}
bool operator < (const WifiMode &a, const WifiMode &b)
{
return a.GetUid () < b.GetUid ();

View File

@@ -222,6 +222,18 @@ private:
* false otherwise
*/
bool operator == (const WifiMode &a, const WifiMode &b);
/**
* Check if the two WifiModes are different.
*
* \param a WifiMode
* \param b WifiMode
*
* \return true if the two WifiModes are different,
* false otherwise
*/
bool operator != (const WifiMode &a, const WifiMode &b);
/**
* Compare two WifiModes
*
@@ -232,6 +244,7 @@ bool operator == (const WifiMode &a, const WifiMode &b);
* false otherwise
*/
bool operator < (const WifiMode &a, const WifiMode &b);
/**
* Serialize WifiMode to ostream (human-readable).
*

View File

@@ -189,9 +189,9 @@ YansErrorRateModel::DoGetChunkSuccessRate (WifiMode mode, const WifiTxVector& tx
|| mode.GetModulationClass () == WIFI_MOD_CLASS_HE)
{
uint64_t phyRate;
if (txVector.IsMu () && (staId == SU_STA_ID))
if ((mode != txVector.GetMode ()) || (txVector.IsMu () && (staId == SU_STA_ID)))
{
phyRate = mode.GetPhyRate (20); //This is the PHY header: consider 20 MHz to calculate the PHY rate
phyRate = mode.GetPhyRate (txVector.GetChannelWidth () >= 40 ? 20 : txVector.GetChannelWidth ()); //This is the PHY header
}
else
{