rtltcp_compat is now a flag; expose through config

This commit is contained in:
Jakob Ketterl 2019-12-15 16:32:23 +01:00
parent f7ff798238
commit ef1435cef7

View File

@ -466,6 +466,18 @@ class ConnectorSource(SdrSource):
self.controlSocket = None self.controlSocket = None
self.controlPort = getAvailablePort() self.controlPort = getAvailablePort()
def getEventNames(self):
return [
"samp_rate",
"center_freq",
"ppm",
"rf_gain",
"device",
"iqswap",
"lfo_offset",
"rtltcp_compat",
]
def sendControlMessage(self, prop, value): def sendControlMessage(self, prop, value):
logger.debug("sending property change over control socket: {0} changed to {1}".format(prop, value)) logger.debug("sending property change over control socket: {0} changed to {1}".format(prop, value))
self.controlSocket.sendall("{prop}:{value}\n".format(prop=prop, value=value).encode()) self.controlSocket.sendall("{prop}:{value}\n".format(prop=prop, value=value).encode())
@ -505,17 +517,6 @@ class ConnectorSource(SdrSource):
class RtlSdrConnectorSource(ConnectorSource): class RtlSdrConnectorSource(ConnectorSource):
def getEventNames(self):
return [
"samp_rate",
"center_freq",
"ppm",
"rf_gain",
"device",
"iqswap",
"lfo_offset",
]
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)
@ -525,6 +526,8 @@ class RtlSdrConnectorSource(ConnectorSource):
cmd += ' -d "{device}"' cmd += ' -d "{device}"'
if self.rtlProps["iqswap"]: if self.rtlProps["iqswap"]:
cmd += " -i" cmd += " -i"
if self.rtlProps["rtltcp_compat"]:
cmd += " -r"
return cmd return cmd
@ -578,16 +581,7 @@ class SdrplayConnectorSource(SoapyConnectorSource):
return "sdrplay" return "sdrplay"
def getEventNames(self): def getEventNames(self):
return [ return super().getEventNames() + ["antenna"]
"samp_rate",
"center_freq",
"ppm",
"rf_gain",
"antenna",
"device",
"iqswap",
"lfo_offset",
]
def getCommand(self): def getCommand(self):
cmd = ( cmd = (
@ -597,6 +591,8 @@ class SdrplayConnectorSource(SoapyConnectorSource):
values = self.getCommandValues() values = self.getCommandValues()
if values["iqswap"]: if values["iqswap"]:
cmd += " -i" cmd += " -i"
if self.rtlProps["rtltcp_compat"]:
cmd += " -r"
return cmd return cmd
@ -605,16 +601,7 @@ class AirspyConnectorSource(SoapyConnectorSource):
return "airspy" return "airspy"
def getEventNames(self): def getEventNames(self):
return [ return super().getEventNames() + ["bias_tee"]
"samp_rate",
"center_freq",
"ppm",
"rf_gain",
"device",
"iqswap",
"lfo_offset",
"bias_tee",
]
def getCommand(self): def getCommand(self):
cmd = ( cmd = (
@ -624,6 +611,8 @@ class AirspyConnectorSource(SoapyConnectorSource):
values = self.getCommandValues() values = self.getCommandValues()
if values["iqswap"]: if values["iqswap"]:
cmd += " -i" cmd += " -i"
if self.rtlProps["rtltcp_compat"]:
cmd += " -r"
if values["bias_tee"]: if values["bias_tee"]:
cmd += " -t biastee=true" cmd += " -t biastee=true"
return cmd return cmd