|
|
|
@ -11,7 +11,7 @@ from cereal import car |
|
|
|
|
from openpilot.selfdrive.car.car_helpers import interfaces |
|
|
|
|
from openpilot.selfdrive.car.fingerprints import FW_VERSIONS |
|
|
|
|
from openpilot.selfdrive.car.fw_versions import FW_QUERY_CONFIGS, FUZZY_EXCLUDE_ECUS, VERSIONS, build_fw_dict, \ |
|
|
|
|
match_fw_to_car, get_fw_versions, get_present_ecus |
|
|
|
|
match_fw_to_car, get_brand_ecu_matches, get_fw_versions, get_present_ecus |
|
|
|
|
from openpilot.selfdrive.car.vin import get_vin |
|
|
|
|
|
|
|
|
|
CarFw = car.CarParams.CarFw |
|
|
|
@ -178,6 +178,14 @@ class TestFwFingerprint(unittest.TestCase): |
|
|
|
|
self.assertFalse(request_obj.auxiliary and request_obj.bus == 1 and request_obj.obd_multiplexing, |
|
|
|
|
f"{brand.title()}: OBD multiplexed request is marked auxiliary: {request_obj}") |
|
|
|
|
|
|
|
|
|
def test_brand_ecu_matches(self): |
|
|
|
|
empty_response = {brand: set() for brand in FW_QUERY_CONFIGS} |
|
|
|
|
self.assertEqual(get_brand_ecu_matches(set()), empty_response) |
|
|
|
|
|
|
|
|
|
# we ignore bus |
|
|
|
|
expected_response = empty_response | {'toyota': {(0x750, 0xf)}} |
|
|
|
|
self.assertEqual(get_brand_ecu_matches({(0x758, 0xf, 99)}), expected_response) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestFwFingerprintTiming(unittest.TestCase): |
|
|
|
|
N: int = 5 |
|
|
|
|