From 0ffff6ffa15b7fb4553a8884807fb0f2cd360a69 Mon Sep 17 00:00:00 2001 From: Martin Lillepuu Date: Fri, 30 Jul 2021 21:48:58 +0300 Subject: [PATCH] Add multiple offsets for Nissan --- selfdrive/car/fw_versions.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/selfdrive/car/fw_versions.py b/selfdrive/car/fw_versions.py index 6b7983d22d..d714b20a30 100755 --- a/selfdrive/car/fw_versions.py +++ b/selfdrive/car/fw_versions.py @@ -77,7 +77,10 @@ MAZDA_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40 NISSAN_VERSION_REQUEST = b'\x21\x84' NISSAN_VERSION_RESPONSE = b'\x61\x84' -NISSAN_RX_OFFSET = 0x20 +NISSAN_RX_OFFSET1 = 0x20 +NISSAN_RX_OFFSET2 = 0x2 +NISSAN_RX_OFFSET3 = 0x3 +NISSAN_RX_OFFSET4 = 0x37 # brand, request, response, response offset REQUESTS = [ @@ -147,6 +150,25 @@ REQUESTS = [ [NISSAN_VERSION_RESPONSE], NISSAN_RX_OFFSET, ), + ( + "nissan", + [NISSAN_VERSION_REQUEST], + [NISSAN_VERSION_RESPONSE], + NISSAN_RX_OFFSET2, + ), + ( + "nissan", + [NISSAN_VERSION_REQUEST], + [NISSAN_VERSION_RESPONSE], + NISSAN_RX_OFFSET3, + ), + ( + "nissan", + [NISSAN_VERSION_REQUEST], + [NISSAN_VERSION_RESPONSE], + NISSAN_RX_OFFSET4, + ), + ]