From 38f28534dcf9c060cd82177cb64f3bc7530b3d2e Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Mon, 17 Jul 2023 16:56:13 -0700 Subject: [PATCH] Ford: fix CAN FD fingerprinting (#28995) * fix CAN FD fingerprinting for now * comment * this is the simplest for now * revert * cmt * todo and fixme! old-commit-hash: 047bb46d3a0e73d1c7160252bcb6f2f7358980ee --- selfdrive/car/ford/values.py | 14 ++++++-------- selfdrive/car/tests/test_fw_fingerprint.py | 4 ++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/selfdrive/car/ford/values.py b/selfdrive/car/ford/values.py index 1a9d048072..1410893f98 100644 --- a/selfdrive/car/ford/values.py +++ b/selfdrive/car/ford/values.py @@ -98,21 +98,19 @@ CAR_INFO: Dict[str, Union[CarInfo, List[CarInfo]]] = { FW_QUERY_CONFIG = FwQueryConfig( requests=[ + # CAN and CAN FD queries are combined. + # FIXME: For CAN FD, ECUs respond with frames larger than 8 bytes on the powertrain bus + # TODO: properly handle auxiliary requests to separate queries and add back whitelists Request( [StdQueries.TESTER_PRESENT_REQUEST, StdQueries.MANUFACTURER_SOFTWARE_VERSION_REQUEST], [StdQueries.TESTER_PRESENT_RESPONSE, StdQueries.MANUFACTURER_SOFTWARE_VERSION_RESPONSE], - whitelist_ecus=[Ecu.engine], - ), - Request( - [StdQueries.TESTER_PRESENT_REQUEST, StdQueries.MANUFACTURER_SOFTWARE_VERSION_REQUEST], - [StdQueries.TESTER_PRESENT_RESPONSE, StdQueries.MANUFACTURER_SOFTWARE_VERSION_RESPONSE], - whitelist_ecus=[Ecu.eps, Ecu.abs, Ecu.fwdRadar, Ecu.fwdCamera, Ecu.shiftByWire], - bus=0, + # whitelist_ecus=[Ecu.engine], + auxiliary=True, ), Request( [StdQueries.TESTER_PRESENT_REQUEST, StdQueries.MANUFACTURER_SOFTWARE_VERSION_REQUEST], [StdQueries.TESTER_PRESENT_RESPONSE, StdQueries.MANUFACTURER_SOFTWARE_VERSION_RESPONSE], - whitelist_ecus=[Ecu.eps, Ecu.abs, Ecu.fwdRadar, Ecu.fwdCamera, Ecu.engine, Ecu.shiftByWire], + # whitelist_ecus=[Ecu.eps, Ecu.abs, Ecu.fwdRadar, Ecu.fwdCamera, Ecu.shiftByWire], bus=0, auxiliary=True, ), diff --git a/selfdrive/car/tests/test_fw_fingerprint.py b/selfdrive/car/tests/test_fw_fingerprint.py index fd8c23263a..04e6f8c718 100755 --- a/selfdrive/car/tests/test_fw_fingerprint.py +++ b/selfdrive/car/tests/test_fw_fingerprint.py @@ -220,12 +220,12 @@ class TestFwFingerprintTiming(unittest.TestCase): print(f'get_vin, query time={vin_time / self.N} seconds') def test_fw_query_timing(self): - total_ref_time = 6.7 + total_ref_time = 6.6 brand_ref_times = { 1: { 'body': 0.1, 'chrysler': 0.3, - 'ford': 0.3, + 'ford': 0.2, 'honda': 0.5, 'hyundai': 0.7, 'mazda': 0.2,