From 0eb04fae67646e283b7d750d1e2119e37c398f95 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Sat, 26 Aug 2023 06:45:46 -0700 Subject: [PATCH] iso-tp: return if updated (#1610) return if updated reverts some of https://github.com/commaai/panda/pull/1314 --- python/uds.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/uds.py b/python/uds.py index f607209412..7d2a0ce0d6 100644 --- a/python/uds.py +++ b/python/uds.py @@ -449,18 +449,18 @@ def recv(self, timeout=None) -> Tuple[Optional[bytes], bool]: timeout = self.timeout start_time = time.monotonic() - rx_in_progress = False + updated = False try: while True: for msg in self._can_client.recv(): - frame_type = self._isotp_rx_next(msg) + self._isotp_rx_next(msg) start_time = time.monotonic() - rx_in_progress = frame_type == ISOTP_FRAME_TYPE.CONSECUTIVE + updated = True if self.tx_done and self.rx_done: - return self.rx_dat, False + return self.rx_dat, updated # no timeout indicates non-blocking if timeout == 0: - return None, rx_in_progress + return None, updated if time.monotonic() - start_time > timeout: raise MessageTimeoutError("timeout waiting for response") finally: