|
1 | 1 | import numpy as np
|
2 | 2 | from opendbc.car import Bus, get_safety_config, structs
|
| 3 | +from opendbc.car.carlog import carlog |
3 | 4 | from opendbc.car.common.conversions import Conversions as CV
|
4 | 5 | from opendbc.car.ford.fordcan import CanBus
|
5 | 6 | from opendbc.car.ford.values import CarControllerParams, DBC, Ecu, FordFlags, RADAR, FordSafetyFlags
|
@@ -47,17 +48,25 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime
|
47 | 48 |
|
48 | 49 | if ret.flags & FordFlags.CANFD:
|
49 | 50 | ret.safetyConfigs[-1].safetyParam |= FordSafetyFlags.CANFD.value
|
| 51 | + |
| 52 | + # TRON (SecOC) platforms are not supported |
| 53 | + # LateralMotionControl2, ACCDATA are 16 bytes on these platforms |
| 54 | + if fingerprint[CAN.camera].get(0x3d6) != 8 or fingerprint[CAN.camera].get(0x186) != 8: |
| 55 | + carlog.error('dashcamOnly: SecOC is unsupported') |
| 56 | + ret.dashcamOnly = True |
50 | 57 | else:
|
51 | 58 | # Lock out if the car does not have needed lateral and longitudinal control APIs.
|
52 | 59 | # Note that we also check CAN for adaptive cruise, but no known signal for LCA exists
|
53 | 60 | pscm_config = next((fw for fw in car_fw if fw.ecu == Ecu.eps and b'\x22\xDE\x01' in fw.request), None)
|
54 | 61 | if pscm_config:
|
55 | 62 | if len(pscm_config.fwVersion) != 24:
|
| 63 | + carlog.error('dashcamOnly: Invalid EPS FW version') |
56 | 64 | ret.dashcamOnly = True
|
57 | 65 | else:
|
58 | 66 | config_tja = pscm_config.fwVersion[7] # Traffic Jam Assist
|
59 | 67 | config_lca = pscm_config.fwVersion[8] # Lane Centering Assist
|
60 | 68 | if config_tja != 0xFF or config_lca != 0xFF:
|
| 69 | + carlog.error('dashcamOnly: Car lacks required lateral control APIs') |
61 | 70 | ret.dashcamOnly = True
|
62 | 71 |
|
63 | 72 | # Auto Transmission: 0x732 ECU or Gear_Shift_by_Wire_FD1
|
|
0 commit comments