Initial changes to handle GQRX process
This commit is contained in:
12
bot.py
12
bot.py
@@ -338,6 +338,7 @@ class Bot(commands.Bot):
|
||||
self.logger.info("Starting GQRX handler")
|
||||
from gqrxHandler import GQRXHandler
|
||||
self.GQRXHandler = GQRXHandler()
|
||||
self.GQRXHandler.start()
|
||||
self.possible_modes = BotResources.PDB_ACCEPTABLE_HANDLERS['gqrx']['Modes']
|
||||
|
||||
elif self.Handler == 'op25':
|
||||
@@ -435,7 +436,9 @@ class Bot(commands.Bot):
|
||||
|
||||
if self.Handler == 'gqrx':
|
||||
# Set the settings in GQRX
|
||||
self.GQRXHandler.set_all_settings(self.mode, self.squelch, self.freq)
|
||||
self.GQRXHandler.set_gqrx_parameters(_frequency=self.freq, _squelch=self.squelch,
|
||||
_fm_mode=self.mode, _output_device_name=self.DEVICE_NAME,
|
||||
_start=True)
|
||||
|
||||
elif self.Handler == 'op25':
|
||||
self.OP25Handler.set_op25_parameters(self.freq, _start=True, _output_device_name=self.DEVICE_NAME)
|
||||
@@ -447,11 +450,16 @@ class Bot(commands.Bot):
|
||||
def stop_sdr(self):
|
||||
if self.sdr_started:
|
||||
# Wait for the running processes to close
|
||||
|
||||
# Close the GQRX handler
|
||||
if self.Handler == 'gqrx':
|
||||
self.GQRXHandler.set_gqrx_parameters(_stop=True)
|
||||
|
||||
# Close the OP25 handler
|
||||
if self.Handler == 'op25':
|
||||
self.OP25Handler.set_op25_parameters(_stop=True)
|
||||
# self.OP25Handler.join()
|
||||
# Need a way to 'close' GQRX
|
||||
|
||||
self.sdr_started = False
|
||||
|
||||
# Set the activity of the bot
|
||||
|
||||
Reference in New Issue
Block a user