Bugzilla – Bug 844
YansWifiPhy::GetPowerDbm off-by-one problem when calculating Tx power
Last modified: 2010-06-07 11:10:32 UTC
For a system with n power levels, there are only (n - 1) intevals. Therefore the return value for YansWifiPhy::GetPowerDbm (uint8_t power) should be: m_txPowerBaseDbm + power * (m_txPowerEndDbm - m_txPowerBaseDbm) / (m_nTxPower - 1), (ie. divide by (m_nTxPower - 1) instead of m_nTxPower)
Created attachment 792 [details] Proposed patch. (Obsolete - Incorrect diff)
Created attachment 793 [details] Proposed patch.
Patch not yet applied to ns-3-dev or ns-3.8.
Nicola - could you please review and comment/commit?
Thanks for catching this! I guess that nobody noticed so far because the power level feature is almost unused in practice, as of now. Anyway, that's fixed now changeset: 6342:a2bdd767bb67