detect device failure

This commit is contained in:
Jakob Ketterl 2020-08-30 23:48:05 +02:00
parent 9be0664e14
commit 95ac5aeb7d

View File

@ -183,6 +183,9 @@ class SdrSource(ABC):
def wait_for_process_to_end():
rc = self.process.wait()
logger.debug("shut down with RC={0}".format(rc))
if self.getState() == SdrSource.STATE_RUNNING:
self.failed = True
self.setState(SdrSource.STATE_FAILED)
self.monitor = None
self.monitor = threading.Thread(target=wait_for_process_to_end, name="source_monitor")