Nissan Altima: fix fingerprinting without comma power (#3418)

* add pt bus fp

* fix

* add missing engine

* keep for now

* bump
This commit is contained in:
Shane Smiskol
2026-05-28 19:31:22 -07:00
committed by GitHub
parent 8a06aa7330
commit 8580dc4b4f
3 changed files with 16 additions and 9 deletions

View File

@@ -16,6 +16,7 @@ FW_VERSIONS = {
(Ecu.engine, 0x7e0, None): [
b'237106GU3B',
b'237109HE2B',
b'237106GV3A',
],
(Ecu.gateway, 0x18dad0f1, None): [
b'284U29HE0A',

View File

@@ -93,41 +93,47 @@ NISSAN_VERSION_RESPONSE_KWP = b'\x61\x83'
NISSAN_RX_OFFSET = 0x20
# TODO: once we gather enough Altima data on PT bus (1), we can remove OBD queries to speed up fingerprinting
FW_QUERY_CONFIG = FwQueryConfig(
requests=[request for bus, logging in ((0, False), (1, True)) for request in [
requests=[request for bus, obd_multiplexing in ((0, False), (1, False), (1, True)) for request in [
Request(
[NISSAN_DIAGNOSTIC_REQUEST_KWP, NISSAN_VERSION_REQUEST_KWP],
[NISSAN_DIAGNOSTIC_RESPONSE_KWP, NISSAN_VERSION_RESPONSE_KWP],
bus=bus,
logging=logging,
logging=obd_multiplexing,
obd_multiplexing=obd_multiplexing,
),
Request(
[NISSAN_DIAGNOSTIC_REQUEST_KWP, NISSAN_VERSION_REQUEST_KWP],
[NISSAN_DIAGNOSTIC_RESPONSE_KWP, NISSAN_VERSION_RESPONSE_KWP],
rx_offset=NISSAN_RX_OFFSET,
bus=bus,
logging=logging,
logging=obd_multiplexing,
obd_multiplexing=obd_multiplexing,
),
# Rogue's engine solely responds to this
Request(
[NISSAN_DIAGNOSTIC_REQUEST_KWP_2, NISSAN_VERSION_REQUEST_KWP],
[NISSAN_DIAGNOSTIC_RESPONSE_KWP_2, NISSAN_VERSION_RESPONSE_KWP],
bus=bus,
logging=logging,
logging=obd_multiplexing,
obd_multiplexing=obd_multiplexing,
),
Request(
[StdQueries.MANUFACTURER_SOFTWARE_VERSION_REQUEST],
[StdQueries.MANUFACTURER_SOFTWARE_VERSION_RESPONSE],
rx_offset=NISSAN_RX_OFFSET,
bus=bus,
logging=logging,
logging=obd_multiplexing,
obd_multiplexing=obd_multiplexing,
),
# Some newer Altima engines respond at normal rx offset
Request(
[StdQueries.MANUFACTURER_SOFTWARE_VERSION_REQUEST],
[StdQueries.MANUFACTURER_SOFTWARE_VERSION_RESPONSE],
bus=bus,
logging=logging,
logging=obd_multiplexing,
obd_multiplexing=obd_multiplexing,
),
]],
)

View File

@@ -232,7 +232,7 @@ class TestFwFingerprintTiming(unittest.TestCase):
return self.total_time / self.N
def _assert_timing(self, avg_time, ref_time):
assert avg_time < ref_time + self.TOL
assert avg_time < ref_time + self.TOL, avg_time
assert avg_time > ref_time - self.TOL, "Performance seems to have improved, update test refs."
def test_startup_timing(self):
@@ -262,7 +262,7 @@ class TestFwFingerprintTiming(unittest.TestCase):
print(f'get_vin {name} case, query time={self.total_time / self.N} seconds')
def test_fw_query_timing(self):
total_ref_time = 7.6
total_ref_time = 8.2
brand_ref_times = {
'gm': 1.0,
'body': 0.1,
@@ -271,7 +271,7 @@ class TestFwFingerprintTiming(unittest.TestCase):
'honda': 0.45,
'hyundai': 0.65,
'mazda': 0.1,
'nissan': 1.0,
'nissan': 1.6,
'subaru': 0.65,
'tesla': 0.1,
'toyota': 0.7,