From 000db65838e0b74d55baecaa5a90c46bc2b886a1 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Sat, 27 May 2023 19:25:38 -0700 Subject: [PATCH] IsoTpParallelQuery: fixup comment and simpler response check (#28326) * startswith works with bytes * this comment only explained an exception, was confusing old-commit-hash: aa3490ac3058832fc7da0e5e824714cb5f95b469 --- selfdrive/car/isotp_parallel_query.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/isotp_parallel_query.py b/selfdrive/car/isotp_parallel_query.py index 965d2e1836..d6b3538840 100644 --- a/selfdrive/car/isotp_parallel_query.py +++ b/selfdrive/car/isotp_parallel_query.py @@ -90,7 +90,8 @@ class IsoTpParallelQuery: for addr in self.functional_addrs: self._create_isotp_msg(addr, None, -1).send(self.request[0]) - # If querying functional addrs, set up physical IsoTpMessages to send consecutive frames + # Send first frame (single or first) to all addresses and receive asynchronously in the loop below. + # If querying functional addrs, only set up physical IsoTpMessages to send consecutive frames for msg in msgs.values(): msg.send(self.request[0], setup_only=len(self.functional_addrs) > 0) @@ -117,7 +118,7 @@ class IsoTpParallelQuery: counter = request_counter[tx_addr] expected_response = self.response[counter] - response_valid = dat[:len(expected_response)] == expected_response + response_valid = dat.startswith(expected_response) if response_valid: if counter + 1 < len(self.request):