Hyundai: blacklist bad camera FW (#28318)

* cmt

* common parts

* add code and date

* Revert "add code and date"

This reverts commit 47f9ac84ca.

* Revert "common parts"

This reverts commit aa5683bbce.

* add back to santa cruz

* todo

* part number test

* pass test

* Update selfdrive/car/hyundai/tests/test_hyundai.py
pull/28850/head
Shane Smiskol 2 years ago committed by GitHub
parent 221bbfe95e
commit 398dd77114
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      selfdrive/car/hyundai/tests/test_hyundai.py
  2. 1
      selfdrive/car/hyundai/values.py

@ -52,6 +52,20 @@ class TestHyundaiFingerprint(unittest.TestCase):
self.assertEqual(len(ecus_not_in_whitelist), 0, self.assertEqual(len(ecus_not_in_whitelist), 0,
f"{car_model}: Car model has ECUs not in auxiliary request whitelists: {ecu_strings}") f"{car_model}: Car model has ECUs not in auxiliary request whitelists: {ecu_strings}")
def test_blacklisted_parts(self):
# Asserts no ECUs known to be shared across platforms exist in the database.
# Tucson having Santa Cruz camera and EPS for example
for car_model, ecus in FW_VERSIONS.items():
with self.subTest(car_model=car_model):
if car_model == CAR.SANTA_CRUZ_1ST_GEN:
raise unittest.SkipTest("Skip checking Santa Cruz for its parts")
for code, _ in get_platform_codes(ecus[(Ecu.fwdCamera, 0x7c4, None)]):
if b"-" not in code:
continue
part = code.split(b"-")[1]
self.assertFalse(part.startswith(b'CW'), "Car has bad part number")
# Tests for platform codes, part numbers, and FW dates which Hyundai will use to fuzzy # Tests for platform codes, part numbers, and FW dates which Hyundai will use to fuzzy
# fingerprint in the absence of full FW matches: # fingerprint in the absence of full FW matches:
def test_platform_code_ecus_available(self): def test_platform_code_ecus_available(self):

@ -1766,7 +1766,6 @@ FW_VERSIONS = {
(Ecu.fwdCamera, 0x7c4, None): [ (Ecu.fwdCamera, 0x7c4, None): [
b'\xf1\x00NX4 FR_CMR AT USA LHD 1.00 1.00 99211-N9210 14G', b'\xf1\x00NX4 FR_CMR AT USA LHD 1.00 1.00 99211-N9210 14G',
b'\xf1\x00NX4 FR_CMR AT USA LHD 1.00 1.01 99211-N9240 14T', b'\xf1\x00NX4 FR_CMR AT USA LHD 1.00 1.01 99211-N9240 14T',
b'\xf1\x00NX4 FR_CMR AT USA LHD 1.00 1.00 99211-CW010 14X',
], ],
(Ecu.fwdRadar, 0x7d0, None): [ (Ecu.fwdRadar, 0x7d0, None): [
b'\xf1\x00NX4__ 1.00 1.00 99110-N9100 ', b'\xf1\x00NX4__ 1.00 1.00 99110-N9100 ',

Loading…
Cancel
Save