--- a/src/mesh/model/dot11s/airtime-metric.cc Tue Aug 13 10:37:49 2013 -0700
+++ b/src/mesh/model/dot11s/airtime-metric.cc Tue Aug 13 22:05:25 2013 -0700
@@ -21,6 +21,8 @@
#include "airtime-metric.h"
#include "ns3/wifi-remote-station-manager.h"
#include "ns3/wifi-mode.h"
+#include "ns3/wifi-tx-vector.h"
+
namespace ns3 {
namespace dot11s {
NS_OBJECT_ENSURE_REGISTERED (AirtimeLinkMetricCalculator);
@@ -86,7 +88,7 @@
*/
NS_ASSERT (!peerAddress.IsGroup ());
//obtain current rate:
- WifiMode mode = mac->GetWifiRemoteStationManager ()->GetDataMode (peerAddress, &m_testHeader, m_testFrame, m_testFrame->GetSize ());
+ WifiMode mode = mac->GetWifiRemoteStationManager ()->GetDataTxVector (peerAddress, &m_testHeader, m_testFrame, m_testFrame->GetSize ()).GetMode();
//obtain frame error rate:
double failAvg = mac->GetWifiRemoteStationManager ()->GetInfo (peerAddress).GetFrameErrorRate ();
if (failAvg == 1)
@@ -95,10 +97,12 @@
return (uint32_t)0xffffffff;
}
NS_ASSERT (failAvg < 1.0);
+ WifiTxVector txVector;
+ txVector.SetMode (mode);
//calculate metric
uint32_t metric = (uint32_t)((double)( /*Overhead + payload*/
mac->GetPifs () + mac->GetSlot () + mac->GetEifsNoDifs () + //DIFS + SIFS + AckTxTime = PIFS + SLOT + EifsNoDifs
- mac->GetWifiPhy ()->CalculateTxDuration (m_testFrame->GetSize (), mode, WIFI_PREAMBLE_LONG)
+ mac->GetWifiPhy ()->CalculateTxDuration (m_testFrame->GetSize (), txVector, WIFI_PREAMBLE_LONG)
).GetMicroSeconds () / (10.24 * (1.0 - failAvg)));
return metric;
}