Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added can/interfaces/canalystii/ControlCAN.dll
Binary file not shown.
3 changes: 3 additions & 0 deletions can/interfaces/canalystii/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
""" CANalyst-II CAN bus driver """

from can.interfaces.canalystii.canalystii import CANalystIIBus
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from ctypes import *
import logging
import platform
Expand Down Expand Up @@ -59,10 +60,11 @@ class VCI_CAN_OBJ(Structure):
}

try:
module_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)))
if platform.system() == "Windows":
CANalystII = WinDLL("./ControlCAN.dll")
CANalystII = WinDLL(os.path.join(module_dir, "ControlCAN.dll"))
else:
CANalystII = CDLL("./libcontrolcan.so")
CANalystII = CDLL(os.path.join(module_dir, "libcontrolcan.so"))
logger.info("Loaded CANalystII library")
except OSError as e:
CANalystII = None
Expand Down
Binary file added can/interfaces/canalystii/libcontrolcan.so
Binary file not shown.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"": ["README.rst", "CONTRIBUTORS.txt", "LICENSE.txt", "CHANGELOG.txt"],
"doc": ["*.*"],
"examples": ["*.py"],
"can": ['interfaces/canalystii/libcontrolcan.so', 'interfaces/canalystii/ControlCAN.dll'],
},
# Installation
# see https://www.python.org/dev/peps/pep-0345/#version-specifiers
Expand Down