Index: src/wifi/model/minstrel-wifi-manager.cc |
=================================================================== |
--- a/src/wifi/model/minstrel-wifi-manager.cc |
+++ b/src/wifi/model/minstrel-wifi-manager.cc |
@@ -362,13 +362,13 @@ |
{ |
CheckInit (station); |
} |
- WifiMode mode = GetSupported (station, station->m_txrate); |
+ WifiMode mode = GetSupported (station, static_cast<uint8_t> (station->m_txrate)); |
if (m_currentRate != mode.GetDataRate (channelWidth) && !station->m_isSampling) |
{ |
NS_LOG_DEBUG ("New datarate: " << mode.GetDataRate (channelWidth)); |
m_currentRate = mode.GetDataRate (channelWidth); |
} |
- return WifiTxVector (mode, GetDefaultTxPowerLevel (), GetLongRetryCount (station), GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false); |
+ return WifiTxVector (mode, GetDefaultTxPowerLevel (), static_cast<uint8_t> (GetLongRetryCount (station)), GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false); |
} |
WifiTxVector |
@@ -392,7 +392,7 @@ |
{ |
mode = GetNonErpSupported (station, 0); |
} |
- rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetShortRetryCount (station), GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false); |
+ rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), static_cast<uint8_t> (GetShortRetryCount (station)), GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1, 0, channelWidth, GetAggregation (station), false); |
return rtsTxVector; |
} |
@@ -428,7 +428,7 @@ |
uint32_t idx = 0; |
NS_LOG_DEBUG ("Total: " << station->m_totalPacketsCount << " Sample: " << station->m_samplePacketsCount << " Deferred: " << station->m_numSamplesDeferred); |
- int delta = (station->m_totalPacketsCount * m_lookAroundRate / 100) - (station->m_samplePacketsCount + station->m_numSamplesDeferred / 2); |
+ int delta = static_cast<int> ((station->m_totalPacketsCount * m_lookAroundRate / 100) - (station->m_samplePacketsCount + station->m_numSamplesDeferred / 2)); |
NS_LOG_DEBUG ("Decide sampling. Delta: " << delta << " lookAroundRatio: " << m_lookAroundRate); |
@@ -455,7 +455,7 @@ |
//now go through the table and find an index rate |
idx = GetNextSample (station); |
- NS_LOG_DEBUG ("Sample rate = " << idx << "(" << GetSupported (station, idx) << ")"); |
+ NS_LOG_DEBUG ("Sample rate = " << idx << "(" << GetSupported (station, static_cast<uint8_t> (idx)) << ")"); |
//error check |
if (idx >= station->m_nModes) |
@@ -486,7 +486,7 @@ |
// if samplieLimit is zero, then don't sample this rate |
if (!station->m_minstrelTable[idx].sampleLimit) |
{ |
- idx = station->m_maxTpRate; |
+ idx = station->m_maxTpRate; |
station->m_isSampling = false; |
} |
else |
@@ -503,18 +503,18 @@ |
//using the best rate instead |
if (station->m_sampleDeferred) |
{ |
- NS_LOG_DEBUG ("The next look around rate is slower than the maximum throughput rate, continue with the maximum throughput rate: " << station->m_maxTpRate << "(" << GetSupported (station, station->m_maxTpRate) << ")"); |
- idx = station->m_maxTpRate; |
+ NS_LOG_DEBUG ("The next look around rate is slower than the maximum throughput rate, continue with the maximum throughput rate: " << station->m_maxTpRate << "(" << GetSupported (station, static_cast<uint8_t> (station->m_maxTpRate)) << ")"); |
+ idx = station->m_maxTpRate; |
} |
} |
//continue using the best rate |
else |
{ |
- NS_LOG_DEBUG ("Continue using the maximum throughput rate: " << station->m_maxTpRate << "(" << GetSupported (station, station->m_maxTpRate) << ")"); |
+ NS_LOG_DEBUG ("Continue using the maximum throughput rate: " << station->m_maxTpRate << "(" << GetSupported (station, static_cast<uint8_t> (station->m_maxTpRate)) << ")"); |
idx = station->m_maxTpRate; |
} |
- NS_LOG_DEBUG ("Rate = " << idx << "(" << GetSupported (station, idx) << ")"); |
+ NS_LOG_DEBUG ("Rate = " << idx << "(" << GetSupported (station, static_cast<uint8_t> (idx)) << ")"); |
return idx; |
} |
@@ -535,7 +535,7 @@ |
NS_LOG_FUNCTION (this); |
station->m_nextStatsUpdate = Simulator::Now () + m_updateStats; |
NS_LOG_DEBUG ("Next update at " << station->m_nextStatsUpdate); |
- NS_LOG_DEBUG ("Currently using rate: " << station->m_txrate << " (" << GetSupported (station, station->m_txrate) << ")"); |
+ NS_LOG_DEBUG ("Currently using rate: " << station->m_txrate << " (" << GetSupported (station, static_cast<uint8_t> (station->m_txrate)) << ")"); |
Time txTime; |
uint32_t tempProb; |
@@ -583,7 +583,7 @@ |
} |
//calculating throughput |
- station->m_minstrelTable[i].throughput = tempProb * (1000000 / txTime.GetMicroSeconds ()); |
+ station->m_minstrelTable[i].throughput = static_cast<uint32_t> (tempProb * (1000000 / txTime.GetMicroSeconds ())); |
} |
else |
@@ -631,7 +631,8 @@ |
NS_LOG_DEBUG ("Attempt/success resetted to 0"); |
- uint32_t max_tp = 0, index_max_tp = 0, index_max_tp2 = 0; |
+ uint32_t max_tp = 0; |
+ uint8_t index_max_tp = 0, index_max_tp2 = 0; |
//go find max throughput, second maximum throughput, high probability succ |
NS_LOG_DEBUG ("Finding the maximum throughput, second maximum throughput, and highest probability"); |
@@ -660,7 +661,8 @@ |
} |
} |
- uint32_t max_prob = 0, index_max_prob = 0; |
+ uint32_t max_prob = 0; |
+ uint8_t index_max_prob = 0; |
for (uint8_t i = 0; i < station->m_nModes; i++) |
{ |
if ((station->m_minstrelTable[i].ewmaProb >= 95 * 180) && (station->m_minstrelTable[i].throughput >= station->m_minstrelTable[index_max_prob].throughput)) |
@@ -714,7 +716,7 @@ |
void |
MinstrelWifiManager::DoReportRtsOk (WifiRemoteStation *st, double ctsSnr, WifiMode ctsMode, double rtsSnr) |
{ |
- NS_LOG_FUNCTION (this << st); |
+ NS_LOG_FUNCTION (this << st << ctsSnr << ctsMode << rtsSnr); |
NS_LOG_DEBUG ("self=" << st << " rts ok"); |
} |