From f1248533323a2dc972be6fe944a350b05e2b08ab Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Wed, 30 Mar 2022 00:20:36 -0400 Subject: [PATCH] Specified output name --- op25Handler.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/op25Handler.py b/op25Handler.py index d632cf8..947f62a 100644 --- a/op25Handler.py +++ b/op25Handler.py @@ -20,6 +20,8 @@ class OP25Handler(threading.Thread): self.Stop_OP25 = False + self.Output_Device_Name = None + self.logger = logging.getLogger("Discord_Radio_Bot.OP25Handler") def run(self) -> None: @@ -38,7 +40,7 @@ class OP25Handler(threading.Thread): time.sleep(.5) def set_op25_parameters(self, _frequency: str = False, _http_enabled: bool = True, _start: bool = False, - _stop: bool = False): + _stop: bool = False, _output_device_name: str = None): if _frequency: self.Frequency = _frequency @@ -51,12 +53,15 @@ class OP25Handler(threading.Thread): if _http_enabled: self.HTTP_ENABLED = _http_enabled + if _output_device_name: + self.Output_Device_Name = _output_device_name + def open_op25(self): if self.OP25Proc is not None: self.close_op25() - p25_kwargs = [f"./rx.py", "--args", "rtl", "-N", "LNA:49", "-s", "200000", "-o", "25600", "-U", "-f", - f"{self.Frequency}e6", "-X", "-2"] + p25_kwargs = [f"./rx.py", "--args", "rtl", "-N", "LNA:49", "-s", "200000", "-o", "25600", "-w", "-U", "-O", + f"{self.Output_Device_Name}", "-f", f"{self.Frequency}e6", "-X", "-2"] self.logger.info(f"Starting OP25") # Change the interpreter's working directory (idr why)