FPv2: only query brands with matching present ECUs (#27697)

* speed up fingerprinting for CAN fp cars

* add comment to describe this behavior

* more explicit, no defaultdict

* do this later

* fix

* a little more clear I think
pull/27446/head^2
Shane Smiskol 2 years ago committed by GitHub
parent 0534016b7b
commit 9b1095a27e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      selfdrive/car/fw_versions.py

@ -221,6 +221,10 @@ def get_fw_versions_ordered(logcan, sendcan, ecu_rx_addrs, timeout=0.1, num_pand
brand_matches = get_brand_ecu_matches(ecu_rx_addrs)
for brand in sorted(brand_matches, key=lambda b: len(brand_matches[b]), reverse=True):
# Skip this brand if there are no matching present ECUs
if not len(brand_matches[brand]):
continue
car_fw = get_fw_versions(logcan, sendcan, query_brand=brand, timeout=timeout, num_pandas=num_pandas, debug=debug, progress=progress)
all_car_fw.extend(car_fw)
# Try to match using FW returned from this brand only

Loading…
Cancel
Save