Bugfix: Working on SDR RX
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user