From 59c5cd41cf7743c0f94c3782c41d0a15e2b4ca38 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 9 Apr 2024 21:06:00 -0700 Subject: [PATCH] add function signature and behavior comment --- selfdrive/car/fw_query_definitions.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/selfdrive/car/fw_query_definitions.py b/selfdrive/car/fw_query_definitions.py index 236ade49bb..991cae31f5 100755 --- a/selfdrive/car/fw_query_definitions.py +++ b/selfdrive/car/fw_query_definitions.py @@ -97,10 +97,16 @@ 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, int | None]] = field(default_factory=list) + # Function a brand can implement to provide better fuzzy matching. Takes in FW versions, # returns set of candidates. Only will match if one candidate is returned match_fw_to_car_fuzzy: Callable[[LiveFwVersions, OfflineFwVersions], set[str]] | None = None + # Alternate matching function that takes FW versions and the VIN and returns a set of matches. + # If there are conflicts with the union of all other matching functions (exact, fuzzy, or custom fuzzy), + # then the result from this custom one takes precedence. + match_fw_to_car_custom: Callable[[LiveFwVersions, str, OfflineFwVersions], set[str]] | None = None + def __post_init__(self): for i in range(len(self.requests)): if self.requests[i].auxiliary: