Specified output name

Specified output name
This commit is contained in:
Logan Cusano
2022-03-30 00:37:01 -04:00
parent 331753ccbf
commit 6135bd81de
2 changed files with 9 additions and 4 deletions

2
bot.py
View File

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

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)