├── deps └── python-can │ ├── .hg │ ├── undo.dirstate │ ├── branch │ ├── store │ │ ├── phaseroots │ │ ├── undo.phaseroots │ │ ├── 00changelog.i │ │ ├── 00manifest.i │ │ └── data │ │ │ ├── _c_a_n.py.i │ │ │ ├── _makefile.i │ │ │ ├── canlib.py.i │ │ │ ├── setup.py.i │ │ │ ├── ~2ehgtags.i │ │ │ ├── can │ │ │ ├── bus.py.i │ │ │ ├── util.py.i │ │ │ ├── _c_a_n.py.i │ │ │ ├── message.py.i │ │ │ ├── notfier.py.i │ │ │ ├── constants.py.i │ │ │ ├── notifier.py.i │ │ │ ├── ____init____.py.i │ │ │ ├── broadcastmanager.py.i │ │ │ ├── interfaces │ │ │ │ ├── canlib.py.i │ │ │ │ ├── pcan.py.i │ │ │ │ ├── interface.py.i │ │ │ │ ├── serial__can.py.i │ │ │ │ ├── ____init____.py.i │ │ │ │ ├── kvaser │ │ │ │ │ ├── canlib.py.i │ │ │ │ │ ├── constants.py.i │ │ │ │ │ ├── ____init____.py.i │ │ │ │ │ └── argument__parser.py.i │ │ │ │ ├── _p_c_a_n_basic.py.i │ │ │ │ ├── canlib__constants.py.i │ │ │ │ ├── socketcan__ctypes.py.i │ │ │ │ ├── socketcan__native.py.i │ │ │ │ └── socketcan__constants.py.i │ │ │ └── protocols │ │ │ │ ├── j1939 │ │ │ │ ├── pdu.py.i │ │ │ │ ├── pgn.py.i │ │ │ │ ├── node.py.i │ │ │ │ ├── nodename.py.i │ │ │ │ ├── constants.py.i │ │ │ │ ├── ____init____.py.i │ │ │ │ └── arbitrationid.py.i │ │ │ │ └── ____init____.py.i │ │ │ ├── canstat.py.i │ │ │ ├── doc │ │ │ ├── api.rst.i │ │ │ ├── bcm.rst.i │ │ │ ├── bin.rst.i │ │ │ ├── bus.rst.i │ │ │ ├── can.rst.i │ │ │ ├── conf.py.i │ │ │ ├── _makefile.i │ │ │ ├── index.rst.i │ │ │ ├── intro.rst.i │ │ │ ├── j1939.rst.i │ │ │ ├── kvaser.rst.i │ │ │ ├── make.bat.i │ │ │ ├── serial.rst.i │ │ │ ├── history.rst.i │ │ │ ├── install.rst.i │ │ │ ├── message.rst.i │ │ │ ├── overview.rst.i │ │ │ ├── pycanlib.pml.i │ │ │ ├── virtual.txt.i │ │ │ ├── interfaces.rst.i │ │ │ ├── listeners.rst.i │ │ │ ├── protocols.rst.i │ │ │ ├── socketcan.rst.i │ │ │ ├── stylesheet.sty.i │ │ │ ├── pycanlib__srs.txt.i │ │ │ ├── socketcanlib.rst.i │ │ │ ├── _old docs │ │ │ │ ├── _makefile.i │ │ │ │ ├── virtual.txt.i │ │ │ │ ├── stylesheet.sty.i │ │ │ │ ├── pycanlib__srs.txt.i │ │ │ │ └── pycanlib__manual.txt.i │ │ │ ├── images │ │ │ │ ├── wireshark.png.d │ │ │ │ └── wireshark.png.i │ │ │ ├── pycanlib__manual.txt.i │ │ │ ├── socketcan__ctypes.rst.i │ │ │ ├── socketcan__native.rst.i │ │ │ └── dcl__srs__stylesheet.sty.i │ │ │ ├── ~2ehgignore.i │ │ │ ├── bin │ │ │ ├── dat2tdv.py.i │ │ │ ├── logger.py.i │ │ │ ├── xml2tdv.py.i │ │ │ ├── can__logger.py.i │ │ │ ├── can__printer.py.i │ │ │ ├── check-pep8.py.i │ │ │ ├── j1939__logger.py.i │ │ │ └── ipy__profile__pycanlib.py.i │ │ │ ├── test │ │ │ ├── test.bat.i │ │ │ ├── j1939__test.py.i │ │ │ ├── ____init____.py.i │ │ │ ├── network__test.py.i │ │ │ └── test__kvaser.py.i │ │ │ ├── ____init____.py.i │ │ │ ├── _r_e_a_d_m_e.md.i │ │ │ ├── _r_e_a_d_m_e.txt.i │ │ │ ├── _c_h_a_n_g_e_s.txt.i │ │ │ ├── _i_n_s_t_a_l_l.txt.i │ │ │ ├── _l_i_c_e_n_s_e.txt.i │ │ │ ├── examples │ │ │ ├── busload.py.i │ │ │ ├── cyclic.py.i │ │ │ ├── send__one.py.i │ │ │ ├── ____init____.py.i │ │ │ ├── getchanneldata.py.i │ │ │ ├── getchanneldatatest.py.i │ │ │ └── virtual__can__demo.py.i │ │ │ ├── pycanlib │ │ │ ├── _c_a_n.py.d │ │ │ ├── _c_a_n.py.i │ │ │ ├── canlib.py.i │ │ │ ├── canstat.py.i │ │ │ ├── ____init____.py.i │ │ │ ├── socketcanlib.py.i │ │ │ ├── __build │ │ │ │ ├── index.html.i │ │ │ │ ├── intro.html.i │ │ │ │ ├── objects.inv.i │ │ │ │ ├── search.html.i │ │ │ │ ├── ~2ebuildinfo.i │ │ │ │ ├── genindex.html.i │ │ │ │ ├── overview.html.i │ │ │ │ ├── searchindex.js.i │ │ │ │ ├── __static │ │ │ │ │ ├── file.png.i │ │ │ │ │ ├── plus.png.i │ │ │ │ │ ├── basic.css.i │ │ │ │ │ ├── jquery.js.i │ │ │ │ │ ├── minus.png.i │ │ │ │ │ ├── sidebar.js.i │ │ │ │ │ ├── default.css.i │ │ │ │ │ ├── doctools.js.i │ │ │ │ │ ├── pygments.css.i │ │ │ │ │ ├── underscore.js.i │ │ │ │ │ └── searchtools.js.i │ │ │ │ ├── __sources │ │ │ │ │ ├── index.txt.i │ │ │ │ │ ├── intro.txt.i │ │ │ │ │ └── overview.txt.i │ │ │ │ └── ~2edoctrees │ │ │ │ │ ├── index.doctree.i │ │ │ │ │ ├── intro.doctree.i │ │ │ │ │ ├── overview.doctree.i │ │ │ │ │ └── environment.pickle.i │ │ │ ├── _input_validation.py.i │ │ │ ├── ipython │ │ │ │ ├── _read_log.py.i │ │ │ │ ├── _log_c_a_n.py.i │ │ │ │ ├── _read_c_a_n.py.i │ │ │ │ ├── _write_log.py.i │ │ │ │ ├── ____init____.py.i │ │ │ │ ├── ____init____.pyc.i │ │ │ │ ├── _print_c_a_n.py.i │ │ │ │ ├── _print_c_a_n.pyc.i │ │ │ │ ├── _read_c_a_n.pyc.i │ │ │ │ ├── _write_c_a_n.py.i │ │ │ │ ├── _read_c_a_n_log.py.i │ │ │ │ ├── _acceptance_filter.py.i │ │ │ │ └── _extract_timeslice.py.i │ │ │ ├── examples │ │ │ │ └── getchanneldata.py.i │ │ │ └── _c_a_n_l_i_b_error_handlers.py.i │ │ │ ├── distribute__setup.py.i │ │ │ ├── ipy__profile__pycanlib.py.i │ │ │ ├── _c_o_n_t_r_i_b_u_t_o_r_s.txt.i │ │ │ └── _c_a_n_l_i_b_error_handlers.py.i │ ├── undo.bookmarks │ ├── undo.branch │ ├── requires │ ├── 00changelog.i │ ├── hgrc │ ├── undo.desc │ ├── dirstate │ └── cache │ │ ├── branchheads │ │ └── tags │ ├── examples │ ├── __init__.py │ ├── send_one.py │ ├── virtual_can_demo.py │ └── cyclic.py │ ├── test │ ├── __init__.py │ ├── test_kvaser.py │ ├── network_test.py │ └── j1939_test.py │ ├── build │ ├── lib.linux-armv7l-2.7 │ │ ├── examples │ │ │ ├── __init__.py │ │ │ ├── send_one.py │ │ │ ├── virtual_can_demo.py │ │ │ └── cyclic.py │ │ ├── test │ │ │ ├── __init__.py │ │ │ ├── test_kvaser.py │ │ │ ├── network_test.py │ │ │ └── j1939_test.py │ │ └── can │ │ │ ├── interfaces │ │ │ ├── kvaser │ │ │ │ ├── __init__.py │ │ │ │ └── argument_parser.py │ │ │ ├── __init__.py │ │ │ ├── interface.py │ │ │ ├── socketcan_constants.py │ │ │ ├── serial_can.py │ │ │ └── pcan.py │ │ │ ├── protocols │ │ │ ├── __init__.py │ │ │ └── j1939 │ │ │ │ ├── pgn.py │ │ │ │ ├── constants.py │ │ │ │ ├── arbitrationid.py │ │ │ │ └── pdu.py │ │ │ ├── __init__.py │ │ │ ├── notifier.py │ │ │ ├── message.py │ │ │ ├── broadcastmanager.py │ │ │ ├── bus.py │ │ │ ├── util.py │ │ │ └── CAN.py │ └── scripts-2.7 │ │ ├── can_logger.py │ │ └── j1939_logger.py │ ├── python_can.egg-info │ ├── dependency_links.txt │ ├── top_level.txt │ └── SOURCES.txt │ ├── can │ ├── interfaces │ │ ├── kvaser │ │ │ ├── __init__.py │ │ │ └── argument_parser.py │ │ ├── __init__.pyc │ │ ├── interface.pyc │ │ ├── __init__.py │ │ ├── interface.py │ │ ├── socketcan_constants.py │ │ ├── serial_can.py │ │ └── pcan.py │ ├── CAN.pyc │ ├── bus.pyc │ ├── protocols │ │ ├── __init__.py │ │ └── j1939 │ │ │ ├── pgn.py │ │ │ ├── constants.py │ │ │ ├── arbitrationid.py │ │ │ └── pdu.py │ ├── util.pyc │ ├── __init__.pyc │ ├── message.pyc │ ├── notifier.pyc │ ├── broadcastmanager.pyc │ ├── __init__.py │ ├── notifier.py │ ├── message.py │ ├── broadcastmanager.py │ ├── bus.py │ ├── util.py │ └── CAN.py │ ├── doc │ ├── j1939.rst │ ├── images │ │ └── wireshark.png │ ├── protocols.rst │ ├── serial.rst │ ├── interfaces.rst │ ├── api.rst │ ├── bcm.rst │ ├── bus.rst │ ├── history.rst │ ├── kvaser.rst │ ├── listeners.rst │ ├── socketcan_native.rst │ ├── index.rst │ ├── socketcan_ctypes.rst │ ├── pycanlib.pml │ ├── overview.rst │ ├── message.rst │ ├── bin.rst │ └── socketcan.rst │ ├── .hgignore │ ├── dist │ └── python_can-1.4-py2.7.egg │ ├── CONTRIBUTORS.txt │ ├── setup.py │ ├── .hgtags │ ├── bin │ ├── can_logger.py │ └── j1939_logger.py │ └── README.md ├── launch ├── msg │ └── CanFrame.msg └── canbus_listener.launch ├── msg └── CanFrame.msg ├── can_config_file ├── srv └── CanFrameSrv.srv ├── README.md ├── install_deps.sh ├── setup.py ├── setup_can.sh ├── src └── canbus_listener.py └── package.xml /deps/python-can/.hg/undo.dirstate: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /deps/python-can/.hg/branch: -------------------------------------------------------------------------------- 1 | default 2 | -------------------------------------------------------------------------------- /deps/python-can/.hg/store/phaseroots: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /deps/python-can/.hg/undo.bookmarks: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /deps/python-can/.hg/undo.branch: -------------------------------------------------------------------------------- 1 | default -------------------------------------------------------------------------------- /deps/python-can/examples/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /deps/python-can/test/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /deps/python-can/.hg/store/undo.phaseroots: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/examples/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /deps/python-can/python_can.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/test/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /launch/msg/CanFrame.msg: -------------------------------------------------------------------------------- 1 | uint8[3] arbitration_id 2 | uint8[8] data 3 | -------------------------------------------------------------------------------- /deps/python-can/.hg/requires: -------------------------------------------------------------------------------- 1 | revlogv1 2 | fncache 3 | store 4 | dotencode 5 | -------------------------------------------------------------------------------- /msg/CanFrame.msg: -------------------------------------------------------------------------------- 1 | time timestamp 2 | uint32 arbitration_id 3 | uint8[] data 4 | -------------------------------------------------------------------------------- /can_config_file: -------------------------------------------------------------------------------- 1 | [default] 2 | interface = socketcan_ctypes 3 | channel = can0 4 | -------------------------------------------------------------------------------- /deps/python-can/python_can.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | test 2 | can 3 | examples 4 | -------------------------------------------------------------------------------- /srv/CanFrameSrv.srv: -------------------------------------------------------------------------------- 1 | uint32 arbitration_id 2 | uint8[] data 3 | --- 4 | bool success 5 | -------------------------------------------------------------------------------- /deps/python-can/.hg/00changelog.i: -------------------------------------------------------------------------------- 1 |  dummy changelog to prevent using the old repo layout -------------------------------------------------------------------------------- /deps/python-can/.hg/hgrc: -------------------------------------------------------------------------------- 1 | [paths] 2 | default = https://bitbucket.org/hardbyte/python-can 3 | -------------------------------------------------------------------------------- /deps/python-can/.hg/undo.desc: -------------------------------------------------------------------------------- 1 | 0 2 | pull 3 | https://bitbucket.org/hardbyte/python-can 4 | -------------------------------------------------------------------------------- /deps/python-can/can/interfaces/kvaser/__init__.py: -------------------------------------------------------------------------------- 1 | from can.interfaces.kvaser.canlib import * -------------------------------------------------------------------------------- /deps/python-can/doc/j1939.rst: -------------------------------------------------------------------------------- 1 | J1939 2 | ===== 3 | 4 | .. TODO:: 5 | Documentation needs to be written -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | canbus_interface 2 | ================ 3 | 4 | ROS interface to a canbus using socketcan and python-can 5 | -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/can/interfaces/kvaser/__init__.py: -------------------------------------------------------------------------------- 1 | from can.interfaces.kvaser.canlib import * -------------------------------------------------------------------------------- /deps/python-can/can/CAN.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/can/CAN.pyc -------------------------------------------------------------------------------- /deps/python-can/can/bus.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/can/bus.pyc -------------------------------------------------------------------------------- /deps/python-can/can/protocols/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | A protocol redefines Bus and Message. 3 | """ 4 | 5 | #import j1939 -------------------------------------------------------------------------------- /deps/python-can/.hg/dirstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/dirstate -------------------------------------------------------------------------------- /deps/python-can/.hgignore: -------------------------------------------------------------------------------- 1 | syntax: glob 2 | build/ 3 | dist/ 4 | .idea/ 5 | pycanlib.egg-info/ 6 | version.txt 7 | *.pyc 8 | -------------------------------------------------------------------------------- /deps/python-can/can/util.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/can/util.pyc -------------------------------------------------------------------------------- /deps/python-can/can/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/can/__init__.pyc -------------------------------------------------------------------------------- /deps/python-can/can/message.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/can/message.pyc -------------------------------------------------------------------------------- /deps/python-can/can/notifier.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/can/notifier.pyc -------------------------------------------------------------------------------- /deps/python-can/.hg/store/00changelog.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/00changelog.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/00manifest.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/00manifest.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/_c_a_n.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/_c_a_n.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/_makefile.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/_makefile.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/canlib.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/canlib.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/setup.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/setup.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/~2ehgtags.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/~2ehgtags.i -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/can/protocols/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | A protocol redefines Bus and Message. 3 | """ 4 | 5 | #import j1939 -------------------------------------------------------------------------------- /deps/python-can/can/broadcastmanager.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/can/broadcastmanager.pyc -------------------------------------------------------------------------------- /deps/python-can/doc/images/wireshark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/doc/images/wireshark.png -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/bus.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/bus.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/util.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/util.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/canstat.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/canstat.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/api.rst.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/api.rst.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/bcm.rst.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/bcm.rst.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/bin.rst.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/bin.rst.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/bus.rst.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/bus.rst.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/can.rst.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/can.rst.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/conf.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/conf.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/~2ehgignore.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/~2ehgignore.i -------------------------------------------------------------------------------- /deps/python-can/can/interfaces/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/can/interfaces/__init__.pyc -------------------------------------------------------------------------------- /deps/python-can/can/interfaces/interface.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/can/interfaces/interface.pyc -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/bin/dat2tdv.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/bin/dat2tdv.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/bin/logger.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/bin/logger.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/bin/xml2tdv.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/bin/xml2tdv.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/_c_a_n.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/_c_a_n.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/message.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/message.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/notfier.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/notfier.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/_makefile.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/_makefile.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/index.rst.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/index.rst.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/intro.rst.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/intro.rst.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/j1939.rst.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/j1939.rst.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/kvaser.rst.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/kvaser.rst.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/make.bat.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/make.bat.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/serial.rst.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/serial.rst.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/test/test.bat.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/test/test.bat.i -------------------------------------------------------------------------------- /deps/python-can/dist/python_can-1.4-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/dist/python_can-1.4-py2.7.egg -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/____init____.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/____init____.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/_r_e_a_d_m_e.md.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/_r_e_a_d_m_e.md.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/_r_e_a_d_m_e.txt.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/_r_e_a_d_m_e.txt.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/constants.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/constants.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/notifier.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/notifier.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/history.rst.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/history.rst.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/install.rst.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/install.rst.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/message.rst.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/message.rst.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/overview.rst.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/overview.rst.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/pycanlib.pml.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/pycanlib.pml.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/virtual.txt.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/virtual.txt.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/_c_h_a_n_g_e_s.txt.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/_c_h_a_n_g_e_s.txt.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/_i_n_s_t_a_l_l.txt.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/_i_n_s_t_a_l_l.txt.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/_l_i_c_e_n_s_e.txt.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/_l_i_c_e_n_s_e.txt.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/bin/can__logger.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/bin/can__logger.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/bin/can__printer.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/bin/can__printer.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/bin/check-pep8.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/bin/check-pep8.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/____init____.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/____init____.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/interfaces.rst.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/interfaces.rst.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/listeners.rst.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/listeners.rst.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/protocols.rst.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/protocols.rst.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/socketcan.rst.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/socketcan.rst.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/stylesheet.sty.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/stylesheet.sty.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/examples/busload.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/examples/busload.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/examples/cyclic.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/examples/cyclic.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/_c_a_n.py.d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/_c_a_n.py.d -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/_c_a_n.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/_c_a_n.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/canlib.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/canlib.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/canstat.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/canstat.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/test/j1939__test.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/test/j1939__test.py.i -------------------------------------------------------------------------------- /deps/python-can/can/interfaces/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Interfaces contain low level implementations that interact with CAN hardware. 4 | """ 5 | -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/bin/j1939__logger.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/bin/j1939__logger.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/distribute__setup.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/distribute__setup.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/pycanlib__srs.txt.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/pycanlib__srs.txt.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/socketcanlib.rst.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/socketcanlib.rst.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/examples/send__one.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/examples/send__one.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/test/____init____.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/test/____init____.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/test/network__test.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/test/network__test.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/test/test__kvaser.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/test/test__kvaser.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/broadcastmanager.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/broadcastmanager.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/interfaces/canlib.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/interfaces/canlib.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/interfaces/pcan.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/interfaces/pcan.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/_old docs/_makefile.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/_old docs/_makefile.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/images/wireshark.png.d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/images/wireshark.png.d -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/images/wireshark.png.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/images/wireshark.png.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/pycanlib__manual.txt.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/pycanlib__manual.txt.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/examples/____init____.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/examples/____init____.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/____init____.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/____init____.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/socketcanlib.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/socketcanlib.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/protocols/j1939/pdu.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/protocols/j1939/pdu.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/protocols/j1939/pgn.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/protocols/j1939/pgn.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/_old docs/virtual.txt.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/_old docs/virtual.txt.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/socketcan__ctypes.rst.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/socketcan__ctypes.rst.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/socketcan__native.rst.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/socketcan__native.rst.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/examples/getchanneldata.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/examples/getchanneldata.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/ipy__profile__pycanlib.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/ipy__profile__pycanlib.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/_c_o_n_t_r_i_b_u_t_o_r_s.txt.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/_c_o_n_t_r_i_b_u_t_o_r_s.txt.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/bin/ipy__profile__pycanlib.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/bin/ipy__profile__pycanlib.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/interfaces/interface.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/interfaces/interface.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/interfaces/serial__can.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/interfaces/serial__can.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/protocols/____init____.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/protocols/____init____.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/protocols/j1939/node.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/protocols/j1939/node.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/_old docs/stylesheet.sty.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/_old docs/stylesheet.sty.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/dcl__srs__stylesheet.sty.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/dcl__srs__stylesheet.sty.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/index.html.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/index.html.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/intro.html.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/intro.html.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/objects.inv.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/objects.inv.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/search.html.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/search.html.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/~2ebuildinfo.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/~2ebuildinfo.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/_input_validation.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/_input_validation.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/ipython/_read_log.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/ipython/_read_log.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/cache/branchheads: -------------------------------------------------------------------------------- 1 | 4baa9ebb48c1fa6702613c617972ea46b5d4206f 473 2 | 4baa9ebb48c1fa6702613c617972ea46b5d4206f default 3 | 7615c760c59f483738ca1ec8c85380d3045ef1be python3 4 | -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/_c_a_n_l_i_b_error_handlers.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/_c_a_n_l_i_b_error_handlers.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/interfaces/____init____.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/interfaces/____init____.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/interfaces/kvaser/canlib.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/interfaces/kvaser/canlib.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/protocols/j1939/nodename.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/protocols/j1939/nodename.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/_old docs/pycanlib__srs.txt.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/_old docs/pycanlib__srs.txt.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/examples/getchanneldatatest.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/examples/getchanneldatatest.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/examples/virtual__can__demo.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/examples/virtual__can__demo.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/genindex.html.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/genindex.html.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/overview.html.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/overview.html.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/searchindex.js.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/searchindex.js.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/ipython/_log_c_a_n.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/ipython/_log_c_a_n.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/ipython/_read_c_a_n.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/ipython/_read_c_a_n.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/ipython/_write_log.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/ipython/_write_log.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/interfaces/_p_c_a_n_basic.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/interfaces/_p_c_a_n_basic.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/interfaces/kvaser/constants.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/interfaces/kvaser/constants.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/protocols/j1939/constants.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/protocols/j1939/constants.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/doc/_old docs/pycanlib__manual.txt.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/doc/_old docs/pycanlib__manual.txt.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/__static/file.png.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/__static/file.png.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/__static/plus.png.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/__static/plus.png.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/ipython/____init____.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/ipython/____init____.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/ipython/____init____.pyc.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/ipython/____init____.pyc.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/ipython/_print_c_a_n.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/ipython/_print_c_a_n.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/ipython/_print_c_a_n.pyc.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/ipython/_print_c_a_n.pyc.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/ipython/_read_c_a_n.pyc.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/ipython/_read_c_a_n.pyc.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/ipython/_write_c_a_n.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/ipython/_write_c_a_n.py.i -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/can/interfaces/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Interfaces contain low level implementations that interact with CAN hardware. 4 | """ 5 | -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/interfaces/canlib__constants.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/interfaces/canlib__constants.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/interfaces/socketcan__ctypes.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/interfaces/socketcan__ctypes.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/interfaces/socketcan__native.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/interfaces/socketcan__native.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/protocols/j1939/____init____.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/protocols/j1939/____init____.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/protocols/j1939/arbitrationid.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/protocols/j1939/arbitrationid.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/__sources/index.txt.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/__sources/index.txt.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/__sources/intro.txt.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/__sources/intro.txt.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/__static/basic.css.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/__static/basic.css.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/__static/jquery.js.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/__static/jquery.js.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/__static/minus.png.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/__static/minus.png.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/__static/sidebar.js.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/__static/sidebar.js.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/examples/getchanneldata.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/examples/getchanneldata.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/ipython/_read_c_a_n_log.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/ipython/_read_c_a_n_log.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/interfaces/kvaser/____init____.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/interfaces/kvaser/____init____.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/interfaces/socketcan__constants.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/interfaces/socketcan__constants.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/__sources/overview.txt.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/__sources/overview.txt.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/__static/default.css.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/__static/default.css.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/__static/doctools.js.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/__static/doctools.js.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/__static/pygments.css.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/__static/pygments.css.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/__static/underscore.js.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/__static/underscore.js.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/_c_a_n_l_i_b_error_handlers.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/_c_a_n_l_i_b_error_handlers.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/ipython/_acceptance_filter.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/ipython/_acceptance_filter.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/ipython/_extract_timeslice.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/ipython/_extract_timeslice.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/can/interfaces/kvaser/argument__parser.py.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/can/interfaces/kvaser/argument__parser.py.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/__static/searchtools.js.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/__static/searchtools.js.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/~2edoctrees/index.doctree.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/~2edoctrees/index.doctree.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/~2edoctrees/intro.doctree.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/~2edoctrees/intro.doctree.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/~2edoctrees/overview.doctree.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/~2edoctrees/overview.doctree.i -------------------------------------------------------------------------------- /deps/python-can/.hg/store/data/pycanlib/__build/~2edoctrees/environment.pickle.i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juancamilog/canbus_interface/HEAD/deps/python-can/.hg/store/data/pycanlib/__build/~2edoctrees/environment.pickle.i -------------------------------------------------------------------------------- /deps/python-can/doc/protocols.rst: -------------------------------------------------------------------------------- 1 | Protocols 2 | ========= 3 | 4 | The :mod:`~can.protocols.j1939` protocol is the only CAN protocol that is currently 5 | implemented. 6 | 7 | 8 | .. toctree:: 9 | :maxdepth: 2 10 | 11 | j1939 12 | 13 | -------------------------------------------------------------------------------- /install_deps.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | sudo apt-get install python-setuptools 3 | cd deps/python-can 4 | sudo python setup.py install 5 | cd ../../ 6 | cp can_config_file ~/.canrc 7 | (sudo crontab -l; echo "@reboot `pwd`/setup_can.sh")| sudo crontab - 8 | -------------------------------------------------------------------------------- /launch/canbus_listener.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /deps/python-can/doc/serial.rst: -------------------------------------------------------------------------------- 1 | .. _serial: 2 | 3 | CAN over Serial 4 | =============== 5 | 6 | 7 | Bus 8 | --- 9 | 10 | .. autoclass:: can.interfaces.serial_can.Bus 11 | 12 | 13 | Internals 14 | --------- 15 | 16 | #TODO: Implement and document serial interface. 17 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from distutils.core import setup 3 | from catkin_pkg.python_setup import generate_distutils_setup 4 | 5 | d = generate_distutils_setup( 6 | packages=['canbus_interface'], 7 | package_dir={'': 'src'}, 8 | ) 9 | 10 | setup(**d) 11 | 12 | -------------------------------------------------------------------------------- /deps/python-can/CONTRIBUTORS.txt: -------------------------------------------------------------------------------- 1 | Ben Powell 2 | Brian Thorne 3 | Geert Linders 4 | Mark Catley 5 | Phillip Dixon 6 | Rose Lu 7 | Albert Bloomfield 8 | -------------------------------------------------------------------------------- /deps/python-can/doc/interfaces.rst: -------------------------------------------------------------------------------- 1 | CAN Interface Modules 2 | --------------------- 3 | 4 | Found under ``can.interfaces`` are the implementations for each backend: 5 | 6 | .. toctree:: 7 | :maxdepth: 1 8 | 9 | socketcan 10 | kvaser 11 | serial 12 | 13 | These interfaces define the low level interface to the physical controller area network. 14 | -------------------------------------------------------------------------------- /deps/python-can/examples/send_one.py: -------------------------------------------------------------------------------- 1 | import can 2 | 3 | 4 | def main(): 5 | bus = can.interface.Bus() 6 | msg = can.Message(arbitration_id=0xc0ffee, 7 | data=[0, 25, 0, 1, 3, 1, 4, 1], 8 | extended_id=False) 9 | bus.send(msg) 10 | print("Message sent") 11 | 12 | if __name__ == "__main__": 13 | main() 14 | -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/examples/send_one.py: -------------------------------------------------------------------------------- 1 | import can 2 | 3 | 4 | def main(): 5 | bus = can.interface.Bus() 6 | msg = can.Message(arbitration_id=0xc0ffee, 7 | data=[0, 25, 0, 1, 3, 1, 4, 1], 8 | extended_id=False) 9 | bus.send(msg) 10 | print("Message sent") 11 | 12 | if __name__ == "__main__": 13 | main() 14 | -------------------------------------------------------------------------------- /setup_can.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | echo BB-DCAN1 | sudo tee /sys/devices/bone_capemgr.*/slots 3 | sudo modprobe can 4 | sudo modprobe can-dev 5 | sudo modprobe can-raw 6 | sudo ifconfig can0 down 7 | #sudo ip link set can0 up type can bitrate 1000000 8 | #sudo ip link set can0 up type can bitrate 1000000 loopback on triple-sampling on 9 | sudo ip link set can0 up type can bitrate 1000000 triple-sampling on 10 | sudo ifconfig can0 up 11 | 12 | -------------------------------------------------------------------------------- /deps/python-can/doc/api.rst: -------------------------------------------------------------------------------- 1 | Library API 2 | =========== 3 | 4 | The main objects are the :class:`~can.Bus` and the :class:`~can.Message`. 5 | A form of CAN interface is also required. 6 | 7 | 8 | .. toctree:: 9 | :maxdepth: 2 10 | 11 | bus 12 | message 13 | listeners 14 | bcm 15 | 16 | 17 | .. _notifier: 18 | 19 | Notifier 20 | -------- 21 | 22 | The Notifier object is used as a message distributor for a bus. 23 | 24 | .. autoclass:: can.Notifier 25 | :members: 26 | 27 | -------------------------------------------------------------------------------- /deps/python-can/doc/bcm.rst: -------------------------------------------------------------------------------- 1 | 2 | Broadcast Manager 3 | ================= 4 | 5 | The broadcast manager is a work in progress, to date the transmit path has been worked on using 6 | the ctypes socketcan interface. 7 | 8 | This example shows the ctypes socketcan using the broadcast manager: 9 | 10 | 11 | .. literalinclude:: ../examples/cyclic.py 12 | :language: python 13 | :linenos: 14 | 15 | 16 | Functional API 17 | -------------- 18 | 19 | .. autofunction:: can.send_periodic 20 | 21 | 22 | Class based API 23 | --------------- 24 | 25 | .. autoclass:: can.CyclicSendTaskABC 26 | :members: 27 | 28 | 29 | .. autoclass:: can.MultiRateCyclicSendTaskABC 30 | :members: 31 | -------------------------------------------------------------------------------- /deps/python-can/can/interfaces/interface.py: -------------------------------------------------------------------------------- 1 | import can 2 | 3 | if can.rc['interface'] == 'kvaser': 4 | from can.interfaces.kvaser import * 5 | elif can.rc['interface'] == 'socketcan_ctypes': 6 | from can.interfaces.socketcan_ctypes import * 7 | elif can.rc['interface'] == 'socketcan_native': 8 | from can.interfaces.socketcan_native import * 9 | elif can.rc['interface'] == 'socketcan': 10 | # try both 11 | try: 12 | from can.interfaces.socketcan_native import * 13 | except ImportError: 14 | from can.interfaces.socketcan_ctypes import * 15 | elif can.rc['interface'] == 'serial': 16 | from can.interfaces.serial_can import * 17 | elif can.rc['interface'] == 'pcan': 18 | from can.interfaces.pcan import * 19 | else: 20 | raise ImportError("CAN interface not found") 21 | -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/can/interfaces/interface.py: -------------------------------------------------------------------------------- 1 | import can 2 | 3 | if can.rc['interface'] == 'kvaser': 4 | from can.interfaces.kvaser import * 5 | elif can.rc['interface'] == 'socketcan_ctypes': 6 | from can.interfaces.socketcan_ctypes import * 7 | elif can.rc['interface'] == 'socketcan_native': 8 | from can.interfaces.socketcan_native import * 9 | elif can.rc['interface'] == 'socketcan': 10 | # try both 11 | try: 12 | from can.interfaces.socketcan_native import * 13 | except ImportError: 14 | from can.interfaces.socketcan_ctypes import * 15 | elif can.rc['interface'] == 'serial': 16 | from can.interfaces.serial_can import * 17 | elif can.rc['interface'] == 'pcan': 18 | from can.interfaces.pcan import * 19 | else: 20 | raise ImportError("CAN interface not found") 21 | -------------------------------------------------------------------------------- /deps/python-can/can/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | can is an object-orient Controller Area Network interface module. 3 | 4 | Modules include: 5 | 6 | :mod:`can.message` 7 | defines the :class:`~can.Message` class which is the 8 | lowest level of OO access to the library. 9 | 10 | """ 11 | import logging 12 | log = logging.getLogger('can') 13 | 14 | 15 | class CanError(IOError): 16 | pass 17 | 18 | from can.CAN import BufferedReader, Listener, Printer, CSVWriter, SqliteWriter, set_logging_level 19 | from can.message import Message 20 | from can.bus import BusABC 21 | from can.notifier import Notifier 22 | from can.broadcastmanager import send_periodic, CyclicSendTaskABC, MultiRateCyclicSendTaskABC 23 | from can.util import load_config 24 | 25 | log.debug("Loading can configuration") 26 | rc = load_config() 27 | log.debug("RC: {}".format(rc)) 28 | 29 | from can.interfaces import interface 30 | 31 | -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/can/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | can is an object-orient Controller Area Network interface module. 3 | 4 | Modules include: 5 | 6 | :mod:`can.message` 7 | defines the :class:`~can.Message` class which is the 8 | lowest level of OO access to the library. 9 | 10 | """ 11 | import logging 12 | log = logging.getLogger('can') 13 | 14 | 15 | class CanError(IOError): 16 | pass 17 | 18 | from can.CAN import BufferedReader, Listener, Printer, CSVWriter, SqliteWriter, set_logging_level 19 | from can.message import Message 20 | from can.bus import BusABC 21 | from can.notifier import Notifier 22 | from can.broadcastmanager import send_periodic, CyclicSendTaskABC, MultiRateCyclicSendTaskABC 23 | from can.util import load_config 24 | 25 | log.debug("Loading can configuration") 26 | rc = load_config() 27 | log.debug("RC: {}".format(rc)) 28 | 29 | from can.interfaces import interface 30 | 31 | -------------------------------------------------------------------------------- /deps/python-can/setup.py: -------------------------------------------------------------------------------- 1 | """ 2 | python-can requires the setuptools package to be installed. 3 | """ 4 | 5 | from setuptools import setup, find_packages 6 | 7 | __version__ = 1.4 8 | 9 | import logging 10 | logging.basicConfig(level=logging.WARNING) 11 | 12 | setup( 13 | name="python-can", 14 | url="https://bitbucket.org/hardbyte/python-can", 15 | version=__version__, 16 | packages=find_packages(), 17 | author="Brian Thorne", 18 | author_email="hardbyte@gmail.com", 19 | description="Controller Area Network interface module for Python", 20 | long_description=open('README.md').read(), 21 | license="LGPL v3", 22 | package_data={ 23 | "": ["CONTRIBUTORS.txt", "LICENSE.txt"], 24 | "doc": ["*.*"] 25 | }, 26 | 27 | scripts=["./bin/can_logger.py", './bin/j1939_logger.py'], 28 | 29 | # Tests can be run using `python setup.py test` 30 | test_suite="nose.collector", 31 | tests_require=['mock'] 32 | ) 33 | -------------------------------------------------------------------------------- /deps/python-can/doc/bus.rst: -------------------------------------------------------------------------------- 1 | .. _can.bus: 2 | 3 | Bus 4 | --- 5 | 6 | The :class:`~can.Bus` class, as the name suggests, provides an abstraction of a CAN bus. 7 | The bus provides a wrapper around a physical or virtual CAN Bus. Where the interface 8 | supports it, message filtering is carried out for each bus. 9 | 10 | 11 | API 12 | '''' 13 | 14 | .. autoclass:: can.BusABC 15 | :members: 16 | 17 | 18 | Transmitting 19 | '''''''''''' 20 | 21 | Writing to the bus is done by calling the :meth:`~can.Bus.send` method and 22 | passing a :class:`~can.Message` object. 23 | 24 | Receiving 25 | ''''''''' 26 | 27 | Reading from the bus is achieved by either calling the :meth:`~can.BusABC.recv` method or 28 | by directly iterating over the bus:: 29 | 30 | for msg in bus: 31 | print(msg.data) 32 | 33 | Alternatively the :class:`~can.Listener` api can be used, which is a list of :class:`~can.Listener` 34 | subclasses that receive notifications when new messages arrive. 35 | -------------------------------------------------------------------------------- /deps/python-can/examples/virtual_can_demo.py: -------------------------------------------------------------------------------- 1 | """ 2 | This demo creates multiple processes of Producers to spam a socketcan bus. 3 | """ 4 | 5 | import time 6 | import logging 7 | import concurrent.futures 8 | 9 | import can 10 | can.rc['interface'] = 'socketcan_native' 11 | from can.interfaces.interface import Bus 12 | can_interface = 'vcan0' 13 | 14 | 15 | def producer(id): 16 | """:param id: Spam the bus with messages including the data id.""" 17 | 18 | bus = Bus(can_interface) 19 | for i in range(16): 20 | msg = can.Message(arbitration_id=0x0cf02200, data=[id, i, 0, 1, 3, 1, 4, 1]) 21 | bus.send(msg) 22 | # TODO Issue #3: Need to keep running to ensure the writing threads stay alive. ? 23 | time.sleep(2) 24 | 25 | if __name__ == "__main__": 26 | #logging.getLogger('').setLevel(logging.DEBUG) 27 | with concurrent.futures.ProcessPoolExecutor(max_workers=4) as executor: 28 | executor.map(producer, range(5)) 29 | 30 | time.sleep(2) -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/examples/virtual_can_demo.py: -------------------------------------------------------------------------------- 1 | """ 2 | This demo creates multiple processes of Producers to spam a socketcan bus. 3 | """ 4 | 5 | import time 6 | import logging 7 | import concurrent.futures 8 | 9 | import can 10 | can.rc['interface'] = 'socketcan_native' 11 | from can.interfaces.interface import Bus 12 | can_interface = 'vcan0' 13 | 14 | 15 | def producer(id): 16 | """:param id: Spam the bus with messages including the data id.""" 17 | 18 | bus = Bus(can_interface) 19 | for i in range(16): 20 | msg = can.Message(arbitration_id=0x0cf02200, data=[id, i, 0, 1, 3, 1, 4, 1]) 21 | bus.send(msg) 22 | # TODO Issue #3: Need to keep running to ensure the writing threads stay alive. ? 23 | time.sleep(2) 24 | 25 | if __name__ == "__main__": 26 | #logging.getLogger('').setLevel(logging.DEBUG) 27 | with concurrent.futures.ProcessPoolExecutor(max_workers=4) as executor: 28 | executor.map(producer, range(5)) 29 | 30 | time.sleep(2) -------------------------------------------------------------------------------- /deps/python-can/doc/history.rst: -------------------------------------------------------------------------------- 1 | History and Roadmap 2 | =================== 3 | 4 | Background 5 | ---------- 6 | 7 | Dynamic Controls has been using and maintaining this library since 2009. 8 | Originally written by Ben Powell as a thin wrapper around the Kvaser SDK 9 | to support the leaf device. Maintenance was taken over and the project was 10 | open sourced by Brian Thorne in 2010. 11 | 12 | Original support for linux socketcan was added by Rose Lu as a summer coding 13 | project in 2011. 14 | 15 | The socketcan interface was helped immensely by Phil Dixon who wrote a 16 | leaf-socketcan driver for Linux. 17 | 18 | The pcan interface was contributed by Albert Bloomfield in 2013. 19 | 20 | Python 3 21 | -------- 22 | 23 | The Python 'socket' module contains support for SocketCAN in version 3.3. 24 | This library started targeting Python 3 as it was released as open source 25 | in 2013. 26 | 27 | Broadcast Connection Manager 28 | ---------------------------- 29 | 30 | From Python 3.4 BCM is natively supported so the plan is to integrate natively 31 | when Python 3.4 is more widespread. For now BCM is possible with the socketcan 32 | ctypes backend. 33 | -------------------------------------------------------------------------------- /deps/python-can/can/notifier.py: -------------------------------------------------------------------------------- 1 | import threading 2 | try: 3 | import queue 4 | except ImportError: 5 | import Queue as queue 6 | 7 | 8 | class Notifier(object): 9 | 10 | def __init__(self, bus, listeners, timeout=None): 11 | """Manages the distribution of **Messages** from a given bus to a 12 | list of listeners. 13 | 14 | :param bus: The :class:`~can.Bus` to listen too. 15 | :param listeners: An iterable of :class:`~can.Listeners` 16 | :param timeout: An optional maximum number of seconds to wait for any message. 17 | """ 18 | self.listeners = listeners 19 | self.bus = bus 20 | self.timeout = timeout 21 | 22 | self.running = threading.Event() 23 | self.running.set() 24 | 25 | self._reader = threading.Thread(target=self.rx_thread) 26 | self._reader.daemon = True 27 | 28 | self._reader.start() 29 | 30 | def rx_thread(self): 31 | while self.running.is_set(): 32 | msg = self.bus.recv(self.timeout) 33 | if msg is not None: 34 | for callback in self.listeners: 35 | callback(msg) 36 | -------------------------------------------------------------------------------- /deps/python-can/doc/kvaser.rst: -------------------------------------------------------------------------------- 1 | .. _sockdoc: 2 | 3 | Kvaser's CANLIB 4 | =============== 5 | 6 | 7 | Bus 8 | --- 9 | 10 | .. autoclass:: can.interfaces.kvaser.canlib.Bus 11 | 12 | 13 | Internals 14 | --------- 15 | 16 | The Kvaser :class:`~can.Bus` object with a physical CAN Bus has one bus handle which is shared 17 | by the read and write daemon threads. The access is protected with the 18 | ``writing_event`` *Event* and the ``done_writing`` *Condition*. 19 | 20 | The read thread acquires ``done_writing`` and while ``writing_event`` is set 21 | blocks waiting on the ``done_writing`` Condition. A 1ms blocking read is carried 22 | out before ``done_writing`` is released. 23 | 24 | The write thread blocks for 5ms on a queue (to allow the thread to stop). If 25 | a message was received it *sets* the writing_event to tell the read thread 26 | that a message in waiting to be sent. The ``done_writing`` is acquired for 27 | the actual write, the writing_event is cleared and the ``done_writing`` event 28 | is notified to start the read thread again. 29 | 30 | .. warning:: Any objects inheriting from `Bus`_ should *not* directly 31 | use the interface handle(/s). 32 | 33 | -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/can/notifier.py: -------------------------------------------------------------------------------- 1 | import threading 2 | try: 3 | import queue 4 | except ImportError: 5 | import Queue as queue 6 | 7 | 8 | class Notifier(object): 9 | 10 | def __init__(self, bus, listeners, timeout=None): 11 | """Manages the distribution of **Messages** from a given bus to a 12 | list of listeners. 13 | 14 | :param bus: The :class:`~can.Bus` to listen too. 15 | :param listeners: An iterable of :class:`~can.Listeners` 16 | :param timeout: An optional maximum number of seconds to wait for any message. 17 | """ 18 | self.listeners = listeners 19 | self.bus = bus 20 | self.timeout = timeout 21 | 22 | self.running = threading.Event() 23 | self.running.set() 24 | 25 | self._reader = threading.Thread(target=self.rx_thread) 26 | self._reader.daemon = True 27 | 28 | self._reader.start() 29 | 30 | def rx_thread(self): 31 | while self.running.is_set(): 32 | msg = self.bus.recv(self.timeout) 33 | if msg is not None: 34 | for callback in self.listeners: 35 | callback(msg) 36 | -------------------------------------------------------------------------------- /deps/python-can/doc/listeners.rst: -------------------------------------------------------------------------------- 1 | Listeners 2 | ========= 3 | 4 | Listener 5 | -------- 6 | 7 | The Listener class is an "abstract" base class for any objects which wish to 8 | register to receive notifications of new messages on the bus. A Listener can 9 | be used in two ways; the default is to **call** the Listener with a new 10 | message, or by calling the method **on_message_received**. 11 | 12 | Listeners are registered with :ref:`notifier` object(s) which ensure they are 13 | notified whenever a new message is received. 14 | 15 | Subclasses of Listener that do not override **on_message_received** will cause 16 | `NotImplementedError` to be thrown when a message is received on 17 | the CAN bus. 18 | 19 | .. autoclass:: can.Listener 20 | :members: 21 | 22 | 23 | BufferedReader 24 | -------------- 25 | 26 | .. autoclass:: can.BufferedReader 27 | :members: 28 | 29 | 30 | Printer 31 | ------- 32 | 33 | .. autoclass:: can.Printer 34 | :members: 35 | 36 | 37 | 38 | CSVWriter & SqliteWriter 39 | ------------------------ 40 | 41 | These Listeners simply create csv and sql files with the messages received. 42 | 43 | .. autoclass:: can.CSVWriter 44 | :members: 45 | 46 | .. autoclass:: can.SqliteWriter 47 | :members: 48 | -------------------------------------------------------------------------------- /deps/python-can/doc/socketcan_native.rst: -------------------------------------------------------------------------------- 1 | SocketCAN (python) 2 | ================== 3 | 4 | Python 3.3 added support for socketcan for linux systems. 5 | 6 | The socketcan_native interface directly uses Python's socket module to 7 | access SocketCAN on linux. This is the most direct route to the kernel 8 | and should provide the most responsive. 9 | 10 | The implementation features efficient filtering of can_id's, this filtering 11 | occurs in the kernel and is much much more efficient than filtering messages 12 | in Python. 13 | 14 | Python 3.4 added support for the Broadcast Connection Manager (BCM) 15 | protocol, which if enabled should be used for queueing periodic tasks. 16 | 17 | Documentation for the socket can backend file can be found: 18 | 19 | https://www.kernel.org/doc/Documentation/networking/can.txt 20 | 21 | 22 | Bus 23 | --- 24 | 25 | .. autoclass:: can.interfaces.socketcan_native.Bus 26 | 27 | 28 | Internals 29 | --------- 30 | 31 | createSocket 32 | ~~~~~~~~~~~~ 33 | 34 | .. autofunction:: can.interfaces.socketcan_native.createSocket 35 | 36 | 37 | bindSocket 38 | ~~~~~~~~~~ 39 | 40 | .. autofunction:: can.interfaces.socketcan_native.bindSocket 41 | 42 | 43 | capturePacket 44 | ~~~~~~~~~~~~~ 45 | 46 | .. autofunction:: can.interfaces.socketcan_native.capturePacket 47 | -------------------------------------------------------------------------------- /deps/python-can/python_can.egg-info/SOURCES.txt: -------------------------------------------------------------------------------- 1 | setup.py 2 | ./bin/can_logger.py 3 | ./bin/j1939_logger.py 4 | can/CAN.py 5 | can/__init__.py 6 | can/broadcastmanager.py 7 | can/bus.py 8 | can/message.py 9 | can/notifier.py 10 | can/util.py 11 | can/interfaces/PCANBasic.py 12 | can/interfaces/__init__.py 13 | can/interfaces/interface.py 14 | can/interfaces/pcan.py 15 | can/interfaces/serial_can.py 16 | can/interfaces/socketcan_constants.py 17 | can/interfaces/socketcan_ctypes.py 18 | can/interfaces/socketcan_native.py 19 | can/interfaces/kvaser/__init__.py 20 | can/interfaces/kvaser/argument_parser.py 21 | can/interfaces/kvaser/canlib.py 22 | can/interfaces/kvaser/constants.py 23 | can/protocols/__init__.py 24 | can/protocols/j1939/__init__.py 25 | can/protocols/j1939/arbitrationid.py 26 | can/protocols/j1939/constants.py 27 | can/protocols/j1939/node.py 28 | can/protocols/j1939/nodename.py 29 | can/protocols/j1939/pdu.py 30 | can/protocols/j1939/pgn.py 31 | examples/__init__.py 32 | examples/cyclic.py 33 | examples/send_one.py 34 | examples/virtual_can_demo.py 35 | python_can.egg-info/PKG-INFO 36 | python_can.egg-info/SOURCES.txt 37 | python_can.egg-info/dependency_links.txt 38 | python_can.egg-info/top_level.txt 39 | test/__init__.py 40 | test/j1939_test.py 41 | test/network_test.py 42 | test/test_kvaser.py -------------------------------------------------------------------------------- /deps/python-can/.hgtags: -------------------------------------------------------------------------------- 1 | 554aa7e41b8815a97175ea80d4ad782c044d7a8e 0.0 2 | 59e7a6a9d8a2a2e320d7ac86a84f57b8a13b7f16 0.0.1 3 | 247fc3771df6078f411c5d15966c18883c73779e 0.0.2 4 | fb32638356a07c0e27bd3d43907945d20fe5a5cc 0.0.3 5 | aa4f0b92bd54b6d7fa4cfc02f9f79e081287baeb 0.0.4 6 | 52c0ffae1d06674b3a02a460ec481816226b03c3 0.0.5 7 | 5389b02b32d576ec21ba74ad57774b4d071905ff 0.0.6 8 | d5f0d65f312d9745dba106c4e32806c407ec624e 0.0.7 9 | 32de1eb19441acbc1b5919047ea2ce11b412934d 0.0.8 10 | fae041e5ea228d0a86825f0f000db84c75970005 0.0.9 11 | 66f43822835048bed7a024b7ecabfb34263f4e90 0.1.0 12 | 99fec0326800d63795d38fae208cfef9c6a79def 0.2.0 13 | bd68e5f4c362017c0d45a59393d8bf3e0d9973cc 0.2.1 14 | 623e0c3d3ce3abc451c5ecccf3a4e8687168fe3a 0.2.2 15 | e8c1ee4bab43ace098156288c73bb23404998cfb 0.2.3 16 | aa8e6f6da85077026dec5b6b178888f9a470aed0 0.2.4 17 | b23bc97dc4cd54ec5d1ba8ecf94b25f2422a3313 0.2.5 18 | ef83fcda0b0ad46563a6a717f9146c9c390ae5ed 0.3.0 19 | 4f9e2d8989cae18451290001fc1746e20198addf 0.3.1 20 | 06d28f7e3762e377e9376ffc67b78f039c1a2033 0.3.2 21 | d494c8fa6f04aae26983cba65a4ef4528c21d2c4 0.3.3 22 | edae01bf767ae387ce3cf9ec10efafa5946e3236 0.3.4 23 | 26723b8a8db52539b8a8190cc00bd7853b215b8c 0.4 24 | 58e8d3032406b6264de27bd48edc0a867ef78bff 0.4.1 25 | d3c228c28ed10db4fcbb9e7bfd0c9f45b11e9515 v1.0 26 | aa92eeca822c3bd58e58c77e0f4ad3306394c38e 1.0.0 27 | -------------------------------------------------------------------------------- /deps/python-can/test/test_kvaser.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | Mocks ctypes and checks that the correct low level calls are made. 4 | """ 5 | 6 | import ctypes 7 | 8 | import unittest 9 | 10 | from mock import patch, MagicMock, Mock 11 | 12 | 13 | class KvaserTest(unittest.TestCase): 14 | 15 | def test_bus_creation(self): 16 | 17 | with patch.dict('sys.modules', ctypes=ctypes): 18 | 19 | from can.interfaces import kvaser as interface 20 | from can.interfaces.kvaser import canlib 21 | 22 | canlib.canGetNumberOfChannels = Mock(return_value=1) 23 | canlib.canOpenChannel = Mock(return_value=0) 24 | canlib.canIoCtl = Mock(return_value=0) 25 | canlib.canSetBusParams = Mock() 26 | canlib.canBusOn = Mock() 27 | canlib.canSetBusOutputControl = Mock() 28 | canlib.canWriteWait = Mock() 29 | 30 | 31 | b = interface.Bus(0) 32 | 33 | canlib.canGetNumberOfChannels.assert_called_once() 34 | canlib.canBusOn.assert_called_once() 35 | 36 | msg = interface.Message( 37 | arbitration_id=0xc0ffee, 38 | data=[0, 25, 0, 1, 3, 1, 4, 1], 39 | extended_id=False) 40 | 41 | b.send(msg) 42 | 43 | canlib.canWriteWait.assert_called_once() 44 | 45 | 46 | if __name__ == '__main__': 47 | unittest.main() 48 | -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/test/test_kvaser.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | Mocks ctypes and checks that the correct low level calls are made. 4 | """ 5 | 6 | import ctypes 7 | 8 | import unittest 9 | 10 | from mock import patch, MagicMock, Mock 11 | 12 | 13 | class KvaserTest(unittest.TestCase): 14 | 15 | def test_bus_creation(self): 16 | 17 | with patch.dict('sys.modules', ctypes=ctypes): 18 | 19 | from can.interfaces import kvaser as interface 20 | from can.interfaces.kvaser import canlib 21 | 22 | canlib.canGetNumberOfChannels = Mock(return_value=1) 23 | canlib.canOpenChannel = Mock(return_value=0) 24 | canlib.canIoCtl = Mock(return_value=0) 25 | canlib.canSetBusParams = Mock() 26 | canlib.canBusOn = Mock() 27 | canlib.canSetBusOutputControl = Mock() 28 | canlib.canWriteWait = Mock() 29 | 30 | 31 | b = interface.Bus(0) 32 | 33 | canlib.canGetNumberOfChannels.assert_called_once() 34 | canlib.canBusOn.assert_called_once() 35 | 36 | msg = interface.Message( 37 | arbitration_id=0xc0ffee, 38 | data=[0, 25, 0, 1, 3, 1, 4, 1], 39 | extended_id=False) 40 | 41 | b.send(msg) 42 | 43 | canlib.canWriteWait.assert_called_once() 44 | 45 | 46 | if __name__ == '__main__': 47 | unittest.main() 48 | -------------------------------------------------------------------------------- /src/canbus_listener.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import rospy 3 | from canbus_interface.msg import CanFrame 4 | from canbus_interface.srv import CanFrameSrv 5 | import can 6 | 7 | class canbus_ros_interface(can.Listener): 8 | def __init__(self,bus): 9 | self.bus = bus 10 | # whenever a message appears on the bus, this node will try to publish it in the ros network 11 | notifier = can.Notifier(bus, [self]) 12 | 13 | self.canpub = rospy.Publisher('data', CanFrame) 14 | self.cansrv = rospy.Service('send_frame', CanFrameSrv, self.send_message) 15 | 16 | def on_message_received(self,msg): 17 | #rospy.loginfo("received this %s"%(msg)) 18 | canframe = CanFrame() 19 | canframe.timestamp = rospy.Time.now() 20 | canframe.arbitration_id = msg.arbitration_id 21 | canframe.data = [x for x in msg.data] 22 | #rospy.loginfo("sending this %s"%(canframe)) 23 | self.canpub.publish(canframe) 24 | 25 | def send_message(self, req): 26 | #rospy.loginfo("sending message"%(req)) 27 | #TODO implement this 28 | pass 29 | 30 | if __name__=='__main__': 31 | rospy.init_node('can') 32 | can_ifname = rospy.get_param('can_ifname','can0') 33 | bus = can.interface.Bus(can_ifname) 34 | canros = canbus_ros_interface(bus) 35 | r = rospy.Rate(10) 36 | try: 37 | while not rospy.is_shutdown(): 38 | r.sleep() 39 | except KeyboardInterrupt: 40 | bus.shutdown() 41 | 42 | -------------------------------------------------------------------------------- /deps/python-can/.hg/cache/tags: -------------------------------------------------------------------------------- 1 | 473 4baa9ebb48c1fa6702613c617972ea46b5d4206f db5cae8ccd60c2c0703f5e7f1026a0a8a6288347 2 | 404 7615c760c59f483738ca1ec8c85380d3045ef1be db5cae8ccd60c2c0703f5e7f1026a0a8a6288347 3 | 4 | aa92eeca822c3bd58e58c77e0f4ad3306394c38e 1.0.0 5 | 554aa7e41b8815a97175ea80d4ad782c044d7a8e 0.0 6 | 26723b8a8db52539b8a8190cc00bd7853b215b8c 0.4 7 | b23bc97dc4cd54ec5d1ba8ecf94b25f2422a3313 0.2.5 8 | aa8e6f6da85077026dec5b6b178888f9a470aed0 0.2.4 9 | e8c1ee4bab43ace098156288c73bb23404998cfb 0.2.3 10 | 623e0c3d3ce3abc451c5ecccf3a4e8687168fe3a 0.2.2 11 | bd68e5f4c362017c0d45a59393d8bf3e0d9973cc 0.2.1 12 | 99fec0326800d63795d38fae208cfef9c6a79def 0.2.0 13 | 66f43822835048bed7a024b7ecabfb34263f4e90 0.1.0 14 | 52c0ffae1d06674b3a02a460ec481816226b03c3 0.0.5 15 | aa4f0b92bd54b6d7fa4cfc02f9f79e081287baeb 0.0.4 16 | d5f0d65f312d9745dba106c4e32806c407ec624e 0.0.7 17 | 5389b02b32d576ec21ba74ad57774b4d071905ff 0.0.6 18 | 59e7a6a9d8a2a2e320d7ac86a84f57b8a13b7f16 0.0.1 19 | fb32638356a07c0e27bd3d43907945d20fe5a5cc 0.0.3 20 | 247fc3771df6078f411c5d15966c18883c73779e 0.0.2 21 | 06d28f7e3762e377e9376ffc67b78f039c1a2033 0.3.2 22 | d494c8fa6f04aae26983cba65a4ef4528c21d2c4 0.3.3 23 | ef83fcda0b0ad46563a6a717f9146c9c390ae5ed 0.3.0 24 | 4f9e2d8989cae18451290001fc1746e20198addf 0.3.1 25 | fae041e5ea228d0a86825f0f000db84c75970005 0.0.9 26 | 32de1eb19441acbc1b5919047ea2ce11b412934d 0.0.8 27 | edae01bf767ae387ce3cf9ec10efafa5946e3236 0.3.4 28 | d3c228c28ed10db4fcbb9e7bfd0c9f45b11e9515 v1.0 29 | 58e8d3032406b6264de27bd48edc0a867ef78bff 0.4.1 30 | -------------------------------------------------------------------------------- /deps/python-can/doc/index.rst: -------------------------------------------------------------------------------- 1 | python-can 2 | ========== 3 | 4 | `python-can` is a library for interacting with a controller area network. 5 | 6 | The **Controller Area Network** is a bus standard designed to allow embedded 7 | devices to communicate with each other. It has priority based bus arbitration, 8 | reliable deterministic communication. It is used in cars, trucks, boats, 9 | wheelchairs and more. 10 | 11 | 12 | Contents: 13 | 14 | .. toctree:: 15 | :maxdepth: 2 16 | 17 | interfaces 18 | api 19 | protocols 20 | bin 21 | overview 22 | history 23 | 24 | 25 | Example 26 | ~~~~~~~ 27 | 28 | This example shows the library in action - sending one message: 29 | 30 | 31 | .. literalinclude:: ../examples/send_one.py 32 | :language: python 33 | :linenos: 34 | 35 | 36 | 37 | Installation and Quickstart 38 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 39 | 40 | See the readme included with the source code. 41 | 42 | https://bitbucket.org/hardbyte/python-can 43 | 44 | Known Bugs 45 | ~~~~~~~~~~ 46 | 47 | See the project `bug tracker`_ on bitbucket. Patches and pull requests very welcome! 48 | 49 | 50 | .. admonition:: Documentation generated 51 | 52 | |today| 53 | 54 | 55 | .. _Python: http://www.python.org 56 | .. _Setuptools: http://pypi.python.org/pypi/setuptools 57 | .. _Pip: http://pip.openplans.org/ 58 | .. _easy_install: http://peak.telecommunity.com/DevCenter/EasyInstall 59 | .. _IPython: http://ipython.scipy.org 60 | .. _Mercurial: http://mercurial.selenic.com 61 | .. _TortoiseHG: http://tortoisehg.bitbucket.org/ 62 | .. _bug tracker: https://bitbucket.org/hardbyte/python-can/issues -------------------------------------------------------------------------------- /deps/python-can/doc/socketcan_ctypes.rst: -------------------------------------------------------------------------------- 1 | SocketCAN (ctypes) 2 | ================== 3 | 4 | `socketcan_ctypes.py` is a ctypes wrapper class around libc. It contains replications 5 | of constants and structures found in various linux header files. With 6 | Python 3.3, much of the functionality of this library is likely to be 7 | available natively in the Python socket module. 8 | 9 | 10 | 11 | Bus 12 | ---- 13 | 14 | .. autoclass:: can.interfaces.socketcan_ctypes.Bus 15 | 16 | 17 | 18 | Broadcast-Manager 19 | ----------------- 20 | 21 | The ``socketcan_ctypes`` interface implements thin wrappers to the linux `broadcast manager` 22 | socket api. This allows the cyclic transmission of CAN messages at given intervals. 23 | The overhead for periodic message sending is extremely low as all the heavy lifting occurs 24 | within the linux kernel. 25 | 26 | send_periodic() 27 | ~~~~~~~~~~~~~~~ 28 | 29 | An example that uses the send_periodic is included in ``python-can/examples/cyclic.py`` 30 | 31 | The object returned can be used to halt, alter or cancel the periodic message task. 32 | 33 | .. autoclass:: can.interfaces.socketcan_ctypes.CyclicSendTask 34 | 35 | 36 | Internals 37 | --------- 38 | 39 | createSocket 40 | ~~~~~~~~~~~~ 41 | 42 | .. autofunction:: can.interfaces.socketcan_ctypes.createSocket 43 | 44 | 45 | bindSocket 46 | ~~~~~~~~~~ 47 | 48 | .. autofunction:: can.interfaces.socketcan_ctypes.bindSocket 49 | 50 | connectSocket 51 | 52 | .. autofunction:: can.interfaces.socketcan_ctypes.connectSocket 53 | 54 | capturePacket 55 | ~~~~~~~~~~~~~ 56 | 57 | .. autofunction:: can.interfaces.socketcan_ctypes.capturePacket 58 | -------------------------------------------------------------------------------- /deps/python-can/can/interfaces/kvaser/argument_parser.py: -------------------------------------------------------------------------------- 1 | 2 | def add_to_parser(parser): 3 | parser.add_argument("-c", "--channel", type=str, dest="channel", 4 | help=""" 5 | If the CAN interface supports multiple channels, select which one 6 | you are after here. For example on linux this might be 1 7 | """, default='0') 8 | 9 | parser.add_argument("-b", "--bitrate", type=int, dest="bitrate", 10 | help="CAN bus bitrate", default=1000000) 11 | 12 | parser.add_argument("--tseg1", type=int, dest="tseg1", 13 | help="CAN bus tseg1", default=4) 14 | 15 | parser.add_argument("--tseg2", type=int, dest="tseg2", 16 | help="CAN bus tseg2", default=3) 17 | 18 | parser.add_argument("--sjw", type=int, dest="sjw", 19 | help="Synchronisation Jump Width decides the maximum number of time quanta that the controller can resynchronise every bit.", 20 | default=1) 21 | 22 | parser.add_argument("-n", "--num_samples", type=int, dest="no_samp", 23 | help="""Some CAN controllers can also sample each bit three times. 24 | In this case, the bit will be sampled three quanta in a row, 25 | with the last sample being taken in the edge between TSEG1 and TSEG2. 26 | 27 | Three samples should only be used for relatively slow baudrates.""", 28 | default=1) 29 | 30 | -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/can/interfaces/kvaser/argument_parser.py: -------------------------------------------------------------------------------- 1 | 2 | def add_to_parser(parser): 3 | parser.add_argument("-c", "--channel", type=str, dest="channel", 4 | help=""" 5 | If the CAN interface supports multiple channels, select which one 6 | you are after here. For example on linux this might be 1 7 | """, default='0') 8 | 9 | parser.add_argument("-b", "--bitrate", type=int, dest="bitrate", 10 | help="CAN bus bitrate", default=1000000) 11 | 12 | parser.add_argument("--tseg1", type=int, dest="tseg1", 13 | help="CAN bus tseg1", default=4) 14 | 15 | parser.add_argument("--tseg2", type=int, dest="tseg2", 16 | help="CAN bus tseg2", default=3) 17 | 18 | parser.add_argument("--sjw", type=int, dest="sjw", 19 | help="Synchronisation Jump Width decides the maximum number of time quanta that the controller can resynchronise every bit.", 20 | default=1) 21 | 22 | parser.add_argument("-n", "--num_samples", type=int, dest="no_samp", 23 | help="""Some CAN controllers can also sample each bit three times. 24 | In this case, the bit will be sampled three quanta in a row, 25 | with the last sample being taken in the edge between TSEG1 and TSEG2. 26 | 27 | Three samples should only be used for relatively slow baudrates.""", 28 | default=1) 29 | 30 | -------------------------------------------------------------------------------- /deps/python-can/doc/pycanlib.pml: -------------------------------------------------------------------------------- 1 | /* This promela model was used to verify the concurrent design of the bus object. */ 2 | 3 | bool lock = false; 4 | 5 | inline enterMon() { 6 | atomic { 7 | !lock; 8 | lock = true; 9 | } 10 | } 11 | 12 | inline leaveMon() { 13 | lock = false; 14 | } 15 | 16 | typedef Condition { 17 | bool gate; 18 | byte waiting; 19 | } 20 | 21 | #define emptyC(C) (C.waiting == 0) 22 | 23 | inline waitC(C) { 24 | atomic { 25 | C.waiting++; 26 | lock = false; 27 | C.gate; 28 | C.gate = false; 29 | C.waiting--; 30 | } 31 | } 32 | 33 | inline signalC(C) { 34 | atomic { 35 | if 36 | :: (C.waiting > 0) -> 37 | C.gate = true; 38 | !lock; 39 | lock = true; 40 | :: else 41 | fi; 42 | } 43 | } 44 | 45 | mtype = { clear, set }; 46 | mtype writing_event = clear; 47 | 48 | byte critical = 0; 49 | Condition done_writing; 50 | 51 | bool live = false; 52 | 53 | active proctype RX() 54 | { 55 | end: 56 | do 57 | :: enterMon(); 58 | if 59 | :: (writing_event == set) -> 60 | waitC(done_writing); 61 | :: else 62 | fi; 63 | critical++; 64 | assert(critical == 1); 65 | live = true; 66 | live = false; 67 | critical--; 68 | leaveMon(); 69 | od 70 | } 71 | 72 | active proctype TX() 73 | { 74 | end: 75 | do 76 | :: atomic { 77 | writing_event == clear -> 78 | writing_event = set; 79 | } 80 | enterMon(); 81 | critical++; 82 | assert(critical == 1); 83 | live = true; 84 | live = false; 85 | critical--; 86 | writing_event = clear; 87 | signalC(done_writing); 88 | leaveMon(); 89 | od 90 | } 91 | ltl {[]<> live} 92 | -------------------------------------------------------------------------------- /deps/python-can/can/protocols/j1939/pgn.py: -------------------------------------------------------------------------------- 1 | class PGN(object): 2 | def __init__(self, reserved_flag=False, data_page_flag=False, pdu_format=0, pdu_specific=0): 3 | self.reserved_flag = reserved_flag 4 | self.data_page_flag = data_page_flag 5 | self.pdu_format = pdu_format 6 | self.pdu_specific = pdu_specific 7 | 8 | 9 | @property 10 | def is_pdu1(self): 11 | return ((self.pdu_format < 240) or self.reserved_flag or self.data_page_flag) 12 | 13 | @property 14 | def is_pdu2(self): 15 | return not self.is_pdu1 16 | 17 | @property 18 | def is_destination_specific(self): 19 | return self.is_pdu1 20 | 21 | @property 22 | def value(self): 23 | _pgn_flags_byte = ((self.reserved_flag << 1) + self.data_page_flag) 24 | return int("%.2x%.2x%.2x" % (_pgn_flags_byte, self.pdu_format, self.pdu_specific), 16) 25 | 26 | 27 | @value.setter 28 | def value(self, value): 29 | self.reserved_flag = (value & 0x020000) >> 17 30 | self.data_page_flag = (value & 0x010000) >> 16 31 | self.pdu_format = (value & 0x00FF00) >> 8 32 | self.pdu_specific = value & 0x0000FF 33 | 34 | @staticmethod 35 | def from_value(value): 36 | pgn = PGN() 37 | pgn.value = value 38 | return pgn 39 | 40 | def __str__(self): 41 | retval = "" 42 | _temp = self.value 43 | if self.is_destination_specific: 44 | _temp -= self.pdu_specific 45 | retval += ("0x%.4x " % (_temp & 0xFFFF)) 46 | if self.reserved_flag: 47 | retval += "R " 48 | else: 49 | retval += " " 50 | if self.data_page_flag: 51 | retval += "P " 52 | else: 53 | retval += " " 54 | return retval 55 | -------------------------------------------------------------------------------- /deps/python-can/examples/cyclic.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | This example exercises the periodic sending capabilities. 4 | 5 | Expects a vcan0 interface: 6 | 7 | python3 -m examples.cyclic 8 | 9 | """ 10 | 11 | import logging 12 | import time 13 | 14 | logging.basicConfig(level=logging.INFO) 15 | import can 16 | can.rc['interface'] = 'socketcan_ctypes' 17 | 18 | from can.interfaces.interface import * 19 | 20 | 21 | def test_simple_periodic_send(): 22 | print("Trying to send a message...") 23 | msg = Message(arbitration_id=0x0cf02200, data=[0, 1, 3, 1, 4, 1]) 24 | task = can.send_periodic('vcan0', msg, 0.020) 25 | time.sleep(2) 26 | 27 | print("Trying to change data") 28 | msg.data[0] = 99 29 | task.modify_data(msg) 30 | time.sleep(2) 31 | 32 | task.stop() 33 | print("stopped cyclic send") 34 | 35 | time.sleep(1) 36 | task.start() 37 | print("starting again") 38 | time.sleep(1) 39 | print("done") 40 | 41 | 42 | def test_dual_rate_periodic_send(): 43 | """Send a message 10 times at 1ms intervals, then continue to send every 500ms""" 44 | msg = Message(arbitration_id=0x0c112200, data=[0, 1, 2, 3, 4, 5]) 45 | print("Creating cyclic task to send message 10 times at 1ms, then every 500ms") 46 | task = MultiRateCyclicSendTask('vcan0', msg, 10, 0.001, 0.50) 47 | time.sleep(2) 48 | 49 | print("Changing data[0] = 0x42") 50 | msg.data[0] = 0x42 51 | task.modify_data(msg) 52 | time.sleep(2) 53 | 54 | task.stop() 55 | print("stopped cyclic send") 56 | 57 | time.sleep(2) 58 | 59 | task.start() 60 | print("starting again") 61 | time.sleep(2) 62 | print("done") 63 | 64 | 65 | if __name__ == "__main__": 66 | 67 | #test_simple_periodic_send() 68 | test_dual_rate_periodic_send() -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/can/protocols/j1939/pgn.py: -------------------------------------------------------------------------------- 1 | class PGN(object): 2 | def __init__(self, reserved_flag=False, data_page_flag=False, pdu_format=0, pdu_specific=0): 3 | self.reserved_flag = reserved_flag 4 | self.data_page_flag = data_page_flag 5 | self.pdu_format = pdu_format 6 | self.pdu_specific = pdu_specific 7 | 8 | 9 | @property 10 | def is_pdu1(self): 11 | return ((self.pdu_format < 240) or self.reserved_flag or self.data_page_flag) 12 | 13 | @property 14 | def is_pdu2(self): 15 | return not self.is_pdu1 16 | 17 | @property 18 | def is_destination_specific(self): 19 | return self.is_pdu1 20 | 21 | @property 22 | def value(self): 23 | _pgn_flags_byte = ((self.reserved_flag << 1) + self.data_page_flag) 24 | return int("%.2x%.2x%.2x" % (_pgn_flags_byte, self.pdu_format, self.pdu_specific), 16) 25 | 26 | 27 | @value.setter 28 | def value(self, value): 29 | self.reserved_flag = (value & 0x020000) >> 17 30 | self.data_page_flag = (value & 0x010000) >> 16 31 | self.pdu_format = (value & 0x00FF00) >> 8 32 | self.pdu_specific = value & 0x0000FF 33 | 34 | @staticmethod 35 | def from_value(value): 36 | pgn = PGN() 37 | pgn.value = value 38 | return pgn 39 | 40 | def __str__(self): 41 | retval = "" 42 | _temp = self.value 43 | if self.is_destination_specific: 44 | _temp -= self.pdu_specific 45 | retval += ("0x%.4x " % (_temp & 0xFFFF)) 46 | if self.reserved_flag: 47 | retval += "R " 48 | else: 49 | retval += " " 50 | if self.data_page_flag: 51 | retval += "P " 52 | else: 53 | retval += " " 54 | return retval 55 | -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/examples/cyclic.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | This example exercises the periodic sending capabilities. 4 | 5 | Expects a vcan0 interface: 6 | 7 | python3 -m examples.cyclic 8 | 9 | """ 10 | 11 | import logging 12 | import time 13 | 14 | logging.basicConfig(level=logging.INFO) 15 | import can 16 | can.rc['interface'] = 'socketcan_ctypes' 17 | 18 | from can.interfaces.interface import * 19 | 20 | 21 | def test_simple_periodic_send(): 22 | print("Trying to send a message...") 23 | msg = Message(arbitration_id=0x0cf02200, data=[0, 1, 3, 1, 4, 1]) 24 | task = can.send_periodic('vcan0', msg, 0.020) 25 | time.sleep(2) 26 | 27 | print("Trying to change data") 28 | msg.data[0] = 99 29 | task.modify_data(msg) 30 | time.sleep(2) 31 | 32 | task.stop() 33 | print("stopped cyclic send") 34 | 35 | time.sleep(1) 36 | task.start() 37 | print("starting again") 38 | time.sleep(1) 39 | print("done") 40 | 41 | 42 | def test_dual_rate_periodic_send(): 43 | """Send a message 10 times at 1ms intervals, then continue to send every 500ms""" 44 | msg = Message(arbitration_id=0x0c112200, data=[0, 1, 2, 3, 4, 5]) 45 | print("Creating cyclic task to send message 10 times at 1ms, then every 500ms") 46 | task = MultiRateCyclicSendTask('vcan0', msg, 10, 0.001, 0.50) 47 | time.sleep(2) 48 | 49 | print("Changing data[0] = 0x42") 50 | msg.data[0] = 0x42 51 | task.modify_data(msg) 52 | time.sleep(2) 53 | 54 | task.stop() 55 | print("stopped cyclic send") 56 | 57 | time.sleep(2) 58 | 59 | task.start() 60 | print("starting again") 61 | time.sleep(2) 62 | print("done") 63 | 64 | 65 | if __name__ == "__main__": 66 | 67 | #test_simple_periodic_send() 68 | test_dual_rate_periodic_send() -------------------------------------------------------------------------------- /deps/python-can/can/interfaces/socketcan_constants.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Defines CAN constants. 4 | """ 5 | 6 | canMSG_EXT = 0x0004 7 | 8 | # BCM opcodes 9 | CAN_BCM_TX_SETUP = 1 10 | CAN_BCM_TX_DELETE = 2 11 | 12 | CAN_BCM_TX_EXPIRED = 9 13 | 14 | CAN_BCM_RX_TIMEOUT = 11 15 | 16 | 17 | # BCM flags 18 | SETTIMER = 0x0001 19 | STARTTIMER = 0x0002 20 | TX_COUNTEVT = 0x0004 21 | TX_ANNOUNCE = 0x0008 22 | TX_CP_CAN_ID = 0x0010 23 | RX_FILTER_ID = 0x0020 24 | RX_CHECK_DLC = 0x0040 25 | RX_NO_AUTOTIMER = 0x0080 26 | RX_ANNOUNCE_RESUME = 0x0100 27 | TX_RESET_MULTI_IDX = 0x0200 28 | RX_RTR_FRAME = 0x0400 29 | 30 | CAN_RAW = 1 31 | CAN_BCM = 2 32 | 33 | SOL_CAN_BASE = 100 34 | SOL_CAN_RAW = SOL_CAN_BASE + CAN_RAW 35 | 36 | CAN_RAW_FILTER = 1 37 | CAN_RAW_ERR_FILTER = 2 38 | CAN_RAW_LOOPBACK = 3 39 | CAN_RAW_RECV_OWN_MSGS = 4 40 | CAN_RAW_FD_FRAMES = 5 41 | 42 | MSK_ARBID = 0x1FFFFFFF 43 | MSK_FLAGS = 0xE0000000 44 | 45 | PF_CAN = 29 46 | SOCK_RAW = 3 47 | SOCK_DGRAM = 2 48 | AF_CAN = PF_CAN 49 | 50 | SIOCGIFINDEX = 0x8933 51 | SIOCGSTAMP = 0x8906 52 | EXTFLG = 0x0004 53 | 54 | SKT_ERRFLG = 0x0001 55 | SKT_RTRFLG = 0x0002 56 | 57 | PYCAN_ERRFLG = 0x0020 58 | PYCAN_STDFLG = 0x0002 59 | PYCAN_RTRFLG = 0x0001 60 | 61 | ID_TYPE_EXTENDED = True 62 | ID_TYPE_STANDARD = False 63 | 64 | ID_TYPE_29_BIT = ID_TYPE_EXTENDED 65 | ID_TYPE_11_BIT = ID_TYPE_STANDARD 66 | 67 | REMOTE_FRAME = True 68 | DATA_FRAME = False 69 | WAKEUP_MSG = True 70 | ERROR_FRAME = True 71 | 72 | DRIVER_MODE_SILENT = False 73 | DRIVER_MODE_NORMAL = (not DRIVER_MODE_SILENT) 74 | 75 | STD_ACCEPTANCE_MASK_ALL_BITS = (2**11 - 1) 76 | MAX_11_BIT_ID = STD_ACCEPTANCE_MASK_ALL_BITS 77 | 78 | EXT_ACCEPTANCE_MASK_ALL_BITS = (2**29 - 1) 79 | MAX_29_BIT_ID = EXT_ACCEPTANCE_MASK_ALL_BITS 80 | 81 | -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/can/interfaces/socketcan_constants.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Defines CAN constants. 4 | """ 5 | 6 | canMSG_EXT = 0x0004 7 | 8 | # BCM opcodes 9 | CAN_BCM_TX_SETUP = 1 10 | CAN_BCM_TX_DELETE = 2 11 | 12 | CAN_BCM_TX_EXPIRED = 9 13 | 14 | CAN_BCM_RX_TIMEOUT = 11 15 | 16 | 17 | # BCM flags 18 | SETTIMER = 0x0001 19 | STARTTIMER = 0x0002 20 | TX_COUNTEVT = 0x0004 21 | TX_ANNOUNCE = 0x0008 22 | TX_CP_CAN_ID = 0x0010 23 | RX_FILTER_ID = 0x0020 24 | RX_CHECK_DLC = 0x0040 25 | RX_NO_AUTOTIMER = 0x0080 26 | RX_ANNOUNCE_RESUME = 0x0100 27 | TX_RESET_MULTI_IDX = 0x0200 28 | RX_RTR_FRAME = 0x0400 29 | 30 | CAN_RAW = 1 31 | CAN_BCM = 2 32 | 33 | SOL_CAN_BASE = 100 34 | SOL_CAN_RAW = SOL_CAN_BASE + CAN_RAW 35 | 36 | CAN_RAW_FILTER = 1 37 | CAN_RAW_ERR_FILTER = 2 38 | CAN_RAW_LOOPBACK = 3 39 | CAN_RAW_RECV_OWN_MSGS = 4 40 | CAN_RAW_FD_FRAMES = 5 41 | 42 | MSK_ARBID = 0x1FFFFFFF 43 | MSK_FLAGS = 0xE0000000 44 | 45 | PF_CAN = 29 46 | SOCK_RAW = 3 47 | SOCK_DGRAM = 2 48 | AF_CAN = PF_CAN 49 | 50 | SIOCGIFINDEX = 0x8933 51 | SIOCGSTAMP = 0x8906 52 | EXTFLG = 0x0004 53 | 54 | SKT_ERRFLG = 0x0001 55 | SKT_RTRFLG = 0x0002 56 | 57 | PYCAN_ERRFLG = 0x0020 58 | PYCAN_STDFLG = 0x0002 59 | PYCAN_RTRFLG = 0x0001 60 | 61 | ID_TYPE_EXTENDED = True 62 | ID_TYPE_STANDARD = False 63 | 64 | ID_TYPE_29_BIT = ID_TYPE_EXTENDED 65 | ID_TYPE_11_BIT = ID_TYPE_STANDARD 66 | 67 | REMOTE_FRAME = True 68 | DATA_FRAME = False 69 | WAKEUP_MSG = True 70 | ERROR_FRAME = True 71 | 72 | DRIVER_MODE_SILENT = False 73 | DRIVER_MODE_NORMAL = (not DRIVER_MODE_SILENT) 74 | 75 | STD_ACCEPTANCE_MASK_ALL_BITS = (2**11 - 1) 76 | MAX_11_BIT_ID = STD_ACCEPTANCE_MASK_ALL_BITS 77 | 78 | EXT_ACCEPTANCE_MASK_ALL_BITS = (2**29 - 1) 79 | MAX_29_BIT_ID = EXT_ACCEPTANCE_MASK_ALL_BITS 80 | 81 | -------------------------------------------------------------------------------- /deps/python-can/can/protocols/j1939/constants.py: -------------------------------------------------------------------------------- 1 | # transport protocol PGNs 2 | PGN_TP_CONNECTION_MANAGEMENT = 0xec00 3 | PGN_TP_DATA_TRANSFER = 0xeb00 4 | 5 | # address claim PGNs 6 | PGN_AC_ADDRESS_CLAIMED = 0xee00 7 | PGN_AC_COMMANDED_ADDRESS = 0xfed8 8 | 9 | PGN_REQUEST_FOR_PGN = 0xea00 10 | 11 | pgn_strings = { 12 | PGN_TP_CONNECTION_MANAGEMENT: "PGN_TP_CONNECTION_MANAGEMENT", 13 | PGN_TP_DATA_TRANSFER: "PGN_TP_DATA_TRANSFER", 14 | PGN_AC_ADDRESS_CLAIMED: "PGN_AC_ADDRESS_CLAIMED", 15 | PGN_AC_COMMANDED_ADDRESS: "PGN_AC_COMMANDED_ADDRESS", 16 | PGN_REQUEST_FOR_PGN: "PGN_REQUEST_FOR_PGN" 17 | } 18 | 19 | DESTINATION_ADDRESS_NULL = 254 20 | DESTINATION_ADDRESS_GLOBAL = 255 21 | 22 | ADDRESS_UNCLAIMED = -1 23 | 24 | # connection management message types 25 | CM_MSG_TYPE_RTS = 0x10 26 | CM_MSG_TYPE_CTS = 0x11 27 | CM_MSG_TYPE_EOM_ACK = 0x13 28 | CM_MSG_TYPE_BAM = 0x20 29 | CM_MSG_TYPE_ABORT = 0xff 30 | 31 | # connection abort reasons 32 | CM_ABORT_UNKNOWN = 0 33 | CM_ABORT_SESSION_IN_PROGRESS = 1 34 | CM_ABORT_NO_RESOURCES = 2 35 | CM_ABORT_TIMEOUT = 3 36 | CM_ABORT_SAE_RESERVED_START = 4 37 | CM_ABORT_SAE_RESERVED_END = 250 38 | CM_ABORT_J1939_71_RESERVED_START = 251 39 | CM_ABORT_J1939_71_RESERVED_END = 255 40 | 41 | INDUSTRY_GROUP_GLOBAL = 0 42 | INDUSTRY_GROUP_HIGHWAY = 1 43 | INDUSTRY_GROUP_AGRICULTURAL = 2 44 | INDUSTRY_GROUP_CONSTRUCTION = 3 45 | INDUSTRY_GROUP_MARINE = 4 46 | INDUSTRY_GROUP_INDUSTRIAL = 5 47 | INDUSTRY_GROUP_RESERVED_1 = 6 48 | INDUSTRY_GROUP_RESERVED_2 = 7 49 | 50 | j1939_industry_groups = { 51 | INDUSTRY_GROUP_GLOBAL: "INDUSTRY_GROUP_GLOBAL", 52 | INDUSTRY_GROUP_HIGHWAY: "INDUSTRY_GROUP_HIGHWAY", 53 | INDUSTRY_GROUP_AGRICULTURAL: "INDUSTRY_GROUP_AGRICULTURAL", 54 | INDUSTRY_GROUP_CONSTRUCTION: "INDUSTRY_GROUP_CONSTRUCTION", 55 | INDUSTRY_GROUP_MARINE: "INDUSTRY_GROUP_MARINE", 56 | INDUSTRY_GROUP_INDUSTRIAL: "INDUSTRY_GROUP_INDUSTRIAL", 57 | INDUSTRY_GROUP_RESERVED_1: "INDUSTRY_GROUP_RESERVED_1", 58 | INDUSTRY_GROUP_RESERVED_2: "INDUSTRY_GROUP_RESERVED_2" 59 | } 60 | -------------------------------------------------------------------------------- /deps/python-can/can/protocols/j1939/arbitrationid.py: -------------------------------------------------------------------------------- 1 | from can.protocols.j1939.pgn import PGN 2 | 3 | 4 | class ArbitrationID(object): 5 | def __init__(self, priority=7, pgn=None, source_address=0): 6 | """ 7 | :param int priority: 8 | Between 0 and 7, where 0 is highest priority. 9 | 10 | :param :class:`can.protocols.j1939.PGN`/int pgn: 11 | The parameter group number. 12 | 13 | :param int source_address: 14 | Between 0 and 255. 15 | """ 16 | self.priority = priority 17 | self.pgn = pgn 18 | self.source_address = source_address 19 | 20 | 21 | @property 22 | def can_id(self): 23 | return (self.source_address + (self.pgn.value << 8) + (self.priority << 26)) 24 | 25 | 26 | @can_id.setter 27 | def can_id(self, value): 28 | """ 29 | Int between 0 and (2**29) - 1 30 | """ 31 | self.priority = (value & 0x1C000000) >> 26 32 | self.pgn.value = (value & 0x03FFFF00) >> 8 33 | self.source_address = value & 0x000000FF 34 | 35 | @property 36 | def destination_address(self): 37 | if self.pgn.is_destination_specific: 38 | return self.pgn.pdu_specific 39 | else: 40 | return None 41 | 42 | @property 43 | def pgn(self): 44 | return self._pgn 45 | 46 | @pgn.setter 47 | def pgn(self, other): 48 | if other is None: 49 | self._pgn = PGN() 50 | elif not isinstance(other, PGN): 51 | self._pgn = PGN.from_value(other) 52 | else: 53 | self._pgn = other 54 | 55 | def __str__(self): 56 | if self.destination_address is not None: 57 | retval = "PRI=%d PGN=%6s DST=0x%.2x SRC=0x%.2x" % ( 58 | self.priority, self.pgn, self.destination_address, self.source_address) 59 | else: 60 | retval = "PRI=%d PGN=%6s SRC=0x%.2x" % (self.priority, self.pgn, self.source_address) 61 | return retval 62 | 63 | -------------------------------------------------------------------------------- /deps/python-can/doc/overview.rst: -------------------------------------------------------------------------------- 1 | Developer's Overview 2 | =================== 3 | 4 | Explore the source code on bitbucket: 5 | https://bitbucket.org/hardbyte/python-can 6 | 7 | 8 | Code Structure 9 | -------------- 10 | 11 | The modules in ``python-can`` are: 12 | 13 | +---------------------------------+------------------------------------------------------+ 14 | |Module | Description | 15 | +=================================+======================================================+ 16 | |:doc:`interfaces ` | Contains interface dependent code. | 17 | +---------------------------------+------------------------------------------------------+ 18 | |:doc:`protocols ` | Currently just the J1939 protocol exists here | 19 | +---------------------------------+------------------------------------------------------+ 20 | |:doc:`bus ` | Contains the interface independent Bus object. | 21 | +---------------------------------+------------------------------------------------------+ 22 | |:doc:`CAN ` | Contains modules to emulate a CAN system, such as a | 23 | | | time stamps, read/write streams and listeners. | 24 | +---------------------------------+------------------------------------------------------+ 25 | |:doc:`message ` | Contains the interface independent Message object. | 26 | +---------------------------------+------------------------------------------------------+ 27 | |:doc:`notifier ` | An object which can be used to notify listeners. | 28 | +---------------------------------+------------------------------------------------------+ 29 | |:doc:`broadcastmanager ` | Contains interface independent broadcast manager | 30 | | | code. | 31 | +---------------------------------+------------------------------------------------------+ 32 | 33 | -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/can/protocols/j1939/constants.py: -------------------------------------------------------------------------------- 1 | # transport protocol PGNs 2 | PGN_TP_CONNECTION_MANAGEMENT = 0xec00 3 | PGN_TP_DATA_TRANSFER = 0xeb00 4 | 5 | # address claim PGNs 6 | PGN_AC_ADDRESS_CLAIMED = 0xee00 7 | PGN_AC_COMMANDED_ADDRESS = 0xfed8 8 | 9 | PGN_REQUEST_FOR_PGN = 0xea00 10 | 11 | pgn_strings = { 12 | PGN_TP_CONNECTION_MANAGEMENT: "PGN_TP_CONNECTION_MANAGEMENT", 13 | PGN_TP_DATA_TRANSFER: "PGN_TP_DATA_TRANSFER", 14 | PGN_AC_ADDRESS_CLAIMED: "PGN_AC_ADDRESS_CLAIMED", 15 | PGN_AC_COMMANDED_ADDRESS: "PGN_AC_COMMANDED_ADDRESS", 16 | PGN_REQUEST_FOR_PGN: "PGN_REQUEST_FOR_PGN" 17 | } 18 | 19 | DESTINATION_ADDRESS_NULL = 254 20 | DESTINATION_ADDRESS_GLOBAL = 255 21 | 22 | ADDRESS_UNCLAIMED = -1 23 | 24 | # connection management message types 25 | CM_MSG_TYPE_RTS = 0x10 26 | CM_MSG_TYPE_CTS = 0x11 27 | CM_MSG_TYPE_EOM_ACK = 0x13 28 | CM_MSG_TYPE_BAM = 0x20 29 | CM_MSG_TYPE_ABORT = 0xff 30 | 31 | # connection abort reasons 32 | CM_ABORT_UNKNOWN = 0 33 | CM_ABORT_SESSION_IN_PROGRESS = 1 34 | CM_ABORT_NO_RESOURCES = 2 35 | CM_ABORT_TIMEOUT = 3 36 | CM_ABORT_SAE_RESERVED_START = 4 37 | CM_ABORT_SAE_RESERVED_END = 250 38 | CM_ABORT_J1939_71_RESERVED_START = 251 39 | CM_ABORT_J1939_71_RESERVED_END = 255 40 | 41 | INDUSTRY_GROUP_GLOBAL = 0 42 | INDUSTRY_GROUP_HIGHWAY = 1 43 | INDUSTRY_GROUP_AGRICULTURAL = 2 44 | INDUSTRY_GROUP_CONSTRUCTION = 3 45 | INDUSTRY_GROUP_MARINE = 4 46 | INDUSTRY_GROUP_INDUSTRIAL = 5 47 | INDUSTRY_GROUP_RESERVED_1 = 6 48 | INDUSTRY_GROUP_RESERVED_2 = 7 49 | 50 | j1939_industry_groups = { 51 | INDUSTRY_GROUP_GLOBAL: "INDUSTRY_GROUP_GLOBAL", 52 | INDUSTRY_GROUP_HIGHWAY: "INDUSTRY_GROUP_HIGHWAY", 53 | INDUSTRY_GROUP_AGRICULTURAL: "INDUSTRY_GROUP_AGRICULTURAL", 54 | INDUSTRY_GROUP_CONSTRUCTION: "INDUSTRY_GROUP_CONSTRUCTION", 55 | INDUSTRY_GROUP_MARINE: "INDUSTRY_GROUP_MARINE", 56 | INDUSTRY_GROUP_INDUSTRIAL: "INDUSTRY_GROUP_INDUSTRIAL", 57 | INDUSTRY_GROUP_RESERVED_1: "INDUSTRY_GROUP_RESERVED_1", 58 | INDUSTRY_GROUP_RESERVED_2: "INDUSTRY_GROUP_RESERVED_2" 59 | } 60 | -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/can/protocols/j1939/arbitrationid.py: -------------------------------------------------------------------------------- 1 | from can.protocols.j1939.pgn import PGN 2 | 3 | 4 | class ArbitrationID(object): 5 | def __init__(self, priority=7, pgn=None, source_address=0): 6 | """ 7 | :param int priority: 8 | Between 0 and 7, where 0 is highest priority. 9 | 10 | :param :class:`can.protocols.j1939.PGN`/int pgn: 11 | The parameter group number. 12 | 13 | :param int source_address: 14 | Between 0 and 255. 15 | """ 16 | self.priority = priority 17 | self.pgn = pgn 18 | self.source_address = source_address 19 | 20 | 21 | @property 22 | def can_id(self): 23 | return (self.source_address + (self.pgn.value << 8) + (self.priority << 26)) 24 | 25 | 26 | @can_id.setter 27 | def can_id(self, value): 28 | """ 29 | Int between 0 and (2**29) - 1 30 | """ 31 | self.priority = (value & 0x1C000000) >> 26 32 | self.pgn.value = (value & 0x03FFFF00) >> 8 33 | self.source_address = value & 0x000000FF 34 | 35 | @property 36 | def destination_address(self): 37 | if self.pgn.is_destination_specific: 38 | return self.pgn.pdu_specific 39 | else: 40 | return None 41 | 42 | @property 43 | def pgn(self): 44 | return self._pgn 45 | 46 | @pgn.setter 47 | def pgn(self, other): 48 | if other is None: 49 | self._pgn = PGN() 50 | elif not isinstance(other, PGN): 51 | self._pgn = PGN.from_value(other) 52 | else: 53 | self._pgn = other 54 | 55 | def __str__(self): 56 | if self.destination_address is not None: 57 | retval = "PRI=%d PGN=%6s DST=0x%.2x SRC=0x%.2x" % ( 58 | self.priority, self.pgn, self.destination_address, self.source_address) 59 | else: 60 | retval = "PRI=%d PGN=%6s SRC=0x%.2x" % (self.priority, self.pgn, self.source_address) 61 | return retval 62 | 63 | -------------------------------------------------------------------------------- /deps/python-can/can/message.py: -------------------------------------------------------------------------------- 1 | import logging 2 | logger = logging.getLogger(__name__) 3 | 4 | 5 | class Message(object): 6 | """ 7 | Represents a CAN message. 8 | """ 9 | 10 | def __init__(self, timestamp=0.0, is_remote_frame=False, extended_id=True, 11 | is_error_frame=False, arbitration_id=0, dlc=None, data=None): 12 | 13 | self.timestamp = timestamp 14 | self.id_type = extended_id 15 | 16 | self.is_remote_frame = is_remote_frame 17 | self.is_error_frame = is_error_frame 18 | self.arbitration_id = arbitration_id 19 | 20 | #if isinstance(data, list): 21 | # data = bytes(data) 22 | 23 | if data is None: 24 | data = [] 25 | try: 26 | self.data = bytearray(data) 27 | except: 28 | logger.error("Couldn't create message from {} ({})".format(data, type(data))) 29 | if dlc is None: 30 | self.dlc = len(data) 31 | else: 32 | self.dlc = dlc 33 | 34 | assert self.dlc <= 8, "data link count was {} but it must be less than or equal to 8".format(self.dlc) 35 | 36 | def __str__(self): 37 | field_strings = ["%15.6f" % self.timestamp] 38 | if self.id_type: 39 | # Extended arbitrationID 40 | arbitration_id_string = "%.8x" % self.arbitration_id 41 | else: 42 | arbitration_id_string = "%.4x" % self.arbitration_id 43 | field_strings.append(arbitration_id_string.rjust(8, " ")) 44 | 45 | flag_string = "".join(map(str, map(int, 46 | [self.is_remote_frame, 47 | self.id_type, 48 | self.is_error_frame, 49 | ])) 50 | ) 51 | 52 | field_strings.append(flag_string) 53 | 54 | field_strings.append("%d" % self.dlc) 55 | data_strings = [] 56 | if self.data is not None: 57 | for byte in self.data: 58 | data_strings.append("%.2x" % byte) 59 | if len(data_strings) > 0: 60 | field_strings.append(" ".join(data_strings).ljust(24, " ")) 61 | else: 62 | field_strings.append(" " * 24) 63 | 64 | return " ".join(field_strings).strip() 65 | 66 | -------------------------------------------------------------------------------- /deps/python-can/can/interfaces/serial_can.py: -------------------------------------------------------------------------------- 1 | """ 2 | Enable basic can over a serial device. 3 | 4 | E.g. over bluetooth with "/dev/rfcomm0" 5 | 6 | """ 7 | 8 | import logging 9 | 10 | logger = logging.getLogger('can.serial') 11 | 12 | try: 13 | import serial 14 | except ImportError: 15 | logger.error("You won't be able to use the serial can backend without the serial module installed!") 16 | serial = None 17 | 18 | from can.bus import BusABC 19 | from can.message import Message 20 | 21 | 22 | class Bus(BusABC): 23 | 24 | def __init__(self, channel, *args, **kwargs): 25 | """A serial interface to CAN. 26 | 27 | :param str channel: 28 | The serial device to open. 29 | """ 30 | if channel == '': 31 | raise TypeError("Must specify a serial port.") 32 | else: 33 | self.channel_info = "Serial interface: " + channel 34 | 35 | # Note: Some serial port implementations don't care about the baud rate 36 | self.ser = serial.Serial(channel, baudrate=115200, timeout=0.1) 37 | super(Bus, self).__init__(*args, **kwargs) 38 | 39 | def _put_message(self, msg): 40 | raise NotImplementedError("This serial interface doesn't support transmit.") 41 | 42 | def _get_message(self, timeout=None): 43 | 44 | try: 45 | # ser.read can return an empty string '' 46 | # or raise a SerialException 47 | rx_byte = self.ser.read() 48 | except serial.SerialException: 49 | return None 50 | 51 | if len(rx_byte) and ord(rx_byte) == 0xAA: 52 | s = bytearray(self.ser.read(4)) 53 | timestamp = s[0] + (s[1] << 8) + (s[2] << 16) + (s[3] << 24) 54 | dlc = ord(self.ser.read()) 55 | 56 | s = bytearray(self.ser.read(4)) 57 | arb_id = s[0] + (s[1] << 8) + (s[2] << 16) + (s[3] << 24) 58 | 59 | data = self.ser.read(dlc) 60 | 61 | rxd_byte = ord(self.ser.read()) 62 | if rxd_byte == 0xBB: 63 | # received message data okay 64 | return Message(timestamp=timestamp, arbitration_id=arb_id, dlc=dlc, data=data) 65 | else: 66 | return None 67 | 68 | 69 | else: 70 | return None 71 | 72 | -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/can/message.py: -------------------------------------------------------------------------------- 1 | import logging 2 | logger = logging.getLogger(__name__) 3 | 4 | 5 | class Message(object): 6 | """ 7 | Represents a CAN message. 8 | """ 9 | 10 | def __init__(self, timestamp=0.0, is_remote_frame=False, extended_id=True, 11 | is_error_frame=False, arbitration_id=0, dlc=None, data=None): 12 | 13 | self.timestamp = timestamp 14 | self.id_type = extended_id 15 | 16 | self.is_remote_frame = is_remote_frame 17 | self.is_error_frame = is_error_frame 18 | self.arbitration_id = arbitration_id 19 | 20 | #if isinstance(data, list): 21 | # data = bytes(data) 22 | 23 | if data is None: 24 | data = [] 25 | try: 26 | self.data = bytearray(data) 27 | except: 28 | logger.error("Couldn't create message from {} ({})".format(data, type(data))) 29 | if dlc is None: 30 | self.dlc = len(data) 31 | else: 32 | self.dlc = dlc 33 | 34 | assert self.dlc <= 8, "data link count was {} but it must be less than or equal to 8".format(self.dlc) 35 | 36 | def __str__(self): 37 | field_strings = ["%15.6f" % self.timestamp] 38 | if self.id_type: 39 | # Extended arbitrationID 40 | arbitration_id_string = "%.8x" % self.arbitration_id 41 | else: 42 | arbitration_id_string = "%.4x" % self.arbitration_id 43 | field_strings.append(arbitration_id_string.rjust(8, " ")) 44 | 45 | flag_string = "".join(map(str, map(int, 46 | [self.is_remote_frame, 47 | self.id_type, 48 | self.is_error_frame, 49 | ])) 50 | ) 51 | 52 | field_strings.append(flag_string) 53 | 54 | field_strings.append("%d" % self.dlc) 55 | data_strings = [] 56 | if self.data is not None: 57 | for byte in self.data: 58 | data_strings.append("%.2x" % byte) 59 | if len(data_strings) > 0: 60 | field_strings.append(" ".join(data_strings).ljust(24, " ")) 61 | else: 62 | field_strings.append(" " * 24) 63 | 64 | return " ".join(field_strings).strip() 65 | 66 | -------------------------------------------------------------------------------- /deps/python-can/can/broadcastmanager.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | Exposes several methods for transmitting cyclic messages. 4 | 20/09/13 5 | """ 6 | 7 | import can 8 | import abc 9 | import logging 10 | 11 | log = logging.getLogger('can.bcm') 12 | log.debug("Loading base broadcast manager functionality") 13 | 14 | 15 | class CyclicTask(object): 16 | 17 | def stop(self): 18 | """Cancel the periodic task""" 19 | raise NotImplementedError() 20 | 21 | def start(self): 22 | """Once stopped a task can be restarted""" 23 | raise NotImplementedError() 24 | 25 | def __del__(self): 26 | self.stop() 27 | 28 | 29 | class CyclicSendTaskABC(CyclicTask): 30 | 31 | def __init__(self, channel, message, period): 32 | """ 33 | :param str channel: The name of the CAN channel to connect to. 34 | :param message: The :class:`can.Message` to be sent periodically. 35 | :param float period: The rate in seconds at which to send the message. 36 | """ 37 | self.can_id = message.arbitration_id 38 | self.period = period 39 | 40 | @abc.abstractmethod 41 | def stop(self): 42 | """Send a TX_DELETE message to the broadcast manager to cancel this task. 43 | 44 | This will delete the entry for the transmission of the CAN message 45 | specified. 46 | """ 47 | 48 | @abc.abstractmethod 49 | def modify_data(self, message): 50 | """Update the contents of this periodically sent message without altering 51 | the timing. 52 | 53 | :param message: The :class:`~can.Message` with new :attr:`Message.data`. Note it must have the same 54 | :attr:`Message.arbitration_id`. 55 | """ 56 | 57 | 58 | class MultiRateCyclicSendTaskABC(CyclicSendTaskABC): 59 | """Exposes more of the full power of the TX_SETUP opcode. 60 | 61 | Transmits a message `count` times at `initial_period` then 62 | continues to transmit message at `subsequent_period`. 63 | """ 64 | 65 | def __init__(self, channel, message, count, initial_period, subsequent_period): 66 | super().__init__(channel, message, subsequent_period) 67 | 68 | 69 | def send_periodic(channel, message, period): 70 | """ 71 | Send a message every `period` seconds on the given channel. 72 | 73 | """ 74 | return can.interfaces.interface.CyclicSendTask(channel, message, period) 75 | 76 | -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/can/interfaces/serial_can.py: -------------------------------------------------------------------------------- 1 | """ 2 | Enable basic can over a serial device. 3 | 4 | E.g. over bluetooth with "/dev/rfcomm0" 5 | 6 | """ 7 | 8 | import logging 9 | 10 | logger = logging.getLogger('can.serial') 11 | 12 | try: 13 | import serial 14 | except ImportError: 15 | logger.error("You won't be able to use the serial can backend without the serial module installed!") 16 | serial = None 17 | 18 | from can.bus import BusABC 19 | from can.message import Message 20 | 21 | 22 | class Bus(BusABC): 23 | 24 | def __init__(self, channel, *args, **kwargs): 25 | """A serial interface to CAN. 26 | 27 | :param str channel: 28 | The serial device to open. 29 | """ 30 | if channel == '': 31 | raise TypeError("Must specify a serial port.") 32 | else: 33 | self.channel_info = "Serial interface: " + channel 34 | 35 | # Note: Some serial port implementations don't care about the baud rate 36 | self.ser = serial.Serial(channel, baudrate=115200, timeout=0.1) 37 | super(Bus, self).__init__(*args, **kwargs) 38 | 39 | def _put_message(self, msg): 40 | raise NotImplementedError("This serial interface doesn't support transmit.") 41 | 42 | def _get_message(self, timeout=None): 43 | 44 | try: 45 | # ser.read can return an empty string '' 46 | # or raise a SerialException 47 | rx_byte = self.ser.read() 48 | except serial.SerialException: 49 | return None 50 | 51 | if len(rx_byte) and ord(rx_byte) == 0xAA: 52 | s = bytearray(self.ser.read(4)) 53 | timestamp = s[0] + (s[1] << 8) + (s[2] << 16) + (s[3] << 24) 54 | dlc = ord(self.ser.read()) 55 | 56 | s = bytearray(self.ser.read(4)) 57 | arb_id = s[0] + (s[1] << 8) + (s[2] << 16) + (s[3] << 24) 58 | 59 | data = self.ser.read(dlc) 60 | 61 | rxd_byte = ord(self.ser.read()) 62 | if rxd_byte == 0xBB: 63 | # received message data okay 64 | return Message(timestamp=timestamp, arbitration_id=arb_id, dlc=dlc, data=data) 65 | else: 66 | return None 67 | 68 | 69 | else: 70 | return None 71 | 72 | -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/can/broadcastmanager.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | Exposes several methods for transmitting cyclic messages. 4 | 20/09/13 5 | """ 6 | 7 | import can 8 | import abc 9 | import logging 10 | 11 | log = logging.getLogger('can.bcm') 12 | log.debug("Loading base broadcast manager functionality") 13 | 14 | 15 | class CyclicTask(object): 16 | 17 | def stop(self): 18 | """Cancel the periodic task""" 19 | raise NotImplementedError() 20 | 21 | def start(self): 22 | """Once stopped a task can be restarted""" 23 | raise NotImplementedError() 24 | 25 | def __del__(self): 26 | self.stop() 27 | 28 | 29 | class CyclicSendTaskABC(CyclicTask): 30 | 31 | def __init__(self, channel, message, period): 32 | """ 33 | :param str channel: The name of the CAN channel to connect to. 34 | :param message: The :class:`can.Message` to be sent periodically. 35 | :param float period: The rate in seconds at which to send the message. 36 | """ 37 | self.can_id = message.arbitration_id 38 | self.period = period 39 | 40 | @abc.abstractmethod 41 | def stop(self): 42 | """Send a TX_DELETE message to the broadcast manager to cancel this task. 43 | 44 | This will delete the entry for the transmission of the CAN message 45 | specified. 46 | """ 47 | 48 | @abc.abstractmethod 49 | def modify_data(self, message): 50 | """Update the contents of this periodically sent message without altering 51 | the timing. 52 | 53 | :param message: The :class:`~can.Message` with new :attr:`Message.data`. Note it must have the same 54 | :attr:`Message.arbitration_id`. 55 | """ 56 | 57 | 58 | class MultiRateCyclicSendTaskABC(CyclicSendTaskABC): 59 | """Exposes more of the full power of the TX_SETUP opcode. 60 | 61 | Transmits a message `count` times at `initial_period` then 62 | continues to transmit message at `subsequent_period`. 63 | """ 64 | 65 | def __init__(self, channel, message, count, initial_period, subsequent_period): 66 | super().__init__(channel, message, subsequent_period) 67 | 68 | 69 | def send_periodic(channel, message, period): 70 | """ 71 | Send a message every `period` seconds on the given channel. 72 | 73 | """ 74 | return can.interfaces.interface.CyclicSendTask(channel, message, period) 75 | 76 | -------------------------------------------------------------------------------- /package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | canbus_interface 4 | 0.0.0 5 | The canbus_interface package 6 | 7 | 8 | 9 | 10 | ubuntu 11 | 12 | 13 | 14 | 15 | 16 | TODO 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | catkin 43 | rospy 44 | roscpp 45 | std_msgs 46 | message_generation 47 | rospy 48 | roscpp 49 | std_msgs 50 | message_runtime 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /deps/python-can/can/bus.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import abc 4 | import logging 5 | logger = logging.getLogger(__name__) 6 | 7 | 8 | class BusABC(object): 9 | """CAN Bus Abstract Base Class 10 | 11 | Concrete implementations must implement the following methods: 12 | * send 13 | * recv 14 | 15 | As well as setting the `channel_info` attribute to a string describing the 16 | interface. 17 | 18 | """ 19 | 20 | #: a string describing the underlying bus channel 21 | channel_info = 'unknown' 22 | 23 | @abc.abstractmethod 24 | def __init__(self, channel=None, can_filters=None, **config): 25 | """ 26 | :param channel: 27 | The can interface identifier. Expected type is backend dependant. 28 | 29 | :param list can_filters: 30 | A list of dictionaries each containing a "can_id" and a "can_mask". 31 | 32 | >>> [{"can_id": 0x11, "can_mask": 0x21}] 33 | 34 | :param dict config: 35 | Any backend dependent configurations are passed in this dictionary 36 | """ 37 | 38 | 39 | @abc.abstractmethod 40 | def recv(self, timeout=None): 41 | """Block waiting for a message from the Bus. 42 | 43 | :return: 44 | None on timeout or a :class:`can.Message` object. 45 | """ 46 | raise NotImplementedError("Trying to read from a write only bus?") 47 | 48 | @abc.abstractmethod 49 | def send(self, msg): 50 | """Transmit a message to CAN bus. 51 | Override this method to enable the transmit path. 52 | 53 | :param msg: A :class:`can.Message` object. 54 | 55 | :raise: :class:`can.CanError` 56 | if the message could not be written. 57 | """ 58 | raise NotImplementedError("Trying to write to a readonly bus?") 59 | 60 | def __iter__(self): 61 | """Allow iteration on messages as they are received. 62 | 63 | >>> for msg in bus: 64 | ... print(msg) 65 | 66 | 67 | :yields: :class:`can.Message` msg objects. 68 | """ 69 | while True: 70 | m = self.recv(timeout=1.0) 71 | if m is not None: 72 | yield m 73 | logger.debug("done iterating over bus messages") 74 | 75 | def flush_tx_buffer(self): 76 | """Used for CAN backends which need to flush their transmit buffer. 77 | 78 | """ 79 | pass 80 | 81 | def shutdown(self): 82 | self.flush_tx_buffer() 83 | 84 | 85 | __metaclass__ = abc.ABCMeta 86 | -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/can/bus.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import abc 4 | import logging 5 | logger = logging.getLogger(__name__) 6 | 7 | 8 | class BusABC(object): 9 | """CAN Bus Abstract Base Class 10 | 11 | Concrete implementations must implement the following methods: 12 | * send 13 | * recv 14 | 15 | As well as setting the `channel_info` attribute to a string describing the 16 | interface. 17 | 18 | """ 19 | 20 | #: a string describing the underlying bus channel 21 | channel_info = 'unknown' 22 | 23 | @abc.abstractmethod 24 | def __init__(self, channel=None, can_filters=None, **config): 25 | """ 26 | :param channel: 27 | The can interface identifier. Expected type is backend dependant. 28 | 29 | :param list can_filters: 30 | A list of dictionaries each containing a "can_id" and a "can_mask". 31 | 32 | >>> [{"can_id": 0x11, "can_mask": 0x21}] 33 | 34 | :param dict config: 35 | Any backend dependent configurations are passed in this dictionary 36 | """ 37 | 38 | 39 | @abc.abstractmethod 40 | def recv(self, timeout=None): 41 | """Block waiting for a message from the Bus. 42 | 43 | :return: 44 | None on timeout or a :class:`can.Message` object. 45 | """ 46 | raise NotImplementedError("Trying to read from a write only bus?") 47 | 48 | @abc.abstractmethod 49 | def send(self, msg): 50 | """Transmit a message to CAN bus. 51 | Override this method to enable the transmit path. 52 | 53 | :param msg: A :class:`can.Message` object. 54 | 55 | :raise: :class:`can.CanError` 56 | if the message could not be written. 57 | """ 58 | raise NotImplementedError("Trying to write to a readonly bus?") 59 | 60 | def __iter__(self): 61 | """Allow iteration on messages as they are received. 62 | 63 | >>> for msg in bus: 64 | ... print(msg) 65 | 66 | 67 | :yields: :class:`can.Message` msg objects. 68 | """ 69 | while True: 70 | m = self.recv(timeout=1.0) 71 | if m is not None: 72 | yield m 73 | logger.debug("done iterating over bus messages") 74 | 75 | def flush_tx_buffer(self): 76 | """Used for CAN backends which need to flush their transmit buffer. 77 | 78 | """ 79 | pass 80 | 81 | def shutdown(self): 82 | self.flush_tx_buffer() 83 | 84 | 85 | __metaclass__ = abc.ABCMeta 86 | -------------------------------------------------------------------------------- /deps/python-can/bin/can_logger.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | can_logger.py logs CAN traffic to the terminal and to a file on disk. 4 | 5 | can_logger.py can0 6 | 7 | See candump in the can-utils package for a C implementation. 8 | Efficient filtering has been implemented for the socketcan backend. 9 | For example the command 10 | 11 | can_logger.py can0 F03000:FFF000 12 | 13 | Will filter for can frames with a can_id containing XXF03XXX. 14 | 15 | Dynamic Controls 2010 16 | """ 17 | from __future__ import print_function 18 | import datetime 19 | import argparse 20 | import time 21 | 22 | import can 23 | 24 | if __name__ == "__main__": 25 | 26 | parser = argparse.ArgumentParser(description="Log CAN traffic, printing messages to stdout or to a given file") 27 | 28 | parser.add_argument("-f", "--file_name", dest="log_file", 29 | help="""Path and base log filename, extension can be .txt, .csv, .db, .npz""", 30 | default=None) 31 | 32 | parser.add_argument("-v", action="count", dest="verbosity", 33 | help='''How much information do you want to see at the command line? 34 | You can add several of these e.g., -vv is DEBUG''', default=2) 35 | 36 | parser.add_argument('-c', '--channel', help='''Most backend interfaces require some sort of channel. 37 | For example with the serial interface the channel might be a rfcomm device: /dev/rfcomm0 38 | Other channel examples are: can0, vcan0''', default=can.rc['channel']) 39 | 40 | parser.add_argument('--filter', help='''Comma separated filters can be specified for the given CAN interface: 41 | : (matches when & mask == can_id & mask) 42 | ~ (matches when & mask != can_id & mask) 43 | ''', nargs=argparse.REMAINDER, default='') 44 | 45 | results = parser.parse_args() 46 | 47 | verbosity = results.verbosity 48 | 49 | logging_level_name = ['critical', 'error', 'warning', 'info', 'debug', 'subdebug'][min(5, verbosity)] 50 | can.set_logging_level(logging_level_name) 51 | 52 | can_filters = [] 53 | if len(results.filter) > 0: 54 | print('we have filter/s', results.filter) 55 | for filt in results.filter: 56 | if ':' in filt: 57 | _ = filt.split(":") 58 | can_id, can_mask = int(_[0], base=16), int(_[1], base=16) 59 | elif "~" in filt: 60 | can_id, can_mask = filt.split("~") 61 | can_id = int(can_id, base=16) | 0x20000000 # CAN_INV_FILTER 62 | can_mask = int(can_mask, base=16) & socket.CAN_ERR_FLAG 63 | can_filters.append({"can_id": can_id, "can_mask": can_mask}) 64 | 65 | bus = can.interface.Bus(results.channel, can_filters=can_filters) 66 | print('Can Logger (Started on {})\n'.format(datetime.datetime.now())) 67 | notifier = can.Notifier(bus, [can.Printer(results.log_file)]) 68 | 69 | try: 70 | while True: 71 | time.sleep(1) 72 | except KeyboardInterrupt: 73 | bus.shutdown() 74 | -------------------------------------------------------------------------------- /deps/python-can/build/scripts-2.7/can_logger.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | """ 3 | can_logger.py logs CAN traffic to the terminal and to a file on disk. 4 | 5 | can_logger.py can0 6 | 7 | See candump in the can-utils package for a C implementation. 8 | Efficient filtering has been implemented for the socketcan backend. 9 | For example the command 10 | 11 | can_logger.py can0 F03000:FFF000 12 | 13 | Will filter for can frames with a can_id containing XXF03XXX. 14 | 15 | Dynamic Controls 2010 16 | """ 17 | from __future__ import print_function 18 | import datetime 19 | import argparse 20 | import time 21 | 22 | import can 23 | 24 | if __name__ == "__main__": 25 | 26 | parser = argparse.ArgumentParser(description="Log CAN traffic, printing messages to stdout or to a given file") 27 | 28 | parser.add_argument("-f", "--file_name", dest="log_file", 29 | help="""Path and base log filename, extension can be .txt, .csv, .db, .npz""", 30 | default=None) 31 | 32 | parser.add_argument("-v", action="count", dest="verbosity", 33 | help='''How much information do you want to see at the command line? 34 | You can add several of these e.g., -vv is DEBUG''', default=2) 35 | 36 | parser.add_argument('-c', '--channel', help='''Most backend interfaces require some sort of channel. 37 | For example with the serial interface the channel might be a rfcomm device: /dev/rfcomm0 38 | Other channel examples are: can0, vcan0''', default=can.rc['channel']) 39 | 40 | parser.add_argument('--filter', help='''Comma separated filters can be specified for the given CAN interface: 41 | : (matches when & mask == can_id & mask) 42 | ~ (matches when & mask != can_id & mask) 43 | ''', nargs=argparse.REMAINDER, default='') 44 | 45 | results = parser.parse_args() 46 | 47 | verbosity = results.verbosity 48 | 49 | logging_level_name = ['critical', 'error', 'warning', 'info', 'debug', 'subdebug'][min(5, verbosity)] 50 | can.set_logging_level(logging_level_name) 51 | 52 | can_filters = [] 53 | if len(results.filter) > 0: 54 | print('we have filter/s', results.filter) 55 | for filt in results.filter: 56 | if ':' in filt: 57 | _ = filt.split(":") 58 | can_id, can_mask = int(_[0], base=16), int(_[1], base=16) 59 | elif "~" in filt: 60 | can_id, can_mask = filt.split("~") 61 | can_id = int(can_id, base=16) | 0x20000000 # CAN_INV_FILTER 62 | can_mask = int(can_mask, base=16) & socket.CAN_ERR_FLAG 63 | can_filters.append({"can_id": can_id, "can_mask": can_mask}) 64 | 65 | bus = can.interface.Bus(results.channel, can_filters=can_filters) 66 | print('Can Logger (Started on {})\n'.format(datetime.datetime.now())) 67 | notifier = can.Notifier(bus, [can.Printer(results.log_file)]) 68 | 69 | try: 70 | while True: 71 | time.sleep(1) 72 | except KeyboardInterrupt: 73 | bus.shutdown() 74 | -------------------------------------------------------------------------------- /deps/python-can/can/util.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | Configuration file parsing. 4 | """ 5 | try: 6 | from configparser import ConfigParser 7 | except ImportError: 8 | from ConfigParser import SafeConfigParser as ConfigParser 9 | import os 10 | import platform 11 | import os.path 12 | 13 | 14 | REQUIRED_KEYS = [ 15 | 'interface', 16 | 'channel', 17 | ] 18 | 19 | 20 | CONFIG_FILES = ['~/can.conf'] 21 | 22 | if platform.system() == "Linux": 23 | CONFIG_FILES.extend( 24 | [ 25 | '/etc/can.conf', 26 | '~/.can', 27 | '~/.canrc' 28 | ] 29 | ) 30 | elif platform.system() == "Windows": 31 | CONFIG_FILES.extend( 32 | [ 33 | 'can.ini', 34 | os.path.join(os.getenv('APPDATA'), 'can.ini') 35 | ] 36 | ) 37 | 38 | 39 | def load_file_config(path=None): 40 | """ 41 | Loads configuration from file with following content:: 42 | 43 | [default] 44 | interface = socketcan 45 | channel = can0 46 | 47 | :param path: path to config file. If not specified, several sensible 48 | default locations are tried depending on platform. 49 | """ 50 | config = ConfigParser() 51 | if path is None: 52 | config.read([os.path.expanduser(path) for path in CONFIG_FILES]) 53 | else: 54 | config.read(path) 55 | 56 | if not config.has_section('default'): 57 | return {} 58 | 59 | return dict( 60 | (key, val) 61 | for key, val in config.items('default') 62 | if key in REQUIRED_KEYS 63 | ) 64 | 65 | 66 | def load_environment_config(): 67 | """ 68 | Loads config dict from environmental variables (if set): 69 | 70 | * CAN_INTERFACE 71 | * CAN_CHANNEL 72 | 73 | """ 74 | mapper = { 75 | 'interface': 'CAN_INTERFACE', 76 | 'channel': 'CAN_CHANNEL', 77 | } 78 | return dict( 79 | (key, os.environ.get(val)) 80 | for key, val in mapper.items() 81 | if val in os.environ 82 | ) 83 | 84 | 85 | def load_config(path=None): 86 | """ 87 | Returns a dict with configuration details which is loaded from (in this order): 88 | 89 | * Environment variables CAN_INTERFACE, CAN_CHANNEL 90 | * Config files ``/etc/can.conf`` or ``~/.can`` or ``~/.canrc`` 91 | where the latter may add or replace values of the former. 92 | 93 | Interface can be kvaser, socketcan, socketcan_ctypes, socketcan_native, serial 94 | 95 | The returned dictionary may look like this:: 96 | 97 | { 98 | 'interface': '>> from can import Message 9 | >>> test = Message() 10 | >>> print test 11 | 0.000000 0000 0002 0 12 | >>> test2 = Message(data=[1,2,3,4,5]) 13 | >>> print test2 14 | 0.000000 0000 0002 5 01 02 03 04 05 15 | 16 | The fields in the printed message are (in order): 17 | - timestamp, 18 | - arbitration ID, 19 | - flags, 20 | - dlc, 21 | - and data. 22 | 23 | The flags field is represented as a four-digit hexadecimal number. The arbitration 24 | ID field as either a four or eight digit hexadecimal number depending on the length 25 | of the arbitration ID (11-bit or 29-bit). Each of the bytes in the data field (when 26 | present) are represented as two-digit hexadecimal numbers. The following sections 27 | describe each of the parameters to the Message constructor. 28 | 29 | Timestamp 30 | --------- 31 | 32 | The timestamp field in a CAN message is a floating point number representing when 33 | the message was received since the epoch in seconds. Where possible this will be 34 | timestamped in hardware. 35 | 36 | 37 | Arbitration ID 38 | -------------- 39 | 40 | The arbitration ID field in a CAN message may be either 11 bits (standard 41 | addressing, CAN 2.0A) or 29 bits (extended addressing, CAN 2.0B) in length, and 42 | ``python-can`` supports this by providing an ``extended_id`` parameter to the 43 | Message constructor. The effect of this parameter is shown below. 44 | 45 | The arbitration ID parameter itself can take an integer between 0 and the 46 | maximum value allowed by the extended_id parameter passed to the Message 47 | constructor (either 2\ :sup:`11` - 1 for 11-bit IDs, or 2\ :sup:`29` - 1 for 48 | 29-bit identifiers). 49 | 50 | >>> print Message(extended_id=False) 51 | 0.000000 0000 0002 0 52 | 53 | >>> print Message(extended_id=True) 54 | 0.000000 00000000 0004 0 55 | 56 | >>> print Message(extended_id=False, arbitration_id=100) 57 | 0.000000 0064 0002 0 58 | 59 | 60 | is_remote_frame 61 | --------------- 62 | 63 | This boolean attribute indicates if the message is a remote frame or a data frame, and 64 | modifies the bit in the CAN message's flags field indicating this. 65 | 66 | id_type 67 | ------- 68 | 69 | This parameter controls the length of this CAN message's arbitration ID field. 70 | It is covered in the `Arbitration ID`_ section of this document. 71 | 72 | 73 | is_error_frame 74 | -------------- 75 | 76 | This boolean parameter indicates if the message is an error frame or not. 77 | 78 | DLC 79 | --- 80 | 81 | The :abbr:`DLC (Data Link Count)` parameter of a CAN message is an integer 82 | between 0 and 8. Its purpose varies depending on the frame type - for data 83 | frames it represents the amount of data contained in the message, in remote 84 | frames it represents the amount of data being requested from the device the 85 | message is addressed to. 86 | 87 | The default behaviour is to use the length of the data passed in. 88 | 89 | >>> print Message(dlc=1) 90 | 0.000000 0000 0002 1 91 | >>> print Message(dlc=5) 92 | 0.000000 0000 0002 5 93 | 94 | .. note:: 95 | The DLC value does not necessarily define the number of bytes of data 96 | in a packet. 97 | 98 | 99 | Data 100 | ---- 101 | 102 | The data parameter of a CAN message is a **bytearray** (or list of ints) 103 | with length between 0 and 8. 104 | 105 | >>> example_data = bytearray([1,2,3]) 106 | >>> print Message(data=example_data) 107 | 0.000000 00000000 0002 3 01 02 03 108 | >>> print can.Message(data=[2,2]) 109 | 0.000000 00000000 010 2 02 02 110 | >>> m = can.Message(data=[3]) 111 | >>> m.data 112 | bytearray(b'\x03') 113 | 114 | 115 | .. autoclass:: can.Message 116 | :members: 117 | -------------------------------------------------------------------------------- /deps/python-can/doc/bin.rst: -------------------------------------------------------------------------------- 1 | Scripts 2 | ======= 3 | 4 | The following scripts are installed along with python-can. 5 | 6 | can_logger.py 7 | ------------- 8 | 9 | Command line help (``--help``):: 10 | 11 | usage: can_logger.py [-h] [-f LOG_FILE] [-v] [-i {socketcan,kvaser,serial}] 12 | channel ... 13 | 14 | Log CAN traffic, printing messages to stdout or to a given file 15 | 16 | positional arguments: 17 | channel Most backend interfaces require some sort of channel. 18 | For example with the serial interface the channel 19 | might be a rfcomm device: /dev/rfcomm0 Other channel 20 | examples are: can0, vcan0 21 | filter Comma separated filters can be specified for the given 22 | CAN interface: : (matches when 23 | & mask == can_id & mask) 24 | ~ (matches when & 25 | mask != can_id & mask) 26 | 27 | optional arguments: 28 | -h, --help show this help message and exit 29 | -f LOG_FILE, --file_name LOG_FILE 30 | Path and base log filename, extension can be .txt, 31 | .csv, .db, .npz 32 | -v How much information do you want to see at the command 33 | line? You can add several of these e.g., -vv is DEBUG 34 | -i {socketcan,kvaser,serial}, --interface {socketcan,kvaser,serial} 35 | Which backend do you want to use? 36 | 37 | 38 | j1939_logger.py 39 | --------------- 40 | 41 | command line help (``--help``):: 42 | 43 | usage: j1939_logger.py [-h] [-v] [-i {socketcan,kvaser,serial}] 44 | [--pgn PGN | --source SOURCE | --filter FILTER] 45 | channel 46 | 47 | Log J1939 traffic, printing messages to stdout or to a given file 48 | 49 | positional arguments: 50 | channel 51 | Most backend interfaces require some sort of channel. For example with the serial 52 | interface the channel might be a rfcomm device: /dev/rfcomm0 53 | Other channel examples are: can0, vcan0 54 | 55 | optional arguments: 56 | -h, --help show this help message and exit 57 | -v 58 | How much information do you want to see at the command line? 59 | You can add several of these e.g., -vv is DEBUG 60 | -i {socketcan,kvaser,serial}, --interface {socketcan,kvaser,serial} 61 | Which backend do you want to use? 62 | --pgn PGN 63 | Only listen for messages with given Parameter Group Number (PGN). 64 | Can be used more than once. Give either hex 0xEE00 or decimal 60928 65 | --source SOURCE 66 | Only listen for messages from the given Source address 67 | Can be used more than once. Give either hex 0x0E or decimal. 68 | --filter FILTER 69 | A json file with more complicated filtering rules. 70 | 71 | An example file that subscribes to all messages from SRC=0 72 | and two particular PGNs from SRC=1: 73 | 74 | [ 75 | { 76 | "source": 1, 77 | "pgn": 61475 78 | } 79 | { 80 | "source": 1, 81 | "pgn": 61474 82 | } 83 | { 84 | "source": 0 85 | } 86 | ] 87 | 88 | 89 | 90 | Pull requests welcome! 91 | https://bitbucket.org/hardbyte/python-can -------------------------------------------------------------------------------- /deps/python-can/doc/socketcan.rst: -------------------------------------------------------------------------------- 1 | Socketcan 2 | ========= 3 | 4 | There are two implementations of socketcan backends. One written with :mod:`ctypes` to be compatible 5 | with Python 2 and 3, and one written for future versions of Python3 which feature native support. 6 | 7 | 8 | .. toctree:: 9 | :maxdepth: 2 10 | 11 | socketcan_ctypes 12 | socketcan_native 13 | 14 | Unless you're running Python3.4 or higher the recommended backend is :doc:`socketcan_ctypes `. 15 | 16 | Socketcan Quickstart 17 | -------------------- 18 | 19 | The full documentation for socketcan can be found in the kernel docs at 20 | `networking/can.txt `_. 21 | The CAN network driver provides a generic 22 | interface to setup, configure and monitor CAN devices. To configure 23 | bit-timing parameters use the program ``ip``. 24 | 25 | The virtual CAN driver (vcan) 26 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 27 | 28 | The virtual CAN interfaces allow the transmission and reception of CAN 29 | frames without real CAN controller hardware. Virtual CAN network devices 30 | are usually named 'vcanX', like vcan0 vcan1 vcan2. 31 | 32 | To create a virtual can interface using socketcan run the following: 33 | 34 | .. code-block:: bash 35 | 36 | sudo modprobe vcan 37 | # Create a vcan network interface with a specific name 38 | sudo ip link add dev vcan0 type vcan 39 | sudo ifconfig vcan0 up 40 | 41 | Real Device 42 | ~~~~~~~~~~~ 43 | 44 | ``vcan`` should be substituted for ``can`` and ``vcan0`` should be 45 | substituted for ``can0`` if you are using real hardware. Setting the 46 | bitrate can also be done at the same time, for example to enable an 47 | existing ``can0`` interface with a bitrate of 1MB: 48 | 49 | .. code-block:: bash 50 | 51 | sudo ip link set can0 up type can bitrate 1000000 52 | 53 | CAN Errors 54 | ^^^^^^^^^^ 55 | 56 | A device may enter the "bus-off" state if too much errors occurred on 57 | the CAN bus. Then no more messages are received or sent. An automatic 58 | bus-off recovery can be enabled by setting the "restart-ms" to a 59 | non-zero value, e.g.: 60 | 61 | .. code-block:: bash 62 | 63 | sudo ip link set canX type can restart-ms 100 64 | 65 | Alternatively, the application may realize the "bus-off" condition by 66 | monitoring CAN error frames and do a restart when appropriate with the 67 | command: 68 | 69 | .. code-block:: bash 70 | 71 | ip link set canX type can restart 72 | 73 | Note that a restart will also create a CAN error frame. 74 | 75 | List network interfaces 76 | ~~~~~~~~~~~~~~~~~~~~~~~ 77 | 78 | To reveal the newly created ``can0`` or a ``vcan0`` interface: 79 | 80 | .. code-block:: bash 81 | 82 | ifconfig 83 | 84 | Display CAN statistics 85 | ~~~~~~~~~~~~~~~~~~~~~~ 86 | 87 | .. code-block:: bash 88 | 89 | ip -details -statistics link show vcan0 90 | 91 | Network Interface Removal 92 | ~~~~~~~~~~~~~~~~~~~~~~~~~ 93 | 94 | To remove the network interface: 95 | 96 | .. code-block:: bash 97 | 98 | sudo ip link del vcan0 99 | 100 | Wireshark 101 | --------- 102 | 103 | Wireshark supports socketcan and can be used to debug *python-can* 104 | messages. Fire it up and watch your new interface. 105 | 106 | To spam a bus: 107 | 108 | .. code-block:: python 109 | 110 | import time 111 | import can 112 | can.rc['interface'] = 'socketcan_native' 113 | from can.interfaces.interface import Bus 114 | can_interface = 'vcan0' 115 | 116 | def producer(id): 117 | """:param id: Spam the bus with messages including the data id.""" 118 | bus = Bus(can_interface) 119 | for i in range(10): 120 | msg = can.Message(arbitration_id=0xc0ffee, data=[id, i, 0, 1, 3, 1, 4, 1], extended_id=False) 121 | bus.send(msg) 122 | # Issue #3: Need to keep running to ensure the writing threads stay alive. ? 123 | time.sleep(1) 124 | 125 | producer(10) 126 | 127 | With debugging turned right up this looks something like this: 128 | 129 | .. image:: images/wireshark.png 130 | :width: 100% 131 | 132 | 133 | The process to follow bus traffic is even easier: 134 | 135 | .. code-block:: python 136 | 137 | for message in Bus(can_interface): 138 | print(message) 139 | 140 | -------------------------------------------------------------------------------- /deps/python-can/README.md: -------------------------------------------------------------------------------- 1 | The **C**ontroller **A**rea **N**etwork is a bus standard designed to 2 | allow microcontrollers and devices to communicate with each other. It 3 | has priority based bus arbitration, reliable deterministic 4 | communication. It is used in cars, trucks, wheelchairs and more. See 5 | [wikipedia][1] for more info. 6 | 7 | # python-can 8 | 9 | This module provides controller area network support for [Python][4]. 10 | 11 | ## Configuration File 12 | 13 | In order to use this library a CAN interface needs to be specified. 14 | A method to do this is to create a configuration file called `can.conf`, 15 | `~/.canrc` or `can.ini`. 16 | 17 | The configuration file sets the default interface and channel: 18 | 19 | [default] 20 | interface = 21 | channel = 22 | 23 | 24 | ## Interfaces 25 | 26 | The interface available are: 27 | 28 | ### kvaser 29 | 30 | [Kvaser][2]'s CANLib SDK for Windows (also available on Linux) 31 | 32 | ### socketcan 33 | 34 | On linux the socketcan interface is exposed via either: 35 | 36 | - socketcan_ctypes 37 | - socketcan_native 38 | 39 | ### serial 40 | 41 | A text based interface. For example use over bluetooth with `/dev/rfcomm0` 42 | 43 | ### pcan 44 | 45 | [Peak-System][8]'s PCAN-Basic API. 46 | 47 | 48 | ## Installation 49 | 50 | ## GNU/Linux dependencies 51 | 52 | Reasonably modern Linux Kernels (2.6.25 or newer) have an implementation of 53 | ``socketcan``. This version of python-can will directly use socketcan 54 | if called with Python 3.3 or greater, otherwise that interface is 55 | used via ctypes. 56 | 57 | ## Windows dependencies 58 | 59 | ### Kvaser 60 | 61 | To install `python-can` using the Kvaser CANLib SDK as the backend: 62 | 63 | 1. Install the [latest stable release of Python][4]. 64 | 65 | 2. Install [Kvaser's latest Windows CANLib drivers][5]. 66 | 67 | 3. Test that Kvaser's own tools work to ensure the driver is properly 68 | installed and that the hardware is working. 69 | 70 | 71 | ### PCAN 72 | 73 | To use the PCAN-Basic API as the backend (which has only been tested with 74 | Python 2.7): 75 | 76 | 1. Download the latest version of the [PCAN-Basic API][9]. 77 | 78 | 2. Extract `PCANBasic.dll` from the Win32 subfolder of the archive or the x64 79 | subfolder depending on whether you have a 32-bit or 64-bit installation of 80 | Python. 81 | 82 | 3. Copy `PCANBasic.dll` into the working directory where you will be running 83 | your python script. There is probably a way to install the dll properly, 84 | but I'm not certain how to do that. 85 | 86 | Note that PCANBasic API timestamps count seconds from system startup. To 87 | convert these to epoch times, the uptime library is used. If it is not 88 | available, the times are returned as number of seconds from system startup. 89 | To install the uptime library, run `pip install uptime`. 90 | 91 | 92 | ## Install python-can 93 | 94 | You may need to install [pip][7] and [setuptools][10] first. 95 | 96 | Two options, install normally with: 97 | 98 | python setup.py install 99 | 100 | Or to do a "development" install of this package to your machine (this allows 101 | you to make changes locally or pull updates from the Mercurial repository and 102 | use them without having to reinstall): 103 | 104 | python setup.py develop 105 | 106 | On linux you will need `sudo` rights. 107 | 108 | 109 | ## Documentation 110 | 111 | The documentation for python-can has been generated with Sphinx they can be viewed online at 112 | [python-can.readthedocs.org][6] 113 | 114 | 115 | ### Generation 116 | 117 | With sphinx installed the documentation can be generated locally with: 118 | 119 | python setup.py build_sphinx 120 | 121 | 122 | [1]: http://en.wikipedia.org/wiki/CAN_bus 123 | [2]: http://www.kvaser.com 124 | [3]: http://www.brownhat.org/docs/socketcan/llcf-api.html 125 | [4]: http://python.org/download/ 126 | [5]: http://www.kvaser.com/en/downloads.html 127 | [6]: https://python-can.readthedocs.org/en/latest/ 128 | [7]: http://www.pip-installer.org/en/latest/installing.html 129 | [8]: http://www.peak-system.com/ 130 | [9]: http://www.peak-system.com/Downloads.76.0.html? 131 | [10]: https://pypi.python.org/pypi/setuptools -------------------------------------------------------------------------------- /deps/python-can/can/CAN.py: -------------------------------------------------------------------------------- 1 | """ 2 | The core of python-can - contains implementations of all 3 | the major classes in the library, which form abstractions of the 4 | functionality provided by each CAN interface. 5 | 6 | Copyright (C) 2010 Dynamic Controls 7 | """ 8 | 9 | import logging 10 | try: 11 | import queue 12 | except ImportError: 13 | import Queue as queue 14 | 15 | 16 | log = logging.getLogger('can') 17 | log.debug("Loading python-can") 18 | 19 | 20 | def set_logging_level(level_name=None): 21 | """Set the logging level for python-can. 22 | Expects one of: 'critical', 'error', 'warning', 'info', 'debug', 'subdebug' 23 | """ 24 | try: 25 | log.setLevel(getattr(logging, level_name.upper())) 26 | except AttributeError: 27 | log.setLevel(logging.DEBUG) 28 | log.debug("Logging set to {}".format(level_name)) 29 | 30 | logging.basicConfig() 31 | 32 | 33 | class Listener(object): 34 | 35 | def on_message_received(self, msg): 36 | raise NotImplementedError( 37 | "{} has not implemented on_message_received".format( 38 | self.__class__.__name__) 39 | ) 40 | 41 | def __call__(self, msg): 42 | return self.on_message_received(msg) 43 | 44 | 45 | class BufferedReader(Listener): 46 | """ 47 | A BufferedReader is a subclass of :class:`~can.Listener` which implements a 48 | **message buffer**: that is, when the :class:`can.BufferedReader` instance is 49 | notified of a new message it pushes it into a queue of messages waiting to 50 | be serviced. 51 | """ 52 | def __init__(self): 53 | self.buffer = queue.Queue(0) 54 | 55 | def on_message_received(self, msg): 56 | self.buffer.put(msg) 57 | 58 | def get_message(self, timeout=0.5): 59 | """ 60 | Attempts to retrieve the latest message received by the instance. If no message is 61 | available it blocks for 0.5 seconds or until a message is received (whichever 62 | is shorter), and returns the message if there is one, or None if there is not. 63 | """ 64 | try: 65 | return self.buffer.get(block=True, timeout=timeout) 66 | except queue.Empty: 67 | return None 68 | 69 | 70 | class Printer(Listener): 71 | """ 72 | The Printer class is a subclass of :class:`~can.Listener` which simply prints 73 | any messages it receives to the terminal. 74 | 75 | :param output_file: An optional file to "print" to. 76 | """ 77 | 78 | def __init__(self, output_file=None): 79 | if output_file is not None: 80 | log.info("Creating log file '{}' ".format(output_file)) 81 | output_file = open(output_file, 'wt') 82 | self.output_file = output_file 83 | 84 | def on_message_received(self, msg): 85 | if self.output_file is not None: 86 | self.output_file.write(str(msg)+"\n") 87 | else: 88 | print(msg) 89 | 90 | def __del__(self): 91 | self.output_file.write("\n") 92 | if self.output_file: 93 | self.output_file.close() 94 | 95 | 96 | class CSVWriter(Listener): 97 | """Writes a comma separated text file of 98 | timestamp, arbitrationid, flags, dlc, data 99 | for each messages received. 100 | """ 101 | 102 | def __init__(self, filename): 103 | self.csv_file = open(filename, 'wt') 104 | 105 | # Write a header row 106 | self.csv_file.write("timestamp, arbitrationid, flags, dlc, data") 107 | 108 | def on_message_received(self, msg): 109 | row = ','.join([msg.timestamp, 110 | msg.arbitration_id, 111 | msg.flags, 112 | msg.dlc, 113 | msg.data]) 114 | self.csv_file.write(row + '\n') 115 | 116 | def __del__(self): 117 | self.csv_file.close() 118 | super(CSVWriter, self).__del__() 119 | 120 | 121 | class SqliteWriter(Listener): 122 | """TODO""" 123 | 124 | def __init__(self, filename): 125 | self.db_file = open(filename, 'wt') 126 | 127 | # create table structure 128 | raise NotImplementedError("TODO") 129 | 130 | def on_message_received(self, msg): 131 | # add row 132 | raise NotImplementedError("TODO") 133 | -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/can/CAN.py: -------------------------------------------------------------------------------- 1 | """ 2 | The core of python-can - contains implementations of all 3 | the major classes in the library, which form abstractions of the 4 | functionality provided by each CAN interface. 5 | 6 | Copyright (C) 2010 Dynamic Controls 7 | """ 8 | 9 | import logging 10 | try: 11 | import queue 12 | except ImportError: 13 | import Queue as queue 14 | 15 | 16 | log = logging.getLogger('can') 17 | log.debug("Loading python-can") 18 | 19 | 20 | def set_logging_level(level_name=None): 21 | """Set the logging level for python-can. 22 | Expects one of: 'critical', 'error', 'warning', 'info', 'debug', 'subdebug' 23 | """ 24 | try: 25 | log.setLevel(getattr(logging, level_name.upper())) 26 | except AttributeError: 27 | log.setLevel(logging.DEBUG) 28 | log.debug("Logging set to {}".format(level_name)) 29 | 30 | logging.basicConfig() 31 | 32 | 33 | class Listener(object): 34 | 35 | def on_message_received(self, msg): 36 | raise NotImplementedError( 37 | "{} has not implemented on_message_received".format( 38 | self.__class__.__name__) 39 | ) 40 | 41 | def __call__(self, msg): 42 | return self.on_message_received(msg) 43 | 44 | 45 | class BufferedReader(Listener): 46 | """ 47 | A BufferedReader is a subclass of :class:`~can.Listener` which implements a 48 | **message buffer**: that is, when the :class:`can.BufferedReader` instance is 49 | notified of a new message it pushes it into a queue of messages waiting to 50 | be serviced. 51 | """ 52 | def __init__(self): 53 | self.buffer = queue.Queue(0) 54 | 55 | def on_message_received(self, msg): 56 | self.buffer.put(msg) 57 | 58 | def get_message(self, timeout=0.5): 59 | """ 60 | Attempts to retrieve the latest message received by the instance. If no message is 61 | available it blocks for 0.5 seconds or until a message is received (whichever 62 | is shorter), and returns the message if there is one, or None if there is not. 63 | """ 64 | try: 65 | return self.buffer.get(block=True, timeout=timeout) 66 | except queue.Empty: 67 | return None 68 | 69 | 70 | class Printer(Listener): 71 | """ 72 | The Printer class is a subclass of :class:`~can.Listener` which simply prints 73 | any messages it receives to the terminal. 74 | 75 | :param output_file: An optional file to "print" to. 76 | """ 77 | 78 | def __init__(self, output_file=None): 79 | if output_file is not None: 80 | log.info("Creating log file '{}' ".format(output_file)) 81 | output_file = open(output_file, 'wt') 82 | self.output_file = output_file 83 | 84 | def on_message_received(self, msg): 85 | if self.output_file is not None: 86 | self.output_file.write(str(msg)+"\n") 87 | else: 88 | print(msg) 89 | 90 | def __del__(self): 91 | self.output_file.write("\n") 92 | if self.output_file: 93 | self.output_file.close() 94 | 95 | 96 | class CSVWriter(Listener): 97 | """Writes a comma separated text file of 98 | timestamp, arbitrationid, flags, dlc, data 99 | for each messages received. 100 | """ 101 | 102 | def __init__(self, filename): 103 | self.csv_file = open(filename, 'wt') 104 | 105 | # Write a header row 106 | self.csv_file.write("timestamp, arbitrationid, flags, dlc, data") 107 | 108 | def on_message_received(self, msg): 109 | row = ','.join([msg.timestamp, 110 | msg.arbitration_id, 111 | msg.flags, 112 | msg.dlc, 113 | msg.data]) 114 | self.csv_file.write(row + '\n') 115 | 116 | def __del__(self): 117 | self.csv_file.close() 118 | super(CSVWriter, self).__del__() 119 | 120 | 121 | class SqliteWriter(Listener): 122 | """TODO""" 123 | 124 | def __init__(self, filename): 125 | self.db_file = open(filename, 'wt') 126 | 127 | # create table structure 128 | raise NotImplementedError("TODO") 129 | 130 | def on_message_received(self, msg): 131 | # add row 132 | raise NotImplementedError("TODO") 133 | -------------------------------------------------------------------------------- /deps/python-can/can/protocols/j1939/pdu.py: -------------------------------------------------------------------------------- 1 | import logging 2 | from can import Message 3 | 4 | from .arbitrationid import ArbitrationID 5 | from .constants import pgn_strings, PGN_AC_ADDRESS_CLAIMED 6 | from .nodename import NodeName 7 | 8 | logger = logging.getLogger(__name__) 9 | 10 | 11 | class PDU(object): 12 | """ 13 | A PDU is a higher level abstraction of a CAN message. 14 | J1939 ensures that long messages are taken care of. 15 | """ 16 | 17 | def __init__(self, timestamp=0.0, arbitration_id=None, data=None, info_strings=None): 18 | """ 19 | :param float timestamp: 20 | Bus time in seconds. 21 | :param :class:`can.protocols.j1939.ArbitrationID` arbitration_id: 22 | 23 | :param bytes/bytearray/list data: 24 | With length up to 1785. 25 | """ 26 | if data is None: 27 | data = [] 28 | if info_strings is None: 29 | info_strings = [] 30 | self.timestamp = timestamp 31 | self.arbitration_id = arbitration_id 32 | self.data = self._check_data(data) 33 | self.info_strings = info_strings 34 | 35 | def __eq__(self, other): 36 | """Returns True if the pgn, data, source and destination are the same""" 37 | if other is None: 38 | return False 39 | if self.pgn != other.pgn: 40 | return False 41 | if self.data != other.data: 42 | return False 43 | if self.source != other.source: 44 | return False 45 | if self.destination != other.destination: 46 | return False 47 | return True 48 | 49 | 50 | @property 51 | def pgn(self): 52 | if self.arbitration_id.pgn.is_destination_specific: 53 | return self.arbitration_id.pgn.value & 0xFF00 54 | else: 55 | return self.arbitration_id.pgn.value 56 | 57 | @property 58 | def destination(self): 59 | """Destination address of the message""" 60 | return self.arbitration_id.destination_address 61 | 62 | @property 63 | def source(self): 64 | """Source address of the message""" 65 | return self.arbitration_id.source_address 66 | 67 | @property 68 | def is_address_claim(self): 69 | return self.pgn == PGN_AC_ADDRESS_CLAIMED 70 | 71 | @property 72 | def arbitration_id(self): 73 | return self._arbitration_id 74 | 75 | @arbitration_id.setter 76 | def arbitration_id(self, other): 77 | if other is None: 78 | self._arbitration_id = ArbitrationID() 79 | elif not isinstance(other, ArbitrationID): 80 | self._arbitration_id = ArbitrationID(other) 81 | else: 82 | self._arbitration_id = other 83 | 84 | def _check_data(self, value): 85 | assert len(value) <= 1785, 'Too much data to fit in a j1939 CAN message. Got {0} bytes'.format(len(value)) 86 | if len(value) > 0: 87 | assert min(value) >= 0, 'Data values must be between 0 and 255' 88 | assert max(value) <= 255, 'Data values must be between 0 and 255' 89 | return value 90 | 91 | def data_segments(self, segment_length=8): 92 | retval = [] 93 | for i in range(0, len(self.data), segment_length): 94 | retval.append(self.data[i:i + min(segment_length, (len(self.data) - i))]) 95 | return retval 96 | 97 | def check_equality(self, other, fields, debug=False): 98 | """ 99 | :param :class:`~can.protocols.j1939.PDU` other: 100 | :param list[str] fields: 101 | """ 102 | 103 | logger.debug("check_equality starting") 104 | 105 | retval = True 106 | for field in fields: 107 | try: 108 | own_value = getattr(self, field) 109 | except AttributeError: 110 | logger.warning("'%s' not found in 'self'" % field) 111 | return False 112 | 113 | try: 114 | other_value = getattr(other, field) 115 | except AttributeError: 116 | logger.debug("'%s' not found in 'other'" % field) 117 | return False 118 | 119 | if debug: 120 | self.info_strings.append("%s: %s, %s" % (field, own_value, other_value)) 121 | if own_value != other_value: 122 | return False 123 | 124 | logger.debug("Messages match") 125 | return retval 126 | 127 | 128 | def __str__(self): 129 | """ 130 | 131 | :return: A string representation of this message. 132 | 133 | """ 134 | # TODO group this into 8 bytes per line and line them up... 135 | data_string = " ".join("{:02d}".format(byte) for byte in self.data) 136 | return "{s.timestamp:15.6f} {s.arbitration_id} {data}".format(s=self, data=data_string) 137 | 138 | -------------------------------------------------------------------------------- /deps/python-can/can/interfaces/pcan.py: -------------------------------------------------------------------------------- 1 | """ 2 | Enable basic can over a PCAN USB device. 3 | 4 | """ 5 | import logging 6 | 7 | from PCANBasic import * 8 | 9 | logger = logging.getLogger(__name__) 10 | 11 | from can.bus import BusABC 12 | from can.message import Message 13 | 14 | boottimeEpoch = 0 15 | try: 16 | import uptime 17 | import datetime 18 | boottimeEpoch = (uptime.boottime() - datetime.datetime.utcfromtimestamp(0)).total_seconds() 19 | except: 20 | boottimeEpoch = 0 21 | 22 | # Set up logging 23 | logging.basicConfig(level=logging.WARNING) 24 | log = logging.getLogger('can.pcan') 25 | 26 | class Bus(BusABC): 27 | 28 | def __init__(self, channel, *args, **kwargs): 29 | """A PCAN USB interface to CAN. 30 | 31 | :param str channel: 32 | The can interface name. An example would be PCAN_USBBUS1 33 | """ 34 | if channel == '': 35 | raise TypeError("Must specify a PCAN channel.") 36 | else: 37 | self.channel_info = channel 38 | 39 | baudrate = PCAN_BAUD_500K 40 | hwtype = PCAN_TYPE_ISA 41 | ioport = 0x02A0 42 | interrupt = 11 43 | 44 | self.m_objPCANBasic = PCANBasic() 45 | self.m_PcanHandle = globals()[channel] 46 | 47 | result = self.m_objPCANBasic.Initialize(self.m_PcanHandle, baudrate, hwtype, ioport, interrupt) 48 | 49 | if result != PCAN_ERROR_OK: 50 | raise Exception(self.GetFormattedError(result)) 51 | 52 | super(Bus, self).__init__(*args, **kwargs) 53 | 54 | def GetFormattedError(self, error): 55 | # Gets the text using the GetErrorText API function 56 | # If the function success, the translated error is returned. If it fails, 57 | # a text describing the current error is returned. 58 | # 59 | #return error 60 | stsReturn = self.m_objPCANBasic.GetErrorText(error, 0) 61 | if stsReturn[0] != PCAN_ERROR_OK: 62 | return "An error occurred. Error-code's text ({0:X}h) couldn't be retrieved".format(error) 63 | else: 64 | return stsReturn[1] 65 | 66 | def recv(self, timeout=None): 67 | rx_msg = Message() 68 | 69 | log.debug("Trying to read a msg") 70 | 71 | result = self.m_objPCANBasic.Read(self.m_PcanHandle) 72 | if result[0] == PCAN_ERROR_QRCVEMPTY or result[0] == PCAN_ERROR_BUSLIGHT or result[0] == PCAN_ERROR_BUSHEAVY: 73 | return None 74 | elif result[0] != PCAN_ERROR_OK: 75 | raise Exception(self.GetFormattedError(result[0])) 76 | 77 | theMsg = result[1] 78 | itsTimeStamp = result[2] 79 | 80 | log.debug("I've got a message") 81 | 82 | arbitration_id = theMsg.ID 83 | 84 | bIsRTR = (theMsg.MSGTYPE & PCAN_MESSAGE_RTR.value) == PCAN_MESSAGE_RTR.value 85 | bIsExt = (theMsg.MSGTYPE & PCAN_MESSAGE_EXTENDED.value) == PCAN_MESSAGE_EXTENDED.value 86 | 87 | # Flags: EXT, RTR, ERR 88 | #flags = (PYCAN_RTRFLG if bIsRTR else 0) | (PYCAN_STDFLG if not bIsExt else 0) 89 | 90 | 91 | if bIsExt: 92 | #rx_msg.id_type = ID_TYPE_EXTENDED 93 | log.debug("CAN: Extended") 94 | else: 95 | #rx_msg.id_type = ID_TYPE_STANDARD 96 | log.debug("CAN: Standard") 97 | 98 | rx_msg.arbitration_id = arbitration_id 99 | rx_msg.id_type = bIsExt 100 | rx_msg.is_remote_frame = bIsRTR 101 | rx_msg.dlc = theMsg.LEN 102 | #rx_msg.flags = flags 103 | rx_msg.data = theMsg.DATA 104 | rx_msg.timestamp = boottimeEpoch + ( (itsTimeStamp.micros + (1000 * itsTimeStamp.millis)) / (1000.0 * 1000.0) ) 105 | 106 | return rx_msg 107 | 108 | def send(self, msg): 109 | if msg.id_type: 110 | msgType = PCAN_MESSAGE_EXTENDED 111 | else: 112 | msgType = PCAN_MESSAGE_STANDARD 113 | 114 | # create a TPCANMsg message structure 115 | CANMsg = TPCANMsg() 116 | 117 | # configure the message. ID, Length of data, message type and data 118 | CANMsg.ID = msg.arbitration_id 119 | CANMsg.LEN = len(msg.data) 120 | CANMsg.MSGTYPE = msgType 121 | 122 | # if a remote frame will be sent, data bytes are not important. 123 | if msg.is_remote_frame: 124 | CANMsg.MSGTYPE = msgType | PCAN_MESSAGE_RTR 125 | else: 126 | # copy data 127 | for i in range(CANMsg.LEN): 128 | CANMsg.DATA[i] = msg.data[i] 129 | 130 | log.debug("Data: {}".format(msg.data)) 131 | log.debug("type: {}".format(type(msg.data))) 132 | 133 | result = self.m_objPCANBasic.Write(self.m_PcanHandle, CANMsg) 134 | 135 | if result != PCAN_ERROR_OK: 136 | logging.error("Error sending frame :-/ " + self.GetFormattedError(result)) 137 | -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/can/protocols/j1939/pdu.py: -------------------------------------------------------------------------------- 1 | import logging 2 | from can import Message 3 | 4 | from .arbitrationid import ArbitrationID 5 | from .constants import pgn_strings, PGN_AC_ADDRESS_CLAIMED 6 | from .nodename import NodeName 7 | 8 | logger = logging.getLogger(__name__) 9 | 10 | 11 | class PDU(object): 12 | """ 13 | A PDU is a higher level abstraction of a CAN message. 14 | J1939 ensures that long messages are taken care of. 15 | """ 16 | 17 | def __init__(self, timestamp=0.0, arbitration_id=None, data=None, info_strings=None): 18 | """ 19 | :param float timestamp: 20 | Bus time in seconds. 21 | :param :class:`can.protocols.j1939.ArbitrationID` arbitration_id: 22 | 23 | :param bytes/bytearray/list data: 24 | With length up to 1785. 25 | """ 26 | if data is None: 27 | data = [] 28 | if info_strings is None: 29 | info_strings = [] 30 | self.timestamp = timestamp 31 | self.arbitration_id = arbitration_id 32 | self.data = self._check_data(data) 33 | self.info_strings = info_strings 34 | 35 | def __eq__(self, other): 36 | """Returns True if the pgn, data, source and destination are the same""" 37 | if other is None: 38 | return False 39 | if self.pgn != other.pgn: 40 | return False 41 | if self.data != other.data: 42 | return False 43 | if self.source != other.source: 44 | return False 45 | if self.destination != other.destination: 46 | return False 47 | return True 48 | 49 | 50 | @property 51 | def pgn(self): 52 | if self.arbitration_id.pgn.is_destination_specific: 53 | return self.arbitration_id.pgn.value & 0xFF00 54 | else: 55 | return self.arbitration_id.pgn.value 56 | 57 | @property 58 | def destination(self): 59 | """Destination address of the message""" 60 | return self.arbitration_id.destination_address 61 | 62 | @property 63 | def source(self): 64 | """Source address of the message""" 65 | return self.arbitration_id.source_address 66 | 67 | @property 68 | def is_address_claim(self): 69 | return self.pgn == PGN_AC_ADDRESS_CLAIMED 70 | 71 | @property 72 | def arbitration_id(self): 73 | return self._arbitration_id 74 | 75 | @arbitration_id.setter 76 | def arbitration_id(self, other): 77 | if other is None: 78 | self._arbitration_id = ArbitrationID() 79 | elif not isinstance(other, ArbitrationID): 80 | self._arbitration_id = ArbitrationID(other) 81 | else: 82 | self._arbitration_id = other 83 | 84 | def _check_data(self, value): 85 | assert len(value) <= 1785, 'Too much data to fit in a j1939 CAN message. Got {0} bytes'.format(len(value)) 86 | if len(value) > 0: 87 | assert min(value) >= 0, 'Data values must be between 0 and 255' 88 | assert max(value) <= 255, 'Data values must be between 0 and 255' 89 | return value 90 | 91 | def data_segments(self, segment_length=8): 92 | retval = [] 93 | for i in range(0, len(self.data), segment_length): 94 | retval.append(self.data[i:i + min(segment_length, (len(self.data) - i))]) 95 | return retval 96 | 97 | def check_equality(self, other, fields, debug=False): 98 | """ 99 | :param :class:`~can.protocols.j1939.PDU` other: 100 | :param list[str] fields: 101 | """ 102 | 103 | logger.debug("check_equality starting") 104 | 105 | retval = True 106 | for field in fields: 107 | try: 108 | own_value = getattr(self, field) 109 | except AttributeError: 110 | logger.warning("'%s' not found in 'self'" % field) 111 | return False 112 | 113 | try: 114 | other_value = getattr(other, field) 115 | except AttributeError: 116 | logger.debug("'%s' not found in 'other'" % field) 117 | return False 118 | 119 | if debug: 120 | self.info_strings.append("%s: %s, %s" % (field, own_value, other_value)) 121 | if own_value != other_value: 122 | return False 123 | 124 | logger.debug("Messages match") 125 | return retval 126 | 127 | 128 | def __str__(self): 129 | """ 130 | 131 | :return: A string representation of this message. 132 | 133 | """ 134 | # TODO group this into 8 bytes per line and line them up... 135 | data_string = " ".join("{:02d}".format(byte) for byte in self.data) 136 | return "{s.timestamp:15.6f} {s.arbitration_id} {data}".format(s=self, data=data_string) 137 | 138 | -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/can/interfaces/pcan.py: -------------------------------------------------------------------------------- 1 | """ 2 | Enable basic can over a PCAN USB device. 3 | 4 | """ 5 | import logging 6 | 7 | from PCANBasic import * 8 | 9 | logger = logging.getLogger(__name__) 10 | 11 | from can.bus import BusABC 12 | from can.message import Message 13 | 14 | boottimeEpoch = 0 15 | try: 16 | import uptime 17 | import datetime 18 | boottimeEpoch = (uptime.boottime() - datetime.datetime.utcfromtimestamp(0)).total_seconds() 19 | except: 20 | boottimeEpoch = 0 21 | 22 | # Set up logging 23 | logging.basicConfig(level=logging.WARNING) 24 | log = logging.getLogger('can.pcan') 25 | 26 | class Bus(BusABC): 27 | 28 | def __init__(self, channel, *args, **kwargs): 29 | """A PCAN USB interface to CAN. 30 | 31 | :param str channel: 32 | The can interface name. An example would be PCAN_USBBUS1 33 | """ 34 | if channel == '': 35 | raise TypeError("Must specify a PCAN channel.") 36 | else: 37 | self.channel_info = channel 38 | 39 | baudrate = PCAN_BAUD_500K 40 | hwtype = PCAN_TYPE_ISA 41 | ioport = 0x02A0 42 | interrupt = 11 43 | 44 | self.m_objPCANBasic = PCANBasic() 45 | self.m_PcanHandle = globals()[channel] 46 | 47 | result = self.m_objPCANBasic.Initialize(self.m_PcanHandle, baudrate, hwtype, ioport, interrupt) 48 | 49 | if result != PCAN_ERROR_OK: 50 | raise Exception(self.GetFormattedError(result)) 51 | 52 | super(Bus, self).__init__(*args, **kwargs) 53 | 54 | def GetFormattedError(self, error): 55 | # Gets the text using the GetErrorText API function 56 | # If the function success, the translated error is returned. If it fails, 57 | # a text describing the current error is returned. 58 | # 59 | #return error 60 | stsReturn = self.m_objPCANBasic.GetErrorText(error, 0) 61 | if stsReturn[0] != PCAN_ERROR_OK: 62 | return "An error occurred. Error-code's text ({0:X}h) couldn't be retrieved".format(error) 63 | else: 64 | return stsReturn[1] 65 | 66 | def recv(self, timeout=None): 67 | rx_msg = Message() 68 | 69 | log.debug("Trying to read a msg") 70 | 71 | result = self.m_objPCANBasic.Read(self.m_PcanHandle) 72 | if result[0] == PCAN_ERROR_QRCVEMPTY or result[0] == PCAN_ERROR_BUSLIGHT or result[0] == PCAN_ERROR_BUSHEAVY: 73 | return None 74 | elif result[0] != PCAN_ERROR_OK: 75 | raise Exception(self.GetFormattedError(result[0])) 76 | 77 | theMsg = result[1] 78 | itsTimeStamp = result[2] 79 | 80 | log.debug("I've got a message") 81 | 82 | arbitration_id = theMsg.ID 83 | 84 | bIsRTR = (theMsg.MSGTYPE & PCAN_MESSAGE_RTR.value) == PCAN_MESSAGE_RTR.value 85 | bIsExt = (theMsg.MSGTYPE & PCAN_MESSAGE_EXTENDED.value) == PCAN_MESSAGE_EXTENDED.value 86 | 87 | # Flags: EXT, RTR, ERR 88 | #flags = (PYCAN_RTRFLG if bIsRTR else 0) | (PYCAN_STDFLG if not bIsExt else 0) 89 | 90 | 91 | if bIsExt: 92 | #rx_msg.id_type = ID_TYPE_EXTENDED 93 | log.debug("CAN: Extended") 94 | else: 95 | #rx_msg.id_type = ID_TYPE_STANDARD 96 | log.debug("CAN: Standard") 97 | 98 | rx_msg.arbitration_id = arbitration_id 99 | rx_msg.id_type = bIsExt 100 | rx_msg.is_remote_frame = bIsRTR 101 | rx_msg.dlc = theMsg.LEN 102 | #rx_msg.flags = flags 103 | rx_msg.data = theMsg.DATA 104 | rx_msg.timestamp = boottimeEpoch + ( (itsTimeStamp.micros + (1000 * itsTimeStamp.millis)) / (1000.0 * 1000.0) ) 105 | 106 | return rx_msg 107 | 108 | def send(self, msg): 109 | if msg.id_type: 110 | msgType = PCAN_MESSAGE_EXTENDED 111 | else: 112 | msgType = PCAN_MESSAGE_STANDARD 113 | 114 | # create a TPCANMsg message structure 115 | CANMsg = TPCANMsg() 116 | 117 | # configure the message. ID, Length of data, message type and data 118 | CANMsg.ID = msg.arbitration_id 119 | CANMsg.LEN = len(msg.data) 120 | CANMsg.MSGTYPE = msgType 121 | 122 | # if a remote frame will be sent, data bytes are not important. 123 | if msg.is_remote_frame: 124 | CANMsg.MSGTYPE = msgType | PCAN_MESSAGE_RTR 125 | else: 126 | # copy data 127 | for i in range(CANMsg.LEN): 128 | CANMsg.DATA[i] = msg.data[i] 129 | 130 | log.debug("Data: {}".format(msg.data)) 131 | log.debug("type: {}".format(type(msg.data))) 132 | 133 | result = self.m_objPCANBasic.Write(self.m_PcanHandle, CANMsg) 134 | 135 | if result != PCAN_ERROR_OK: 136 | logging.error("Error sending frame :-/ " + self.GetFormattedError(result)) 137 | -------------------------------------------------------------------------------- /deps/python-can/test/j1939_test.py: -------------------------------------------------------------------------------- 1 | from time import sleep 2 | import unittest 3 | import threading 4 | from sys import version_info 5 | 6 | try: 7 | import queue 8 | except ImportError: 9 | import Queue as queue 10 | import random 11 | 12 | 13 | import can 14 | from can.interfaces.interface import Bus 15 | 16 | can_interface = 'vcan0' 17 | from can.protocols import j1939 18 | 19 | import logging 20 | logging.getLogger("").setLevel(logging.DEBUG) 21 | 22 | 23 | def generate_long_messages(arbitration_id): 24 | for l in list(range(10)) + [100, 1000, 1784, 1785]: 25 | data = bytearray([random.randrange(0, 2 ** 8 - 1) for b in range(l)]) 26 | m = j1939.PDU(arbitration_id=arbitration_id, data=data) 27 | yield m, data 28 | 29 | 30 | class J1939ImportTest(unittest.TestCase): 31 | 32 | def testProtocolImportable(self): 33 | assert hasattr(j1939, 'PDU') 34 | assert hasattr(j1939, 'ArbitrationID') 35 | 36 | 37 | class StaticJ1939Test(unittest.TestCase): 38 | 39 | def setUp(self): 40 | self.arbitration_id = j1939.ArbitrationID() 41 | 42 | def assert_correct_message_data(self, m, data): 43 | self.assertEqual(len(m.data), len(data)) 44 | assert all(d1 == d2 for d1, d2 in zip(m.data, data)) 45 | 46 | def testCreateMessage(self): 47 | self.m = j1939.PDU(arbitration_id=self.arbitration_id) 48 | 49 | def testArbitrationIDEquality(self): 50 | self.testCreateMessage() 51 | self.assertEqual(self.m.arbitration_id, self.arbitration_id) 52 | 53 | @unittest.skipIf(version_info < (3, 2), "bytes don't really exist in python 2") 54 | def testMessageWithBytes(self): 55 | data_as_bytes = b'abc123' 56 | m = j1939.PDU(arbitration_id=self.arbitration_id, data=data_as_bytes) 57 | self.assert_correct_message_data(m, data_as_bytes) 58 | 59 | def testMessageWithByteArray(self): 60 | data_as_bytearray = bytearray(b'abc123') 61 | m = j1939.PDU(arbitration_id=self.arbitration_id, data=data_as_bytearray) 62 | self.assert_correct_message_data(m, data_as_bytearray) 63 | 64 | def testMessageWithList(self): 65 | data = [1, 4, 123, 35] 66 | m = j1939.PDU(arbitration_id=self.arbitration_id, data=data) 67 | self.assert_correct_message_data(m, data) 68 | 69 | def testLongMessage(self): 70 | # test message of length between 0 and 1785 bytes 71 | for m, data in generate_long_messages(self.arbitration_id): 72 | self.assert_correct_message_data(m, data) 73 | 74 | def testTooLongAMessage(self): 75 | data = bytes([random.randrange(0, 2 ** 8 - 1) for b in range(1786)]) 76 | self.assertRaises(j1939.PDU, kwargs={'arbitration_id': self.arbitration_id, 'data': data}) 77 | 78 | 79 | class J1939BusTest(unittest.TestCase): 80 | def testCreateBus(self): 81 | self.bus = j1939.Bus(channel=can_interface) 82 | self.bus.shutdown() 83 | 84 | 85 | class NetworkJ1939Test(unittest.TestCase): 86 | """ 87 | 88 | """ 89 | 90 | def setUp(self): 91 | super(NetworkJ1939Test, self).setUp() 92 | self.bus = j1939.Bus(channel=can_interface) 93 | 94 | def tearDown(self): 95 | sleep(0.2) 96 | self.bus.shutdown() 97 | 98 | def testSendingJ1939Message(self): 99 | # this version puts the message through the network 100 | arbitration_id = j1939.ArbitrationID(pgn=65259) 101 | m = j1939.PDU(arbitration_id=arbitration_id, data=bytearray(b'abc123')) 102 | 103 | logging.debug("writing message: {}".format(m)) 104 | self.bus.send(m) 105 | logging.debug("message written") 106 | 107 | def _testSendingLongMessage(self): 108 | arbitration_id = j1939.ArbitrationID(pgn=0x22) 109 | 110 | for m, data in generate_long_messages(arbitration_id): 111 | sleep(0.050) 112 | self.bus.send(m) 113 | 114 | 115 | def testReceivingLongMessage(self): 116 | node = j1939.Node(self.bus, j1939.NodeName(0), [0x42, 0x01]) 117 | 118 | data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] 119 | pgn = j1939.PGN(reserved_flag=True, pdu_specific=j1939.constants.DESTINATION_ADDRESS_GLOBAL) 120 | arbitration_id = j1939.ArbitrationID(pgn=pgn, source_address=0x01) 121 | m_out = j1939.PDU(arbitration_id=arbitration_id, data=data) 122 | 123 | otherbus = j1939.Bus(channel=can_interface) 124 | 125 | attempts = 0 126 | while attempts < 5: 127 | m_in = otherbus.recv(timeout=0.5) 128 | if m_in is not None: break 129 | # send a long message 130 | self.bus.send(m_out) 131 | attempts += 1 132 | 133 | 134 | self.assertIsNotNone(m_in, 'Should receive messages on can bus when sending long message') 135 | self.assertIsInstance(m_in, j1939.PDU) 136 | self.assertListEqual(m_in.data, m_out.data) 137 | 138 | otherbus.shutdown() 139 | 140 | 141 | if __name__ == "__main__": 142 | unittest.main() 143 | -------------------------------------------------------------------------------- /deps/python-can/build/lib.linux-armv7l-2.7/test/j1939_test.py: -------------------------------------------------------------------------------- 1 | from time import sleep 2 | import unittest 3 | import threading 4 | from sys import version_info 5 | 6 | try: 7 | import queue 8 | except ImportError: 9 | import Queue as queue 10 | import random 11 | 12 | 13 | import can 14 | from can.interfaces.interface import Bus 15 | 16 | can_interface = 'vcan0' 17 | from can.protocols import j1939 18 | 19 | import logging 20 | logging.getLogger("").setLevel(logging.DEBUG) 21 | 22 | 23 | def generate_long_messages(arbitration_id): 24 | for l in list(range(10)) + [100, 1000, 1784, 1785]: 25 | data = bytearray([random.randrange(0, 2 ** 8 - 1) for b in range(l)]) 26 | m = j1939.PDU(arbitration_id=arbitration_id, data=data) 27 | yield m, data 28 | 29 | 30 | class J1939ImportTest(unittest.TestCase): 31 | 32 | def testProtocolImportable(self): 33 | assert hasattr(j1939, 'PDU') 34 | assert hasattr(j1939, 'ArbitrationID') 35 | 36 | 37 | class StaticJ1939Test(unittest.TestCase): 38 | 39 | def setUp(self): 40 | self.arbitration_id = j1939.ArbitrationID() 41 | 42 | def assert_correct_message_data(self, m, data): 43 | self.assertEqual(len(m.data), len(data)) 44 | assert all(d1 == d2 for d1, d2 in zip(m.data, data)) 45 | 46 | def testCreateMessage(self): 47 | self.m = j1939.PDU(arbitration_id=self.arbitration_id) 48 | 49 | def testArbitrationIDEquality(self): 50 | self.testCreateMessage() 51 | self.assertEqual(self.m.arbitration_id, self.arbitration_id) 52 | 53 | @unittest.skipIf(version_info < (3, 2), "bytes don't really exist in python 2") 54 | def testMessageWithBytes(self): 55 | data_as_bytes = b'abc123' 56 | m = j1939.PDU(arbitration_id=self.arbitration_id, data=data_as_bytes) 57 | self.assert_correct_message_data(m, data_as_bytes) 58 | 59 | def testMessageWithByteArray(self): 60 | data_as_bytearray = bytearray(b'abc123') 61 | m = j1939.PDU(arbitration_id=self.arbitration_id, data=data_as_bytearray) 62 | self.assert_correct_message_data(m, data_as_bytearray) 63 | 64 | def testMessageWithList(self): 65 | data = [1, 4, 123, 35] 66 | m = j1939.PDU(arbitration_id=self.arbitration_id, data=data) 67 | self.assert_correct_message_data(m, data) 68 | 69 | def testLongMessage(self): 70 | # test message of length between 0 and 1785 bytes 71 | for m, data in generate_long_messages(self.arbitration_id): 72 | self.assert_correct_message_data(m, data) 73 | 74 | def testTooLongAMessage(self): 75 | data = bytes([random.randrange(0, 2 ** 8 - 1) for b in range(1786)]) 76 | self.assertRaises(j1939.PDU, kwargs={'arbitration_id': self.arbitration_id, 'data': data}) 77 | 78 | 79 | class J1939BusTest(unittest.TestCase): 80 | def testCreateBus(self): 81 | self.bus = j1939.Bus(channel=can_interface) 82 | self.bus.shutdown() 83 | 84 | 85 | class NetworkJ1939Test(unittest.TestCase): 86 | """ 87 | 88 | """ 89 | 90 | def setUp(self): 91 | super(NetworkJ1939Test, self).setUp() 92 | self.bus = j1939.Bus(channel=can_interface) 93 | 94 | def tearDown(self): 95 | sleep(0.2) 96 | self.bus.shutdown() 97 | 98 | def testSendingJ1939Message(self): 99 | # this version puts the message through the network 100 | arbitration_id = j1939.ArbitrationID(pgn=65259) 101 | m = j1939.PDU(arbitration_id=arbitration_id, data=bytearray(b'abc123')) 102 | 103 | logging.debug("writing message: {}".format(m)) 104 | self.bus.send(m) 105 | logging.debug("message written") 106 | 107 | def _testSendingLongMessage(self): 108 | arbitration_id = j1939.ArbitrationID(pgn=0x22) 109 | 110 | for m, data in generate_long_messages(arbitration_id): 111 | sleep(0.050) 112 | self.bus.send(m) 113 | 114 | 115 | def testReceivingLongMessage(self): 116 | node = j1939.Node(self.bus, j1939.NodeName(0), [0x42, 0x01]) 117 | 118 | data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] 119 | pgn = j1939.PGN(reserved_flag=True, pdu_specific=j1939.constants.DESTINATION_ADDRESS_GLOBAL) 120 | arbitration_id = j1939.ArbitrationID(pgn=pgn, source_address=0x01) 121 | m_out = j1939.PDU(arbitration_id=arbitration_id, data=data) 122 | 123 | otherbus = j1939.Bus(channel=can_interface) 124 | 125 | attempts = 0 126 | while attempts < 5: 127 | m_in = otherbus.recv(timeout=0.5) 128 | if m_in is not None: break 129 | # send a long message 130 | self.bus.send(m_out) 131 | attempts += 1 132 | 133 | 134 | self.assertIsNotNone(m_in, 'Should receive messages on can bus when sending long message') 135 | self.assertIsInstance(m_in, j1939.PDU) 136 | self.assertListEqual(m_in.data, m_out.data) 137 | 138 | otherbus.shutdown() 139 | 140 | 141 | if __name__ == "__main__": 142 | unittest.main() 143 | --------------------------------------------------------------------------------