|
|
@ -18,10 +18,7 @@ def is_valid_vin(vin: str): |
|
|
|
def get_vin(logcan, sendcan, buses, timeout=0.1, retry=3, debug=False): |
|
|
|
def get_vin(logcan, sendcan, buses, timeout=0.1, retry=3, debug=False): |
|
|
|
for i in range(retry): |
|
|
|
for i in range(retry): |
|
|
|
for bus in buses: |
|
|
|
for bus in buses: |
|
|
|
# TODO: can you send to 0x7df on bolt? |
|
|
|
for request, response in ((StdQueries.UDS_VIN_REQUEST, StdQueries.UDS_VIN_RESPONSE), (StdQueries.OBD_VIN_REQUEST, StdQueries.OBD_VIN_RESPONSE)): |
|
|
|
for request, response, vin_addrs, rx_offset in ((StdQueries.GM_VIN_REQUEST, StdQueries.GM_VIN_RESPONSE, STANDARD_VIN_ADDRS + [0x24b], 0x400), |
|
|
|
|
|
|
|
(StdQueries.UDS_VIN_REQUEST, StdQueries.UDS_VIN_RESPONSE, STANDARD_VIN_ADDRS, 0x8), |
|
|
|
|
|
|
|
(StdQueries.OBD_VIN_REQUEST, StdQueries.OBD_VIN_RESPONSE, STANDARD_VIN_ADDRS, 0x8)): |
|
|
|
|
|
|
|
try: |
|
|
|
try: |
|
|
|
query = IsoTpParallelQuery(sendcan, logcan, bus, STANDARD_VIN_ADDRS, [request, ], [response, ], functional_addrs=FUNCTIONAL_ADDRS, debug=debug) |
|
|
|
query = IsoTpParallelQuery(sendcan, logcan, bus, STANDARD_VIN_ADDRS, [request, ], [response, ], functional_addrs=FUNCTIONAL_ADDRS, debug=debug) |
|
|
|
results = query.get_data(timeout) |
|
|
|
results = query.get_data(timeout) |
|
|
|