summaryrefslogtreecommitdiffstats
path: root/src/output/SDR.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/output/SDR.cpp')
-rw-r--r--src/output/SDR.cpp13
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" ) {