Add ability to pass explicit dlc value to send() using the SYSTEC interface by dbristow-otc · Pull Request #1756 · hardbyte/python-can

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