mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-03-03 02:33:53 +08:00
@@ -8,7 +8,7 @@ from system.version import is_comma_remote, is_tested_branch
|
||||
from selfdrive.car.interfaces import get_interface_attr
|
||||
from selfdrive.car.fingerprints import eliminate_incompatible_cars, all_legacy_fingerprint_cars
|
||||
from selfdrive.car.vin import get_vin, is_valid_vin, VIN_UNKNOWN
|
||||
from selfdrive.car.fw_versions import get_fw_versions_ordered, match_fw_to_car, get_present_ecus
|
||||
from selfdrive.car.fw_versions import disable_obd_multiplexing, get_fw_versions_ordered, match_fw_to_car, get_present_ecus
|
||||
from system.swaglog import cloudlog
|
||||
import cereal.messaging as messaging
|
||||
from selfdrive.car import gen_empty_fingerprint
|
||||
@@ -116,6 +116,7 @@ def fingerprint(logcan, sendcan, num_pandas):
|
||||
|
||||
params = Params()
|
||||
params.put("CarVin", vin)
|
||||
disable_obd_multiplexing(params)
|
||||
|
||||
finger = gen_empty_fingerprint()
|
||||
candidate_cars = {i: all_legacy_fingerprint_cars() for i in [0, 1]} # attempt fingerprint on both bus 0 and 1
|
||||
|
||||
@@ -198,6 +198,15 @@ def get_brand_ecu_matches(ecu_rx_addrs):
|
||||
return brand_matches
|
||||
|
||||
|
||||
def disable_obd_multiplexing(params):
|
||||
if not params.get_bool("ObdMultiplexingDisabled"):
|
||||
params.put_bool("FirmwareObdQueryDone", True)
|
||||
|
||||
cloudlog.warning("Waiting for OBD multiplexing to be disabled")
|
||||
params.get_bool("ObdMultiplexingDisabled", block=True)
|
||||
cloudlog.warning("OBD multiplexing disabled")
|
||||
|
||||
|
||||
def get_fw_versions_ordered(logcan, sendcan, ecu_rx_addrs, timeout=0.1, num_pandas=1, debug=False, progress=False):
|
||||
"""Queries for FW versions ordering brands by likelihood, breaks when exact match is found"""
|
||||
|
||||
@@ -214,14 +223,9 @@ def get_fw_versions_ordered(logcan, sendcan, ecu_rx_addrs, timeout=0.1, num_pand
|
||||
matched_brand = brand
|
||||
break
|
||||
|
||||
disable_obd_multiplexing(Params())
|
||||
|
||||
# Do non-OBD queries for matched brand, or all if no match is found
|
||||
params = Params()
|
||||
params.put_bool("FirmwareObdQueryDone", True)
|
||||
|
||||
cloudlog.warning("Waiting for OBD multiplexing to be disabled")
|
||||
params.get_bool("ObdMultiplexingDisabled", block=True)
|
||||
cloudlog.warning("OBD multiplexing disabled")
|
||||
|
||||
for brand in FW_QUERY_CONFIGS.keys():
|
||||
if brand == matched_brand or matched_brand is None:
|
||||
all_car_fw.extend(get_fw_versions(logcan, sendcan, query_brand=brand, timeout=timeout, num_pandas=num_pandas, obd_multiplexed=False, debug=debug, progress=progress))
|
||||
|
||||
Reference in New Issue
Block a user