mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-07-16 18:32:06 +08:00
FPv2: log all responses (#25239)
* should be all that's required * try using rx_addr (should be the same) * log bus * bump cereal * remove debugging * bump cereal to master * rm line * add printing to offline debug script
This commit is contained in:
+1
-1
Submodule cereal updated: 7870a1123d...bc999518e7
@@ -452,7 +452,8 @@ def get_fw_versions(logcan, sendcan, query_brand=None, extra=None, timeout=0.1,
|
||||
|
||||
addrs.insert(0, parallel_addrs)
|
||||
|
||||
fw_versions = {}
|
||||
# Get versions and build capnp list to put into CarParams
|
||||
car_fw = []
|
||||
requests = [r for r in REQUESTS if query_brand is None or r.brand == query_brand]
|
||||
for addr in tqdm(addrs, disable=not progress):
|
||||
for addr_chunk in chunks(addr):
|
||||
@@ -463,27 +464,24 @@ def get_fw_versions(logcan, sendcan, query_brand=None, extra=None, timeout=0.1,
|
||||
|
||||
if addrs:
|
||||
query = IsoTpParallelQuery(sendcan, logcan, r.bus, addrs, r.request, r.response, r.rx_offset, debug=debug)
|
||||
fw_versions.update({(r.brand, addr): (version, r) for (addr, _), version in query.get_data(timeout).items()})
|
||||
for (addr, rx_addr), version in query.get_data(timeout).items():
|
||||
f = car.CarParams.CarFw.new_message()
|
||||
|
||||
f.ecu = ecu_types[(r.brand, addr[0], addr[1])]
|
||||
f.fwVersion = version
|
||||
f.address = addr[0]
|
||||
f.responseAddress = rx_addr
|
||||
f.request = r.request
|
||||
f.brand = r.brand
|
||||
f.bus = r.bus
|
||||
|
||||
if addr[1] is not None:
|
||||
f.subAddress = addr[1]
|
||||
|
||||
car_fw.append(f)
|
||||
except Exception:
|
||||
cloudlog.warning(f"FW query exception: {traceback.format_exc()}")
|
||||
|
||||
# Build capnp list to put into CarParams
|
||||
car_fw = []
|
||||
for (brand, addr), (version, request) in fw_versions.items():
|
||||
f = car.CarParams.CarFw.new_message()
|
||||
|
||||
f.ecu = ecu_types[(brand, addr[0], addr[1])]
|
||||
f.fwVersion = version
|
||||
f.address = addr[0]
|
||||
f.responseAddress = uds.get_rx_addr_for_tx_addr(addr[0], request.rx_offset)
|
||||
f.request = request.request
|
||||
f.brand = brand
|
||||
|
||||
if addr[1] is not None:
|
||||
f.subAddress = addr[1]
|
||||
|
||||
car_fw.append(f)
|
||||
|
||||
return car_fw
|
||||
|
||||
|
||||
@@ -531,7 +529,7 @@ if __name__ == "__main__":
|
||||
padding = max([len(fw.brand) for fw in fw_vers] or [0])
|
||||
for version in fw_vers:
|
||||
subaddr = None if version.subAddress == 0 else hex(version.subAddress)
|
||||
print(f" Brand: {version.brand:{padding}} - (Ecu.{version.ecu}, {hex(version.address)}, {subaddr}): [{version.fwVersion}]")
|
||||
print(f" Brand: {version.brand:{padding}}, bus: {version.bus} - (Ecu.{version.ecu}, {hex(version.address)}, {subaddr}): [{version.fwVersion}]")
|
||||
print("}")
|
||||
|
||||
print()
|
||||
|
||||
@@ -115,7 +115,7 @@ if __name__ == "__main__":
|
||||
padding = max([len(fw.brand or UNKNOWN_BRAND) for fw in car_fw])
|
||||
for version in sorted(car_fw, key=lambda fw: fw.brand):
|
||||
subaddr = None if version.subAddress == 0 else hex(version.subAddress)
|
||||
print(f" Brand: {version.brand or UNKNOWN_BRAND:{padding}} - (Ecu.{version.ecu}, {hex(version.address)}, {subaddr}): [{version.fwVersion}],")
|
||||
print(f" Brand: {version.brand or UNKNOWN_BRAND:{padding}}, bus: {version.bus} - (Ecu.{version.ecu}, {hex(version.address)}, {subaddr}): [{version.fwVersion}],")
|
||||
|
||||
print("Mismatches")
|
||||
found = False
|
||||
|
||||
Reference in New Issue
Block a user