fixed bug 844
This commit is contained in:
@@ -726,7 +726,16 @@ YansWifiPhy::GetPowerDbm (uint8_t power) const
|
||||
{
|
||||
NS_ASSERT (m_txPowerBaseDbm <= m_txPowerEndDbm);
|
||||
NS_ASSERT (m_nTxPower > 0);
|
||||
double dbm = m_txPowerBaseDbm + power * (m_txPowerEndDbm - m_txPowerBaseDbm) / m_nTxPower;
|
||||
double dbm;
|
||||
if (m_nTxPower > 1)
|
||||
{
|
||||
dbm = m_txPowerBaseDbm + power * (m_txPowerEndDbm - m_txPowerBaseDbm) / (m_nTxPower - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
NS_ASSERT_MSG (m_txPowerBaseDbm == m_txPowerEndDbm, "cannot have TxPowerEnd != TxPowerStart with TxPowerLevels == 1");
|
||||
dbm = m_txPowerBaseDbm;
|
||||
}
|
||||
return dbm;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user