From 0ecca373c649fe2e321b97e63a2d570d51a3b04c Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Tue, 4 Jan 2022 00:07:02 -0500 Subject: [PATCH] Bugfix: Working on SDR RX --- gqrxHandler.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gqrxHandler.py b/gqrxHandler.py index 28a1802..0aa0224 100644 --- a/gqrxHandler.py +++ b/gqrxHandler.py @@ -8,6 +8,7 @@ class GQRXHandler(): self.telnet_connection = None def create_telnet_connection(self): + print("Creating connection") tel_conn = Telnet(self.hostname, self.port) tel_conn.read_until(bytes("Escape character is '^]'.", 'utf-8')) @@ -15,24 +16,26 @@ class GQRXHandler(): def change_freq(self, freq): tel_conn = self.create_telnet_connection() + print(f"Changing freq to {freq}") tel_conn.write(f"F {int(freq)}") tel_conn.read_all() tel_conn.close() def change_squelch(self, squelch): tel_conn = self.create_telnet_connection() + print(f"Changing squelch to {squelch}") tel_conn.write(f"L SQL {float(squelch)}") tel_conn.read_all() tel_conn.close() def change_mode(self, mode): tel_conn = self.create_telnet_connection() + print(f"Changing mode to {mode}") tel_conn.write(f"M {str(mode)}") tel_conn.read_all() tel_conn.close() def set_all_settings(self, mode, squelch, freq): - tel_conn = self.create_telnet_connection() - tel_conn.write(f"F {int(freq)}") - tel_conn.write(f"M {str(mode)}") - tel_conn.write(f"L SQL {float(squelch)}") + self.change_mode(mode) + self.change_freq(freq) + self.change_squelch(squelch)