Skip to content

Commit

Permalink
debug_fw_fingerprinting_offline: add rxoffset
Browse files Browse the repository at this point in the history
  • Loading branch information
sshane committed Feb 28, 2025
1 parent 33e84ad commit 7d43fba
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions selfdrive/debug/debug_fw_fingerprinting_offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from openpilot.tools.lib.logreader import LogReader, ReadMode


def main(route: str | None, addrs: list[int]):
def main(route: str | None, addrs: list[int], rxoffset: int):
"""
TODO:
- highlight TX vs RX clearly
Expand All @@ -23,7 +23,7 @@ def main(route: str | None, addrs: list[int]):
prev_mono_time = 0

# include rx addresses
addrs = addrs + [uds.get_rx_addr_for_tx_addr(addr) for addr in addrs]
addrs = addrs + [uds.get_rx_addr_for_tx_addr(addr, rxoffset) for addr in addrs]

for msg in lr:
if msg.which() == 'can':
Expand All @@ -44,7 +44,9 @@ def main(route: str | None, addrs: list[int]):
parser = argparse.ArgumentParser(description='View back and forth ISO-TP communication between various ECUs given an address')
parser.add_argument('route', nargs='?', help='Route name, live if not specified')
parser.add_argument('--addrs', nargs='*', default=[], help='List of tx address to view (0x7e0 for engine)')
parser.add_argument('--rxoffset', default='')
args = parser.parse_args()

addrs = [int(addr, base=16) if addr.startswith('0x') else int(addr) for addr in args.addrs]
main(args.route, addrs)
rxoffset = int(args.rxoffset, base=16) if args.rxoffset else None
main(args.route, addrs, rxoffset)

0 comments on commit 7d43fba

Please sign in to comment.