|
|
@ -146,12 +146,16 @@ def match_fw_to_car(fw_versions, allow_exact=True, allow_fuzzy=True): |
|
|
|
return True, set() |
|
|
|
return True, set() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_present_ecus(logcan, sendcan): |
|
|
|
def get_present_ecus(logcan, sendcan, num_pandas=1) -> Set[Tuple[int, Optional[int], int]]: |
|
|
|
queries = list() |
|
|
|
queries = list() |
|
|
|
parallel_queries = list() |
|
|
|
parallel_queries = list() |
|
|
|
responses = set() |
|
|
|
responses = set() |
|
|
|
|
|
|
|
|
|
|
|
for brand, r in REQUESTS: |
|
|
|
for brand, r in REQUESTS: |
|
|
|
|
|
|
|
# Skip query if no panda available |
|
|
|
|
|
|
|
if r.bus > num_pandas * 4 - 1: |
|
|
|
|
|
|
|
continue |
|
|
|
|
|
|
|
|
|
|
|
for brand_versions in VERSIONS[brand].values(): |
|
|
|
for brand_versions in VERSIONS[brand].values(): |
|
|
|
for ecu_type, addr, sub_addr in brand_versions: |
|
|
|
for ecu_type, addr, sub_addr in brand_versions: |
|
|
|
# Only query ecus in whitelist if whitelist is not empty |
|
|
|
# Only query ecus in whitelist if whitelist is not empty |
|
|
@ -171,7 +175,7 @@ def get_present_ecus(logcan, sendcan): |
|
|
|
|
|
|
|
|
|
|
|
queries.insert(0, parallel_queries) |
|
|
|
queries.insert(0, parallel_queries) |
|
|
|
|
|
|
|
|
|
|
|
ecu_responses: Set[Tuple[int, Optional[int], int]] = set() |
|
|
|
ecu_responses = set() |
|
|
|
for query in queries: |
|
|
|
for query in queries: |
|
|
|
ecu_responses.update(get_ecu_addrs(logcan, sendcan, set(query), responses, timeout=0.1)) |
|
|
|
ecu_responses.update(get_ecu_addrs(logcan, sendcan, set(query), responses, timeout=0.1)) |
|
|
|
return ecu_responses |
|
|
|
return ecu_responses |
|
|
|