lay out how this should look

pull/28386/head
Shane Smiskol 2 years ago
parent 695d748a4f
commit 36b7cce8ac
  1. 9
      selfdrive/car/fw_query_definitions.py
  2. 2
      selfdrive/car/fw_versions.py

@ -74,6 +74,15 @@ class FwQueryConfig:
non_essential_ecus: Dict[capnp.lib.capnp._EnumModule, List[str]] = field(default_factory=dict) non_essential_ecus: Dict[capnp.lib.capnp._EnumModule, List[str]] = field(default_factory=dict)
# Ecus added for data collection, not to be fingerprinted on # 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) 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 # 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 match_fw_to_car_fuzzy: Optional[Callable[[Dict[Tuple[int, Optional[int]], List[bytes]]], Set[str]]] = None

@ -94,7 +94,7 @@ def match_fw_to_car_fuzzy(fw_versions_dict, config, log=True, exclude=None):
for version in versions: for version in versions:
# All cars that have this FW response on the specified address # All cars that have this FW response on the specified address
candidates = all_fw_versions[(addr[0], addr[1], version)] candidates = all_fw_versions[(addr[0], addr[1], version)]
print(addr) print(addr, version)
print('first candidates', candidates) print('first candidates', candidates)
if len(candidates) != 1: if len(candidates) != 1:

Loading…
Cancel
Save