Enumerations

AcceptFilterFlag

class canlib.canlib.AcceptFilterFlag(value)[source]

canFILTER_SET_xxx

NULL_MASK = 0
SET_CODE_EXT = 5
SET_CODE_STD = 3
SET_MASK_EXT = 6
SET_MASK_STD = 4

Bitrate

class canlib.canlib.Bitrate(value)[source]

canBITRATE_xxx

Predefined CAN bitrates. See BitrateFD for predefined CAN FD bitrates.

New in version 1.17.

BITRATE_100K = -5

Indicate a bitrate of 100 kbit/s.

BITRATE_10K = -9

Indicate a bitrate of 10 kbit/s.

BITRATE_125K = -4

Indicate a bitrate of 125 kbit/s.

BITRATE_1M = -1

Indicate a bitrate of 1 Mbit/s.

BITRATE_250K = -3

Indicate a bitrate of 250 kbit/s.

BITRATE_500K = -2

Indicate a bitrate of 500 kbit/s.

BITRATE_50K = -7

Indicate a bitrate of 50 kbit/s.

BITRATE_62K = -6

Indicate a bitrate of 62 kbit/s.

BITRATE_83K = -8

Indicate a bitrate of 83 kbit/s.

BitrateFD

class canlib.canlib.BitrateFD(value)[source]

canFD_BITRATE_xxx

Predefined CAN FD bitrates. Used when setting bitrates using the CAN FD protocol, see Bitrate for predefined CAN bitrates.

New in version 1.17.

BITRATE_1M_80P = -1001

Indicates a bitrate of 1 Mbit/s and sampling point at 80%.

BITRATE_2M_80P = -1002

Indicates a bitrate of 2 Mbit/s and sampling point at 80%.

BITRATE_4M_80P = -1003

Indicates a bitrate of 4 Mbit/s and sampling point at 80%.

BITRATE_500K_80P = -1000

Indicates a bitrate of 500 kbit/s and sampling point at 80%.

BITRATE_8M_60P = -1004

Indicates a bitrate of 8 Mbit/s and sampling point at 60%.

BITRATE_8M_80P = -1005

Indicates a bitrate of 8 Mbit/s and sampling point at 80%.

BusTypeGroup

class canlib.canlib.BusTypeGroup(value)[source]

kvBUSTYPE_GROUP_xxx

Bus type group. This is a grouping of the individual kvBUSTYPE_xxx.

INTERNAL = 4

kvBUSTYPE_PCI, kvBUSTYPE_PCMCIA, …

LOCAL = 2

kvBUSTYPE_USB

REMOTE = 3

kvBUSTYPE_WLAN, kvBUSTYPE_LAN

VIRTUAL = 1

ChannelCap

class canlib.canlib.ChannelCap(value)[source]

canCHANNEL_CAP_xxx

Channel capabilities.

Changed in version 1.8.

BUS_STATISTICS = 2

Can report busload etc.

CAN_FD = 524288

CAN-FD ISO compliant channel.

CAN_FD_NONISO = 1048576

CAN-FD NON-ISO compliant channel.

DIAGNOSTICS = 268435456

Channel has diagnostic capabilities.

ERROR_COUNTERS = 4

Can return error counters.

EXTENDED_CAN = 1

Can use extended identifiers.

GENERATE_ERROR = 16

Can send error frames.

GENERATE_OVERLOAD = 32

Can send CAN overload frame.

IO_API = 134217728

Channel has diagnostic capabilities.

LIN_HYBRID = 67108864

Channel has LIN capabilities.

LOGGER = 8388608

Channel has logger capabilities.

REMOTE_ACCESS = 16777216

Channel has remote capabilities.

RESERVED_1 = 262144
RESERVED_2 = 8

Obsolete, only used by LAPcan driver

SCRIPT = 33554432

Channel has script capabilities.

SILENT_MODE = 2097152

Channel supports Silent mode.

SIMULATED = 131072

Simulated CAN channel.

SINGLE_SHOT = 4194304

Channel supports Single Shot messages.

TXACKNOWLEDGE = 128

Can report when a CAN messages has been transmitted.

TXREQUEST = 64

Can report when a CAN messsage transmission is initiated.

VIRTUAL = 65536

Virtual CAN channel.

ChannelDataItem

class canlib.canlib.ChannelDataItem(value)[source]

Low level helper object representing canCHANNELDATA_xxx.

See the properties of ChannelData for how to get retrieve this data.

BUS_PARAM_LIMITS = 45
BUS_TYPE = 30

see ChannelData.bus_type

CARD_FIRMWARE_REV = 9

firmware revision number on the card, see ChannelData.card_firmware_rev

CARD_HARDWARE_REV = 10

version of the card’s hardware, see ChannelData.card_hardware_rev

CARD_NUMBER = 5

the card’s number in the computer, see ChannelData.card_number

CARD_SERIAL_NO = 7

serial number of the card, or 0, see ChannelData.card_serial_no

CARD_TYPE = 4

hardware type of the card, see ChannelData.card_type

CARD_UPC_NO = 11

EAN of the card, see ChannelData.card_upc_no

CHANNEL_CAP = 1

capabilities of the CAN controller, see ChannelData.channel_cap

CHANNEL_CAP_EX = 47

see ChannelData.channel_cap_ex

CHANNEL_CAP_MASK = 38

see ChannelData.channel_cap_mask

CHANNEL_FLAGS = 3

status of the channel as flags, see ChannelData.channel_flags

CHANNEL_NAME = 13

Deprecated

CHANNEL_QUALITY = 28

see ChannelData.channel_quality

CHAN_NO_ON_CARD = 6

local channel number on the card, see ChannelData.chan_no_on_card

CLOCK_INFO = 46

see ChannelData.clock_info

CUST_CHANNEL_NAME = 39

see ChannelData.cust_channel_name

DEVDESCR_ASCII = 26

product name of the device, see ChannelData.devdescr_ascii

DEVDESCR_UNICODE = 25

product name of the device, see ChannelData.devdescr_unicode

DEVICE_PHYSICAL_POSITION = 18

see ChannelData.device_physical_position

DEVNAME_ASCII = 31

see ChannelData.devname_ascii

DLL_FILETYPE = 16

see ChannelData.dll_filetype

DLL_FILE_VERSION = 14

version of the dll file, see ChannelData.dll_file_version

DLL_PRODUCT_VERSION = 15

version of the CANlib, see ChannelData.dll_product_version

DRIVER_FILE_VERSION = 21

version of the driver, see ChannelData.driver_file_version

DRIVER_NAME = 27

device driver name, see ChannelData.driver_name

DRIVER_PRODUCT_VERSION = 22

version of the CANlib, see ChannelData.driver_product_version

FEATURE_EAN = 44

see ChannelData.feature_ean

HW_STATUS = 43

see ChannelData.hw_status

IS_REMOTE = 40

see ChannelData.is_remote

LOGGER_TYPE = 42

see ChannelData.logger_type

MAX_BITRATE = 37

see ChannelData.max_bitrate

MFGNAME_ASCII = 24

manufacturer’s name, see ChannelData.mfgname_ascii

MFGNAME_UNICODE = 23

manufacturer’s name, see ChannelData.mfgname_unicode

REMOTE_HOST_NAME = 35

see ChannelData.remote_host_name

REMOTE_MAC = 36

see ChannelData.remote_mac

REMOTE_OPERATIONAL_MODE = 33

see ChannelData.remote_operational_mode

REMOTE_PROFILE_NAME = 34

see ChannelData.remote_profile_name

REMOTE_TYPE = 41

see ChannelData.remote_type

ROUNDTRIP_TIME = 29

see ChannelData.roundtrip_time

TIMESYNC_ENABLED = 20

see ChannelData.timesync_enabled

TIME_SINCE_LAST_SEEN = 32

see ChannelData.time_since_last_seen

TRANS_CAP = 2

capabilities of the CAN transceiver, see ChannelData.trans_cap

TRANS_SERIAL_NO = 8

serial number of the transceiver, or 0, see ChannelData.trans_serial_no

TRANS_TYPE = 17

transceiver type, see ChannelData.trans_type

TRANS_UPC_NO = 12

EAN of the transceiver, see ChannelData.trans_upc_no

UI_NUMBER = 19

see ChannelData.ui_number

ChannelFlags

class canlib.canlib.ChannelFlags(value)[source]

canCHANNEL_IS_xxx

These channel flags are used in conjunction with ChannelDataItem.channel_flags.

IS_CANFD = 4

Channel has been opened as CAN FD.

IS_EXCLUSIVE = 1

Channel is opened exclusively.

IS_LIN = 16

Channel has been opened as LIN.

IS_LIN_MASTER = 32

Channel has been opened as a LIN master.

IS_LIN_SLAVE = 64

Channel has been opened as a LIN slave.

IS_OPEN = 2

Channel is active, either opened in LIN mode or on-bus in CAN mode.

DeviceMode

class canlib.canlib.DeviceMode(value)[source]

kvDEVICE_MODE_xxx

INTERFACE = 0

Device is running or should be running in interface mode.

LOGGER = 1

Device is running or should be running in logger mode.

Driver

class canlib.canlib.Driver(value)[source]

An enumeration.

NORMAL = 4

The “normal” driver type (push-pull). This is the default.

OFF = 0

The driver is turned off. Not implemented in all types of hardware.

SELFRECEPTION = 8

Self-reception. Not implemented.

SILENT = 1

Sets the CAN controller in Silent Mode.

DriverCap

class canlib.canlib.DriverCap(value)[source]

canDRIVER_CAP_xxx

Driver (transceiver) capabilities.

HIGHSPEED = 1

EnvVarType

class canlib.canlib.EnvVarType(value)[source]

kvENVVAR_TYPE_xxx

FLOAT = 2

The type of the envvar is C float.

INT = 1

The type of the envvar is C int.

STRING = 3

The type of the envvar is C string.

Error

class canlib.canlib.Error(value)[source]

canERR_xxx

BUFFER_TOO_SMALL = -43

Buffer provided was not large enough.

CONFIG = -37

Configuration Error.

CRC = -36

CRC error.

DEVICE_FILE = -33

Device File error.

DISK = -35

Disk error.

DRIVER = -12

Driver type not supported

DRIVERFAILED = -24

DeviceIOControl failed, use Win32 GetLastError() to learn more

DRIVERLOAD = -23

Can’t find or load kernel driver

DYNAINIT = -18

Error when initializing a DLL

DYNALIB = -17

A DLL seems to have wrong version

DYNALOAD = -16

A driver DLL can’t be found or loaded

HARDWARE = -15

A hardware error has occurred

HOST_FILE = -34

Host File error.

INIFILE = -11

Error in the ini-file (16-bit only)

INTERNAL = -30

Internal error in the driver.

INTERRUPTED = -6

Interrupted by signals.

INVALID_PASSWORD = -128
INVALID_SESSION = -131
INVHANDLE = -10

Handle is invalid

IO_CONFIG_CHANGED = -46

The I/O pin configuration has changed after last confirmation.

IO_NOT_CONFIRMED = -45

The I/O pin configuration is not confirmed.

IO_NO_VALID_CONFIG = -48

There is no valid I/O pin configuration.

IO_PENDING = -47

The previous I/O pin value has not yet changed the output.

IO_WRONG_PIN_TYPE = -44

I/O pin doesn’t exist or the I/O pin type doesn’t match.

LICENSE = -29

The license is not valid.

MEMO_FAIL = -38

Memo Error.

NOCARD = -26

The card was removed or not inserted

NOCHANNELS = -5

No channels available.

NOCONFIGMGR = -25

Can’t find req’d config s/w (e.g. CS/SS)

NOHANDLES = -9

Out of handles

NOMEM = -4

Out of memory.

NOMSG = -2

There were no messages to read.

NOTFOUND = -3

Specified device or channel not found.

NOTINITIALIZED = -8

The library is not initialized.

NOT_AUTHORIZED = -130
NOT_IMPLEMENTED = -32

Not implemented.

NOT_SUPPORTED = -19

Operation not supported by hardware or firmware

NO_ACCESS = -31

Access denied.

NO_SUCH_FUNCTION = -129
PARAM = -1

Error in one or more parameters.

REGISTRY = -28

Error (missing data) in the Registry

RESERVED_2 = -22

Reserved

RESERVED_5 = -20

Reserved

RESERVED_6 = -21

Reserved

RESERVED_7 = -27

Reserved

SCRIPT_FAIL = -39

Script Fail.

SCRIPT_WRONG_VERSION = -40

Unsupported t program version.

TIMEOUT = -7

Timeout occurred.

TXBUFOFL = -13

Transmit buffer overflow

TXE_CONTAINER_FORMAT = -42

Parsing t program failed.

TXE_CONTAINER_VERSION = -41

Unsuppoted txe version.

HardwareType

class canlib.canlib.HardwareType(value)[source]

canHWTYPE_xxx

The following constants can be returned from ChannelData, using the card_type property. They identify the hardware type for the current channel.

Note

The members indicate a hardware type, but not necessarily a specific product. For example, canHWTYPE_LAPCAN is returned both for LAPcan and LAPcan II. (Use the card_upc_no property of ChannelData to obtain the UPC/EAN code for the device. This number uniquely identifies the product.)

ACQUISITOR = 46

Kvaser Acquisitor (obsolete).

BAGEL = 64

Obsolete name, use BLACKBIRD_V2 instead.

BLACKBIRD = 58

Kvaser BlackBird.

BLACKBIRD_V2 = 64

Kvaser BlackBird v2.

CANLINHYBRID = 84

Kvaser Hybrid CAN/LIN.

CANPARI = 3

CANpari (obsolete).

DINRAIL = 86

Kvaser DIN Rail SE400S and variants

EAGLE = 62

Kvaser Eagle family.

ETHERCAN = 70

Kvaser Ethercan.

IRIS = 58

Obsolete name, use BLACKBIRD instead.

LAPCAN = 2

LAPcan Family.

LEAF = 48

Kvaser Leaf Family.

LEAF2 = 80

Kvaser Leaf Pro HS v2 and variants.

MEMORATOR_II = 54

Kvaser Memorator Professional family.

MEMORATOR_LIGHT = 60

Kvaser Memorator Light.

MEMORATOR_PRO = 54

Kvaser Memorator Professional family.

MEMORATOR_PRO2 = 78

Kvaser Memorator Pro 5xHS and variants.

MEMORATOR_V2 = 82

Kvaser Memorator (2nd generation)

MINIHYDRA = 62

Obsolete name, use EAGLE instead.

MINIPCIE = 66

Kvaser Mini PCI Express.

NONE = 0

Unknown or undefined.

PC104_PLUS = 50

Kvaser PC104+.

PCCAN = 8

PCcan Family.

PCICAN = 9

PCIcan Family.

PCICANX_II = 52

Kvaser PCIcanx II.

PCICAN_II = 40

PCIcan II family.

PCIE_V2 = 76

Kvaser PCIEcan 4xHS and variants.

SIMULATED = 44

Simulated CAN bus for Kvaser Creator (obsolete).

U100 = 88

Kvaser U100 and variants

USBCAN = 11

USBcan (obsolete).

USBCAN_II = 42

USBcan II, USBcan Rugged, Kvaser Memorator.

USBCAN_KLINE = 68

USBcan Pro HS/K-Line.

USBCAN_LIGHT = 72

Kvaser USBcan Light.

USBCAN_PRO = 56

Kvaser USBcan Professional.

USBCAN_PRO2 = 74

Kvaser USBcan Pro 5xHS and variants.

VIRTUAL = 1

The virtual CAN bus.

IOControlItem

class canlib.canlib.IOControlItem(value)[source]

An enumeration used in Channel.iocontrol.

CLEAR_ERROR_COUNTERS = 5

Clear the CAN error counters.

CONNECT_TO_VIRTUAL_BUS = 22

Windows only

DISCONNECT_FROM_VIRTUAL_BUS = 23

Windows only

FLUSH_RX_BUFFER = 10

Discard contents of the RX queue.

FLUSH_TX_BUFFER = 11

Discard contents of the TX queue.

GET_BUS_TYPE = 36

Windows only.

GET_CHANNEL_QUALITY = 34

Read remote channel quality.

GET_DEVNAME_ASCII = 37

Retreive device name.

GET_DRIVERHANDLE = 17

Windows only.

GET_EVENTHANDLE = 14

Windows only.

GET_REPORT_ACCESS_ERRORS = 21

Current setting of access error reporting

GET_ROUNDTRIP_TIME = 35

Round trip time in ms, for remote channel.

GET_RX_BUFFER_LEVEL = 8

Current receive queue, RX, level.

GET_THROTTLE_SCALED = 42

Windows only

GET_TIMER_SCALE = 12

Current time-stamp clock resolution in microseconds.

GET_TIME_SINCE_LAST_SEEN = 38

For WLAN devices, this is the time since the last keep-alive message.

GET_TREF_LIST = 39

Unsupported

GET_TXACK = 31

Status of Transmit Acknowledge.

GET_TX_BUFFER_LEVEL = 9

Current transmitt queue, TX, level.

GET_USB_THROTTLE = 29

For internal use only.

GET_USER_IOPORT = 25

Read IO port value.

GET_WAKEUP = 19

For internal use only.

LIN_MODE = 45

For internal use only.

MAP_RXQUEUE = 18

For internal use only.

PREFER_EXT = 1

Tells CANlib to “prefer” extended identifiers.

PREFER_STD = 2

Tells CANlib to “prefer” standard identifiers.

RESET_OVERRUN_COUNT = 44

Reset overrun count and flags

SET_BRLIMIT = 43

Max bitrate limit can be overridden with this IOCTL.

SET_BUFFER_WRAPAROUND_MODE = 26

For internal use only.

SET_BUSON_TIME_AUTO_RESET = 30

Enable/disable time reset at bus on.

SET_BYPASS_MODE = 15

Not implemented.

SET_ERROR_FRAMES_REPORTING = 33

Windows only

SET_LOCAL_TXECHO = 32

Turn on/off local transmit echo.

SET_REPORT_ACCESS_ERRORS = 20

Turn access error reporting on/off.

SET_RX_QUEUE_SIZE = 27

Windows only.

SET_THROTTLE_SCALED = 41

Windows only

SET_TIMER_SCALE = 6

Set time-stamp clock resolution in microseconds, default 1000.

SET_TXACK = 7

Enable/disable Transmit Acknowledge.

SET_TXRQ = 13

Turn transmit requests on or off.

SET_USB_THROTTLE = 28

For internal use only.

SET_USER_IOPORT = 24

Set IO port to value.

SET_WAKEUP = 16

For internal use only.

TX_INTERVAL = 40

Minimum CAN message transmit interval

LEDAction

class canlib.canlib.LEDAction(value)[source]

kvLED_ACTION_xxx

The following can be used together with canlib.canlib.Channel.flashLeds.

Changed in version 1.18: Added LEDs 4 through 11 (needs CANlib v5.19+)

ALL_LEDS_OFF = 1

Turn all LEDs off.

ALL_LEDS_ON = 0

Turn all LEDs on.

LED_0_OFF = 3

Turn LED 0 off.

LED_0_ON = 2

Turn LED 0 on.

LED_10_OFF = 23

Turn LED 10 off.

LED_10_ON = 22

Turn LED 10 on.

LED_11_OFF = 25

Turn LED 11 off.

LED_11_ON = 24

Turn LED 11 on.

LED_1_OFF = 5

Turn LED 1 off.

LED_1_ON = 4

Turn LED 1 on.

LED_2_OFF = 7

Turn LED 2 off.

LED_2_ON = 6

Turn LED 2 on.

LED_3_OFF = 9

Turn LED 3 off.

LED_3_ON = 8

Turn LED 3 on.

LED_4_OFF = 11

Turn LED 4 off.

LED_4_ON = 10

Turn LED 4 on.

LED_5_OFF = 13

Turn LED 5 off.

LED_5_ON = 12

Turn LED 5 on.

LED_6_OFF = 15

Turn LED 6 off.

LED_6_ON = 14

Turn LED 6 on.

LED_7_OFF = 17

Turn LED 7 off.

LED_7_ON = 16

Turn LED 7 on.

LED_8_OFF = 19

Turn LED 8 off.

LED_8_ON = 18

Turn LED 8 on.

LED_9_OFF = 21

Turn LED 9 off.

LED_9_ON = 20

Turn LED 9 on.

LoggerType

class canlib.canlib.LoggerType(value)[source]

kvLOGGER_TYPE_xxx

Logger type, returned when using ChannelData.logger_type.

NOT_A_LOGGER = 0
V1 = 1
V2 = 2

MessageFlag

class canlib.canlib.MessageFlag(value)[source]

Message information flags

The following flags can be returned from Channel.read et al, or passed to Channel.write.

This enum is a combination of flags for messages, CAN FD messages, and message errors. Normal messages flags are the flags covered by MSG_MASK, CAN FD message flags are those covered by FDMSG_MASK, and message errors are those covered by MSGERR_MASK.

Note

FDF, BRS, and ESI require CAN FD.

RTR cannot be set for CAN FD messages.

Not all hardware platforms can detect the difference between hardware overruns and software overruns, so your application should test for both conditions. You can use the symbol OVERRUN for this purpose.

ABL = 67108864

Single shot message was not sent because arbitration was lost.

BIT = 49152

Any bit error.

BIT0 = 16384

Sent dominant bit, read recessive bit

BIT1 = 32768

Sent recessive bit, read dominmant bit

BRS = 131072

Message is sent/received with bit rate switch (CAN FD)

BUSERR = 63488

Any RX error.

CRC = 8192

CRC error.

EDL = 65536

obsolete

ERROR_FRAME = 32

Message represents an error frame.

ESI = 262144

Sender of the message is in error passive mode (CAN FD)

EXT = 4

Message has an extended (29-bit) identifier.

FDF = 65536

Message is a CAN FD message.

FDMSG_MASK = 16711680

obsolete

FORM = 4096

Form error.

HW_OVERRUN = 512

Hardware buffer overrun.

MSGERR_MASK = 65280

Used to mask the non-error bits

MSG_MASK = 255

Used to mask the non-info bits.

NERR = 16

NERR was active during the message (TJA1054 hardware)

OVERRUN = 1536

Any overrun condition.

RTR = 1

Message is a remote request.

SINGLE_SHOT = 16777216

Message is Single Shot, try to send once, no retransmission.

STD = 2

Message has a standard (11-bit) identifier.

STUFF = 2048

Stuff error.

SW_OVERRUN = 1024

Software buffer overrun.

TXACK = 64

Message is a TX ACK (msg has really been sent)

TXNACK = 33554432

Message is a failed Single Shot, message was not sent.

TXRQ = 128

Message is a TX REQUEST (msg was transfered to the chip)

WAKEUP = 8

Message is a WAKEUP message, Single Wire CAN.

Notify

class canlib.canlib.Notify(value)[source]

canNOTIFY_xxx

These notify flags are used in Channel.set_callback to indicate different kind of events.

BUSONOFF = 32

Notify on bus on/off status changed

ENVVAR = 16

An environment variable was changed by a script. Note that you will not be notified when an environment variable is updated from the Canlib API.

ERROR = 4

CAN bus error notification

NONE = 0

Turn notifications off.

REMOVED = 64

Notify on device removed

RX = 1

CAN message reception notification

STATUS = 8

CAN chip status change

TX = 2

CAN message transmission notification

Open

class canlib.canlib.Open(value)[source]

Flags used in the flags argument to canlib.openChannel().

ACCEPT_LARGE_DLC = 512

DLC can be greater than 8.

The channel will accept CAN messages with DLC (Data Length Code) greater than 8. If this flag is not used, a message with DLC > 8 will always be reported or transmitted as a message with DLC = 8. When the ACCEPT_LARGE_DLC flag is used, the message will be sent and/or received with the true DLC, which can be at most 15. The length of the message is always at most 8.

ACCEPT_VIRTUAL = 32

Allow opening of virtual channels as well as physical channels.

CAN_FD = 1024

The channel will use the CAN FD protocol, ISO compliant.

This also means that messages with MessageFlag.FDF, MessageFlag.BRS and MessageFlag.ESI can now be used.

CAN_FD_NONISO = 2048

The channel will use the CAN FD NON-ISO protocol.

Use this if you want to configure the can controller to be able to communicate with a can controller designed prior to the release of the CAN FD ISO specification.

Non ISO mode implies:

  1. The stuff bit counter will not be included in the frame format.

  2. Initial value for CRC17 and CRC21 will be zero.

This also means that messages with MessageFlag.FDF, MessageFlag.BRS and MessageFlag.ESI can now be used.

EXCLUSIVE = 8

Don’t allow sharing of this CANlib channel between applications.

Two or more applications can share the same CAN channel. You can, for example, have one application send messages on the bus and another application that just monitors the bus. If this is not desired (for performance or other reasons) you can open an exclusive handle to a channel. This means that no other application can open a handle to the same channel.

NOFLAG = 0
NO_INIT_ACCESS = 256

Don’t open the handle with init access.

Note: A handle opened without init access will still set default bitrate when going on bus, if no other handle has opened the channel with init access at the time of the buson.

OVERRIDE_EXCLUSIVE = 64

Open the channel even if it is opened for exclusive access already.

REQUIRE_EXTENDED = 16

This flag causes two things to happen:

  1. The call will fail if the specified circuit doesn’t allow extended CAN (CAN 2.0B).

  2. If no frame-type flag is specified in a call to Channel.write(), it is assumed that extended CAN should be used.

REQUIRE_INIT_ACCESS = 128

Fail the call if the channel cannot be opened with init access.

Init access means that the CAN handle can set bit rate and CAN driver mode. At most one CAN handle may have init access to any given channel. If you try to set the bit rate or CAN driver mode for a handle to which you don’t have init access, the call will silently fail (i.e. canOK is returned although the call had no effect), unless you enable “access error reporting” by using Channel.IOControlItem.SET_REPORT_ACCESS_ERRORS. Access error reporting is by default off. Init access is the default.

OperationalMode

class canlib.canlib.OperationalMode(value)[source]

canCHANNEL_OPMODE_xxx

Current WLAN operational mode.

ADH = 4

Adhoc mode

INFRASTRUCTURE = 2

Infrastructure mode

NONE = 1

Not applicable, or unknown mode.

RESERVED = 3

Reserved

RemoteType

class canlib.canlib.RemoteType(value)[source]

kvREMOTE_TYPExxx

Remote type, returned when using canCHANNELDATA_REMOTE_TYPE

LAN = 2
NOT_REMOTE = 0
WLAN = 1

ScriptRequest

class canlib.canlib.ScriptRequest(value)[source]

kvSCRIPT_REQUEST_TEXT_xxx

These defines are used in kvScriptRequestText() for printf message subscribe/unsubscribe.

ALL_SLOTS = 255
SUBSCRIBE = 2
UNSUBSCRIBE = 1

ScriptStatus

class canlib.canlib.ScriptStatus(value)[source]

Status of t program

New in version 1.6.

Changed in version 1.7: Is now based on IntFlag instead of IntEnum

IDLE = 0
LOADED = 1
RUNNING = 2

ScriptStop

class canlib.canlib.ScriptStop(value)[source]

An enumeration.

FORCED = -9
NORMAL = 0

Stat

class canlib.canlib.Stat(value)[source]

canSTAT_xxx

The following circuit status flags are returned by Channel.readStatus. Note that more than one flag might be set at any one time.

Note

Usually both canSTAT_HW_OVERRUN and canSTAT_SW_OVERRUN are set when overrun has occurred. This is because the kernel driver can’t see the difference between a software overrun and a hardware overrun. So the code should always test for both types of overrun using the flag.

BUS_OFF = 2

The circuit is Off Bus

ERROR_ACTIVE = 8

The circuit is error active.

ERROR_PASSIVE = 1

The circuit is error passive

ERROR_WARNING = 4

At least one error counter > 96

HW_OVERRUN = 512

There has been at least one HW buffer overflow

OVERRUN = 1536

For convenience.

RESERVED_1 = 64
RXERR = 256

There has been at least one RX error of some sort

RX_PENDING = 32

There are messages in the receive buffer

SW_OVERRUN = 1024

There has been at least one SW buffer overflow

TXERR = 128

There has been at least one TX error

TX_PENDING = 16

There are messages pending transmission

TransceiverType

class canlib.canlib.TransceiverType(value)[source]

Transceiver (logical) types

The following constants can be returned from canGetChannelData(), using the canCHANNELDATA_TRANS_TYPE item code. They identify the bus transceiver type for the channel specified in the call to canGetChannelData.

Note

If the type starts with a number T_ has been prepended to the name.

They indicate a hardware type, but not necessarily a specific circuit or product.

CANFD = 22
CANFD_LIN = 24

HYBRID CAN-FD/LIN

DNOPTO = 3

Optoisolated 82C251

EVA = 7
FIBER = 8

82c251 with fibre extension

K = 10

K-line, without CAN.

K251 = 9

K-line + 82c251

KONE = 20
LIN = 19
LINX_J1708 = 66
LINX_K = 68
LINX_LIN = 64
LINX_LS = 72
LINX_SWC = 70
RS485(i.e. J1708) = 18

RS485 (i.e. J1708)

SWC = 6

AU5790

SWC_OPTO = 12

AU5790 with optical isolation

SWC_PROTO = 5

AU5790 prototype

TT = 13

B10011S Truck-And-Trailer

T_1041 = 16

TJA1041

T_1041_OPTO = 17

TJA1041 with optical isolation

T_1050 = 14

TJA1050

T_1050_OPTO = 15

TJA1050 with optical isolation

T_1054_OPTO = 11

TJA1054 with optical isolation

T_251 = 1

82c251

T_252 = 2

82c252, TJA1053, TJA1054

UNKNOWN = 0

Unknown or undefined

W210 = 4

TxeDataItem

class canlib.canlib.TxeDataItem(value)[source]

An enumeration.

COMPILER_VERSION = 2

The three part version number of the compiler used to create the compiled script file (.txe).

DATE = 3

Compilation date in Coordinated Universal Time (UTC) of the compiled script file (.txe).

Contents: 0. Year, 1. Month, 2. Day, 3. Hour, 4. Minute, 5. Second.

DESCRIPTION = 4

Description of the compiled script file (.txe).

FILE_VERSION = 1

The three part version number of the compiled script file (.txe) file format.

IS_ENCRYPTED = 7

Non-zero value if the compiled script file (.txe) contents is encrypted.

SIZE_OF_CODE = 6

The size of the compiled code in the .txe file.

SOURCE = 5

The name followed by the content of each unencrypted source file