listen for codec2 traffic

shutdownfix
DJ2LS 2024-05-11 13:30:48 +02:00
parent d0182cb1af
commit cf7685b3e6
2 changed files with 7 additions and 3 deletions

View File

@ -65,7 +65,7 @@ class ScheduleManager:
def transmit_beacon(self): def transmit_beacon(self):
try: try:
if not self.state_manager.getARQ() and self.state_manager.is_beacon_running: if not self.state_manager.getARQ() and self.state_manager.is_beacon_running and self.state_manager.is_modem_running:
cmd = command_beacon.BeaconCommand(self.config, self.state_manager, self.event_manager) cmd = command_beacon.BeaconCommand(self.config, self.state_manager, self.event_manager)
cmd.run(self.event_manager, self.modem) cmd.run(self.event_manager, self.modem)
except Exception as e: except Exception as e:
@ -79,14 +79,14 @@ class ScheduleManager:
def push_to_explorer(self): def push_to_explorer(self):
self.config = self.config_manager.read() self.config = self.config_manager.read()
if self.config['STATION']['enable_explorer']: if self.config['STATION']['enable_explorer'] and self.state_manager.is_modem_running:
try: try:
explorer.explorer(self.modem_version, self.config_manager, self.state_manager).push() explorer.explorer(self.modem_version, self.config_manager, self.state_manager).push()
except Exception as e: except Exception as e:
print(e) print(e)
def check_for_queued_messages(self): def check_for_queued_messages(self):
if not self.state_manager.getARQ(): if not self.state_manager.getARQ() and not self.state_manager.is_receiving_codec2_signal() and self.state_manager.is_modem_running:
try: try:
if first_queued_message := DatabaseManagerMessages( if first_queued_message := DatabaseManagerMessages(
self.event_manager self.event_manager

View File

@ -100,6 +100,7 @@ class StateManager:
"is_away_from_key": self.is_away_from_key, "is_away_from_key": self.is_away_from_key,
"radio_status": self.radio_status, "radio_status": self.radio_status,
"channel_busy_slot": self.channel_busy_slot, "channel_busy_slot": self.channel_busy_slot,
"is_codec2_traffic": self.is_receiving_codec2_signal(),
"audio_dbfs": self.audio_dbfs, "audio_dbfs": self.audio_dbfs,
"activities": self.activities_list, "activities": self.activities_list,
"is_modem_busy" : self.getARQ() "is_modem_busy" : self.getARQ()
@ -233,6 +234,9 @@ class StateManager:
self.channel_busy_condition_codec2 = threading.Event() self.channel_busy_condition_codec2 = threading.Event()
self.calculate_channel_busy_state() self.calculate_channel_busy_state()
def is_receiving_codec2_signal(self):
return not self.channel_busy_condition_codec2.is_set()
def get_radio_status(self): def get_radio_status(self):
return { return {
"radio_status": self.radio_status, "radio_status": self.radio_status,