From 44ca186c800e1d53ae4a96f04a70debd3eb5238a Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sun, 14 Jan 2024 17:51:09 +0100 Subject: [PATCH] add preliminary support for netsdr devices --- owrx/feature.py | 9 +++++++++ owrx/source/netsdr.py | 30 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 owrx/source/netsdr.py diff --git a/owrx/feature.py b/owrx/feature.py index 92c03e57..bfc7ca57 100644 --- a/owrx/feature.py +++ b/owrx/feature.py @@ -70,6 +70,7 @@ class FeatureDetector(object): "radioberry": ["soapy_connector", "soapy_radioberry"], "fcdpp": ["soapy_connector", "soapy_fcdpp"], "bladerf": ["soapy_connector", "soapy_bladerf"], + "netsdr": ["soapy_connector", "soapy_netsdr"], "sddc": ["sddc_connector"], "hpsdr": ["hpsdr_connector"], "runds": ["runds_connector"], @@ -417,6 +418,14 @@ class FeatureDetector(object): """ return self._has_soapy_driver("bladerf") + def has_soapy_netsdr(self): + """ + The SoapyNetSDR module allows the use of devices using the NetSDR protocol. + + You can get it [here](https://github.com/pothosware/SoapyNetSDR) + """ + return self._has_soapy_driver("netsdr") + def has_m17_demod(self): """ The `m17-demod` tool is used to demodulate M17 digital voice signals. diff --git a/owrx/source/netsdr.py b/owrx/source/netsdr.py new file mode 100644 index 00000000..8b513b8d --- /dev/null +++ b/owrx/source/netsdr.py @@ -0,0 +1,30 @@ +from owrx.source.soapy import SoapyConnectorSource, SoapyConnectorDeviceDescription +from owrx.form.input import Input +from owrx.form.input.device import RemoteInput +from typing import List + + +class NetsdrSource(SoapyConnectorSource): + def getEventNames(self): + return super().getEventNames() + ["remote"] + + def buildSoapyDeviceParameters(self, parsed, values): + params = super().buildSoapyDeviceParameters(parsed, values) + params += [{"netsdr": values["remote"]}] + return params + + def getDriver(self): + return "netsdr" + + +class NetsdrDeviceDescription(SoapyConnectorDeviceDescription): + def getName(self): + return "NetSDR device" + + def getInputs(self) -> List[Input]: + return super().getInputs() + [ + RemoteInput() + ] + + def getDeviceMandatoryKeys(self): + return super().getDeviceMandatoryKeys() + ["remote"]