This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async def _on_message(message : Message): | |
print(f'[received message] {message}') | |
print((message.arbitration_id, binascii.hexlify(message.data))) | |
if message.arbitration_id == 0x0241 and binascii.hexlify(message.data) == b'0008021a90': | |
print(f'FOUND MESSAGE! {message}') | |
found_message.set_result((True, binascii.hexlify(message.data))) | |
async with pcan.listen_message(_on_message): | |
print('Listening for messages!') | |
print('Sending obd_driver') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print_grid( | |
columns=('Function', 'Occurences', 'Sender'), | |
values=[(x['function'], 1337, x['sender']) for x in messages if 'function' in x] | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import sys | |
import json | |
import itertools | |
from collections import Counter | |
from collections import defaultdict | |
SPLIT_MESSAGES = re.compile(r'\n.?\w{3} \w+ +\d+ \d+:\d+:\d+ \d+[\r\s]*\n') | |
MATCH_SIGNAL = re.compile(r'signal sender=(?P<sender>.*) -> dest=(?P<dest>.*) serial=(?P<serial>.*) path=(?P<path>.*) interface=(?P<interface>.*) member=(?P<member>.*)\n\s+string (?P<function>.*)\n\s+string (?P<params>.*)') | |
MATCH_METHOD_CALL = re.compile(r'method call sender=(?P<sender>.*) -> dest=(?P<dest>.*) serial=(?P<serial>.*) path=(?P<path>.*) interface=(?P<interface>.*) member=(?P<member>.*)\n\s+string (?P<function>.*)\n\s+string (?P<params>.*)') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetchDependencies: (version, value) -> | |
promises = [] | |
for x in version.dependencies | |
promise = @searchTerm(x.name).then (data) => | |
d = _.first(data) | |
dep_search = _.last(d.versions) | |
if dep_search.scripts.length > 0 | |
el = document.createElement("script") | |
el.setAttribute("data-require", value.name + "@*") | |
el.setAttribute("data-semver", version.semver) |