From 695d748a4f5a87897d8dcfdf8e863d98590c429d Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 1 Jun 2023 17:21:23 -0700 Subject: [PATCH] needs to allow 1 match --- selfdrive/car/fw_versions.py | 8 +++++--- selfdrive/car/hyundai/values.py | 3 --- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/selfdrive/car/fw_versions.py b/selfdrive/car/fw_versions.py index 6df41d0d8d..bd9dea13d8 100755 --- a/selfdrive/car/fw_versions.py +++ b/selfdrive/car/fw_versions.py @@ -103,8 +103,10 @@ def match_fw_to_car_fuzzy(fw_versions_dict, config, log=True, exclude=None): if len(platform_codes): print(platform_codes, version) platform_code = list(platform_codes)[0] - candidates = all_fw_versions_prefixes[(addr[0], addr[1], platform_code)] - print('second candidates', candidates) + key = (addr[0], addr[1], platform_code) + print('key', key) + candidates = all_fw_versions_prefixes[key] + print('second candidates', candidates) print() if len(candidates) == 1: @@ -116,7 +118,7 @@ def match_fw_to_car_fuzzy(fw_versions_dict, config, log=True, exclude=None): return set() print('match_count', match_count) - if match_count >= 2: + if match_count >= 1: if log: cloudlog.error(f"Fingerprinted {candidate} using fuzzy match. {match_count} matching ECUs") return {candidate} diff --git a/selfdrive/car/hyundai/values.py b/selfdrive/car/hyundai/values.py index 4e7646377d..c27c373932 100644 --- a/selfdrive/car/hyundai/values.py +++ b/selfdrive/car/hyundai/values.py @@ -356,7 +356,6 @@ def get_platform_codes(fw_versions: List[bytes]): def match_fw_to_hyundai_fuzzy(fw_versions_dict): - print('HERERERERER') platform_codes_radar = get_platform_codes(fw_versions_dict.get((0x7d0, None), {})) platform_codes_camera = get_platform_codes(fw_versions_dict.get((0x7c4, None), {})) if len(platform_codes_radar) != 1 or len(platform_codes_camera) != 1: @@ -1381,7 +1380,6 @@ FW_VERSIONS = { ], (Ecu.fwdCamera, 0x7c4, None): [ b'\xf1\x00SG2EMFC AT EUR LHD 1.01 1.09 99211-AT000 220801', - b'\xf1\x00SG2EMFC AT USA LHD 1.01 1.09 99211-AT000 220801', ], }, CAR.KIA_NIRO_PHEV: { @@ -1677,7 +1675,6 @@ FW_VERSIONS = { b'\xf1\x00CV1 MFC AT EUR RHD 1.00 1.00 99210-CV100 220630', b'\xf1\x00CV1 MFC AT USA LHD 1.00 1.00 99210-CV100 220630', b'\xf1\x00CV1 MFC AT KOR LHD 1.00 1.04 99210-CV000 210823', - b'\xf1\x00CV1 MFC AT KOR LHD 1.00 1.05 99210-CV000 211027', b'\xf1\x00CV1 MFC AT KOR LHD 1.00 1.06 99210-CV000 220328', ], },