Skip to content

take msg.is_extend_id into use and fix typo #513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 22, 2019
Merged
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
5 changes: 3 additions & 2 deletions can/interfaces/canalystii.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)