From 4a1ef9edbf8c32d87292beac6cf96606442bf302 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 25 Aug 2023 14:01:24 +0200 Subject: Add max_gps_holdover_time to RC, allow modifying synchronous too --- src/output/SDR.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/output') diff --git a/src/output/SDR.cpp b/src/output/SDR.cpp index 91c31f0..44af875 100644 --- a/src/output/SDR.cpp +++ b/src/output/SDR.cpp @@ -86,6 +86,7 @@ SDR::SDR(SDRDeviceConfig& config, std::shared_ptr device) : RC_ADD_PARAMETER(latepackets, "Counter of number of late packets"); RC_ADD_PARAMETER(frames, "Counter of number of frames modulated"); RC_ADD_PARAMETER(synchronous, "1 if configured for synchronous transmission"); + RC_ADD_PARAMETER(max_gps_holdover_time, "Max holdover duration in seconds"); #ifdef HAVE_OUTPUT_UHD if (std::dynamic_pointer_cast(device)) { @@ -405,6 +406,14 @@ void SDR::set_parameter(const string& parameter, const string& value) else if (parameter == "muting") { ss >> m_config.muting; } + else if (parameter == "synchronous") { + uint32_t enableSync = 0; + ss >> enableSync; + m_config.enableSync = enableSync > 0; + } + else if (parameter == "max_gps_holdover_time") { + ss >> m_config.maxGPSHoldoverTime; + } else { stringstream ss_err; ss_err << "Parameter '" << parameter @@ -462,6 +471,9 @@ const string SDR::get_parameter(const string& parameter) const else if (parameter == "synchronous") { ss << m_config.enableSync; } + else if (parameter == "max_gps_holdover_time") { + ss << m_config.maxGPSHoldoverTime; + } else { if (m_device) { const auto stat = m_device->get_run_statistics(); @@ -531,6 +543,7 @@ const json::map_t SDR::get_all_values() const .count(); stat["synchronous"].v = m_config.enableSync; + stat["max_gps_holdover_time"].v = (size_t)m_config.maxGPSHoldoverTime; return stat; } -- cgit v1.2.3