attempt to select new sdr on failure

This commit is contained in:
Jakob Ketterl
2019-12-23 21:12:28 +01:00
parent 7793609fa4
commit 46b5e9034f
4 changed files with 49 additions and 25 deletions

View File

@ -80,6 +80,9 @@ class SdrSource(object):
profiles = self.props["profiles"]
if profile_id is None:
profile_id = list(profiles.keys())[0]
if profile_id not in profiles:
logger.warning("invalid profile %s for sdr %s. ignoring", profile_id, self.id)
return
if profile_id == self.profile_id:
return
logger.debug("activating profile {0}".format(profile_id))
@ -275,6 +278,9 @@ class SdrSource(object):
for c in self.spectrumClients:
c.write_spectrum_data(data)
def getState(self):
return self.state
def setState(self, state):
if state == self.state:
return