From 36b7cce8acf94628623ddee4c1bef3fc6b06e43a Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 1 Jun 2023 17:37:16 -0700 Subject: [PATCH] lay out how this should look --- selfdrive/car/fw_query_definitions.py | 9 +++++++++ selfdrive/car/fw_versions.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/selfdrive/car/fw_query_definitions.py b/selfdrive/car/fw_query_definitions.py index e2f16bb8b8..c10fd2c138 100755 --- a/selfdrive/car/fw_query_definitions.py +++ b/selfdrive/car/fw_query_definitions.py @@ -74,6 +74,15 @@ class FwQueryConfig: non_essential_ecus: Dict[capnp.lib.capnp._EnumModule, List[str]] = field(default_factory=dict) # Ecus added for data collection, not to be fingerprinted on extra_ecus: List[Tuple[capnp.lib.capnp._EnumModule, int, Optional[int]]] = field(default_factory=list) + + # Brand-specific fuzzy fingerprinting options: + # The minimum number of version matches to fuzzy fingerprint + fuzzy_min_match_count: Optional[int] = None + # A function to get uniquely identifiable codes for a version + # TODO: take list of versions and return set of platform codes + fuzzy_get_platform_codes: Optional[Callable] = None + + # TODO: below func is to be replaced by above two # A function that each make can provide to fuzzy fingerprint reliably on that make match_fw_to_car_fuzzy: Optional[Callable[[Dict[Tuple[int, Optional[int]], List[bytes]]], Set[str]]] = None diff --git a/selfdrive/car/fw_versions.py b/selfdrive/car/fw_versions.py index bd9dea13d8..cae07e6b77 100755 --- a/selfdrive/car/fw_versions.py +++ b/selfdrive/car/fw_versions.py @@ -94,7 +94,7 @@ def match_fw_to_car_fuzzy(fw_versions_dict, config, log=True, exclude=None): for version in versions: # All cars that have this FW response on the specified address candidates = all_fw_versions[(addr[0], addr[1], version)] - print(addr) + print(addr, version) print('first candidates', candidates) if len(candidates) != 1: