|
|
| 127 |
void |
127 |
void |
| 128 |
AparfWifiManager::SetupPhy (Ptr<WifiPhy> phy) |
128 |
AparfWifiManager::SetupPhy (Ptr<WifiPhy> phy) |
| 129 |
{ |
129 |
{ |
| 130 |
m_nPower = phy->GetNTxPower (); |
130 |
m_minPower = phy->GetTxPowerStart(); |
|
|
131 |
m_maxPower = phy->GetTxPowerEnd(); |
| 131 |
WifiRemoteStationManager::SetupPhy (phy); |
132 |
WifiRemoteStationManager::SetupPhy (phy); |
| 132 |
} |
133 |
} |
| 133 |
|
134 |
|
|
|
| 158 |
{ |
159 |
{ |
| 159 |
station->m_nSupported = GetNSupported (station); |
160 |
station->m_nSupported = GetNSupported (station); |
| 160 |
station->m_rate = station->m_nSupported - 1; |
161 |
station->m_rate = station->m_nSupported - 1; |
| 161 |
station->m_power = m_nPower - 1; |
162 |
station->m_power = m_maxPower; |
| 162 |
station->m_rateCrit = 0; |
163 |
station->m_rateCrit = 0; |
| 163 |
m_powerChange (station->m_power, station->m_state->m_address); |
164 |
m_powerChange (station->m_power, station->m_state->m_address); |
| 164 |
m_rateChange (station->m_rate, station->m_state->m_address); |
165 |
m_rateChange (station->m_rate, station->m_state->m_address); |
|
|
| 197 |
station->m_nFailed = 0; |
198 |
station->m_nFailed = 0; |
| 198 |
station->m_nSuccess = 0; |
199 |
station->m_nSuccess = 0; |
| 199 |
station->m_pCount = 0; |
200 |
station->m_pCount = 0; |
| 200 |
if (station->m_power == (m_nPower - 1)) |
201 |
if (station->m_power == m_maxPower) |
| 201 |
{ |
202 |
{ |
| 202 |
station->m_rateCrit = station->m_rate; |
203 |
station->m_rateCrit = station->m_rate; |
| 203 |
if (station->m_rate != 0) |
204 |
if (station->m_rate != 0) |
|
|
| 261 |
station->m_nFailed = 0; |
262 |
station->m_nFailed = 0; |
| 262 |
if (station->m_rate == (station->m_state->m_operationalRateSet.size () - 1)) |
263 |
if (station->m_rate == (station->m_state->m_operationalRateSet.size () - 1)) |
| 263 |
{ |
264 |
{ |
| 264 |
if (station->m_power != 0) |
265 |
if (station->m_power != m_minPower) |
| 265 |
{ |
266 |
{ |
| 266 |
NS_LOG_DEBUG ("station=" << station << " dec power"); |
267 |
NS_LOG_DEBUG ("station=" << station << " dec power"); |
| 267 |
station->m_power -= m_powerDec; |
268 |
station->m_power -= m_powerDec; |
|
|
| 283 |
{ |
284 |
{ |
| 284 |
if (station->m_pCount == m_powerMax) |
285 |
if (station->m_pCount == m_powerMax) |
| 285 |
{ |
286 |
{ |
| 286 |
station->m_power = (m_nPower - 1); |
287 |
station->m_power = m_maxPower; |
| 287 |
m_powerChange (station->m_power, station->m_state->m_address); |
288 |
m_powerChange (station->m_power, station->m_state->m_address); |
| 288 |
station->m_rate = station->m_rateCrit; |
289 |
station->m_rate = station->m_rateCrit; |
| 289 |
m_rateChange (station->m_rate, station->m_state->m_address); |
290 |
m_rateChange (station->m_rate, station->m_state->m_address); |
|
|
| 292 |
} |
293 |
} |
| 293 |
else |
294 |
else |
| 294 |
{ |
295 |
{ |
| 295 |
if (station->m_power != 0) |
296 |
if (station->m_power != m_minPower) |
| 296 |
{ |
297 |
{ |
| 297 |
station->m_power -= m_powerDec; |
298 |
station->m_power -= m_powerDec; |
| 298 |
m_powerChange (station->m_power, station->m_state->m_address); |
299 |
m_powerChange (station->m_power, station->m_state->m_address); |