Specified output name

This commit is contained in:
Logan Cusano
2022-03-30 00:20:36 -04:00
parent 331753ccbf
commit f124853332

View File

@@ -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)