Adding support for DubokSDR.

This commit is contained in:
Marat Fayzullin 2023-11-02 13:21:13 -04:00
parent d179d6b085
commit 10b4be5c5f
2 changed files with 55 additions and 1 deletions

View File

@ -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")

48
owrx/source/dubok.py Normal file
View File

@ -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"]