# canlib.frame

class `canlib.frame.``Frame`(id_, data, dlc=None, flags=0, timestamp=None)

  Bases: `object`

  Represents a CAN message

  Parameters: | id_ – Message id data – Message data, will pad zero to match dlc (if dlc is given) dlc – Message dlc, default is calculated from number of data flags – Message flags, default is 0 timestamp – Optional timestamp

  `data`
  `dlc`
  `flags`
  `id`
  `timestamp`

class `canlib.frame.``LINFrame`(*args, **kwargs)

  Bases: `canlib.frame.Frame`

  Represents a LIN message

  A `Frame` that also has a `info` attribute, which is a `linlib.MessageInfo` or `None`. This attribute is initialized via the `info` keyword-only argument to `__init__`.

  `data`
  `dlc`
  `flags`
  `id`
  `info`
  `timestamp`

`canlib.frame.``dlc_to_bytes`(dlc, canFd=False)

  Convert DLC to number of bytes

  New in version 1.7.