aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-06-19 19:29:59 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-06-25 13:07:22 +0200
commit58d80a014e01cb9d76724c66e1875308027f0470 (patch)
treec4e604a8a22fad7e90d5ea66e3963576093a00c7
parent5bd3d4263bf026c8a5a892b23f01f1413cc51747 (diff)
{UHD,LMS}Dervice: Log expected resulting TxPower when setting device specific TxGain
-rw-r--r--Transceiver52M/device/lms/LMSDevice.cpp9
-rw-r--r--Transceiver52M/device/uhd/UHDDevice.cpp9
2 files changed, 11 insertions, 7 deletions
diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp
index 8bb5316..20b9856 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 d1f61d3..0eb79fc 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<std::string> 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]);
}