mirror of https://github.com/commaai/panda.git
Merge pull request #101 from adhintz/master
add support for multiple buses to can_unique and can_bit_transition
This commit is contained in:
commit
f4efd1f29d
|
@ -45,7 +45,7 @@ class Info():
|
|||
message_id = row[1][2:] # remove leading '0x'
|
||||
else:
|
||||
message_id = hex(int(row[1]))[2:] # old message IDs are in decimal
|
||||
|
||||
message_id = '%s:%s' % (bus, message_id)
|
||||
if row[3].startswith('0x'):
|
||||
data = row[3][2:] # remove leading '0x'
|
||||
else:
|
||||
|
@ -74,7 +74,7 @@ def PrintUnique(log_file, low_range, high_range):
|
|||
high.load(log_file, start, end)
|
||||
# print messages that go from low to high
|
||||
found = False
|
||||
for message_id in high.messages:
|
||||
for message_id in sorted(high.messages):
|
||||
if message_id in low.messages:
|
||||
high.messages[message_id].printBitDiff(low.messages[message_id])
|
||||
found = True
|
||||
|
|
|
@ -51,10 +51,12 @@ class Info():
|
|||
reader = csv.reader(input)
|
||||
next(reader, None) # skip the CSV header
|
||||
for row in reader:
|
||||
bus = row[0]
|
||||
if row[1].startswith('0x'):
|
||||
message_id = row[1][2:] # remove leading '0x'
|
||||
else:
|
||||
message_id = hex(int(row[1]))[2:] # old message IDs are in decimal
|
||||
message_id = '%s:%s' % (bus, message_id)
|
||||
if row[1].startswith('0x'):
|
||||
data = row[2][2:] # remove leading '0x'
|
||||
else:
|
||||
|
@ -76,7 +78,7 @@ def PrintUnique(interesting_file, background_files):
|
|||
background.load(background_file)
|
||||
interesting = Info()
|
||||
interesting.load(interesting_file)
|
||||
for message_id in interesting.messages:
|
||||
for message_id in sorted(interesting.messages):
|
||||
if message_id not in background.messages:
|
||||
print 'New message_id: %s' % message_id
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue