From b5d5f59260cab369830c960a32654d0b81f8443c Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Fri, 31 Mar 2023 20:57:32 -0700 Subject: [PATCH] IsoTpParallelQuery: extend timeouts when receiving consecutive frames (#27762) * change to rx_in_progress * bump panda * bump panda old-commit-hash: a0f33658f283072fe86d18b06d0c4c98728d507a --- panda | 2 +- selfdrive/car/isotp_parallel_query.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/panda b/panda index a12c0a7956..8efbcf041c 160000 --- a/panda +++ b/panda @@ -1 +1 @@ -Subproject commit a12c0a795678373d946b644b43d9402b72e502a9 +Subproject commit 8efbcf041c1b6da1764bb56f822609fd4bb0758f diff --git a/selfdrive/car/isotp_parallel_query.py b/selfdrive/car/isotp_parallel_query.py index 70f8b5f50d..1b115c665d 100644 --- a/selfdrive/car/isotp_parallel_query.py +++ b/selfdrive/car/isotp_parallel_query.py @@ -105,13 +105,14 @@ class IsoTpParallelQuery: for tx_addr, msg in msgs.items(): try: - dat, updated = msg.recv() + dat, rx_in_progress = msg.recv() except Exception: cloudlog.exception(f"Error processing UDS response: {tx_addr}") request_done[tx_addr] = True continue - if updated: + # Extend timeout for each consecutive ISO-TP frame to avoid timing out on long responses + if rx_in_progress: response_timeouts[tx_addr] = time.monotonic() + timeout if not dat: @@ -123,6 +124,7 @@ class IsoTpParallelQuery: if response_valid: if counter + 1 < len(self.request): + response_timeouts[tx_addr] = time.monotonic() + timeout msg.send(self.request[counter + 1]) request_counter[tx_addr] += 1 else: