Skip to content

Commit de94772

Browse files
acolombhardbyte
authored andcommitted
Fix initialization of usb2can Bus interface object (#501)
* Fully initialize usb2can Bus interface object. The usb2can interface backend currently does not work because the _filters member is not initialized in the constructor of can.interfaces.usb2can.Usb2canBus. Call the parent class constructor to pull in the missing object attributes. * Add a note about the 32-bit only CANAL DLL. The usb2can interface currently only supports 32-bit Python on Windows, because there is no 64-bit CANAL library available yet. Mention this in the documentation section.
1 parent 89f4c20 commit de94772

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

can/interfaces/usb2can/usb2canInterface.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ def __init__(self, channel, *args, **kwargs):
119119

120120
self.handle = self.can.open(connector.encode('utf-8'), enable_flags)
121121

122+
super(Usb2canBus, self).__init__(channel=channel, *args, **kwargs)
123+
122124
def send(self, msg, timeout=None):
123125
tx = message_convert_tx(msg)
124126
if timeout:

doc/interfaces/usb2can.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ WINDOWS INSTALL
2626
1. To install on Windows download the USB2CAN Windows driver. It is compatible with XP, Vista, Win7, Win8/8.1. (Written against driver version v1.0.2.1)
2727
2. Install the appropriate version of `pywin32 <https://sourceforge.net/projects/pywin32/>`_ (win32com)
2828
3. Download the USB2CAN CANAL DLL from the USB2CAN website. Place this in either the same directory you are running usb2can.py from or your DLL folder in your python install.
29+
Note that only a 32-bit version is currently available, so this only works in a 32-bit Python environment.
2930
(Written against CANAL DLL version v1.0.6)
3031

3132
Interface Layout

0 commit comments

Comments
 (0)