mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
Merge pull request #650 from DJ2LS/dev-arq
This commit is contained in:
commit
11a27bcbd7
4 changed files with 24 additions and 12 deletions
|
@ -54,6 +54,9 @@ class ARQDataTypeHandler:
|
||||||
|
|
||||||
def dispatch(self, type_byte: int, data: bytearray):
|
def dispatch(self, type_byte: int, data: bytearray):
|
||||||
session_type = self.get_session_type_from_value(type_byte)
|
session_type = self.get_session_type_from_value(type_byte)
|
||||||
|
|
||||||
|
self.state_manager.setARQ(False)
|
||||||
|
|
||||||
if session_type and session_type in self.handlers and 'handle' in self.handlers[session_type]:
|
if session_type and session_type in self.handlers and 'handle' in self.handlers[session_type]:
|
||||||
return self.handlers[session_type]['handle'](data)
|
return self.handlers[session_type]['handle'](data)
|
||||||
else:
|
else:
|
||||||
|
@ -61,6 +64,9 @@ class ARQDataTypeHandler:
|
||||||
|
|
||||||
def failed(self, type_byte: int, data: bytearray):
|
def failed(self, type_byte: int, data: bytearray):
|
||||||
session_type = self.get_session_type_from_value(type_byte)
|
session_type = self.get_session_type_from_value(type_byte)
|
||||||
|
|
||||||
|
self.state_manager.setARQ(False)
|
||||||
|
|
||||||
if session_type in self.handlers and 'failed' in self.handlers[session_type]:
|
if session_type in self.handlers and 'failed' in self.handlers[session_type]:
|
||||||
return self.handlers[session_type]['failed'](data)
|
return self.handlers[session_type]['failed'](data)
|
||||||
else:
|
else:
|
||||||
|
@ -74,6 +80,9 @@ class ARQDataTypeHandler:
|
||||||
|
|
||||||
def transmitted(self, type_byte: int, data: bytearray):
|
def transmitted(self, type_byte: int, data: bytearray):
|
||||||
session_type = self.get_session_type_from_value(type_byte)
|
session_type = self.get_session_type_from_value(type_byte)
|
||||||
|
|
||||||
|
self.state_manager.setARQ(False)
|
||||||
|
|
||||||
if session_type in self.handlers and 'transmitted' in self.handlers[session_type]:
|
if session_type in self.handlers and 'transmitted' in self.handlers[session_type]:
|
||||||
return self.handlers[session_type]['transmitted'](data)
|
return self.handlers[session_type]['transmitted'](data)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -98,7 +98,6 @@ class ARQSession():
|
||||||
if isinstance(received_data, bytearray) and isinstance(type_byte, int):
|
if isinstance(received_data, bytearray) and isinstance(type_byte, int):
|
||||||
self.arq_data_type_handler.dispatch(type_byte, received_data)
|
self.arq_data_type_handler.dispatch(type_byte, received_data)
|
||||||
|
|
||||||
self.states.setARQ(False)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
self.log(f"Ignoring unknown transition from state {self.state.name} with frame {frame['frame_type']}")
|
self.log(f"Ignoring unknown transition from state {self.state.name} with frame {frame['frame_type']}")
|
||||||
|
|
|
@ -229,29 +229,33 @@ class radio:
|
||||||
return value in ['ignore', 0]
|
return value in ['ignore', 0]
|
||||||
|
|
||||||
# Model ID, Serial Port, and Speed
|
# Model ID, Serial Port, and Speed
|
||||||
if not should_ignore(config.get('model_id', "0")):
|
if not should_ignore(config.get('model_id')):
|
||||||
args += ['-m', str(config['model_id'])]
|
args += ['-m', str(config['model_id'])]
|
||||||
if not should_ignore(config.get('serial_port', "0")):
|
if not should_ignore(config.get('serial_port')):
|
||||||
args += ['-r', config['serial_port']]
|
args += ['-r', config['serial_port']]
|
||||||
if not should_ignore(config.get('serial_speed', "0")):
|
if not should_ignore(config.get('serial_speed')):
|
||||||
args += ['-s', str(config['serial_speed'])]
|
args += ['-s', str(config['serial_speed'])]
|
||||||
|
|
||||||
# PTT Port and Type
|
# PTT Port and Type
|
||||||
if not should_ignore(config.get('ptt_port', "0")):
|
if not should_ignore(config.get('ptt_port')):
|
||||||
args += ['--ptt-port', config['ptt_port']]
|
args += ['--ptt-port', config['ptt_port']]
|
||||||
if not should_ignore(config.get('ptt_type', "0")):
|
if not should_ignore(config.get('ptt_type')):
|
||||||
args += ['--ptt-type', config['ptt_type']]
|
args += ['--ptt-type', config['ptt_type']]
|
||||||
|
|
||||||
# Serial DCD and DTR
|
# Serial DCD and DTR
|
||||||
if not should_ignore(config.get('serial_dcd', "0")):
|
if not should_ignore(config.get('serial_dcd')):
|
||||||
args += ['--set-dcd', config['serial_dcd']]
|
args += ['--set-dcd', config['serial_dcd']]
|
||||||
if not should_ignore(config.get('serial_dtr', "0")):
|
if not should_ignore(config.get('serial_dtr')):
|
||||||
args += ['--set-dtr', config['serial_dtr']]
|
args += ['--set-conf', f'dtr_state={config["serial_dtr"]}']
|
||||||
|
|
||||||
# Handling Stop Bits with the corrected --set-conf syntax
|
# Handling Data Bits and Stop Bits
|
||||||
if not should_ignore(config.get('stop_bits', "0")):
|
if not should_ignore(config.get('data_bits')):
|
||||||
|
args += ['--set-conf', f'data_bits={config["data_bits"]}']
|
||||||
|
if not should_ignore(config.get('stop_bits')):
|
||||||
args += ['--set-conf', f'stop_bits={config["stop_bits"]}']
|
args += ['--set-conf', f'stop_bits={config["stop_bits"]}']
|
||||||
|
|
||||||
|
# Fixme #rts_state
|
||||||
|
|
||||||
# Handle custom arguments for rigctld
|
# Handle custom arguments for rigctld
|
||||||
# Custom args are split via ' ' so python doesn't add extranaeous quotes on windows
|
# Custom args are split via ' ' so python doesn't add extranaeous quotes on windows
|
||||||
args += config_rigctld["arguments"].split(" ")
|
args += config_rigctld["arguments"].split(" ")
|
||||||
|
|
|
@ -70,7 +70,7 @@ class ScheduleManager:
|
||||||
cmd.run(self.event_manager, self.modem)
|
cmd.run(self.event_manager, self.modem)
|
||||||
|
|
||||||
def delete_beacons(self):
|
def delete_beacons(self):
|
||||||
DatabaseManagerBeacon(self.event_manager).beacon_cleanup_older_than_days(14)
|
DatabaseManagerBeacon(self.event_manager).beacon_cleanup_older_than_days(2)
|
||||||
|
|
||||||
def push_to_explorer(self):
|
def push_to_explorer(self):
|
||||||
self.config = self.config_manager.read()
|
self.config = self.config_manager.read()
|
||||||
|
|
Loading…
Reference in a new issue