add soapyremote source

This commit is contained in:
Jakob Ketterl 2020-02-09 13:59:37 +01:00
parent 46c3e5077d
commit c92929a32d
4 changed files with 40 additions and 8 deletions

View File

@ -1,3 +1,6 @@
**unreleased**
- Support for SoapyRemote
**2020-02-08** **2020-02-08**
- Compression, resampling and filtering in the frontend have been rewritten in javascript, sdr.js has been removed - Compression, resampling and filtering in the frontend have been rewritten in javascript, sdr.js has been removed
- Decoding of Pocsag modulation is now possible - Decoding of Pocsag modulation is now possible

View File

@ -30,6 +30,7 @@ class FeatureDetector(object):
"lime_sdr": ["soapy_connector", "soapy_lime_sdr"], "lime_sdr": ["soapy_connector", "soapy_lime_sdr"],
"fifi_sdr": ["alsa"], "fifi_sdr": ["alsa"],
"pluto_sdr": ["soapy_connector", "soapy_pluto_sdr"], "pluto_sdr": ["soapy_connector", "soapy_pluto_sdr"],
"soapy_remote": ["soapy_connector", "soapy_remote"],
# optional features and their requirements # optional features and their requirements
"digital_voice_digiham": ["digiham", "sox"], "digital_voice_digiham": ["digiham", "sox"],
"digital_voice_dsd": ["dsd", "sox", "digiham"], "digital_voice_dsd": ["dsd", "sox", "digiham"],
@ -290,6 +291,14 @@ class FeatureDetector(object):
""" """
return self._has_soapy_driver("PlutoSDR") return self._has_soapy_driver("PlutoSDR")
def has_soapy_remote(self):
"""
The SoapyRemote allows the usage of remote SDR devices using the SoapySDRServer.
You can get the code and find additional information [here](https://github.com/pothosware/SoapyRemote/wiki).
"""
return self._has_soapy_driver("remote")
def has_dsd(self): def has_dsd(self):
""" """
The digital voice modes NXDN and D-Star can be decoded by the dsd project. Please note that you need the version The digital voice modes NXDN and D-Star can be decoded by the dsd project. Please note that you need the version

View File

@ -41,18 +41,21 @@ class SoapyConnectorSource(ConnectorSource, metaclass=ABCMeta):
return ",".join([encodeComponent(c) for c in dobj]) return ",".join([encodeComponent(c) for c in dobj])
def buildSoapyDeviceParameters(self, parsed, values):
""" """
this method always attempts to inject a driver= part into the soapysdr query, depending on what connector was used. this method always attempts to inject a driver= part into the soapysdr query, depending on what connector was used.
this prevents the soapy_connector from using the wrong device in scenarios where there's no same-type sdrs. this prevents the soapy_connector from using the wrong device in scenarios where there's no same-type sdrs.
""" """
parsed = [v for v in parsed if "driver" not in v]
parsed += [{"driver": self.getDriver()}]
return parsed
def getCommandValues(self): def getCommandValues(self):
values = super().getCommandValues() values = super().getCommandValues()
if "device" in values and values["device"] is not None: if "device" in values and values["device"] is not None:
parsed = self.parseDeviceString(values["device"]) parsed = self.parseDeviceString(values["device"])
parsed = [v for v in parsed if "driver" not in v]
parsed += [{"driver": self.getDriver()}]
values["device"] = self.encodeDeviceString(parsed)
else: else:
values["device"] = "driver={0}".format(self.getDriver()) parsed = []
modified = self.buildSoapyDeviceParameters(parsed, values)
values["device"] = self.encodeDeviceString(modified)
return values return values

View File

@ -0,0 +1,17 @@
from .soapy import SoapyConnectorSource
class SoapyRemoteSource(SoapyConnectorSource):
def getEventNames(self):
return super().getEventNames() + ["remote", "remote_driver"]
def getDriver(self):
return "remote"
def buildSoapyDeviceParameters(self, parsed, values):
params = super().buildSoapyDeviceParameters(parsed, values)
params = [v for v in params if not "remote" in params]
params += [{"remote": values["remote"]}]
if "remote_driver" in values and values["remote_driver"] is not None:
params += [{"remote:driver": values["remote_driver"]}]
return params