Skip to content

Commit 71580d8

Browse files
authored
canalystii: Fix transmitting onto a busy bus (hardbyte#1114)
* canalystii: Add a note about the library * canalystii: Retry if sending fails the first time
1 parent 596f07d commit 71580d8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

can/interfaces/canalystii.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ class VCI_CAN_OBJ(Structure):
3232
]
3333

3434

35+
SENDTYPE_ALLOW_RETRY = 0 # Retry send if there is bus contention
36+
SENDTYPE_ONE_SHOT = 1 # Drop the message if transmission fails first time
37+
3538
VCI_USBCAN2 = 4
3639

3740
STATUS_OK = 0x01
@@ -145,7 +148,7 @@ def send(self, msg, timeout=None):
145148
msg.arbitration_id,
146149
0,
147150
0,
148-
1,
151+
SENDTYPE_ALLOW_RETRY,
149152
msg.is_remote_frame,
150153
extern_flag,
151154
msg.dlc,

doc/interfaces/canalystii.rst

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ CANalyst-II
44
CANalyst-II(+) is a USB to CAN Analyzer. The controlcan library is originally developed by
55
`ZLG ZHIYUAN Electronics`_.
66

7+
.. note::
8+
9+
Use of this interface requires the ``ControlCAN.dll`` (Windows) or ``libcontrolcan.so`` vendor library to be placed in the Python working directory.
710

811
Bus
912
---

0 commit comments

Comments
 (0)