diff --git a/selfdrive/car/hyundai/values.py b/selfdrive/car/hyundai/values.py index eef31222fe..20fc29897d 100644 --- a/selfdrive/car/hyundai/values.py +++ b/selfdrive/car/hyundai/values.py @@ -396,6 +396,9 @@ HYUNDAI_VERSION_REQUEST_MULTI = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER] p16(uds.DATA_IDENTIFIER_TYPE.APPLICATION_SOFTWARE_IDENTIFICATION) + \ p16(0xf100) +HYUNDAI_ECU_MANUFACTURING_DATE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ + p16(uds.DATA_IDENTIFIER_TYPE.ECU_MANUFACTURING_DATE) + HYUNDAI_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) # Regex patterns for parsing platform code, FW date, and part number from FW versions @@ -449,6 +452,17 @@ FW_QUERY_CONFIG = FwQueryConfig( obd_multiplexing=False, ), + # CAN & CAN FD query to understand the three digit date code + # HDA2 cars usually use 6 digit date codes, so skip bus 1 + Request( + [HYUNDAI_ECU_MANUFACTURING_DATE], + [HYUNDAI_VERSION_RESPONSE], + whitelist_ecus=[Ecu.fwdCamera], + bus=0, + auxiliary=True, + logging=True, + ), + # CAN & CAN FD logging queries (from camera) Request( [HYUNDAI_VERSION_REQUEST_LONG], diff --git a/selfdrive/car/tests/test_fw_fingerprint.py b/selfdrive/car/tests/test_fw_fingerprint.py index 73472b7a11..d8e3296985 100755 --- a/selfdrive/car/tests/test_fw_fingerprint.py +++ b/selfdrive/car/tests/test_fw_fingerprint.py @@ -254,7 +254,7 @@ class TestFwFingerprintTiming(unittest.TestCase): @pytest.mark.timeout(60) def test_fw_query_timing(self): - total_ref_time = {1: 5.85, 2: 6.65} + total_ref_time = {1: 5.95, 2: 6.85} brand_ref_times = { 1: { 'gm': 0.5, @@ -262,7 +262,7 @@ class TestFwFingerprintTiming(unittest.TestCase): 'chrysler': 0.3, 'ford': 0.1, 'honda': 0.55, - 'hyundai': 0.95, + 'hyundai': 1.05, 'mazda': 0.1, 'nissan': 0.8, 'subaru': 0.45, @@ -272,7 +272,7 @@ class TestFwFingerprintTiming(unittest.TestCase): }, 2: { 'ford': 0.2, - 'hyundai': 1.65, + 'hyundai': 1.85, } }