Enumerations¶
AcceptFilterFlag¶
Bitrate¶
BitrateFD¶
BusTypeGroup¶
ChannelCap¶
- class canlib.canlib.ChannelCap(value)[source]¶
canCHANNEL_CAP_xxx
Channel capabilities.
Changed in version 1.8.
- BUS_STATISTICS = 2¶
- CAN_FD = 524288¶
- CAN_FD_NONISO = 1048576¶
- DIAGNOSTICS = 268435456¶
- ERROR_COUNTERS = 4¶
- EXTENDED_CAN = 1¶
- GENERATE_ERROR = 16¶
- GENERATE_OVERLOAD = 32¶
- IO_API = 134217728¶
- LIN_HYBRID = 67108864¶
- LOGGER = 8388608¶
- REMOTE_ACCESS = 16777216¶
- RESERVED_1 = 262144¶
- RESERVED_2 = 8¶
- SCRIPT = 33554432¶
- SILENT_MODE = 2097152¶
- SIMULATED = 131072¶
- SINGLE_SHOT = 4194304¶
- TXACKNOWLEDGE = 128¶
- TXREQUEST = 64¶
- VIRTUAL = 65536¶
ChannelDataItem¶
- class canlib.canlib.ChannelDataItem(value)[source]¶
An enumeration.
- BUS_PARAM_LIMITS = 45¶
- BUS_TYPE = 30¶
- CARD_FIRMWARE_REV = 9¶
- CARD_HARDWARE_REV = 10¶
- CARD_NUMBER = 5¶
- CARD_SERIAL_NO = 7¶
- CARD_TYPE = 4¶
- CARD_UPC_NO = 11¶
- CHANNEL_CAP = 1¶
- CHANNEL_CAP_EX = 47¶
- CHANNEL_CAP_MASK = 38¶
- CHANNEL_FLAGS = 3¶
- CHANNEL_NAME = 13¶
- CHANNEL_QUALITY = 28¶
- CHAN_NO_ON_CARD = 6¶
- CLOCK_INFO = 46¶
- CUST_CHANNEL_NAME = 39¶
- DEVDESCR_ASCII = 26¶
- DEVDESCR_UNICODE = 25¶
- DEVICE_PHYSICAL_POSITION = 18¶
- DEVNAME_ASCII = 31¶
- DLL_FILETYPE = 16¶
- DLL_FILE_VERSION = 14¶
- DLL_PRODUCT_VERSION = 15¶
- DRIVER_FILE_VERSION = 21¶
- DRIVER_NAME = 27¶
- DRIVER_PRODUCT_VERSION = 22¶
- FEATURE_EAN = 44¶
- HW_STATUS = 43¶
- IS_REMOTE = 40¶
- LOGGER_TYPE = 42¶
- MAX_BITRATE = 37¶
- MFGNAME_ASCII = 24¶
- MFGNAME_UNICODE = 23¶
- REMOTE_HOST_NAME = 35¶
- REMOTE_MAC = 36¶
- REMOTE_OPERATIONAL_MODE = 33¶
- REMOTE_PROFILE_NAME = 34¶
- REMOTE_TYPE = 41¶
- ROUNDTRIP_TIME = 29¶
- TIMESYNC_ENABLED = 20¶
- TIME_SINCE_LAST_SEEN = 32¶
- TRANS_CAP = 2¶
- TRANS_SERIAL_NO = 8¶
- TRANS_TYPE = 17¶
- TRANS_UPC_NO = 12¶
- UI_NUMBER = 19¶
ChannelFlags¶
DeviceMode¶
Driver¶
DriverCap¶
EnvVarType¶
Error¶
- class canlib.canlib.Error(value)[source]¶
An enumeration.
- HARDWARE = -15¶
- INVALID_PASSWORD = -128¶
- INVALID_SESSION = -131¶
- INVHANDLE = -10¶
- IO_CONFIG_CHANGED = -46¶
- IO_NOT_CONFIRMED = -45¶
- IO_NO_VALID_CONFIG = -48¶
- IO_PENDING = -47¶
- NOCARD = -26¶
- NOCHANNELS = -5¶
- NOHANDLES = -9¶
- NOMSG = -2¶
- NOTFOUND = -3¶
- NOT_AUTHORIZED = -130¶
- NOT_IMPLEMENTED = -32¶
- NO_SUCH_FUNCTION = -129¶
- PARAM = -1¶
- SCRIPT_FAIL = -39¶
- TIMEOUT = -7¶
- TXBUFOFL = -13¶
HardwareType¶
- class canlib.canlib.HardwareType(value)[source]¶
canHWTYPE_xxx
The following constants can be returned from canGetChannelData(), using the canCHANNELDATA_CARD_TYPE item code. They identify the hardware type for the channel specified in the call to canGetChannelData().
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. (You can use canGetChannelData() to obtain the UPC/EAN code for the device. This number uniquely identifies the product.)
- ACQUISITOR = 46¶
- BAGEL = 64¶
- BLACKBIRD = 58¶
- BLACKBIRD_V2 = 64¶
- CANLINHYBRID = 84¶
- CANPARI = 3¶
- DINRAIL = 86¶
- EAGLE = 62¶
- ETHERCAN = 70¶
- IRIS = 58¶
- LAPCAN = 2¶
- LEAF = 48¶
- LEAF2 = 80¶
- MEMORATOR_II = 54¶
- MEMORATOR_LIGHT = 60¶
- MEMORATOR_PRO = 54¶
- MEMORATOR_PRO2 = 78¶
- MEMORATOR_V2 = 82¶
- MINIHYDRA = 62¶
- MINIPCIE = 66¶
- NONE = 0¶
- PC104_PLUS = 50¶
- PCCAN = 8¶
- PCICAN = 9¶
- PCICANX_II = 52¶
- PCICAN_II = 40¶
- PCIE_V2 = 76¶
- SIMULATED = 44¶
- U100 = 88¶
- USBCAN = 11¶
- USBCAN_II = 42¶
- USBCAN_KLINE = 68¶
- USBCAN_LIGHT = 72¶
- USBCAN_PRO = 56¶
- USBCAN_PRO2 = 74¶
- VIRTUAL = 1¶
IOControlItem¶
- class canlib.canlib.IOControlItem(value)[source]¶
An enumeration.
- CLEAR_ERROR_COUNTERS = 5¶
- CONNECT_TO_VIRTUAL_BUS = 22¶
- DISCONNECT_FROM_VIRTUAL_BUS = 23¶
- FLUSH_RX_BUFFER = 10¶
- FLUSH_TX_BUFFER = 11¶
- GET_BUS_TYPE = 36¶
- GET_CHANNEL_QUALITY = 34¶
- GET_DEVNAME_ASCII = 37¶
- GET_DRIVERHANDLE = 17¶
- GET_EVENTHANDLE = 14¶
- GET_REPORT_ACCESS_ERRORS = 21¶
- GET_ROUNDTRIP_TIME = 35¶
- GET_RX_BUFFER_LEVEL = 8¶
- GET_THROTTLE_SCALED = 42¶
- GET_TIMER_SCALE = 12¶
- GET_TIME_SINCE_LAST_SEEN = 38¶
- GET_TREF_LIST = 39¶
- GET_TXACK = 31¶
- GET_TX_BUFFER_LEVEL = 9¶
- GET_USB_THROTTLE = 29¶
- GET_USER_IOPORT = 25¶
- GET_WAKEUP = 19¶
- LIN_MODE = 45¶
- MAP_RXQUEUE = 18¶
- PREFER_EXT = 1¶
- PREFER_STD = 2¶
- RESET_OVERRUN_COUNT = 44¶
- SET_BRLIMIT = 43¶
- SET_BUFFER_WRAPAROUND_MODE = 26¶
- SET_BUSON_TIME_AUTO_RESET = 30¶
- SET_BYPASS_MODE = 15¶
- SET_ERROR_FRAMES_REPORTING = 33¶
- SET_LOCAL_TXECHO = 32¶
- SET_REPORT_ACCESS_ERRORS = 20¶
- SET_RX_QUEUE_SIZE = 27¶
- SET_THROTTLE_SCALED = 41¶
- SET_TIMER_SCALE = 6¶
- SET_TXACK = 7¶
- SET_TXRQ = 13¶
- SET_USB_THROTTLE = 28¶
- SET_USER_IOPORT = 24¶
- SET_WAKEUP = 16¶
- TX_INTERVAL = 40¶
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¶
MessageFlag¶
- class canlib.canlib.MessageFlag(value)[source]¶
Message information flags
The following flags can be returned from
Channel.read
et al, or passed toChannel.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 byFDMSG_MASK
, and message errors are those covered byMSGERR_MASK
.Note
FDF
,BRS
, andESI
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.- BIT = 49152¶
- BIT0 = 16384¶
- BIT1 = 32768¶
- BRS = 131072¶
- BUSERR = 63488¶
- CRC = 8192¶
- EDL = 65536¶
- ERROR_FRAME = 32¶
- ESI = 262144¶
- EXT = 4¶
- FDF = 65536¶
- FDMSG_MASK = 16711680¶
- FORM = 4096¶
- HW_OVERRUN = 512¶
- MSGERR_MASK = 65280¶
- MSG_MASK = 255¶
- NERR = 16¶
- OVERRUN = 1536¶
- RTR = 1¶
- STD = 2¶
- STUFF = 2048¶
- SW_OVERRUN = 1024¶
- TXACK = 64¶
- TXRQ = 128¶
- WAKEUP = 8¶
Notify¶
Open¶
OperationalMode¶
RemoteType¶
ScriptRequest¶
ScriptStatus¶
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¶
- ERROR_ACTIVE = 8¶
- ERROR_PASSIVE = 1¶
- ERROR_WARNING = 4¶
- HW_OVERRUN = 512¶
- OVERRUN = 1536¶
- RESERVED_1 = 64¶
- RXERR = 256¶
- RX_PENDING = 32¶
- SW_OVERRUN = 1024¶
- TXERR = 128¶
- TX_PENDING = 16¶
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¶
- DNOPTO = 3¶
- EVA = 7¶
- FIBER = 8¶
- K = 10¶
- K251 = 9¶
- KONE = 20¶
- LIN = 19¶
- LINX_J1708 = 66¶
- LINX_K = 68¶
- LINX_LIN = 64¶
- LINX_LS = 72¶
- LINX_SWC = 70¶
- RS485 = 18¶
- SWC = 6¶
- SWC_OPTO = 12¶
- SWC_PROTO = 5¶
- TT = 13¶
- T_1041 = 16¶
- T_1041_OPTO = 17¶
- T_1050 = 14¶
- T_1050_OPTO = 15¶
- T_1054_OPTO = 11¶
- T_251 = 1¶
- T_252 = 2¶
- UNKNOWN = 0¶
- W210 = 4¶