|
|
|
@ -97,6 +97,7 @@ class IsoTpParallelQuery: |
|
|
|
|
|
|
|
|
|
results = {} |
|
|
|
|
start_time = time.monotonic() |
|
|
|
|
addrs_responded = set() # track addresses that have ever sent a valid iso-tp frame for timeout logging |
|
|
|
|
response_timeouts = {tx_addr: start_time + timeout for tx_addr in self.msg_addrs} |
|
|
|
|
while True: |
|
|
|
|
self.rx() |
|
|
|
@ -111,6 +112,7 @@ class IsoTpParallelQuery: |
|
|
|
|
|
|
|
|
|
# Extend timeout for each consecutive ISO-TP frame to avoid timing out on long responses |
|
|
|
|
if rx_in_progress: |
|
|
|
|
addrs_responded.add(tx_addr) |
|
|
|
|
response_timeouts[tx_addr] = time.monotonic() + timeout |
|
|
|
|
|
|
|
|
|
if not dat: |
|
|
|
@ -141,8 +143,13 @@ class IsoTpParallelQuery: |
|
|
|
|
cur_time = time.monotonic() |
|
|
|
|
for tx_addr in response_timeouts: |
|
|
|
|
if cur_time - response_timeouts[tx_addr] > 0: |
|
|
|
|
if request_counter[tx_addr] > 0 and not request_done[tx_addr]: |
|
|
|
|
cloudlog.error(f"iso-tp query timeout after receiving response: {tx_addr}") |
|
|
|
|
if not request_done[tx_addr]: |
|
|
|
|
if request_counter[tx_addr] > 0: |
|
|
|
|
cloudlog.error(f"iso-tp query timeout after receiving partial response: {tx_addr}") |
|
|
|
|
elif tx_addr in addrs_responded: |
|
|
|
|
cloudlog.error(f"iso-tp query timeout while receiving response: {tx_addr}") |
|
|
|
|
else: |
|
|
|
|
cloudlog.error(f"iso-tp query timeout with no response: {tx_addr}") |
|
|
|
|
request_done[tx_addr] = True |
|
|
|
|
|
|
|
|
|
# Break if all requests are done (finished or timed out) |
|
|
|
|