equal
deleted
inserted
replaced
20 |
20 |
21 #include "onoe-wifi-manager.h" |
21 #include "onoe-wifi-manager.h" |
22 #include "ns3/simulator.h" |
22 #include "ns3/simulator.h" |
23 #include "ns3/log.h" |
23 #include "ns3/log.h" |
24 #include "ns3/uinteger.h" |
24 #include "ns3/uinteger.h" |
|
25 |
|
26 #define Min(a,b) ((a < b) ? a : b) |
25 |
27 |
26 NS_LOG_COMPONENT_DEFINE ("OnoeWifiRemoteStation"); |
28 NS_LOG_COMPONENT_DEFINE ("OnoeWifiRemoteStation"); |
27 |
29 |
28 namespace ns3 { |
30 namespace ns3 { |
29 |
31 |
213 station->m_tx_ok = station->m_tx_err = station->m_tx_retr = 0; |
215 station->m_tx_ok = station->m_tx_err = station->m_tx_retr = 0; |
214 } |
216 } |
215 |
217 |
216 } |
218 } |
217 |
219 |
218 WifiMode |
220 WifiTxVector |
219 OnoeWifiManager::DoGetDataMode (WifiRemoteStation *st, |
221 OnoeWifiManager::DoGetDataTxVector (WifiRemoteStation *st, |
220 uint32_t size) |
222 uint32_t size) |
221 { |
223 { |
222 OnoeWifiRemoteStation *station = (OnoeWifiRemoteStation *)st; |
224 OnoeWifiRemoteStation *station = (OnoeWifiRemoteStation *)st; |
223 UpdateMode (station); |
225 UpdateMode (station); |
224 NS_ASSERT (station->m_txrate < GetNSupported (station)); |
226 NS_ASSERT (station->m_txrate < GetNSupported (station)); |
258 else |
260 else |
259 { |
261 { |
260 rateIndex = station->m_txrate; |
262 rateIndex = station->m_txrate; |
261 } |
263 } |
262 } |
264 } |
263 return GetSupported (station, rateIndex); |
265 return WifiTxVector (GetSupported (station, rateIndex), GetDefaultTxPowerLevel (), GetLongRetryCount (station), GetShortGuardInterval (station), Min (GetNumberOfReceiveAntennas (station),GetNumberOfTransmitAntennas()), GetNumberOfTransmitAntennas (station), GetStbc (station)); |
264 } |
266 } |
265 WifiMode |
267 WifiTxVector |
266 OnoeWifiManager::DoGetRtsMode (WifiRemoteStation *st) |
268 OnoeWifiManager::DoGetRtsTxVector (WifiRemoteStation *st) |
267 { |
269 { |
268 OnoeWifiRemoteStation *station = (OnoeWifiRemoteStation *)st; |
270 OnoeWifiRemoteStation *station = (OnoeWifiRemoteStation *)st; |
269 UpdateMode (station); |
271 UpdateMode (station); |
270 /// \todo can we implement something smarter ? |
272 /// \todo can we implement something smarter ? |
271 return GetSupported (station, 0); |
273 return WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetShortRetryCount (station), GetShortGuardInterval (station), Min (GetNumberOfReceiveAntennas (station),GetNumberOfTransmitAntennas()), GetNumberOfTransmitAntennas (station), GetStbc (station)); |
272 } |
274 } |
273 |
275 |
274 bool |
276 bool |
275 OnoeWifiManager::IsLowLatency (void) const |
277 OnoeWifiManager::IsLowLatency (void) const |
276 { |
278 { |