OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2004,2005,2006 INRIA | 3 * Copyright (c) 2004,2005,2006 INRIA |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 { | 184 { |
185 NS_LOG_FUNCTION (this << st); | 185 NS_LOG_FUNCTION (this << st); |
186 CaraWifiRemoteStation *station = (CaraWifiRemoteStation *) st; | 186 CaraWifiRemoteStation *station = (CaraWifiRemoteStation *) st; |
187 uint32_t channelWidth = GetChannelWidth (station); | 187 uint32_t channelWidth = GetChannelWidth (station); |
188 if (channelWidth > 20 && channelWidth != 22) | 188 if (channelWidth > 20 && channelWidth != 22) |
189 { | 189 { |
190 //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac | 190 //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac |
191 channelWidth = 20; | 191 channelWidth = 20; |
192 } | 192 } |
193 WifiMode mode = GetSupported (station, station->m_rate); | 193 WifiMode mode = GetSupported (station, station->m_rate); |
194 if (m_currentRate != mode.GetDataRate (channelWidth)) | 194 if (m_currentRate != mode.GetDataRate (static_cast<uint8_t>(channelWidth))) |
195 { | 195 { |
196 NS_LOG_DEBUG ("New datarate: " << mode.GetDataRate (channelWidth)); | 196 NS_LOG_DEBUG ("New datarate: " << mode.GetDataRate (static_cast<uint8_t>(c
hannelWidth))); |
197 m_currentRate = mode.GetDataRate (channelWidth); | 197 m_currentRate = mode.GetDataRate (static_cast<uint8_t>(channelWidth)); |
198 } | 198 } |
199 return WifiTxVector (mode, GetDefaultTxPowerLevel (), GetLongRetryCount (stati
on), GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1, 0, chan
nelWidth, GetAggregation (station), false); | 199 return WifiTxVector (mode, GetDefaultTxPowerLevel (), static_cast<uint8_t>(Get
LongRetryCount (station)), GetPreambleForTransmission (mode, GetAddress (station
)), 800, 1, 1, 0, static_cast<uint8_t>(channelWidth), GetAggregation (station),
false); |
200 } | 200 } |
201 | 201 |
202 WifiTxVector | 202 WifiTxVector |
203 CaraWifiManager::DoGetRtsTxVector (WifiRemoteStation *st) | 203 CaraWifiManager::DoGetRtsTxVector (WifiRemoteStation *st) |
204 { | 204 { |
205 NS_LOG_FUNCTION (this << st); | 205 NS_LOG_FUNCTION (this << st); |
206 CaraWifiRemoteStation *station = (CaraWifiRemoteStation *) st; | 206 CaraWifiRemoteStation *station = (CaraWifiRemoteStation *) st; |
207 /// \todo we could/should implement the Arf algorithm for | 207 /// \todo we could/should implement the Arf algorithm for |
208 /// RTS only by picking a single rate within the BasicRateSet. | 208 /// RTS only by picking a single rate within the BasicRateSet. |
209 uint32_t channelWidth = GetChannelWidth (station); | 209 uint32_t channelWidth = GetChannelWidth (station); |
210 if (channelWidth > 20 && channelWidth != 22) | 210 if (channelWidth > 20 && channelWidth != 22) |
211 { | 211 { |
212 //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac | 212 //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac |
213 channelWidth = 20; | 213 channelWidth = 20; |
214 } | 214 } |
215 WifiTxVector rtsTxVector; | 215 WifiTxVector rtsTxVector; |
216 WifiMode mode; | 216 WifiMode mode; |
217 if (GetUseNonErpProtection () == false) | 217 if (GetUseNonErpProtection () == false) |
218 { | 218 { |
219 mode = GetSupported (station, 0); | 219 mode = GetSupported (station, 0); |
220 } | 220 } |
221 else | 221 else |
222 { | 222 { |
223 mode = GetNonErpSupported (station, 0); | 223 mode = GetNonErpSupported (station, 0); |
224 } | 224 } |
225 rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetLongRetryCount
(station), GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1,
0, channelWidth, GetAggregation (station), false); | 225 rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), static_cast<uint8
_t>(GetLongRetryCount (station)), GetPreambleForTransmission (mode, GetAddress (
station)), 800, 1, 1, 0, static_cast<uint8_t>(channelWidth), GetAggregation (sta
tion), false); |
226 return rtsTxVector; | 226 return rtsTxVector; |
227 } | 227 } |
228 | 228 |
229 bool | 229 bool |
230 CaraWifiManager::DoNeedRts (WifiRemoteStation *st, | 230 CaraWifiManager::DoNeedRts (WifiRemoteStation *st, |
231 Ptr<const Packet> packet, bool normally) | 231 Ptr<const Packet> packet, bool normally) |
232 { | 232 { |
233 NS_LOG_FUNCTION (this << st << normally); | 233 NS_LOG_FUNCTION (this << st << normally); |
234 CaraWifiRemoteStation *station = (CaraWifiRemoteStation *) st; | 234 CaraWifiRemoteStation *station = (CaraWifiRemoteStation *) st; |
235 return normally || station->m_failed >= m_probeThreshold; | 235 return normally || station->m_failed >= m_probeThreshold; |
(...skipping 30 matching lines...) Expand all Loading... |
266 CaraWifiManager::SetHeSupported (bool enable) | 266 CaraWifiManager::SetHeSupported (bool enable) |
267 { | 267 { |
268 //HE is not supported by this algorithm. | 268 //HE is not supported by this algorithm. |
269 if (enable) | 269 if (enable) |
270 { | 270 { |
271 NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rat
es"); | 271 NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rat
es"); |
272 } | 272 } |
273 } | 273 } |
274 | 274 |
275 } //namespace ns3 | 275 } //namespace ns3 |
OLD | NEW |