From a30d73c32d8b22f03b562ffa9a4c71bd02a4d241 Mon Sep 17 00:00:00 2001 From: Alexander Sholohov Date: Tue, 16 Apr 2024 09:45:23 +0700 Subject: [PATCH] disable soapysdr runtime setting for SoapySDR API below 0.8 --- source_modules/soapy_source/src/main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source_modules/soapy_source/src/main.cpp b/source_modules/soapy_source/src/main.cpp index 08b86d21e..6752f08df 100644 --- a/source_modules/soapy_source/src/main.cpp +++ b/source_modules/soapy_source/src/main.cpp @@ -8,12 +8,17 @@ #include #include #include +#include #include #include #include #define CONCAT(a, b) ((std::string(a) + b).c_str()) +#if defined(SOAPY_SDR_API_VERSION) && (SOAPY_SDR_API_VERSION >= 0x00080000) +#define ENABLE_SOAPYSDR_RUNTIME_SETTINGS +#endif + SDRPP_MOD_INFO{ /* Name: */ "soapy_source", /* Description: */ "SoapySDR source module for SDR++", @@ -238,7 +243,9 @@ class SoapyModule : public ModuleManager::Instance { hasAgc = dev->hasGainMode(SOAPY_SDR_RX, channelId); +#ifdef ENABLE_SOAPYSDR_RUNTIME_SETTINGS settings = dev->getSettingInfo(); +#endif SoapySDR::Device::unmake(dev); @@ -316,6 +323,7 @@ class SoapyModule : public ModuleManager::Instance { if (hasAgc) { conf["agc"] = agc; } +#ifdef ENABLE_SOAPYSDR_RUNTIME_SETTINGS if (running) { for (const SoapySDR::ArgInfo& argInfo : settings) { std::string val = dev->readSetting(argInfo.key); @@ -325,6 +333,7 @@ class SoapyModule : public ModuleManager::Instance { } } } +#endif config.acquire(); config.conf["devices"][devArgs["label"]] = conf; config.release(true); @@ -539,6 +548,7 @@ class SoapyModule : public ModuleManager::Instance { } } +#ifdef ENABLE_SOAPYSDR_RUNTIME_SETTINGS for (const SoapySDR::ArgInfo& argInfo : _this->settings) { if (!_this->running) break; @@ -624,6 +634,7 @@ class SoapyModule : public ModuleManager::Instance { ImGui::SetTooltip("%s", argInfo.description.c_str()); } */ } +#endif } static void _worker(SoapyModule* _this) { @@ -671,7 +682,9 @@ class SoapyModule : public ModuleManager::Instance { int uiBandwidthId = 0; std::vector bandwidthList; std::string txtBwList; +#ifdef ENABLE_SOAPYSDR_RUNTIME_SETTINGS SoapySDR::ArgInfoList settings; +#endif char stringSettingVal[1024]; std::unordered_map configSettings; char txtExtraDeviceArgs[256];