mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-06 05:52:12 +08:00
VIN: lower retries (#31471)
* lower retries * comment old-commit-hash: 9acc55861cfe5f78bca6d46762b38c4f5903ea6c
This commit is contained in:
@@ -141,9 +141,10 @@ def fingerprint(logcan, sendcan, num_pandas):
|
||||
cached = True
|
||||
else:
|
||||
cloudlog.warning("Getting VIN & FW versions")
|
||||
# enable OBD multiplexing for Vin query, also allows time for sendcan subscriber to connect
|
||||
# enable OBD multiplexing for VIN query
|
||||
# NOTE: this takes ~0.1s and is relied on to allow sendcan subscriber to connect in time
|
||||
set_obd_multiplexing(params, True)
|
||||
# Vin query only reliably works through OBDII
|
||||
# VIN query only reliably works through OBDII
|
||||
vin_rx_addr, vin_rx_bus, vin = get_vin(logcan, sendcan, (0, 1))
|
||||
ecu_rx_addrs = get_present_ecus(logcan, sendcan, num_pandas=num_pandas)
|
||||
car_fw = get_fw_versions_ordered(logcan, sendcan, ecu_rx_addrs, num_pandas=num_pandas)
|
||||
|
||||
@@ -225,7 +225,7 @@ class TestFwFingerprintTiming(unittest.TestCase):
|
||||
|
||||
def test_startup_timing(self):
|
||||
# Tests worse-case VIN query time and typical present ECU query time
|
||||
vin_ref_times = {'worst': 1.5, 'best': 0.5} # best assumes we go through all queries to get a match
|
||||
vin_ref_times = {'worst': 1.0, 'best': 0.5} # best assumes we go through all queries to get a match
|
||||
present_ecu_ref_time = 0.75
|
||||
|
||||
def fake_get_ecu_addrs(*_, timeout):
|
||||
|
||||
@@ -15,7 +15,7 @@ def is_valid_vin(vin: str):
|
||||
return re.fullmatch(VIN_RE, vin) is not None
|
||||
|
||||
|
||||
def get_vin(logcan, sendcan, buses, timeout=0.1, retry=3, debug=False):
|
||||
def get_vin(logcan, sendcan, buses, timeout=0.1, retry=2, debug=False):
|
||||
for i in range(retry):
|
||||
for bus in buses:
|
||||
for request, response, valid_buses, vin_addrs, functional_addrs, rx_offset in (
|
||||
|
||||
Reference in New Issue
Block a user