From 34414de4e5ca901cff340e5b952229e71f7a91c3 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sat, 19 Sep 2020 21:17:00 +0200 Subject: [PATCH] only re-start dsp if dsp has been started before --- owrx/connection.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/owrx/connection.py b/owrx/connection.py index 1dfd537..c8cfbec 100644 --- a/owrx/connection.py +++ b/owrx/connection.py @@ -133,6 +133,9 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient): self.configSub = None self.connectionProperties = {} + # to be able to remember if the dsp has been started before + self.dspState = False + try: ClientRegistry.getSharedInstance().addClient(self) except TooManyClientsException: @@ -183,6 +186,7 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient): if "type" in message: if message["type"] == "dspcontrol": if "action" in message and message["action"] == "start": + self.dspState = True self.startDsp() if "params" in message: @@ -274,7 +278,8 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient): self.__sendProfiles() self.sdr.addSpectrumClient(self) - self.startDsp() + if self.dspState: + self.startDsp() def handleNoSdrsAvailable(self): self.write_sdr_error("No SDR Devices available")