# Enumerations

## ChannelData

class canlib.linlib.ChannelData(value)

  linCHANNELDATA_xxx

  These defines are used in `getChannelData`.

  CARD_FIRMWARE_REV = 9

    Firmware version from the LIN interface.

## ChannelType

class canlib.linlib.ChannelType(value)

  Flags for `openChannel`

  MASTER = 1

    The LIN interface will be a LIN master

  SLAVE = 2

    The LIN interface will be a LIN slave

## Error

class canlib.linlib.Error(value)

  An enumeration.

  CANERROR = -15

    Internal error in the driver

  DRIVER = -18

    CAN driver type not supported

  DRIVERFAILED = -19

    DeviceIOControl failed

  ERRRESP = -16

    There was an error response from the LIN interface

  INTERNAL = -22

    Internal error in the driver

  INVHANDLE = -14

    Handle is invalid

  LICENSE = -21

    The license is not valid

  MASTERONLY = -5

    The function is only for a master.

  NOCARD = -20

    The card was removed or not inserted

  NOCHANNELS = -10

    No channels avaliable

  NOHANDLES = -13

    Can’t get handle

  NOMEM = -9

    Out of memory

  NOMSG = -1

    No messages available

  NOTFOUND = -8

    Specified hardware not found. This error is reported when the LIN transceiver isn’t powered up

  NOTINITIALIZED = -12

    Library not initialized

  NOTRUNNING = -3

    Handle not on-bus. Some functions requires that the handle is on-bus before being called.

  NOT_IMPLEMENTED = -26

    The requested feature or function is not implemented in the device you are trying to use it on

  NO_ACCESS = -23

    Access denied

  NO_REF_POWER = -25

    Function not supported in this version

  PARAM = -7

    Error in parameter

  RUNNING = -4

    Handle not off-bus. Some functions requires that the handle is off-bus before being called.

  SLAVEONLY = -6

    The function is only for a slave.

  TIMEOUT = -11

    Timeout occurred

  VERSION = -24

    Function not supported in this version

  WRONGRESP = -17

    The LIN interface response wasn’t the expected one

## MessageDisturb

class canlib.linlib.MessageDisturb(value)

  LIN illegal message flags

  CSUM = 1

    The checksum of transmitted messages will be inverted

  PARITY = 2

    The two parity bits will be inverted, used only in master mode.

## MessageFlag

class canlib.linlib.MessageFlag(value)

  LIN message flags

  The following flags is used in `LINFrame.flags`.

  BIT_ERROR = 128

    Bit error when transmitting.

  CSUM_ERROR = 16

    Checksum error

  NODATA = 8

    No data, only a header.

  PARITY_ERROR = 32

    ID parity error

  RX = 2

    The message was something we received from the bus.

  SYNCH_ERROR = 64

    A synch error

  SYNC_ERROR = 64

    A synch error

  TX = 1

    The message was something we transmitted on the bus.

  WAKEUP_FRAME = 4

## MessageParity

class canlib.linlib.MessageParity(value)

  LIN message parity

  - `MessageParity.STANDARD` == `LIN_MSG_USE_STANDARD_PARITY`

  - `MessageParity.ENHANCED` == `LIN_MSG_USE_ENHANCED_PARITY`

  ENHANCED = 8

    Use enhanced (2.x) parity for the specified msg

  STANDARD = 4

    Use standard (1.x) parity for the specified msg

## Setup

class canlib.linlib.Setup(value)

  Used in `Channel.setupLIN`

  ENHANCED_CHECKSUM = 1

    When specified, the LIN interface will use the “enhanced” checksum according to LIN 2.0. Note that as per the LIN 2.0 spec) the enhanced checksum is not used on the diagnostic frames even if the `Setup.ENHANCED_CHECKSUM` setting is in effect.

  VARIABLE_DLC = 2

    When specified, turns variable message length on, so the the message length will depend on the message ID.