mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
listen for codec2 traffic
This commit is contained in:
parent
d0182cb1af
commit
cf7685b3e6
2 changed files with 7 additions and 3 deletions
|
@ -65,7 +65,7 @@ class ScheduleManager:
|
|||
|
||||
def transmit_beacon(self):
|
||||
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.run(self.event_manager, self.modem)
|
||||
except Exception as e:
|
||||
|
@ -79,14 +79,14 @@ class ScheduleManager:
|
|||
|
||||
def push_to_explorer(self):
|
||||
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:
|
||||
explorer.explorer(self.modem_version, self.config_manager, self.state_manager).push()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
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:
|
||||
if first_queued_message := DatabaseManagerMessages(
|
||||
self.event_manager
|
||||
|
|
|
@ -100,6 +100,7 @@ class StateManager:
|
|||
"is_away_from_key": self.is_away_from_key,
|
||||
"radio_status": self.radio_status,
|
||||
"channel_busy_slot": self.channel_busy_slot,
|
||||
"is_codec2_traffic": self.is_receiving_codec2_signal(),
|
||||
"audio_dbfs": self.audio_dbfs,
|
||||
"activities": self.activities_list,
|
||||
"is_modem_busy" : self.getARQ()
|
||||
|
@ -233,6 +234,9 @@ class StateManager:
|
|||
self.channel_busy_condition_codec2 = threading.Event()
|
||||
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):
|
||||
return {
|
||||
"radio_status": self.radio_status,
|
||||
|
|
Loading…
Reference in a new issue