mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-04 03:18:10 +10:00
dmshell reliability tweaks
This commit is contained in:
@@ -634,6 +634,10 @@ def reader_loop(transport, state: SessionState) -> None:
|
||||
sys.stdout.buffer.flush()
|
||||
elif shell.op == state.pb2.mesh.RemoteShell.ERROR:
|
||||
message = shell.payload.decode("utf-8", errors="replace")
|
||||
if state.replay_log_file is None:
|
||||
state.open_replay_log(shell.session_id or state.session_id)
|
||||
sanitized = message.replace("\n", "\\n")
|
||||
state.log_replay_event("error_received", shell.seq, f"message={sanitized}")
|
||||
state.event_queue.put(f"remote error: {message}")
|
||||
elif shell.op == state.pb2.mesh.RemoteShell.CLOSED:
|
||||
message = shell.payload.decode("utf-8", errors="replace")
|
||||
@@ -645,7 +649,7 @@ def reader_loop(transport, state: SessionState) -> None:
|
||||
remote_last_tx_seq = shell.last_tx_seq
|
||||
remote_last_rx_seq = shell.last_rx_seq
|
||||
local_latest_tx_seq = state.highest_sent_seq()
|
||||
if remote_last_rx_seq < local_latest_tx_seq:
|
||||
if remote_last_rx_seq != 0 and remote_last_rx_seq < local_latest_tx_seq:
|
||||
replay_frames_from(transport, state, remote_last_rx_seq + 1)
|
||||
if remote_last_tx_seq > state.current_ack_seq():
|
||||
state.note_peer_reported_tx_seq(remote_last_tx_seq)
|
||||
|
||||
@@ -570,6 +570,8 @@ void DMShellModule::sendFrameToPeer(NodeNum peer, meshtastic_RemoteShell frame,
|
||||
}
|
||||
|
||||
packet->to = peer;
|
||||
packet->hop_limit = 0;
|
||||
packet->hop_start = 0;
|
||||
packet->channel = 0;
|
||||
packet->want_ack = false;
|
||||
packet->pki_encrypted = true;
|
||||
|
||||
Reference in New Issue
Block a user