From adc7f23b6d7f37632de9e29ca69ae3d31a4201f6 Mon Sep 17 00:00:00 2001 From: zhengyingkai Date: Fri, 22 Feb 2019 16:22:16 +0800 Subject: [PATCH] take msg.is_extend_id into use and fix typo --- can/interfaces/canalystii.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/can/interfaces/canalystii.py b/can/interfaces/canalystii.py index 55f349a2d..35f240a66 100644 --- a/can/interfaces/canalystii.py +++ b/can/interfaces/canalystii.py @@ -122,7 +122,8 @@ def send(self, msg, timeout=None): :param timeout: timeout is not used here :return: """ - 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])) + extern_flag = 1 if msg.is_extended_id else 0 + 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])) if msg.channel is not None: channel = msg.channel @@ -161,7 +162,7 @@ def _recv_internal(self, timeout=None): def flush_tx_buffer(self): for channel in self.channels: - CANalystII.VCI_ClearBUffer(VCI_USBCAN2, self.device, channel) + CANalystII.VCI_ClearBuffer(VCI_USBCAN2, self.device, channel) def shutdown(self): CANalystII.VCI_CloseDevice(VCI_USBCAN2, self.device)