Merge remote-tracking branch 'upstream/master' into fuzzy-fp-count-ecu-matches-not-fw-matches

pull/28423/head
Shane Smiskol 2 years ago
commit 352a41b937
  1. 2
      panda
  2. 6
      selfdrive/car/chrysler/values.py
  3. 15
      selfdrive/car/fw_versions.py
  4. 11
      selfdrive/car/volkswagen/values.py

@ -1 +1 @@
Subproject commit 5847d7dbc05df3bc76243b6704b9d98544eb53df
Subproject commit bf2c0071036bae4e0c00c37ae43237fce6063e31

@ -227,6 +227,7 @@ FW_VERSIONS = {
b'68510283AG',
b'68527346AE',
b'68527375AD',
b'68527382AE',
],
(Ecu.srs, 0x744, None): [
b'68428609AB',
@ -254,6 +255,7 @@ FW_VERSIONS = {
(Ecu.fwdRadar, 0x753, None): [
b'04672892AB',
b'04672932AB',
b'22DTRHD_AA',
b'68320950AH',
b'68320950AI',
b'68320950AJ',
@ -265,8 +267,10 @@ FW_VERSIONS = {
b'68475160AG',
],
(Ecu.eps, 0x75A, None): [
b'21590101AA',
b'68273275AF',
b'68273275AG',
b'68273275AH',
b'68312176AE',
b'68312176AG',
b'68440789AC',
@ -283,7 +287,9 @@ FW_VERSIONS = {
b'05036065AE ',
b'05036066AE ',
b'05149846AA ',
b'05149848AA ',
b'68378701AI ',
b'68378748AL ',
b'68378758AM ',
b'68448163AJ',
b'68448165AK',

@ -28,11 +28,16 @@ def chunks(l, n=128):
yield l[i:i + n]
def is_brand(brand: str, filter_brand: Optional[str]) -> bool:
"""Returns if brand matches filter_brand or no brand filter is specified"""
return filter_brand is None or brand == filter_brand
def build_fw_dict(fw_versions: List[capnp.lib.capnp._DynamicStructBuilder],
filter_brand: Optional[str] = None) -> Dict[Tuple[int, Optional[int]], Set[bytes]]:
fw_versions_dict = defaultdict(set)
for fw in fw_versions:
if (filter_brand is None or fw.brand == filter_brand) and not fw.logging:
if is_brand(fw.brand, filter_brand) and not fw.logging:
sub_addr = fw.subAddress if fw.subAddress != 0 else None
fw_versions_dict[(fw.address, sub_addr)].add(fw.fwVersion)
return dict(fw_versions_dict)
@ -95,7 +100,7 @@ def match_fw_to_car_fuzzy(fw_versions_dict, log=True, exclude=None):
return set()
def match_fw_to_car_exact(fw_versions_dict) -> Set[str]:
def match_fw_to_car_exact(fw_versions_dict, log=True) -> Set[str]:
"""Do an exact FW match. Returns all cars that match the given
FW versions for a list of "essential" ECUs. If an ECU is not considered
essential the FW version can be missing to get a fingerprint, but if it's present it
@ -130,7 +135,7 @@ def match_fw_to_car_exact(fw_versions_dict) -> Set[str]:
return set(candidates.keys()) - set(invalid)
def match_fw_to_car(fw_versions, allow_exact=True, allow_fuzzy=True):
def match_fw_to_car(fw_versions, allow_exact=True, allow_fuzzy=True, log=True):
# Try exact matching first
exact_matches = []
if allow_exact:
@ -143,7 +148,7 @@ def match_fw_to_car(fw_versions, allow_exact=True, allow_fuzzy=True):
matches = set()
for brand in VERSIONS.keys():
fw_versions_dict = build_fw_dict(fw_versions, filter_brand=brand)
matches |= match_func(fw_versions_dict)
matches |= match_func(fw_versions_dict, log=log)
if len(matches):
return exact_match, matches
@ -278,7 +283,7 @@ def get_fw_versions(logcan, sendcan, query_brand=None, extra=None, timeout=0.1,
# Get versions and build capnp list to put into CarParams
car_fw = []
requests = [(brand, config, r) for brand, config, r in REQUESTS if query_brand is None or brand == query_brand]
requests = [(brand, config, r) for brand, config, r in REQUESTS if is_brand(brand, query_brand)]
for addr in tqdm(addrs, disable=not progress):
for addr_chunk in chunks(addr):
for brand, config, r in requests:

@ -923,6 +923,7 @@ FW_VERSIONS = {
b'\xf1\x8704E906027CJ\xf1\x897798',
b'\xf1\x8704L997022N \xf1\x899459',
b'\xf1\x875G0906259A \xf1\x890004',
b'\xf1\x875G0906259D \xf1\x890002',
b'\xf1\x875G0906259L \xf1\x890002',
b'\xf1\x875G0906259Q \xf1\x890002',
b'\xf1\x878V0906259F \xf1\x890002',
@ -932,7 +933,7 @@ FW_VERSIONS = {
b'\xf1\x878V0906264B \xf1\x890003',
b'\xf1\x878V0907115B \xf1\x890007',
b'\xf1\x878V0907404A \xf1\x890005',
b'\xf1\x875G0906259D \xf1\x890002',
b'\xf1\x878V0907404G \xf1\x890005',
],
(Ecu.transmission, 0x7e1, None): [
b'\xf1\x870CW300044T \xf1\x895245',
@ -949,6 +950,7 @@ FW_VERSIONS = {
b'\xf1\x870DD300046F \xf1\x891602',
b'\xf1\x870DD300046G \xf1\x891601',
b'\xf1\x870DL300012E \xf1\x892012',
b'\xf1\x870DL300012H \xf1\x892112',
b'\xf1\x870GC300011 \xf1\x890403',
b'\xf1\x870GC300013M \xf1\x892402',
b'\xf1\x870GC300042J \xf1\x891402',
@ -961,9 +963,9 @@ FW_VERSIONS = {
b'\xf1\x875Q0959655BJ\xf1\x890339\xf1\x82\x1311110011131100311111011731179321342100',
b'\xf1\x875Q0959655J \xf1\x890825\xf1\x82\x13111112111111--241115141112221291163221',
b'\xf1\x875Q0959655J \xf1\x890825\xf1\x82\023111112111111--171115141112221291163221',
b'\xf1\x875Q0959655J \xf1\x890830\xf1\x82\023121111111211--261117141112231291163221',
b'\xf1\x875Q0959655J \xf1\x890830\xf1\x82\x13111112111111--241115141112221291163221',
b'\xf1\x875Q0959655J \xf1\x890830\xf1\x82\x13121111111111--341117141212231291163221',
b'\xf1\x875Q0959655J \xf1\x890830\xf1\x82\x13121111111211--261117141112231291163221',
b'\xf1\x875Q0959655N \xf1\x890361\xf1\x82\0211212001112110004110411111421149114',
b'\xf1\x875Q0959655N \xf1\x890361\xf1\x82\0211212001112111104110411111521159114',
],
@ -972,6 +974,7 @@ FW_VERSIONS = {
b'\xf1\x873Q0909144J \xf1\x895063\xf1\x82\x0566G0HA14A1',
b'\xf1\x873Q0909144K \xf1\x895072\xf1\x82\x0571G01A16A1',
b'\xf1\x873Q0909144K \xf1\x895072\xf1\x82\x0571G0HA16A1',
b'\xf1\x873Q0909144K \xf1\x895072\xf1\x82\x0571G0JA13A1',
b'\xf1\x873Q0909144L \xf1\x895081\xf1\x82\x0571G0JA14A1',
b'\xf1\x875Q0909144AB\xf1\x891082\xf1\x82\00521G0G809A1',
b'\xf1\x875Q0909144P \xf1\x891043\xf1\x82\00503G00303A0',
@ -1163,6 +1166,7 @@ FW_VERSIONS = {
b'\xf1\x8705E906018DJ\xf1\x891903',
b'\xf1\x875NA907115E \xf1\x890003',
b'\xf1\x875NA907115E \xf1\x890005',
b'\xf1\x875NA906259E \xf1\x890003',
],
(Ecu.transmission, 0x7e1, None): [
b'\xf1\x870D9300043 \xf1\x895202',
@ -1171,6 +1175,7 @@ FW_VERSIONS = {
b'\xf1\x870DL300012N \xf1\x892110',
b'\xf1\x870DL300013G \xf1\x892119',
b'\xf1\x870GC300014N \xf1\x892801',
b'\xf1\x870GC300019H \xf1\x892806',
b'\xf1\x870GC300046Q \xf1\x892802',
],
(Ecu.srs, 0x715, None): [
@ -1180,6 +1185,7 @@ FW_VERSIONS = {
b'\xf1\x873Q0959655CN\xf1\x890720\xf1\x82\x0e1213001211001205212112052100',
b'\xf1\x873Q0959655CQ\xf1\x890720\xf1\x82\x0e1213111211001205212112052111',
b'\xf1\x873Q0959655DJ\xf1\x890731\xf1\x82\x0e1513001511001205232113052J00',
b'\xf1\x875QF959655AT\xf1\x890755\xf1\x82\x1311110011110011111100010200--1121240749',
],
(Ecu.eps, 0x712, None): [
b'\xf1\x875Q0909143P \xf1\x892051\xf1\x820527T6050405',
@ -1187,6 +1193,7 @@ FW_VERSIONS = {
b'\xf1\x875Q0909143P \xf1\x892051\xf1\x820527T6070405',
b'\xf1\x875Q0910143C \xf1\x892211\xf1\x82\x0567T600G500',
b'\xf1\x875Q0910143C \xf1\x892211\xf1\x82\x0567T600G600',
b'\xf1\x875TA907145F \xf1\x891063\xf1\x82\x002LT61A2LOM',
],
(Ecu.fwdRadar, 0x757, None): [
b'\xf1\x872Q0907572Q \xf1\x890342',

Loading…
Cancel
Save