|
|
@ -67,19 +67,20 @@ def can_fingerprint(logcan: SimpleNamespace) -> tuple[str | None, dict[int, dict |
|
|
|
if can.src == b and can.address < 0x800 and can.address not in (0x7df, 0x7e0, 0x7e8): |
|
|
|
if can.src == b and can.address < 0x800 and can.address not in (0x7df, 0x7e0, 0x7e8): |
|
|
|
candidate_cars[b] = eliminate_incompatible_cars(can, candidate_cars[b]) |
|
|
|
candidate_cars[b] = eliminate_incompatible_cars(can, candidate_cars[b]) |
|
|
|
|
|
|
|
|
|
|
|
# if we only have one car choice and the time since we got our first |
|
|
|
if len(can_packet) > 0: |
|
|
|
# message has elapsed, exit |
|
|
|
# if we only have one car choice and the time since we got our first |
|
|
|
for b in candidate_cars: |
|
|
|
# message has elapsed, exit |
|
|
|
if len(candidate_cars[b]) == 1 and frame > FRAME_FINGERPRINT: |
|
|
|
for b in candidate_cars: |
|
|
|
# fingerprint done |
|
|
|
if len(candidate_cars[b]) == 1 and frame > FRAME_FINGERPRINT: |
|
|
|
car_fingerprint = candidate_cars[b][0] |
|
|
|
# fingerprint done |
|
|
|
|
|
|
|
car_fingerprint = candidate_cars[b][0] |
|
|
|
# bail if no cars left or we've been waiting for more than 2s |
|
|
|
|
|
|
|
failed = (all(len(cc) == 0 for cc in candidate_cars.values()) and frame > FRAME_FINGERPRINT) or frame > 200 |
|
|
|
# bail if no cars left or we've been waiting for more than 2s |
|
|
|
succeeded = car_fingerprint is not None |
|
|
|
failed = (all(len(cc) == 0 for cc in candidate_cars.values()) and frame > FRAME_FINGERPRINT) or frame > 200 |
|
|
|
done = failed or succeeded |
|
|
|
succeeded = car_fingerprint is not None |
|
|
|
|
|
|
|
done = failed or succeeded |
|
|
|
frame += 1 |
|
|
|
|
|
|
|
|
|
|
|
frame += 1 |
|
|
|
|
|
|
|
|
|
|
|
return car_fingerprint, finger |
|
|
|
return car_fingerprint, finger |
|
|
|
|
|
|
|
|
|
|
|