IsoTpParallelQuery: break earlier and add comment (#27883)

* better ordering and comments

* one comment one dream
pull/27853/head
Shane Smiskol 2 years ago committed by GitHub
parent 02798513af
commit 74f709a59f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      selfdrive/car/isotp_parallel_query.py

@ -100,9 +100,6 @@ class IsoTpParallelQuery:
while True:
self.rx()
if all(request_done.values()):
break
for tx_addr, msg in msgs.items():
try:
dat, rx_in_progress = msg.recv()
@ -140,6 +137,10 @@ class IsoTpParallelQuery:
request_done[tx_addr] = True
cloudlog.error(f"iso-tp query bad response: {tx_addr} - 0x{dat.hex()}")
# Break if all requests are done, we've timed out on all requests, or we've hit a max total timeout
if all(request_done.values()):
break
cur_time = time.monotonic()
if cur_time - max(response_timeouts.values()) > 0:
for tx_addr in msgs:

Loading…
Cancel
Save