Skip to content

Commit 119999d

Browse files
atmlvshardbyte
authored andcommitted
canalystii interface take msg.is_extend_id into use and fix typo (#513)
1 parent f8524c1 commit 119999d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

can/interfaces/canalystii.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ def send(self, msg, timeout=None):
122122
:param timeout: timeout is not used here
123123
:return:
124124
"""
125-
raw_message = VCI_CAN_OBJ(msg.arbitration_id, 0, 0, 0, msg.is_remote_frame, 0, msg.dlc, (c_ubyte * 8)(*msg.data), (c_byte * 3)(*[0, 0, 0]))
125+
extern_flag = 1 if msg.is_extended_id else 0
126+
raw_message = VCI_CAN_OBJ(msg.arbitration_id, 0, 0, 1, msg.is_remote_frame, extern_flag, msg.dlc, (c_ubyte * 8)(*msg.data), (c_byte * 3)(*[0, 0, 0]))
126127

127128
if msg.channel is not None:
128129
channel = msg.channel
@@ -161,7 +162,7 @@ def _recv_internal(self, timeout=None):
161162

162163
def flush_tx_buffer(self):
163164
for channel in self.channels:
164-
CANalystII.VCI_ClearBUffer(VCI_USBCAN2, self.device, channel)
165+
CANalystII.VCI_ClearBuffer(VCI_USBCAN2, self.device, channel)
165166

166167
def shutdown(self):
167168
CANalystII.VCI_CloseDevice(VCI_USBCAN2, self.device)

0 commit comments

Comments
 (0)