mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-30 19:12:07 +08:00
VIN: query physical addresses (#25122)
* Try engine and VMCU addrs for VIN * Add address for Honda * Update selfdrive/car/vin.py * Update selfdrive/car/vin.py * Update selfdrive/car/vin.py old-commit-hash: 0697ca223974f2361ca655506ceab7d18917b9de
This commit is contained in:
@@ -5,7 +5,6 @@ import traceback
|
||||
|
||||
import cereal.messaging as messaging
|
||||
import panda.python.uds as uds
|
||||
from panda.python.uds import FUNCTIONAL_ADDRS
|
||||
from selfdrive.car.isotp_parallel_query import IsoTpParallelQuery
|
||||
from system.swaglog import cloudlog
|
||||
|
||||
@@ -24,10 +23,11 @@ def is_valid_vin(vin: str):
|
||||
|
||||
|
||||
def get_vin(logcan, sendcan, bus, timeout=0.1, retry=5, debug=False):
|
||||
addrs = [0x7e0, 0x7e2, 0x18da10f1, 0x18da0ef1] # engine, VMCU, 29-bit engine, PGM-FI
|
||||
for i in range(retry):
|
||||
for request, response in ((UDS_VIN_REQUEST, UDS_VIN_RESPONSE), (OBD_VIN_REQUEST, OBD_VIN_RESPONSE)):
|
||||
try:
|
||||
query = IsoTpParallelQuery(sendcan, logcan, bus, FUNCTIONAL_ADDRS, [request, ], [response, ], functional_addr=True, debug=debug)
|
||||
query = IsoTpParallelQuery(sendcan, logcan, bus, addrs, [request, ], [response, ], debug=debug)
|
||||
for (addr, rx_addr), vin in query.get_data(timeout).items():
|
||||
|
||||
# Honda Bosch response starts with a length, trim to correct length
|
||||
|
||||
Reference in New Issue
Block a user