use major version

pull/28641/head
Shane Smiskol 2 years ago
parent d194947d91
commit 780a66fc5f
  1. 41
      selfdrive/car/toyota/tests/test_toyota.py
  2. 7
      selfdrive/car/toyota/values.py

@ -148,30 +148,35 @@ class TestToyotaFingerprint(unittest.TestCase):
# Asserts a list of platforms that will not fuzzy fingerprint with platform codes due to them being shared. # Asserts a list of platforms that will not fuzzy fingerprint with platform codes due to them being shared.
# This list can be shrunk as we combine platforms, detect features, and add the hybrid ECU # This list can be shrunk as we combine platforms, detect features, and add the hybrid ECU
excluded_platforms = { excluded_platforms = {
CAR.LEXUS_ESH_TSS2, # # CAR.LEXUS_ESH_TSS2,
CAR.RAV4_TSS2_2022, # # CAR.RAV4_TSS2_2022,
CAR.LEXUS_ES_TSS2, CAR.LEXUS_ES_TSS2,
CAR.RAV4_TSS2, # # CAR.RAV4_TSS2,
CAR.RAV4_TSS2_2023, # # CAR.RAV4_TSS2_2023,
CAR.CAMRY, # CAR.RAV4_TSS2,
CAR.HIGHLANDER_TSS2, # # CAR.CAMRY,
CAR.RAV4H_TSS2, # CAR.HIGHLANDER_TSS2,
# CAR.RAV4H_TSS2,
CAR.LEXUS_RX_TSS2, CAR.LEXUS_RX_TSS2,
CAR.CAMRYH_TSS2, # # CAR.CAMRYH_TSS2,
CAR.CHR, # CAR.CHR,
CAR.RAV4H, # # CAR.RAV4H,
CAR.RAV4H_TSS2_2022, # CAR.RAV4H_TSS2_2022,
CAR.HIGHLANDERH_TSS2, # # CAR.HIGHLANDERH_TSS2,
CAR.RAV4, # # CAR.RAV4,
CAR.CHR_TSS2, # # CAR.CHR_TSS2,
CAR.CHRH, # CAR.CHRH,
CAR.RAV4H_TSS2_2023, # CAR.RAV4H_TSS2_2023,
CAR.CAMRY_TSS2, # CAR.CAMRY_TSS2,
CAR.COROLLA_TSS2, # CAR.COROLLA_TSS2,
} }
platforms_with_shared_codes = set() platforms_with_shared_codes = set()
for platform, fw_by_addr in FW_VERSIONS.items(): for platform, fw_by_addr in FW_VERSIONS.items():
# if platform != CAR.RAV4_TSS2:
# continue
# if 'RAV4 HYBRID' not in platform:
# continue
print('platform', platform) print('platform', platform)
car_fw = [] car_fw = []
for ecu, fw_versions in fw_by_addr.items(): for ecu, fw_versions in fw_by_addr.items():

@ -259,9 +259,6 @@ def get_platform_codes(fw_versions: List[bytes]) -> Set[Tuple[bytes, Optional[by
if not len(chunks): if not len(chunks):
continue continue
# a = list(map(len, chunks))
# print(fw, chunks, a)
# only first is considered for now since second is commonly shared (TODO: understand that) # only first is considered for now since second is commonly shared (TODO: understand that)
first_chunk = chunks[0] first_chunk = chunks[0]
if len(first_chunk) == 8: if len(first_chunk) == 8:
@ -274,7 +271,7 @@ def get_platform_codes(fw_versions: List[bytes]) -> Set[Tuple[bytes, Optional[by
codes.add((platform + b'-' + major_version, sub_version)) codes.add((platform + b'-' + major_version, sub_version))
elif len(first_chunk) == 10: elif len(first_chunk) == 10:
print('medium fw', fw) # print('medium fw', fw)
fw_match = MEDIUM_FW_PATTERN.search(first_chunk) fw_match = MEDIUM_FW_PATTERN.search(first_chunk)
if fw_match is not None: if fw_match is not None:
part, platform, major_version, sub_version = fw_match.groups() part, platform, major_version, sub_version = fw_match.groups()
@ -289,7 +286,7 @@ def get_platform_codes(fw_versions: List[bytes]) -> Set[Tuple[bytes, Optional[by
# print('got long match!') # print('got long match!')
part, platform, major_version, sub_version = fw_match.groups() part, platform, major_version, sub_version = fw_match.groups()
# print(first_chunk, fw_match, fw_match.groups()) # print(first_chunk, fw_match, fw_match.groups())
codes.add((part + b'-' + platform, major_version + b'-' + sub_version)) codes.add((part + b'-' + platform + b'-' + major_version, sub_version))
return codes return codes

Loading…
Cancel
Save