|
|
@ -153,27 +153,6 @@ def match_fw_to_car_exact(fw_versions_dict, _=None, log=True) -> Set[str]: |
|
|
|
return set(candidates.keys()) - set(invalid) |
|
|
|
return set(candidates.keys()) - set(invalid) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def match_fw_to_car_orig(fw_versions, allow_exact=True, allow_fuzzy=True): |
|
|
|
|
|
|
|
# Try exact matching first |
|
|
|
|
|
|
|
exact_matches = [] |
|
|
|
|
|
|
|
if allow_exact: |
|
|
|
|
|
|
|
exact_matches = [(True, match_fw_to_car_exact)] |
|
|
|
|
|
|
|
if allow_fuzzy: |
|
|
|
|
|
|
|
exact_matches.append((False, match_fw_to_car_fuzzy_orig)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for exact_match, match_func in exact_matches: |
|
|
|
|
|
|
|
# For each brand, attempt to fingerprint using all FW returned from its queries |
|
|
|
|
|
|
|
matches = set() |
|
|
|
|
|
|
|
for brand in VERSIONS.keys(): |
|
|
|
|
|
|
|
fw_versions_dict = build_fw_dict(fw_versions, filter_brand=brand) |
|
|
|
|
|
|
|
matches |= match_func(fw_versions_dict, FW_QUERY_CONFIGS[brand]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(matches): |
|
|
|
|
|
|
|
return exact_match, matches |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return True, set() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def match_fw_to_car(fw_versions, allow_exact=True, allow_fuzzy=True, log=True): |
|
|
|
def match_fw_to_car(fw_versions, allow_exact=True, allow_fuzzy=True, log=True): |
|
|
|
# Try exact matching first |
|
|
|
# Try exact matching first |
|
|
|
exact_matches = [] |
|
|
|
exact_matches = [] |
|
|
|