Files
dragonpilot/selfdrive/boardd/boardd.py

18 lines
496 B
Python
Raw Normal View History

2019-05-16 13:20:29 -07:00
# pylint: skip-file
2016-11-29 18:34:21 -08:00
import os
2019-05-16 13:20:29 -07:00
import subprocess
2016-11-29 18:34:21 -08:00
2019-05-16 13:20:29 -07:00
# Cython
boardd_api_dir = os.path.dirname(os.path.abspath(__file__))
subprocess.check_call(["make", "boardd_api_impl.so"], cwd=boardd_api_dir)
from selfdrive.boardd.boardd_api_impl import can_list_to_can_capnp
assert can_list_to_can_capnp
2016-11-29 18:34:21 -08:00
2016-12-14 21:29:12 -08:00
def can_capnp_to_can_list(can, src_filter=None):
2016-11-29 18:34:21 -08:00
ret = []
2016-12-14 21:29:12 -08:00
for msg in can:
if src_filter is None or msg.src in src_filter:
ret.append((msg.address, msg.busTime, msg.dat, msg.src))
2016-11-29 18:34:21 -08:00
return ret