22 #include "ns3/assert.h" |
22 #include "ns3/assert.h" |
23 #include "ns3/log.h" |
23 #include "ns3/log.h" |
24 #include "ns3/double.h" |
24 #include "ns3/double.h" |
25 #include "ns3/uinteger.h" |
25 #include "ns3/uinteger.h" |
26 #include "ns3/simulator.h" |
26 #include "ns3/simulator.h" |
|
27 |
|
28 #define Min(a,b) ((a < b) ? a : b) |
27 |
29 |
28 NS_LOG_COMPONENT_DEFINE ("Cara"); |
30 NS_LOG_COMPONENT_DEFINE ("Cara"); |
29 |
31 |
30 |
32 |
31 namespace ns3 { |
33 namespace ns3 { |
161 CaraWifiManager::DoReportFinalDataFailed (WifiRemoteStation *st) |
163 CaraWifiManager::DoReportFinalDataFailed (WifiRemoteStation *st) |
162 { |
164 { |
163 NS_LOG_FUNCTION (this << st); |
165 NS_LOG_FUNCTION (this << st); |
164 } |
166 } |
165 |
167 |
166 WifiMode |
168 WifiTxVector |
167 CaraWifiManager::DoGetDataMode (WifiRemoteStation *st, |
169 CaraWifiManager::DoGetDataTxVector (WifiRemoteStation *st, |
168 uint32_t size) |
170 uint32_t size) |
169 { |
171 { |
170 NS_LOG_FUNCTION (this << st << size); |
172 NS_LOG_FUNCTION (this << st << size); |
171 CaraWifiRemoteStation *station = (CaraWifiRemoteStation *) st; |
173 CaraWifiRemoteStation *station = (CaraWifiRemoteStation *) st; |
172 return GetSupported (station, station->m_rate); |
174 return WifiTxVector (GetSupported (station, station->m_rate), GetDefaultTxPowerLevel (), GetLongRetryCount (station), GetShortGuardInterval (station), Min (GetNumberOfReceiveAntennas (station),GetNumberOfTransmitAntennas()), GetNumberOfTransmitAntennas (station), GetStbc (station)); |
173 } |
175 } |
174 WifiMode |
176 WifiTxVector |
175 CaraWifiManager::DoGetRtsMode (WifiRemoteStation *st) |
177 CaraWifiManager::DoGetRtsTxVector (WifiRemoteStation *st) |
176 { |
178 { |
177 NS_LOG_FUNCTION (this << st); |
179 NS_LOG_FUNCTION (this << st); |
178 /// \todo we could/should implement the Arf algorithm for |
180 /// \todo we could/should implement the Arf algorithm for |
179 /// RTS only by picking a single rate within the BasicRateSet. |
181 /// RTS only by picking a single rate within the BasicRateSet. |
180 return GetSupported (st, 0); |
182 return WifiTxVector (GetSupported (st, 0), GetDefaultTxPowerLevel (), GetLongRetryCount (st), GetShortGuardInterval (st), Min (GetNumberOfReceiveAntennas (st),GetNumberOfTransmitAntennas()), GetNumberOfTransmitAntennas (st), GetStbc (st)); |
181 } |
183 } |
182 |
184 |
183 bool |
185 bool |
184 CaraWifiManager::DoNeedRts (WifiRemoteStation *st, |
186 CaraWifiManager::DoNeedRts (WifiRemoteStation *st, |
185 Ptr<const Packet> packet, bool normally) |
187 Ptr<const Packet> packet, bool normally) |