From 38ccd3f45e59ad41b4e6df280638c8e940f17d5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Fri, 30 Mar 2018 10:22:38 +0200 Subject: [PATCH] wifi: Use uint8_t for channel width in Ideal wifi manager --- src/wifi/model/ideal-wifi-manager.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wifi/model/ideal-wifi-manager.cc b/src/wifi/model/ideal-wifi-manager.cc index 87a16752c..f940e8136 100644 --- a/src/wifi/model/ideal-wifi-manager.cc +++ b/src/wifi/model/ideal-wifi-manager.cc @@ -123,7 +123,7 @@ IdealWifiManager::DoInitialize () nModes = GetPhy ()->GetNMcs (); for (uint8_t i = 0; i < nModes; i++) { - for (uint16_t j = 20; j <= GetPhy ()->GetChannelWidth (); j *= 2) + for (uint8_t j = 20; j <= GetPhy ()->GetChannelWidth (); j *= 2) { txVector.SetChannelWidth (j); mode = GetPhy ()->GetMcs (i); @@ -166,6 +166,10 @@ IdealWifiManager::DoInitialize () AddSnrThreshold (txVector, GetPhy ()->CalculateSnr (txVector, m_ber)); } } + if (j == 160) + { + break; + } } } }