introduce connector source for sdrplay
这个提交包含在:
		| @@ -20,8 +20,9 @@ class FeatureDetector(object): | ||||
|     features = { | ||||
|         "core": ["csdr", "nmux", "nc"], | ||||
|         "rtl_sdr": ["rtl_sdr"], | ||||
|         "rtl_sdr_socket": ["owrx_connector"], | ||||
|         "rtl_sdr_connector": ["owrx_connector"], | ||||
|         "sdrplay": ["rx_tools"], | ||||
|         "sdrplay_connector": ["owrx_connector"], | ||||
|         "hackrf": ["hackrf_transfer"], | ||||
|         "airspy": ["airspy_rx"], | ||||
|         "digital_voice_digiham": ["digiham", "sox"], | ||||
|   | ||||
| @@ -199,9 +199,7 @@ class SdrSource(object): | ||||
|         props = self.rtlProps | ||||
|  | ||||
|         cmd = self.getCommand().format( | ||||
|             **props.collect( | ||||
|                 "samp_rate", "center_freq", "ppm", "rf_gain", "lna_gain", "rf_amp", "antenna", "if_gain" | ||||
|             ).__dict__() | ||||
|             **props.collect(*self.getEventNames()).__dict__() | ||||
|         ) | ||||
|  | ||||
|         format_conversion = self.getFormatConversion() | ||||
| @@ -439,15 +437,12 @@ class Resampler(SdrSource): | ||||
|         pass | ||||
|  | ||||
|  | ||||
| class RtlSdrSocketSource(SdrSource): | ||||
| class ConnectorSource(SdrSource): | ||||
|     def __init__(self, id, props, port): | ||||
|         super().__init__(id, props, port) | ||||
|         self.controlSocket = None | ||||
|         self.controlPort = getAvailablePort() | ||||
|  | ||||
|     def getEventNames(self): | ||||
|         return ["samp_rate", "center_freq", "ppm", "rf_gain"] | ||||
|  | ||||
|     def wireEvents(self): | ||||
|         def reconfigure(prop, value): | ||||
|             if self.monitor is None: | ||||
| @@ -468,9 +463,6 @@ class RtlSdrSocketSource(SdrSource): | ||||
|             self.controlSocket.close() | ||||
|             self.controlSocket = None | ||||
|  | ||||
|     def getCommand(self): | ||||
|         return "rtl_connector -p {port} -c {controlPort}".format(port=self.port, controlPort=self.controlPort) + " -s {samp_rate} -f {center_freq} -g {rf_gain} -P {ppm}" | ||||
|  | ||||
|     def getFormatConversion(self): | ||||
|         return None | ||||
|  | ||||
| @@ -478,6 +470,22 @@ class RtlSdrSocketSource(SdrSource): | ||||
|         return False | ||||
|  | ||||
|  | ||||
| class RtlSdrConnectorSource(ConnectorSource): | ||||
|     def getEventNames(self): | ||||
|         return ["samp_rate", "center_freq", "ppm", "rf_gain"] | ||||
|  | ||||
|     def getCommand(self): | ||||
|         return "rtl_connector -p {port} -c {controlPort}".format(port=self.port, controlPort=self.controlPort) + " -s {samp_rate} -f {center_freq} -g {rf_gain} -P {ppm}" | ||||
|  | ||||
|  | ||||
| class SdrplayConnectorSource(ConnectorSource): | ||||
|     def getEventNames(self): | ||||
|         return ["samp_rate", "center_freq", "ppm", "rf_gain", "antenna", "device"] | ||||
|  | ||||
|     def getCommand(self): | ||||
|         return "soapy_connector -p {port} -c {controlPort}".format(port=self.port, controlPort=self.controlPort) + " -s {samp_rate} -f {center_freq} -g \"{rf_gain}\" -P {ppm} -a \"{antenna}\" -d \"{device}\"" | ||||
|  | ||||
|  | ||||
| class RtlSdrSource(SdrSource): | ||||
|     def getCommand(self): | ||||
|         return "rtl_sdr -s {samp_rate} -f {center_freq} -p {ppm} -g {rf_gain} -" | ||||
|   | ||||
		在新工单中引用
	
	屏蔽一个用户
	 Jakob Ketterl
					Jakob Ketterl