From f1248533323a2dc972be6fe944a350b05e2b08ab Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Wed, 30 Mar 2022 00:20:36 -0400 Subject: [PATCH 1/2] 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) From dc178e54afb13493eca9c54d5b5fa4c5a84a19cf Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Wed, 30 Mar 2022 00:33:13 -0400 Subject: [PATCH 2/2] Specified output name --- bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 61f0982..dc2da80 100644 --- a/bot.py +++ b/bot.py @@ -437,7 +437,7 @@ class Bot(commands.Bot): self.GQRXHandler.set_all_settings(self.mode, self.squelch, self.freq) elif self.Handler == 'op25': - self.OP25Handler.set_op25_parameters(self.freq, _start=True) + self.OP25Handler.set_op25_parameters(self.freq, _start=True, _output_device_name=self.DEVICE_NAME) # Set the started variable for later checks self.sdr_started = True