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): 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)