From 7b0bd2675b7514e2292684bfe2bd647f87330727 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sun, 18 Nov 2018 17:39:22 +0100 Subject: Add SDR temperature to RC --- src/output/UHD.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/output/UHD.cpp') diff --git a/src/output/UHD.cpp b/src/output/UHD.cpp index 1106fe0..9358072 100644 --- a/src/output/UHD.cpp +++ b/src/output/UHD.cpp @@ -451,6 +451,15 @@ const char* UHD::device_name(void) const return "UHD"; } +double UHD::get_temperature(void) const +{ + try { + return std::round(m_usrp->get_tx_sensor("temp", 0).to_real()); + } + catch (uhd::lookup_error &e) { + return std::numeric_limits::quiet_NaN(); + } +} bool UHD::refclk_loss_needs_check() const { -- cgit v1.2.3