From 88f0d8611e638de644adc5feabade848c03d59e4 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 30 Jan 2024 00:12:01 -0800 Subject: [PATCH] preview: what multiple DIDs per ECU would look like in the future --- selfdrive/car/fw_query_definitions.py | 1 + selfdrive/car/gm/fingerprints.py | 14 ++++++++++++-- selfdrive/car/gm/values.py | 17 +++++++++++++---- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/selfdrive/car/fw_query_definitions.py b/selfdrive/car/fw_query_definitions.py index fcd0845e14..0c4c3f21f9 100755 --- a/selfdrive/car/fw_query_definitions.py +++ b/selfdrive/car/fw_query_definitions.py @@ -65,6 +65,7 @@ class StdQueries: @dataclass class Request: + label: str request: List[bytes] response: List[bytes] whitelist_ecus: List[int] = field(default_factory=list) diff --git a/selfdrive/car/gm/fingerprints.py b/selfdrive/car/gm/fingerprints.py index e4c6f659e5..d390932fba 100644 --- a/selfdrive/car/gm/fingerprints.py +++ b/selfdrive/car/gm/fingerprints.py @@ -58,6 +58,16 @@ FINGERPRINTS = { }], } -FW_VERSIONS: dict[str, dict[tuple, list[bytes]]] = { - CAR.BOLT_EUV: {}, +FW_VERSIONS = { + CAR.BOLT_EUV: { + # Require all to exact or fuzzy function match + (Ecu.fwdCamera, 0x24b, None): { + 'SoftwareModule1': [ + b'\x02\x8c\xf0)' # 42790953 + ], + 'EndModelPartNumber': [ + b"\x02\x8c\xf0'", # 42790951 + ], + } + }, } diff --git a/selfdrive/car/gm/values.py b/selfdrive/car/gm/values.py index 8188ad4e6e..fbbaab176e 100644 --- a/selfdrive/car/gm/values.py +++ b/selfdrive/car/gm/values.py @@ -169,15 +169,24 @@ GM_FW_REQUESTS = [ GM_RX_OFFSET = 0x400 FW_QUERY_CONFIG = FwQueryConfig( - requests=[request for req in GM_FW_REQUESTS for request in [ + requests=[ Request( - [StdQueries.SHORT_TESTER_PRESENT_REQUEST, req], - [StdQueries.SHORT_TESTER_PRESENT_RESPONSE, GM_FW_RESPONSE + bytes([req[-1]])], + "EndModelPartNumber", + [StdQueries.SHORT_TESTER_PRESENT_REQUEST, GM_END_MODEL_PART_NUMBER_REQUEST], + [StdQueries.SHORT_TESTER_PRESENT_RESPONSE, GM_FW_RESPONSE + bytes([GM_END_MODEL_PART_NUMBER_REQUEST[-1]])], rx_offset=GM_RX_OFFSET, bus=0, logging=True, ), - ]], + Request( + "SoftwareModule1", + [StdQueries.SHORT_TESTER_PRESENT_REQUEST, GM_SOFTWARE_MODULE_1_REQUEST], + [StdQueries.SHORT_TESTER_PRESENT_RESPONSE, GM_FW_RESPONSE + bytes([GM_SOFTWARE_MODULE_1_REQUEST[-1]])], + rx_offset=GM_RX_OFFSET, + bus=0, + logging=True, + ), + ], extra_ecus=[(Ecu.fwdCamera, 0x24b, None)], )