|
|
| 81 |
UintegerValue (1), |
81 |
UintegerValue (1), |
| 82 |
MakeUintegerAccessor (&YansWifiPhy::m_nTxPower), |
82 |
MakeUintegerAccessor (&YansWifiPhy::m_nTxPower), |
| 83 |
MakeUintegerChecker<uint32_t> ()) |
83 |
MakeUintegerChecker<uint32_t> ()) |
|
|
84 |
.AddAttribute ("TxPowerLevel", |
| 85 |
"Transmission power level to be used.", |
| 86 |
UintegerValue (0), |
| 87 |
MakeUintegerAccessor (&YansWifiPhy::SetTxPowerLevel, |
| 88 |
&YansWifiPhy::GetTxPowerLevel), |
| 89 |
MakeUintegerChecker<uint32_t> ()) |
| 84 |
.AddAttribute ("TxPowerEnd", |
90 |
.AddAttribute ("TxPowerEnd", |
| 85 |
"Maximum available transmission level (dbm).", |
91 |
"Maximum available transmission level (dbm).", |
| 86 |
DoubleValue (16.0206), |
92 |
DoubleValue (16.0206), |
|
|
| 208 |
NS_LOG_FUNCTION (this << n); |
214 |
NS_LOG_FUNCTION (this << n); |
| 209 |
m_nTxPower = n; |
215 |
m_nTxPower = n; |
| 210 |
} |
216 |
} |
|
|
217 |
void |
| 218 |
YansWifiPhy::SetTxPowerLevel (uint32_t n) |
| 219 |
{ |
| 220 |
NS_ASSERT (n < GetNTxPower ()); |
| 221 |
NS_LOG_FUNCTION (this << n); |
| 222 |
m_txPowerLevel = n; |
| 223 |
} |
| 211 |
void |
224 |
void |
| 212 |
YansWifiPhy::SetTxGain (double gain) |
225 |
YansWifiPhy::SetTxGain (double gain) |
| 213 |
{ |
226 |
{ |
|
|
| 489 |
} |
502 |
} |
| 490 |
|
503 |
|
| 491 |
void |
504 |
void |
| 492 |
YansWifiPhy::SendPacket (Ptr<const Packet> packet, WifiMode txMode, WifiPreamble preamble, uint8_t txPower) |
505 |
YansWifiPhy::SendPacket (Ptr<const Packet> packet, WifiMode txMode, WifiPreamble preamble) |
| 493 |
{ |
506 |
{ |
| 494 |
NS_LOG_FUNCTION (this << packet << txMode << preamble << (uint32_t)txPower); |
507 |
NS_LOG_FUNCTION (this << packet << txMode << preamble); |
| 495 |
/* Transmission can happen if: |
508 |
/* Transmission can happen if: |
| 496 |
* - we are syncing on a packet. It is the responsability of the |
509 |
* - we are syncing on a packet. It is the responsability of the |
| 497 |
* MAC layer to avoid doing this but the PHY does nothing to |
510 |
* MAC layer to avoid doing this but the PHY does nothing to |
|
|
| 509 |
uint32_t dataRate500KbpsUnits = txMode.GetDataRate () / 500000; |
522 |
uint32_t dataRate500KbpsUnits = txMode.GetDataRate () / 500000; |
| 510 |
bool isShortPreamble = (WIFI_PREAMBLE_SHORT == preamble); |
523 |
bool isShortPreamble = (WIFI_PREAMBLE_SHORT == preamble); |
| 511 |
NotifyPromiscSniffTx (packet, (uint16_t)GetChannelFrequencyMhz (), GetChannelNumber (), dataRate500KbpsUnits, isShortPreamble); |
524 |
NotifyPromiscSniffTx (packet, (uint16_t)GetChannelFrequencyMhz (), GetChannelNumber (), dataRate500KbpsUnits, isShortPreamble); |
| 512 |
m_state->SwitchToTx (txDuration, packet, txMode, preamble, txPower); |
525 |
m_state->SwitchToTx (txDuration, packet, txMode, preamble, m_txPowerLevel); |
| 513 |
m_channel->Send (this, packet, GetPowerDbm (txPower) + m_txGainDb, txMode, preamble); |
526 |
m_channel->Send (this, packet, GetPowerDbm (m_txPowerLevel) + m_txGainDb, txMode, preamble); |
| 514 |
} |
527 |
} |
| 515 |
|
528 |
|
| 516 |
uint32_t |
529 |
uint32_t |
|
|
| 528 |
{ |
541 |
{ |
| 529 |
return m_nTxPower; |
542 |
return m_nTxPower; |
| 530 |
} |
543 |
} |
|
|
544 |
uint32_t |
| 545 |
YansWifiPhy::GetTxPowerLevel (void) const |
| 546 |
{ |
| 547 |
return m_txPowerLevel; |
| 548 |
} |
| 531 |
|
549 |
|
| 532 |
void |
550 |
void |
| 533 |
YansWifiPhy::Configure80211a (void) |
551 |
YansWifiPhy::Configure80211a (void) |