Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions can/interfaces/systec/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ class CanMsg(Structure):
), # Receive time stamp in ms (for transmit messages no meaning)
]

def __init__(self, id_=0, frame_format=MsgFrameFormat.MSG_FF_STD, data=None):
def __init__(
self, id_=0, frame_format=MsgFrameFormat.MSG_FF_STD, data=None, dlc=None
):
data = [] if data is None else data
super().__init__(id_, frame_format, len(data), (BYTE * 8)(*data), 0)
dlc = len(data) if dlc is None else dlc
super().__init__(id_, frame_format, dlc, (BYTE * 8)(*data), 0)

def __eq__(self, other):
if not isinstance(other, CanMsg):
Expand Down
1 change: 1 addition & 0 deletions can/interfaces/systec/ucanbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ def send(self, msg, timeout=None):
| (MsgFrameFormat.MSG_FF_EXT if msg.is_extended_id else 0)
| (MsgFrameFormat.MSG_FF_RTR if msg.is_remote_frame else 0),
msg.data,
msg.dlc,
)
self._ucan.write_can_msg(self.channel, [message])
except UcanException as exception:
Expand Down