This commit is contained in:
firestar5683
2026-07-18 19:17:25 -05:00
parent a106e222ca
commit 29cb892e1a
2 changed files with 26 additions and 1 deletions
+6 -1
View File
@@ -62,8 +62,13 @@ class CarInterface(CarInterfaceBase):
# A DSU bypass adapter reroutes the stock DSU messages to the camera bus.
# These messages are normally absent there on pre-TSS2 platforms.
# Require the native-bus message to be absent so startup relay mirroring is not mistaken for an adapter.
pt_fingerprint = fingerprint.get(0, {})
radar_fingerprint = fingerprint.get(1, {})
camera_fingerprint = fingerprint.get(2, {})
if not use_sdsu and candidate not in TSS2_CAR and (0x343 in camera_fingerprint or 0x4CB in camera_fingerprint):
has_dsu_bypass = ((0x343 in camera_fingerprint and 0x343 not in radar_fingerprint) or
(0x4CB in camera_fingerprint and 0x4CB not in pt_fingerprint))
if not use_sdsu and candidate not in TSS2_CAR and has_dsu_bypass:
ret.flags |= ToyotaFlags.DSU_BYPASS.value
# In TSS2 cars, the camera does long control
@@ -113,6 +113,26 @@ class TestToyotaInterfaces:
assert message not in can_parsers[Bus.pt].vl
assert message in can_parsers[Bus.cam].vl
@pytest.mark.parametrize(("native_bus", "message"), [(1, 0x343), (0, 0x4CB)])
def test_dsu_bypass_ignores_startup_bus_mirror(self, native_bus, message):
fingerprint = {bus: {} for bus in range(8)}
fingerprint[native_bus][message] = 8
fingerprint[2][message] = 8
car_params = CarInterface.get_params(
CAR.LEXUS_IS,
fingerprint,
[],
alpha_long=False,
is_release=False,
docs=False,
starpilot_toggles=SimpleNamespace(),
)
assert not car_params.flags & ToyotaFlags.DSU_BYPASS.value
assert not car_params.openpilotLongitudinalControl
assert car_params.safetyConfigs[0].safetyParam & ToyotaSafetyFlags.STOCK_LONGITUDINAL.value
def test_dsu_bypass_does_not_change_tss2_or_smart_dsu(self):
fingerprint = {bus: {} for bus in range(8)}
fingerprint[0][0x2FF] = 8