Skip to content

Commit

Permalink
fix bad CAN fingerprint type (commaai#30809)
Browse files Browse the repository at this point in the history
fix bad wrong type
  • Loading branch information
sshane authored Dec 20, 2023
1 parent 5f04517 commit 426072b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions selfdrive/car/fingerprints.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 426072b

Please sign in to comment.