remove old sources, make the connector-based ones default
This commit is contained in:
parent
3bbcaa1329
commit
10de50d251
@ -18,20 +18,20 @@ class UnknownFeatureException(Exception):
|
|||||||
|
|
||||||
class FeatureDetector(object):
|
class FeatureDetector(object):
|
||||||
features = {
|
features = {
|
||||||
|
# core features; we won't start without these
|
||||||
"core": ["csdr", "nmux", "nc"],
|
"core": ["csdr", "nmux", "nc"],
|
||||||
"rtl_sdr": ["rtl_sdr"],
|
# different types of sdrs and their requirements
|
||||||
"rtl_sdr_connector": ["rtl_connector"],
|
"rtl_sdr": ["rtl_connector"],
|
||||||
"sdrplay": ["rx_tools"],
|
"sdrplay": ["soapy_connector"],
|
||||||
"sdrplay_connector": ["soapy_connector"],
|
|
||||||
"hackrf": ["hackrf_transfer"],
|
"hackrf": ["hackrf_transfer"],
|
||||||
"airspy": ["airspy_rx"],
|
"airspy": ["soapy_connector"],
|
||||||
"airspy_connector": ["soapy_connector"],
|
"airspyhf": ["soapy_connector"],
|
||||||
"airspyhf_connector": ["soapy_connector"],
|
"fifi_sdr": ["alsa"],
|
||||||
|
# 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"],
|
||||||
"wsjt-x": ["wsjtx", "sox"],
|
"wsjt-x": ["wsjtx", "sox"],
|
||||||
"packet": ["direwolf", "sox"],
|
"packet": ["direwolf", "sox"],
|
||||||
"fifi_sdr": ["alsa"],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def feature_availability(self):
|
def feature_availability(self):
|
||||||
|
@ -524,7 +524,7 @@ class ConnectorSource(SdrSource):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
class RtlSdrConnectorSource(ConnectorSource):
|
class RtlSdrSource(ConnectorSource):
|
||||||
def getCommand(self):
|
def getCommand(self):
|
||||||
cmd = (
|
cmd = (
|
||||||
"rtl_connector -p {port} -c {controlPort}".format(port=self.port, controlPort=self.controlPort)
|
"rtl_connector -p {port} -c {controlPort}".format(port=self.port, controlPort=self.controlPort)
|
||||||
@ -584,7 +584,7 @@ class SoapyConnectorSource(ConnectorSource):
|
|||||||
return values
|
return values
|
||||||
|
|
||||||
|
|
||||||
class SdrplayConnectorSource(SoapyConnectorSource):
|
class SdrplaySource(SoapyConnectorSource):
|
||||||
def getDriver(self):
|
def getDriver(self):
|
||||||
return "sdrplay"
|
return "sdrplay"
|
||||||
|
|
||||||
@ -604,7 +604,7 @@ class SdrplayConnectorSource(SoapyConnectorSource):
|
|||||||
return cmd
|
return cmd
|
||||||
|
|
||||||
|
|
||||||
class AirspyConnectorSource(SoapyConnectorSource):
|
class AirspySource(SoapyConnectorSource):
|
||||||
def getDriver(self):
|
def getDriver(self):
|
||||||
return "airspy"
|
return "airspy"
|
||||||
|
|
||||||
@ -626,19 +626,11 @@ class AirspyConnectorSource(SoapyConnectorSource):
|
|||||||
return cmd
|
return cmd
|
||||||
|
|
||||||
|
|
||||||
class AirspyhfConnectorSource(AirspyConnectorSource):
|
class AirspyhfSource(AirspySource):
|
||||||
def getDriver(self):
|
def getDriver(self):
|
||||||
return "airspyhf"
|
return "airspyhf"
|
||||||
|
|
||||||
|
|
||||||
class RtlSdrSource(SdrSource):
|
|
||||||
def getCommand(self):
|
|
||||||
return "rtl_sdr -s {samp_rate} -f {tuner_freq} -p {ppm} -g {rf_gain} -"
|
|
||||||
|
|
||||||
def getFormatConversion(self):
|
|
||||||
return "csdr convert_u8_f"
|
|
||||||
|
|
||||||
|
|
||||||
class HackrfSource(SdrSource):
|
class HackrfSource(SdrSource):
|
||||||
def getCommand(self):
|
def getCommand(self):
|
||||||
return "hackrf_transfer -s {samp_rate} -f {tuner_freq} -g {rf_gain} -l{lna_gain} -a{rf_amp} -r-"
|
return "hackrf_transfer -s {samp_rate} -f {tuner_freq} -g {rf_gain} -l{lna_gain} -a{rf_amp} -r-"
|
||||||
@ -647,38 +639,6 @@ class HackrfSource(SdrSource):
|
|||||||
return "csdr convert_s8_f"
|
return "csdr convert_s8_f"
|
||||||
|
|
||||||
|
|
||||||
class SdrplaySource(SdrSource):
|
|
||||||
def getCommand(self):
|
|
||||||
command = "rx_sdr -F CF32 -s {samp_rate} -f {tuner_freq} -p {ppm}"
|
|
||||||
gainMap = {"rf_gain": "RFGR", "if_gain": "IFGR"}
|
|
||||||
gains = [
|
|
||||||
"{0}={{{1}}}".format(gainMap[name], name)
|
|
||||||
for (name, value) in self.rtlProps.collect("rf_gain", "if_gain").__dict__().items()
|
|
||||||
if value is not None
|
|
||||||
]
|
|
||||||
if gains:
|
|
||||||
command += " -g {gains}".format(gains=",".join(gains))
|
|
||||||
if self.rtlProps["antenna"] is not None:
|
|
||||||
command += ' -a "{antenna}"'
|
|
||||||
command += " -"
|
|
||||||
return command
|
|
||||||
|
|
||||||
def sleepOnRestart(self):
|
|
||||||
time.sleep(1)
|
|
||||||
|
|
||||||
|
|
||||||
class AirspySource(SdrSource):
|
|
||||||
def getCommand(self):
|
|
||||||
frequency = self.props["tuner_freq"] / 1e6
|
|
||||||
command = "airspy_rx"
|
|
||||||
command += " -f{0}".format(frequency)
|
|
||||||
command += " -r /dev/stdout -a{samp_rate} -g {rf_gain}"
|
|
||||||
return command
|
|
||||||
|
|
||||||
def getFormatConversion(self):
|
|
||||||
return "csdr convert_s16_f"
|
|
||||||
|
|
||||||
|
|
||||||
class SpectrumThread(csdr.output):
|
class SpectrumThread(csdr.output):
|
||||||
def __init__(self, sdrSource):
|
def __init__(self, sdrSource):
|
||||||
self.sdrSource = sdrSource
|
self.sdrSource = sdrSource
|
||||||
|
Loading…
Reference in New Issue
Block a user