From bb53d88da155f5608fe60c5c83941b1526be5bab Mon Sep 17 00:00:00 2001 From: Martin Lillepuu Date: Sat, 31 Jul 2021 13:27:28 +0300 Subject: [PATCH] Nissan FPv2: more RX offsets, add no diagostic request scan for 0x20 --- selfdrive/car/fw_versions.py | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/selfdrive/car/fw_versions.py b/selfdrive/car/fw_versions.py index 5f7a8ab085..e363a6b458 100755 --- a/selfdrive/car/fw_versions.py +++ b/selfdrive/car/fw_versions.py @@ -80,11 +80,12 @@ NISSAN_VERSION_RESPONSE = b'\x61\x83' #NISSAN_VERSION_REQUEST = b'\x21\x84' #NISSAN_VERSION_RESPONSE = b'\x61\x84' -NISSAN_RX_OFFSET1 = 0x20 -NISSAN_RX_OFFSET2 = 0x2 -NISSAN_RX_OFFSET3 = 0x3 -NISSAN_RX_OFFSET4 = 0x37 -NISSAN_RX_OFFSET5 = 0x8 +NISSAN_RX_OFFSET1 = 0x1 +NISSAN_RX_OFFSET2 = 0x3 +NISSAN_RX_OFFSET3 = 0x8 +NISSAN_RX_OFFSET4 = 0x20 +NISSAN_RX_OFFSET5 = 0x22 +NISSAN_RX_OFFSET6 = 0x37 # brand, request, response, response offset REQUESTS = [ @@ -178,6 +179,20 @@ REQUESTS = [ [NISSAN_DIAGNOSTIC_RESPONSE, NISSAN_VERSION_RESPONSE], NISSAN_RX_OFFSET5, ), + ( + "nissan", + [NISSAN_DIAGNOSTIC_REQUEST, NISSAN_VERSION_REQUEST], + [NISSAN_DIAGNOSTIC_RESPONSE, NISSAN_VERSION_RESPONSE], + NISSAN_RX_OFFSET6, + ), + # RX offset 0x20 without diagnostic request + ( + "nissan", + [NISSAN_VERSION_REQUEST], + [NISSAN_VERSION_RESPONSE], + NISSAN_RX_OFFSET4, + ), + ]