fix bad CAN fingerprint type (#30809)

fix bad wrong type
old-commit-hash: 426072bd8717753afec89c4291f329bdedbc31b8
This commit is contained in:
Shane Smiskol
2023-12-19 20:30:42 -08:00
committed by GitHub
parent 8056fe5aff
commit b7811099e4

View File

@@ -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