Update source.py

This commit is contained in:
d9394 2019-10-29 14:06:02 +08:00 committed by GitHub
parent e210094a32
commit a6933ec832
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -379,7 +379,7 @@ class Resampler(SdrSource):
class RtlSdrSource(SdrSource): class RtlSdrSource(SdrSource):
def getCommand(self): def getCommand(self):
command = "rtl_sdr -s {samp_rate} -f {center_freq} -p {ppm} -g {rf_gain}" command = "rtl_sdr -s {samp_rate} -f {center_freq} -p {ppm} -g {rf_gain}"
if self.rtlProps["device"] != "0" : if self.rtlProps["device"] != "" :
command += " -d {device}" command += " -d {device}"
command += " -" command += " -"
return command return command
@ -391,7 +391,7 @@ class RtlSdrSource(SdrSource):
class HackrfSource(SdrSource): class HackrfSource(SdrSource):
def getCommand(self): def getCommand(self):
command="hackrf_transfer -s {samp_rate} -f {center_freq} -g {rf_gain} -l{lna_gain} -a{rf_amp} " command="hackrf_transfer -s {samp_rate} -f {center_freq} -g {rf_gain} -l{lna_gain} -a{rf_amp} "
if self.rtlProps["device"] != "0" : if self.rtlProps["device"] != "" :
command += " -d {device}" command += " -d {device}"
command += " -r-" command += " -r-"
return command return command
@ -413,7 +413,7 @@ class SdrplaySource(SdrSource):
command += " -g {gains}".format(gains=",".join(gains)) command += " -g {gains}".format(gains=",".join(gains))
if self.rtlProps["antenna"] is not None: if self.rtlProps["antenna"] is not None:
command += ' -a "{antenna}"' command += ' -a "{antenna}"'
if self.rtlProps["device"] != "0" : if self.rtlProps["device"] != "" :
command += " -d {device}" command += " -d {device}"
command += " -" command += " -"
return command return command
@ -428,7 +428,7 @@ class AirspySource(SdrSource):
command = "airspy_rx" command = "airspy_rx"
command += " -f{0}".format(frequency) command += " -f{0}".format(frequency)
command += " -r /dev/stdout -a{samp_rate} -g {rf_gain}" command += " -r /dev/stdout -a{samp_rate} -g {rf_gain}"
if self.rtlProps["device"] != "0" : if self.rtlProps["device"] != "" :
command += " -s {device}" command += " -s {device}"
return command return command