@@ -75,6 +75,10 @@ def _get_interface_names() -> Dict[str, List[str]]:
75
75
interfaces = load_interfaces (interface_names )
76
76
77
77
78
+ def only_toyota_left (candidate_cars ):
79
+ return all (("TOYOTA" in c or "LEXUS" in c ) for c in candidate_cars ) and len (candidate_cars ) > 0
80
+
81
+
78
82
# **** for use live only ****
79
83
def fingerprint (logcan , sendcan ):
80
84
fixed_fingerprint = os .environ .get ('FINGERPRINT' , "" )
@@ -134,13 +138,19 @@ def fingerprint(logcan, sendcan):
134
138
finger [can .src ][can .address ] = len (can .dat )
135
139
136
140
for b in candidate_cars :
141
+ # Include bus 2 for toyotas to disambiguate cars using camera messages
142
+ # (ideally should be done for all cars but we can't for Honda Bosch)
137
143
# Ignore extended messages and VIN query response.
138
- if can .src == b and can .address < 0x800 and can .address not in (0x7df , 0x7e0 , 0x7e8 ):
144
+ if (can .src == b or (only_toyota_left (candidate_cars [b ]) and can .src == 2 )) and \
145
+ can .address < 0x800 and can .address not in (0x7df , 0x7e0 , 0x7e8 ):
139
146
candidate_cars [b ] = eliminate_incompatible_cars (can , candidate_cars [b ])
140
147
141
148
# if we only have one car choice and the time since we got our first
142
149
# message has elapsed, exit
143
150
for b in candidate_cars :
151
+ # Toyota needs higher time to fingerprint, since DSU does not broadcast immediately
152
+ if only_toyota_left (candidate_cars [b ]):
153
+ frame_fingerprint = 100 # 1s
144
154
if len (candidate_cars [b ]) == 1 and frame > frame_fingerprint :
145
155
# fingerprint done
146
156
car_fingerprint = candidate_cars [b ][0 ]
0 commit comments