diff --git a/owrx/feature.py b/owrx/feature.py index 8649b69e..101ad8ea 100644 --- a/owrx/feature.py +++ b/owrx/feature.py @@ -57,6 +57,7 @@ class FeatureDetector(object): "rtl_sdr_soapy": ["soapy_connector", "soapy_rtl_sdr"], "rtl_tcp": ["rtl_tcp_connector"], "sdrplay": ["soapy_connector", "soapy_sdrplay"], + "dubok": ["soapy_connector", "soapy_dubok"], "hackrf": ["soapy_connector", "soapy_hackrf"], "perseussdr": ["perseustest", "nmux"], "airspy": ["soapy_connector", "soapy_airspy"], @@ -335,6 +336,12 @@ class FeatureDetector(object): """ return self._has_soapy_driver("sdrplay") + def has_soapy_dubok(self): + """ + The SoapySDR module for DubokSDR devices is required for interfacing with DubokSDR devices + """ + return self._has_soapy_driver("dubok") + def has_soapy_airspy(self): """ The SoapySDR module for airspy devices is required for interfacing with Airspy devices (Airspy R2, Airspy Mini). @@ -657,4 +664,3 @@ class FeatureDetector(object): distributions, or you can compile it from source. """ return self.command_is_runnable("multimon-ng --help") - diff --git a/owrx/source/dubok.py b/owrx/source/dubok.py new file mode 100644 index 00000000..63d8771a --- /dev/null +++ b/owrx/source/dubok.py @@ -0,0 +1,48 @@ +from owrx.source.soapy import SoapyConnectorSource, SoapyConnectorDeviceDescription +from owrx.form.input import Input, TextInput, NumberInput +from owrx.form.input.validator import RangeValidator +from typing import List + + +class DubokSource(SoapyConnectorSource): + def getSoapySettingsMappings(self): + mappings = super().getSoapySettingsMappings() + mappings.update( + { + "audioDevice" : "audioDevice", + "i2cDevice" : "i2cDevice", + "i2cAddress" : "i2cAddress", + } + ) + return mappings + + def getDriver(self): + return "dubok" + + +class DubokDeviceDescription(SoapyConnectorDeviceDescription): + def getName(self): + return "DubokSDR device" + + def getInputs(self) -> List[Input]: + return super().getInputs() + [ + TextInput( + "audioDevice", + "Audio Device", + infotext="ALSA device to be used for IQ data", + ), + TextInput( + "i2cDevice", + "I2C Device", + infotext="I2C device to be used for control", + ), + NumberInput( + "i2cAddress", + "I2C Address", + infotext="I2C device address", + validator=RangeValidator(0, 255), + ), + ] + + def getDeviceOptionalKeys(self): + return super().getDeviceOptionalKeys() + ["audioDevice", "i2cDevice", "i2cAddress"]