fix bad CAN fingerprint type (#30809)

fix bad wrong type
pull/30813/head
Shane Smiskol 2 years ago committed by GitHub
parent 5f04517677
commit 426072bd87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      selfdrive/car/fingerprints.py

@ -1,15 +1,12 @@
from typing import Dict, List
from openpilot.selfdrive.car.interfaces import get_interface_attr
OfflineCanFingerprints = Dict[str, List[Dict[int, int]]]
FW_VERSIONS = get_interface_attr('FW_VERSIONS', combine_brands=True, ignore_none=True)
_FINGERPRINTS = get_interface_attr('FINGERPRINTS', combine_brands=True, ignore_none=True)
_DEBUG_ADDRESS = {1880: 8} # reserved for debug purposes
def is_valid_for_fingerprint(msg, car_fingerprint: OfflineCanFingerprints):
def is_valid_for_fingerprint(msg, car_fingerprint: dict[int, int]):
adr = msg.address
# ignore addresses that are more than 11 bits
return (adr in car_fingerprint and car_fingerprint[adr] == len(msg.dat)) or adr >= 0x800

Loading…
Cancel
Save