avoid confusion between code and uncoded rates.

This commit is contained in:
Mathieu Lacage
2007-11-22 16:40:35 +01:00
parent 39a0e3b29c
commit 3f174e0bd0
4 changed files with 18 additions and 17 deletions

View File

@@ -116,13 +116,13 @@ MacHighNqap::GetSupportedRates (void) const
for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
{
WifiMode mode = m_phy->GetMode (i);
rates.AddSupportedRate (mode.GetPhyRate ());
rates.AddSupportedRate (mode.GetDataRate ());
}
// set the basic rates
for (uint32_t j = 0; j < m_stations->GetNBasicModes (); j++)
{
WifiMode mode = m_stations->GetBasicMode (j);
rates.SetBasicRate (mode.GetPhyRate ());
rates.SetBasicRate (mode.GetDataRate ());
}
return rates;
}
@@ -273,7 +273,7 @@ MacHighNqap::Receive (Ptr<Packet> packet, WifiMacHeader const *hdr)
for (uint32_t i = 0; i < m_stations->GetNBasicModes (); i++)
{
WifiMode mode = m_stations->GetBasicMode (i);
if (!rates.IsSupportedRate (mode.GetPhyRate ()))
if (!rates.IsSupportedRate (mode.GetDataRate ()))
{
problem = true;
break;
@@ -293,7 +293,7 @@ MacHighNqap::Receive (Ptr<Packet> packet, WifiMacHeader const *hdr)
for (uint32_t j = 0; j < m_phy->GetNModes (); j++)
{
WifiMode mode = m_phy->GetMode (j);
if (rates.IsSupportedRate (mode.GetPhyRate ()))
if (rates.IsSupportedRate (mode.GetDataRate ()))
{
station->AddSupportedMode (mode);
}

View File

@@ -379,10 +379,10 @@ MacHighNqsta::Receive (Ptr<Packet> packet, WifiMacHeader const *hdr)
for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
{
WifiMode mode = m_phy->GetMode (i);
if (rates.IsSupportedRate (mode.GetPhyRate ()))
if (rates.IsSupportedRate (mode.GetDataRate ()))
{
ap->AddSupportedMode (mode);
if (rates.IsBasicRate (mode.GetPhyRate ()))
if (rates.IsBasicRate (mode.GetDataRate ()))
{
m_stations->AddBasicMode (mode);
}
@@ -406,7 +406,7 @@ MacHighNqsta::GetSupportedRates (void) const
for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
{
WifiMode mode = m_phy->GetMode (i);
rates.AddSupportedRate (mode.GetPhyRate ());
rates.AddSupportedRate (mode.GetDataRate ());
}
return rates;
}

View File

@@ -95,7 +95,7 @@ GetWifiModeForPhyMode (Ptr<WifiPhy> phy, enum WifiDefaultParameters::PhyModePara
for (uint32_t i= 0; i < phy->GetNModes (); i++)
{
WifiMode mode = phy->GetMode (i);
if (mode.GetPhyRate () == phyRate)
if (mode.GetDataRate () == phyRate)
{
return mode;
}

View File

@@ -39,28 +39,29 @@ namespace ns3 {
// Define all the WifiMode needed for 802.11a
static WifiMode g_6mba = WifiModeFactory::CreateBpsk ("wifia-6mbs",
true,
20000000, 6000000 * 1 / 2, 6000000);
20000000, 6000000, 12000000);
static WifiMode g_9mba = WifiModeFactory::CreateBpsk ("wifia-9mbs",
false,
20000000, 9000000 * 3 / 4, 9000000);
20000000, 9000000, 12000000);
// XXX explain why Bpsk rather than Qpsk
static WifiMode g_12mba = WifiModeFactory::CreateBpsk ("wifia-12mbs",
true,
20000000, 12000000 * 1 / 2, 12000000);
20000000, 12000000, 24000000);
static WifiMode g_18mba = WifiModeFactory::CreateBpsk ("wifia-18mbs",
false,
20000000, 18000000 * 3 / 4, 18000000);
20000000, 18000000, 24000000);
static WifiMode g_24mba = WifiModeFactory::CreateBpsk ("wifia-24mbs",
true,
20000000, 24000000 * 1 / 2, 24000000);
20000000, 24000000, 48000000);
static WifiMode g_36mba = WifiModeFactory::CreateBpsk ("wifia-36mbs",
false,
20000000, 36000000 * 3 / 4, 36000000);
20000000, 36000000, 48000000);
static WifiMode g_48mba = WifiModeFactory::CreateBpsk ("wifia-48mbs",
false,
20000000, 48000000 * 2 / 3, 48000000);
20000000, 48000000, 72000000);
static WifiMode g_54mba = WifiModeFactory::CreateBpsk ("wifia-54mbs",
false,
20000000, 54000000 * 3 / 4, 54000000);
20000000, 54000000, 72000000);
/****************************************************************
@@ -1204,7 +1205,7 @@ WifiPhy::EndSync (Ptr<Packet> packet, Ptr<RxEvent> event)
* all SNIR changes in the snir vector.
*/
double per = CalculatePer (event, &ni);
NS_LOG_DEBUG ("mode="<<(event->GetPayloadMode ().GetPhyRate ())<<
NS_LOG_DEBUG ("mode="<<(event->GetPayloadMode ().GetDataRate ())<<
", ber="<<(1-GetChunkSuccessRate (event->GetPayloadMode (), snr, 1))<<
", snr="<<snr<<", per="<<per<<", size="<<packet->GetSize ());