diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index 8bb53160..20b9856b 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -563,7 +563,7 @@ double LMSDevice::setRxGain(double dB, size_t chan) double LMSDevice::setPowerAttenuation(int atten, size_t chan) { - double dB; + double tx_power, dB; dev_band_desc desc; if (chan >= tx_gains.size()) { @@ -572,12 +572,13 @@ double LMSDevice::setPowerAttenuation(int atten, size_t chan) } get_dev_band_desc(desc); - dB = TxPower2TxGain(desc, desc.nom_out_tx_power - atten); + tx_power = desc.nom_out_tx_power - atten; + dB = TxPower2TxGain(desc, tx_power); - LOGCHAN(chan, DDEV, NOTICE) << "Setting TX gain to " << dB << " dB"; + LOGCHAN(chan, DDEV, NOTICE) << "Setting TX gain to " << dB << " dB (~" << tx_power << " dBm)"; if (LMS_SetGaindB(m_lms_dev, LMS_CH_TX, chan, dB) < 0) - LOGCHAN(chan, DDEV, ERR) << "Error setting TX gain to " << dB << " dB"; + LOGCHAN(chan, DDEV, ERR) << "Error setting TX gain to " << dB << " dB (~" << tx_power << " dBm)"; else tx_gains[chan] = dB; return desc.nom_out_tx_power - TxGain2TxPower(desc, tx_gains[chan]); diff --git a/Transceiver52M/device/uhd/UHDDevice.cpp b/Transceiver52M/device/uhd/UHDDevice.cpp index d1f61d31..0eb79fc2 100644 --- a/Transceiver52M/device/uhd/UHDDevice.cpp +++ b/Transceiver52M/device/uhd/UHDDevice.cpp @@ -358,7 +358,7 @@ double uhd_device::getRxGain(size_t chan) } double uhd_device::setPowerAttenuation(int atten, size_t chan) { - double db; + double tx_power, db; dev_band_desc desc; if (chan >= tx_gains.size()) { @@ -367,7 +367,8 @@ double uhd_device::setPowerAttenuation(int atten, size_t chan) { } get_dev_band_desc(desc); - db = TxPower2TxGain(desc, desc.nom_out_tx_power - atten); + tx_power = desc.nom_out_tx_power - atten; + db = TxPower2TxGain(desc, tx_power); if (dev_type == UMTRX) { std::vector gain_stages = usrp_dev->get_tx_gain_names(0); @@ -388,7 +389,9 @@ double uhd_device::setPowerAttenuation(int atten, size_t chan) { tx_gains[chan] = usrp_dev->get_tx_gain(chan); - LOGC(DDEV, INFO) << "Set TX gain to " << tx_gains[chan] << "dB (asked for " << db << "dB)"; + LOGC(DDEV, INFO) << "Set TX gain to " << tx_gains[chan] << "dB, ~" + << TxGain2TxPower(desc, tx_gains[chan]) << " dBm " + << "(asked for " << db << " dB, ~" << tx_power << " dBm)"; return desc.nom_out_tx_power - TxGain2TxPower(desc, tx_gains[chan]); }