|
|
@ -2,7 +2,7 @@ |
|
|
|
import struct |
|
|
|
import struct |
|
|
|
import traceback |
|
|
|
import traceback |
|
|
|
from collections import defaultdict |
|
|
|
from collections import defaultdict |
|
|
|
from dataclasses import dataclass |
|
|
|
from dataclasses import dataclass, field |
|
|
|
from typing import Any, List |
|
|
|
from typing import Any, List |
|
|
|
from tqdm import tqdm |
|
|
|
from tqdm import tqdm |
|
|
|
|
|
|
|
|
|
|
@ -96,9 +96,11 @@ class Request: |
|
|
|
brand: str |
|
|
|
brand: str |
|
|
|
request: List[bytes] |
|
|
|
request: List[bytes] |
|
|
|
response: List[bytes] |
|
|
|
response: List[bytes] |
|
|
|
|
|
|
|
whitelist_ecus: List[int] = field(default_factory=list) |
|
|
|
rx_offset: int = DEFAULT_RX_OFFSET |
|
|
|
rx_offset: int = DEFAULT_RX_OFFSET |
|
|
|
bus: int = 1 |
|
|
|
bus: int = 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
REQUESTS: List[Request] = [ |
|
|
|
REQUESTS: List[Request] = [ |
|
|
|
# Subaru |
|
|
|
# Subaru |
|
|
|
Request( |
|
|
|
Request( |
|
|
@ -328,7 +330,8 @@ def get_fw_versions(logcan, sendcan, extra=None, timeout=0.1, debug=False, progr |
|
|
|
for addr_chunk in chunks(addr): |
|
|
|
for addr_chunk in chunks(addr): |
|
|
|
for r in REQUESTS: |
|
|
|
for r in REQUESTS: |
|
|
|
try: |
|
|
|
try: |
|
|
|
addrs = [(a, s) for (b, a, s) in addr_chunk if b in (r.brand, 'any')] |
|
|
|
addrs = [(a, s) for (b, a, s) in addr_chunk if b in (r.brand, 'any') and |
|
|
|
|
|
|
|
(len(r.whitelist_ecus) == 0 or ecu_types[(a, s)] in r.whitelist_ecus)] |
|
|
|
|
|
|
|
|
|
|
|
if addrs: |
|
|
|
if addrs: |
|
|
|
query = IsoTpParallelQuery(sendcan, logcan, r.bus, addrs, r.request, r.response, r.rx_offset, debug=debug) |
|
|
|
query = IsoTpParallelQuery(sendcan, logcan, r.bus, addrs, r.request, r.response, r.rx_offset, debug=debug) |
|
|
|