diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2023-03-29 16:30:06 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2023-03-29 17:09:21 +0200 |
commit | fd46d43f51796a6bbdd629e08535bacbc853f283 (patch) | |
tree | 832f0a36a2d54c0dba23b59297d6894c8d9a6edc /src/output/UHD.cpp | |
parent | efea1c485f178cdbadf5babdf7951e6d1a1ed801 (diff) | |
download | dabmod-fd46d43f51796a6bbdd629e08535bacbc853f283.tar.gz dabmod-fd46d43f51796a6bbdd629e08535bacbc853f283.tar.bz2 dabmod-fd46d43f51796a6bbdd629e08535bacbc853f283.zip |
Replace RunStatistics to permit representation of SDR device specific stats
Diffstat (limited to 'src/output/UHD.cpp')
-rw-r--r-- | src/output/UHD.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/output/UHD.cpp b/src/output/UHD.cpp index c325272..7f07ff2 100644 --- a/src/output/UHD.cpp +++ b/src/output/UHD.cpp @@ -377,18 +377,22 @@ void UHD::transmit_frame(struct FrameData&& frame) } -SDRDevice::RunStatistics UHD::get_run_statistics(void) const +SDRDevice::run_statistics_t UHD::get_run_statistics(void) const { - RunStatistics rs; - rs.num_underruns = num_underflows; - rs.num_overruns = num_overflows; - rs.num_late_packets = num_late_packets; - rs.num_frames_modulated = num_frames_modulated; + run_statistics_t rs; + rs["underruns"] = num_underflows; + rs["overruns"] = num_overflows; + rs["late_packets"] = num_late_packets; + rs["frames"] = num_frames_modulated; if (m_device_time) { const auto gpsdo_stat = m_device_time->get_gnss_stats(); - rs.gpsdo_holdover = gpsdo_stat.holdover; - rs.gpsdo_num_sv = gpsdo_stat.num_sv; + rs["gpsdo_holdover"] = gpsdo_stat.holdover; + rs["gpsdo_num_sv"] = gpsdo_stat.num_sv; + } + else { + rs["gpsdo_holdover"] = true; + rs["gpsdo_num_sv"] = 0; } return rs; } @@ -472,13 +476,13 @@ const char* UHD::device_name(void) const return "UHD"; } -double UHD::get_temperature(void) const +std::optional<double> UHD::get_temperature(void) const { try { return std::round(m_usrp->get_tx_sensor("temp", 0).to_real()); } catch (const uhd::lookup_error &e) { - return std::numeric_limits<double>::quiet_NaN(); + return std::nullopt; } } |