improve control socket handling

This commit is contained in:
Jakob Ketterl 2019-11-12 15:57:10 +01:00
parent bf27f51049
commit 2a6c7863b1

View File

@ -418,8 +418,10 @@ class RtlSdrSocketSource(SdrSource):
def wireEvents(self): def wireEvents(self):
def reconfigure(prop, value): def reconfigure(prop, value):
if self.monitor is None:
return
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.send("{prop}:{value}\n".format(prop=prop, value=value).encode()) self.controlSocket.sendall("{prop}:{value}\n".format(prop=prop, value=value).encode())
self.rtlProps.wire(reconfigure) self.rtlProps.wire(reconfigure)