wifi: Add GetDataRate for non-HT/VHT stations

This commit is contained in:
Sébastien Deronne
2016-12-29 13:35:28 +01:00
parent 2982f27f59
commit ba448bf7f7
11 changed files with 64 additions and 58 deletions

View File

@@ -85,7 +85,7 @@ WaveMacLow::GetDataTxVector (Ptr<const Packet> packet, const WifiMacHeader *hdr)
txAdapter.SetChannelWidth (10);
// the DataRate set by higher layer is the minimum data rate
// which is the lower bound for the actual data rate.
if (txHigher.GetMode ().GetDataRate (txHigher.GetChannelWidth (), txHigher.IsShortGuardInterval (), 1) > txMac.GetMode ().GetDataRate (txMac.GetChannelWidth (), txMac.IsShortGuardInterval (), 1))
if (txHigher.GetMode ().GetDataRate (txHigher.GetChannelWidth ()) > txMac.GetMode ().GetDataRate (txMac.GetChannelWidth ()))
{
txAdapter.SetMode (txHigher.GetMode ());
txAdapter.SetPreambleType (txHigher.GetPreambleType ());

View File

@@ -379,13 +379,12 @@ ApWifiMac::GetSupportedRates (void) const
}
}
//
uint8_t nss = 1; // Number of spatial streams is 1 for non-MIMO modes
//Send the set of supported rates and make sure that we indicate
//the Basic Rate set in this set of supported rates.
for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
{
WifiMode mode = m_phy->GetMode (i);
uint64_t modeDataRate = mode.GetDataRate (m_phy->GetChannelWidth (), false, nss);
uint64_t modeDataRate = mode.GetDataRate (m_phy->GetChannelWidth ());
NS_LOG_DEBUG ("Adding supported rate of " << modeDataRate);
rates.AddSupportedRate (modeDataRate);
//Add rates that are part of the BSSBasicRateSet (manufacturer dependent!)
@@ -401,7 +400,7 @@ ApWifiMac::GetSupportedRates (void) const
for (uint32_t j = 0; j < m_stationManager->GetNBasicModes (); j++)
{
WifiMode mode = m_stationManager->GetBasicMode (j);
uint64_t modeDataRate = mode.GetDataRate (m_phy->GetChannelWidth (), false, nss);
uint64_t modeDataRate = mode.GetDataRate (m_phy->GetChannelWidth ());
NS_LOG_DEBUG ("Setting basic rate " << mode.GetUniqueName ());
rates.SetBasicRate (modeDataRate);
}
@@ -856,8 +855,7 @@ ApWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr)
for (uint32_t i = 0; i < m_stationManager->GetNBasicModes (); i++)
{
WifiMode mode = m_stationManager->GetBasicMode (i);
uint8_t nss = 1; // Assume 1 spatial stream in basic mode
if (!rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, nss)))
if (!rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
{
if ((mode.GetModulationClass () == WIFI_MOD_CLASS_DSSS) || (mode.GetModulationClass () == WIFI_MOD_CLASS_HR_DSSS))
{
@@ -943,8 +941,7 @@ ApWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr)
for (uint32_t j = 0; j < m_phy->GetNModes (); j++)
{
WifiMode mode = m_phy->GetMode (j);
uint8_t nss = 1; // Assume 1 spatial stream in basic mode
if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, nss)))
if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
{
m_stationManager->AddSupportedMode (from, mode);
}

View File

@@ -980,7 +980,7 @@ MinstrelHtWifiManager::DoGetRtsTxVector (WifiRemoteStation *st)
for (uint32_t i = 0; i < nBasicRates; i++)
{
uint64_t rate = GetBasicMode (i).GetDataRate (20,false,1);
uint64_t rate = GetBasicMode (i).GetDataRate (20);
if (rate <= lastDataRate)
{
rtsRate = GetBasicMode (i);
@@ -994,7 +994,7 @@ MinstrelHtWifiManager::DoGetRtsTxVector (WifiRemoteStation *st)
uint32_t nSupportRates = phy->GetNModes ();
for (uint32_t i = 0; i < nSupportRates; i++)
{
uint64_t rate = phy->GetMode (i).GetDataRate (20,false,1);
uint64_t rate = phy->GetMode (i).GetDataRate (20);
if (rate <= lastDataRate)
{
rtsRate = phy->GetMode (i);

View File

@@ -340,7 +340,7 @@ NistErrorRateModel::GetChunkSuccessRate (WifiMode mode, WifiTxVector txVector, d
}
else if (mode.GetModulationClass () == WIFI_MOD_CLASS_DSSS || mode.GetModulationClass () == WIFI_MOD_CLASS_HR_DSSS)
{
switch (mode.GetDataRate (20, 0, 1))
switch (mode.GetDataRate (20))
{
case 1000000:
return DsssErrorRateModel::GetDsssDbpskSuccessRate (snr, nbits);

View File

@@ -404,8 +404,7 @@ RraaWifiManager::GetThresholds (RraaWifiRemoteStation *station,
RraaWifiManager::ThresholdsItem
RraaWifiManager::GetThresholds (WifiMode mode, RraaWifiRemoteStation *station) const
{
uint8_t nss = 1; // This RAA only supports 1 spatial stream
switch (mode.GetDataRate (GetChannelWidth (station), GetShortGuardInterval (station), nss) / 1000000)
switch (mode.GetDataRate (GetChannelWidth (station)) / 1000000)
{
case 54:
{

View File

@@ -586,11 +586,10 @@ StaWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr)
for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
{
WifiMode mode = m_phy->GetMode (i);
uint8_t nss = 1; // Assume 1 spatial stream
if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, nss)))
if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
{
m_stationManager->AddSupportedMode (hdr->GetAddr2 (), mode);
if (rates.IsBasicRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, nss)))
if (rates.IsBasicRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
{
m_stationManager->AddBasicMode (mode);
}
@@ -604,7 +603,7 @@ StaWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr)
for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
{
WifiMode mode = m_phy->GetMode (i);
if (mode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM && rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, 1)))
if (mode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM && rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
{
isErpAllowed = true;
break;
@@ -670,7 +669,7 @@ StaWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr)
for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
{
WifiMode mode = m_phy->GetMode (i);
if (mode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM && rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, 1)))
if (mode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM && rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
{
isErpAllowed = true;
break;
@@ -726,11 +725,10 @@ StaWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr)
for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
{
WifiMode mode = m_phy->GetMode (i);
uint8_t nss = 1; // Assume 1 spatial stream
if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, nss)))
if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
{
m_stationManager->AddSupportedMode (hdr->GetAddr2 (), mode);
if (rates.IsBasicRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, nss)))
if (rates.IsBasicRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
{
m_stationManager->AddBasicMode (mode);
}
@@ -786,7 +784,6 @@ SupportedRates
StaWifiMac::GetSupportedRates (void) const
{
SupportedRates rates;
uint8_t nss = 1; // Number of spatial streams is 1 for non-MIMO modes
if (m_htSupported || m_vhtSupported)
{
for (uint32_t i = 0; i < m_phy->GetNBssMembershipSelectors (); i++)
@@ -797,7 +794,7 @@ StaWifiMac::GetSupportedRates (void) const
for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
{
WifiMode mode = m_phy->GetMode (i);
uint64_t modeDataRate = mode.GetDataRate (m_phy->GetChannelWidth (), false, nss);
uint64_t modeDataRate = mode.GetDataRate (m_phy->GetChannelWidth ());
NS_LOG_DEBUG ("Adding supported rate of " << modeDataRate);
rates.AddSupportedRate (modeDataRate);
}

View File

@@ -103,6 +103,18 @@ WifiMode::GetPhyRate (WifiTxVector txVector) const
return GetPhyRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), txVector.GetNss ());
}
uint64_t
WifiMode::GetDataRate (uint32_t channelWidth) const
{
return GetDataRate (channelWidth, false, 1);
}
uint64_t
WifiMode::GetDataRate (WifiTxVector txVector) const
{
return GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), txVector.GetNss ());
}
uint64_t
WifiMode::GetDataRate (uint32_t channelWidth, bool isShortGuardInterval, uint8_t nss) const
{
@@ -225,12 +237,6 @@ WifiMode::GetDataRate (uint32_t channelWidth, bool isShortGuardInterval, uint8_t
return dataRate;
}
uint64_t
WifiMode::GetDataRate (WifiTxVector txVector) const
{
return GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), txVector.GetNss ());
}
WifiCodeRate
WifiMode::GetCodeRate (void) const
{

View File

@@ -131,6 +131,13 @@ public:
* \returns the data bit rate of this signal.
*/
uint64_t GetDataRate (WifiTxVector txVector) const;
/*
* \param channelWidth the considered channel width in MHz
*
* \returns the data bit rate of this non-HT or non-VHT signal.
*/
uint64_t GetDataRate (uint32_t channelWidth) const;
/**
* \returns the coding rate of this transmission mode
*/

View File

@@ -1755,7 +1755,7 @@ WifiPhy::GetPlcpHeaderDuration (WifiTxVector txVector)
return MicroSeconds (4);
case WIFI_MOD_CLASS_DSSS:
case WIFI_MOD_CLASS_HR_DSSS:
if ((preamble == WIFI_PREAMBLE_SHORT) && (txVector.GetMode ().GetDataRate (22, 0, 1) > 1000000))
if ((preamble == WIFI_PREAMBLE_SHORT) && (txVector.GetMode ().GetDataRate (22) > 1000000))
{
//(Section 17.2.2.3 "Short PPDU format" and Figure 17-2 "Short PPDU format"; IEEE Std 802.11-2012)
return MicroSeconds (24);
@@ -1808,7 +1808,7 @@ WifiPhy::GetPlcpPreambleDuration (WifiTxVector txVector)
return MicroSeconds (16);
case WIFI_MOD_CLASS_DSSS:
case WIFI_MOD_CLASS_HR_DSSS:
if ((preamble == WIFI_PREAMBLE_SHORT) && (txVector.GetMode ().GetDataRate (22, 0, 1) > 1000000))
if ((preamble == WIFI_PREAMBLE_SHORT) && (txVector.GetMode ().GetDataRate (22) > 1000000))
{
//(Section 17.2.2.3 "Short PPDU format)" Figure 17-2 "Short PPDU format"; IEEE Std 802.11-2012)
return MicroSeconds (72);
@@ -1862,7 +1862,7 @@ WifiPhy::GetPayloadDuration (uint32_t size, WifiTxVector txVector, double freque
//(Section 18.3.2.3 "Modulation-dependent parameters" Table 18-4 "Modulation-dependent parameters"; IEEE Std 802.11-2012)
//corresponds to N_{DBPS} in the table
double numDataBitsPerSymbol = payloadMode.GetDataRate (txVector.GetChannelWidth (), 0, 1) * symbolDuration.GetNanoSeconds () / 1e9;
double numDataBitsPerSymbol = payloadMode.GetDataRate (txVector.GetChannelWidth ()) * symbolDuration.GetNanoSeconds () / 1e9;
double numSymbols;
if (mpdutype == MPDU_IN_AGGREGATE && preamble != WIFI_PREAMBLE_NONE)
@@ -2115,8 +2115,8 @@ WifiPhy::GetPayloadDuration (uint32_t size, WifiTxVector txVector, double freque
//(Section 17.2.3.6 "Long PLCP LENGTH field"; IEEE Std 802.11-2012)
NS_LOG_LOGIC (" size=" << size
<< " mode=" << payloadMode
<< " rate=" << payloadMode.GetDataRate (22, 0, 1));
return MicroSeconds (lrint (ceil ((size * 8.0) / (payloadMode.GetDataRate (22, 0, 1) / 1.0e6))));
<< " rate=" << payloadMode.GetDataRate (22));
return MicroSeconds (lrint (ceil ((size * 8.0) / (payloadMode.GetDataRate (22) / 1.0e6))));
default:
NS_FATAL_ERROR ("unsupported modulation class");
return MicroSeconds (0);

View File

@@ -330,7 +330,7 @@ YansErrorRateModel::GetChunkSuccessRate (WifiMode mode, WifiTxVector txVector, d
}
else if (mode.GetModulationClass () == WIFI_MOD_CLASS_DSSS || mode.GetModulationClass () == WIFI_MOD_CLASS_HR_DSSS)
{
switch (mode.GetDataRate (20, 0, 1))
switch (mode.GetDataRate (20))
{
case 1000000:
return DsssErrorRateModel::GetDsssDbpskSuccessRate (snr, nbits);

View File

@@ -139,7 +139,7 @@ PowerRateAdaptationTest::TestParf ()
WifiMode mode = txVector.GetMode ();
int power = (int) txVector.GetTxPowerLevel ();
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), 54000000, "PARF: Initial data rate wrong");
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth ()), 54000000, "PARF: Initial data rate wrong");
NS_TEST_ASSERT_MSG_EQ (power, 17, "PARF: Initial power level wrong");
//-----------------------------------------------------------------------------------------------------
@@ -157,7 +157,7 @@ PowerRateAdaptationTest::TestParf ()
mode = txVector.GetMode ();
power = (int) txVector.GetTxPowerLevel ();
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), 54000000, "PARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth ()), 54000000, "PARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (power, 16, "PARF: Incorrect value of power level");
//-----------------------------------------------------------------------------------------------------
@@ -172,7 +172,7 @@ PowerRateAdaptationTest::TestParf ()
mode = txVector.GetMode ();
power = (int) txVector.GetTxPowerLevel ();
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), 54000000, "PARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth ()), 54000000, "PARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (power, 17, "PARF: Incorrect value of power level");
//-----------------------------------------------------------------------------------------------------
@@ -192,7 +192,7 @@ PowerRateAdaptationTest::TestParf ()
mode = txVector.GetMode ();
power = (int) txVector.GetTxPowerLevel ();
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), 54000000, "PARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth ()), 54000000, "PARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (power, 16, "PARF: Incorrect value of power level");
//-----------------------------------------------------------------------------------------------------
@@ -207,7 +207,7 @@ PowerRateAdaptationTest::TestParf ()
mode = txVector.GetMode ();
power = (int) txVector.GetTxPowerLevel ();
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), 54000000, "PARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth ()), 54000000, "PARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (power, 17, "PARF: Incorrect value of power level");
//-----------------------------------------------------------------------------------------------------
@@ -223,7 +223,7 @@ PowerRateAdaptationTest::TestParf ()
mode = txVector.GetMode ();
power = (int) txVector.GetTxPowerLevel ();
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), 48000000, "PARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth ()), 48000000, "PARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (power, 17, "PARF: Incorrect value of power level");
//-----------------------------------------------------------------------------------------------------
@@ -241,7 +241,7 @@ PowerRateAdaptationTest::TestParf ()
mode = txVector.GetMode ();
power = (int) txVector.GetTxPowerLevel ();
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), 54000000, "PARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth ()), 54000000, "PARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (power, 17, "PARF: Incorrect value of power level");
//-----------------------------------------------------------------------------------------------------
@@ -256,7 +256,7 @@ PowerRateAdaptationTest::TestParf ()
mode = txVector.GetMode ();
power = (int) txVector.GetTxPowerLevel ();
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), 48000000, "PARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth ()), 48000000, "PARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (power, 17, "PARF: Incorrect value of power level");
//-----------------------------------------------------------------------------------------------------
@@ -274,7 +274,7 @@ PowerRateAdaptationTest::TestParf ()
mode = txVector.GetMode ();
power = (int) txVector.GetTxPowerLevel ();
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), 54000000, "PARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth ()), 54000000, "PARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (power, 17, "PARF: Incorrect value of power level");
//-----------------------------------------------------------------------------------------------------
@@ -292,7 +292,7 @@ PowerRateAdaptationTest::TestParf ()
mode = txVector.GetMode ();
power = (int) txVector.GetTxPowerLevel ();
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), 54000000, "PARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth ()), 54000000, "PARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (power, 16, "PARF: Incorrect value of power level");
//-----------------------------------------------------------------------------------------------------
@@ -312,7 +312,7 @@ PowerRateAdaptationTest::TestParf ()
mode = txVector.GetMode ();
power = (int) txVector.GetTxPowerLevel ();
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), 54000000, "PARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth ()), 54000000, "PARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (power, 17, "PARF: Incorrect value of power level");
Simulator::Destroy ();
@@ -359,7 +359,7 @@ PowerRateAdaptationTest::TestAparf ()
WifiMode mode = txVector.GetMode ();
int power = (int) txVector.GetTxPowerLevel ();
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), 54000000, "APARF: Initial data rate wrong");
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth ()), 54000000, "APARF: Initial data rate wrong");
NS_TEST_ASSERT_MSG_EQ (power, 17, "APARF: Initial power level wrong");
//-----------------------------------------------------------------------------------------------------
@@ -378,7 +378,7 @@ PowerRateAdaptationTest::TestAparf ()
mode = txVector.GetMode ();
power = (int) txVector.GetTxPowerLevel ();
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), 54000000, "APARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth ()), 54000000, "APARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (power, 16, "APARF: Incorrect value of power level");
//-----------------------------------------------------------------------------------------------------
@@ -393,7 +393,7 @@ PowerRateAdaptationTest::TestAparf ()
mode = txVector.GetMode ();
power = (int) txVector.GetTxPowerLevel ();
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), 54000000, "APARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth ()), 54000000, "APARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (power, 17, "APARF: Incorrect value of power level");
//-----------------------------------------------------------------------------------------------------
@@ -412,7 +412,7 @@ PowerRateAdaptationTest::TestAparf ()
mode = txVector.GetMode ();
power = (int) txVector.GetTxPowerLevel ();
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), 54000000, "APARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth ()), 54000000, "APARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (power, 16, "APARF: Incorrect value of power level");
//-----------------------------------------------------------------------------------------------------
@@ -431,7 +431,7 @@ PowerRateAdaptationTest::TestAparf ()
mode = txVector.GetMode ();
power = (int) txVector.GetTxPowerLevel ();
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), 54000000, "APARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth ()), 54000000, "APARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (power, 15, "APARF: Incorrect value of power level");
//-----------------------------------------------------------------------------------------------------
@@ -449,7 +449,7 @@ PowerRateAdaptationTest::TestAparf ()
mode = txVector.GetMode ();
power = (int) txVector.GetTxPowerLevel ();
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), 54000000, "APARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth ()), 54000000, "APARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (power, 0, "APARF: Incorrect value of power level");
//-----------------------------------------------------------------------------------------------------
@@ -464,7 +464,7 @@ PowerRateAdaptationTest::TestAparf ()
mode = txVector.GetMode ();
power = (int) txVector.GetTxPowerLevel ();
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), 54000000, "Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth ()), 54000000, "Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (power, 1, "Incorrect value of power level");
//-----------------------------------------------------------------------------------------------------
@@ -482,7 +482,7 @@ PowerRateAdaptationTest::TestAparf ()
mode = txVector.GetMode ();
power = (int) txVector.GetTxPowerLevel ();
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), 54000000, "APARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth ()), 54000000, "APARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (power, 17, "APARF: Incorrect value of power level");
//-----------------------------------------------------------------------------------------------------
@@ -498,7 +498,7 @@ PowerRateAdaptationTest::TestAparf ()
mode = txVector.GetMode ();
power = (int) txVector.GetTxPowerLevel ();
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), 48000000, "Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth ()), 48000000, "Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (power, 17, "Incorrect value of power level");
//-----------------------------------------------------------------------------------------------------
@@ -516,7 +516,7 @@ PowerRateAdaptationTest::TestAparf ()
mode = txVector.GetMode ();
power = (int) txVector.GetTxPowerLevel ();
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), 48000000, "APARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth ()), 48000000, "APARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (power, 16, "APARF: Incorrect value of power level");
//-----------------------------------------------------------------------------------------------------
@@ -536,7 +536,7 @@ PowerRateAdaptationTest::TestAparf ()
mode = txVector.GetMode ();
power = (int) txVector.GetTxPowerLevel ();
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), 48000000, "APARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth ()), 48000000, "APARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (power, 7, "APARF: Incorrect value of power level");
for (int i = 0; i < 3; i++)
@@ -548,7 +548,7 @@ PowerRateAdaptationTest::TestAparf ()
mode = txVector.GetMode ();
power = (int) txVector.GetTxPowerLevel ();
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), 54000000, "APARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (mode.GetDataRate (txVector.GetChannelWidth ()), 54000000, "APARF: Incorrect vale of data rate");
NS_TEST_ASSERT_MSG_EQ (power, 17, "APARF: Incorrect value of power level");
Simulator::Destroy ();