From 00a7b7877c903fd47a16a603b512e4e19ce92229 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sat, 14 Mar 2020 23:06:52 +0100 Subject: [PATCH 1/2] update parameter to match latest dev code --- owrx/source/rtl_sdr_soapy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/owrx/source/rtl_sdr_soapy.py b/owrx/source/rtl_sdr_soapy.py index 393286c..55744d5 100644 --- a/owrx/source/rtl_sdr_soapy.py +++ b/owrx/source/rtl_sdr_soapy.py @@ -4,7 +4,7 @@ from .soapy import SoapyConnectorSource class RtlSdrSoapySource(SoapyConnectorSource): def getSoapySettingsMappings(self): mappings = super().getSoapySettingsMappings() - mappings.update({"direct_sampling": "direct_samp", "bias_tee": "bias_tee"}) + mappings.update({"direct_sampling": "direct_samp", "bias_tee": "biastee"}) return mappings def getDriver(self): From d2ce27eeab8ed822dcf916e39f7ed21a8298e8f7 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sat, 14 Mar 2020 23:07:23 +0100 Subject: [PATCH 2/2] convert boolean values into something that soapy understands --- owrx/source/soapy.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/owrx/source/soapy.py b/owrx/source/soapy.py index e5ef480..d4702c2 100644 --- a/owrx/source/soapy.py +++ b/owrx/source/soapy.py @@ -61,9 +61,14 @@ class SoapyConnectorSource(ConnectorSource, metaclass=ABCMeta): settings = {} for k, v in self.getSoapySettingsMappings().items(): if k in values and values[k] is not None: - settings[v] = values[k] + settings[v] = self.convertSoapySettingsValue(values[k]) return settings + def convertSoapySettingsValue(self, value): + if isinstance(value, bool): + return "true" if value else "false" + return value + def getCommandValues(self): values = super().getCommandValues() if "device" in values and values["device"] is not None: @@ -80,6 +85,6 @@ class SoapyConnectorSource(ConnectorSource, metaclass=ABCMeta): def onPropertyChange(self, prop, value): mappings = self.getSoapySettingsMappings() if prop in mappings.keys(): - value = "{0}={1}".format(mappings[prop], value) + value = "{0}={1}".format(mappings[prop], self.convertSoapySettingsValue(value)) prop = "settings" super().onPropertyChange(prop, value)