if_gain is optional, default is agc

This commit is contained in:
Jakob Ketterl
2019-05-19 22:23:35 +02:00
parent 8091831b1f
commit 8a7aeca6b9
2 changed files with 9 additions and 5 deletions

View File

@ -246,7 +246,7 @@ class SdrplaySource(SdrSource):
def getCommand(self):
command = "rx_sdr -F CF32 -s {samp_rate} -f {center_freq} -p {ppm}"
gainMap = { "rf_gain" : "RFGR", "if_gain" : "IFGR"}
gains = [ "{0}={{{1}}}".format(gainMap[name], name) for name in self.rtlProps.collect("rf_gain", "if_gain").__dict__() ]
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: