diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-11-18 17:39:22 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-11-18 17:39:22 +0100 |
commit | 7b0bd2675b7514e2292684bfe2bd647f87330727 (patch) | |
tree | 73f85d7b8f9dcabbb1c71f7956fd9f8cc2096a5d /src/output/SDR.cpp | |
parent | e84f532b9e97dc2ad53ad96cc9543a178d6f20fd (diff) | |
download | dabmod-7b0bd2675b7514e2292684bfe2bd647f87330727.tar.gz dabmod-7b0bd2675b7514e2292684bfe2bd647f87330727.tar.bz2 dabmod-7b0bd2675b7514e2292684bfe2bd647f87330727.zip |
Add SDR temperature to RC
Diffstat (limited to 'src/output/SDR.cpp')
-rw-r--r-- | src/output/SDR.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/output/SDR.cpp b/src/output/SDR.cpp index 9be9aa2..068b5af 100644 --- a/src/output/SDR.cpp +++ b/src/output/SDR.cpp @@ -75,6 +75,7 @@ SDR::SDR(SDRDeviceConfig& config, std::shared_ptr<SDRDevice> device) : RC_ADD_PARAMETER(rxgain, "RX gain for DPD feedback"); RC_ADD_PARAMETER(freq, "Transmission frequency"); RC_ADD_PARAMETER(muting, "Mute the output by stopping the transmitter"); + RC_ADD_PARAMETER(temp, "Temperature in degrees C of the device"); RC_ADD_PARAMETER(underruns, "Counter of number of underruns"); RC_ADD_PARAMETER(latepackets, "Counter of number of late packets"); RC_ADD_PARAMETER(frames, "Counter of number of frames modulated"); @@ -412,6 +413,18 @@ const string SDR::get_parameter(const string& parameter) const else if (parameter == "muting") { ss << m_config.muting; } + else if (parameter == "temp") { + if (not m_device) { + throw ParameterError("OutputSDR has no device"); + } + const double temp = m_device->get_temperature(); + if (std::isnan(temp)) { + throw ParameterError("Temperature not available"); + } + else { + ss << temp; + } + } else if (parameter == "underruns" or parameter == "latepackets" or parameter == "frames" ) { |