Update: Working on SDR RX
- Switched to using GQRX - Created a handler to connect over Telnet to local GQRS TODO - Need to find a way to close GQRX without closing the application; Can't start the app with the radio listening, so it must be opened manually
This commit is contained in:
38
gqrxHandler.py
Normal file
38
gqrxHandler.py
Normal file
@@ -0,0 +1,38 @@
|
||||
from telnetlib import Telnet
|
||||
|
||||
class GQRXHandler():
|
||||
def __init__(self, hostname: str = "localhost", port: int = 7356):
|
||||
self.hostname = hostname
|
||||
self.port = port
|
||||
|
||||
self.telnet_connection = None
|
||||
|
||||
def create_telnet_connection(self):
|
||||
tel_conn = Telnet(self.hostname, self.port)
|
||||
tel_conn.read_until("Escape character is '^]'.")
|
||||
|
||||
return tel_conn
|
||||
|
||||
def change_freq(self, freq):
|
||||
tel_conn = self.create_telnet_connection()
|
||||
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()
|
||||
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()
|
||||
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)}")
|
||||
Reference in New Issue
Block a user