Kvaser Linux CANLIB: Welcome to Kvaser CANLIB!
Data Structures | Macros | Typedefs | Functions
canlib.h File Reference
#include <stdlib.h>
#include <stdint.h>
#include "canstat.h"
#include "obsolete.h"

Data Structures

struct  canNotifyData
 
struct  canUserIoPortData
 
struct  canBusStatistics_s
 
struct  kvTimeDomainData_s
 

Macros

#define _CANLIB_H_
 
#define canINVALID_HANDLE   (-1)
 
canOPEN_xxx

These defines are used in canOpenChannel().

#define canWANT_EXCLUSIVE   0x0008
 
#define canWANT_EXTENDED   0x0010
 
#define canWANT_VIRTUAL   0x0020
 
#define canOPEN_EXCLUSIVE   0x0008
 
#define canOPEN_REQUIRE_EXTENDED   0x0010
 
#define canOPEN_ACCEPT_VIRTUAL   0x0020
 
#define canOPEN_ACCEPT_LARGE_DLC   0x0200
 
#define canOPEN_CAN_FD   0x0400
 
#define canOPEN_CAN_FD_NONISO   0x0800
 
#define canOPEN_LIN   0x1000
 
canFILTER_xxx

Flags for canAccept().

#define canFILTER_ACCEPT   1
 
#define canFILTER_REJECT   2
 
#define canFILTER_SET_CODE_STD   3
 
#define canFILTER_SET_MASK_STD   4
 
#define canFILTER_SET_CODE_EXT   5
 
#define canFILTER_SET_MASK_EXT   6
 
#define canFILTER_NULL_MASK   0L
 
canDRIVER_xxx

CAN driver types - not all are supported on all cards.

#define canDRIVER_NORMAL   4
 
#define canDRIVER_SILENT   1
 
#define canDRIVER_SELFRECEPTION   8
 
#define canDRIVER_OFF   0
 
canBITRATE_xxx

Common bus speeds. Used in canSetBusParams() and canSetBusParamsC200(). The values are translated in canlib, canTranslateBaud().

Note
The BAUD_xxx names are only retained for compability.
See also
Bit Rate Constants
#define canBITRATE_1M   (-1)
 
#define canBITRATE_500K   (-2)
 
#define canBITRATE_250K   (-3)
 
#define canBITRATE_125K   (-4)
 
#define canBITRATE_100K   (-5)
 
#define canBITRATE_62K   (-6)
 
#define canBITRATE_50K   (-7)
 
#define canBITRATE_83K   (-8)
 
#define canBITRATE_10K   (-9)
 
#define canFD_BITRATE_500K_80P   (-1000)
 
#define canFD_BITRATE_1M_80P   (-1001)
 
#define canFD_BITRATE_2M_80P   (-1002)
 
#define canFD_BITRATE_4M_80P   (-1003)
 
#define canFD_BITRATE_8M_60P   (-1004)
 
#define BAUD_1M   (-1)
 
#define BAUD_500K   (-2)
 
#define BAUD_250K   (-3)
 
#define BAUD_125K   (-4)
 
#define BAUD_100K   (-5)
 
#define BAUD_62K   (-6)
 
#define BAUD_50K   (-7)
 
#define BAUD_83K   (-8)
 
kvREMOTE_TYPExxx

Remote type, returned when using canCHANNELDATA_REMOTE_TYPE

#define kvREMOTE_TYPE_NOT_REMOTE   0
 
#define kvREMOTE_TYPE_WLAN   1
 
#define kvREMOTE_TYPE_LAN   2
 
kvLOGGER_TYPE_xxx

Logger type, returned when using canCHANNELDATA_LOGGER_TYPE

#define kvLOGGER_TYPE_NOT_A_LOGGER   0
 
#define kvLOGGER_TYPE_V1   1
 
#define kvLOGGER_TYPE_V2   2
 
canCHANNELDATA_xxx

These defines are used in canGetChannelData().

#define canCHANNELDATA_CHANNEL_CAP   1
 
#define canCHANNELDATA_TRANS_CAP   2
 
#define canCHANNELDATA_CHANNEL_FLAGS   3
 
#define canCHANNELDATA_CARD_TYPE   4
 
#define canCHANNELDATA_CARD_NUMBER   5
 
#define canCHANNELDATA_CHAN_NO_ON_CARD   6
 
#define canCHANNELDATA_CARD_SERIAL_NO   7
 
#define canCHANNELDATA_TRANS_SERIAL_NO   8
 
#define canCHANNELDATA_CARD_FIRMWARE_REV   9
 
#define canCHANNELDATA_CARD_HARDWARE_REV   10
 
#define canCHANNELDATA_CARD_UPC_NO   11
 
#define canCHANNELDATA_TRANS_UPC_NO   12
 
#define canCHANNELDATA_CHANNEL_NAME   13
 
#define canCHANNELDATA_DLL_FILE_VERSION   14
 
#define canCHANNELDATA_DLL_PRODUCT_VERSION   15
 
#define canCHANNELDATA_DLL_FILETYPE   16
 
#define canCHANNELDATA_TRANS_TYPE   17
 
#define canCHANNELDATA_DEVICE_PHYSICAL_POSITION   18
 
#define canCHANNELDATA_UI_NUMBER   19
 
#define canCHANNELDATA_TIMESYNC_ENABLED   20
 
#define canCHANNELDATA_DRIVER_FILE_VERSION   21
 
#define canCHANNELDATA_DRIVER_PRODUCT_VERSION   22
 
#define canCHANNELDATA_MFGNAME_UNICODE   23
 
#define canCHANNELDATA_MFGNAME_ASCII   24
 
#define canCHANNELDATA_DEVDESCR_UNICODE   25
 
#define canCHANNELDATA_DEVDESCR_ASCII   26
 
#define canCHANNELDATA_DRIVER_NAME   27
 
#define canCHANNELDATA_CHANNEL_QUALITY   28
 
#define canCHANNELDATA_ROUNDTRIP_TIME   29
 
#define canCHANNELDATA_BUS_TYPE   30
 
#define canCHANNELDATA_DEVNAME_ASCII   31
 
#define canCHANNELDATA_TIME_SINCE_LAST_SEEN   32
 
#define canCHANNELDATA_REMOTE_OPERATIONAL_MODE   33
 
#define canCHANNELDATA_REMOTE_PROFILE_NAME   34
 
#define canCHANNELDATA_REMOTE_HOST_NAME   35
 
#define canCHANNELDATA_REMOTE_MAC   36
 
#define canCHANNELDATA_MAX_BITRATE   37
 
#define canCHANNELDATA_CHANNEL_CAP_MASK   38
 
#define canCHANNELDATA_IS_REMOTE   40
 
#define canCHANNELDATA_REMOTE_TYPE   41
 
#define canCHANNELDATA_LOGGER_TYPE   42
 
#define canCHANNELDATA_HW_STATUS   43
 
#define canCHANNELDATA_FEATURE_EAN   44
 
#define canCHANNELDATA_CUST_CHANNEL_NAME   39
 
canCHANNEL_IS_xxx

These channelFlags are used in canGetChannelData() and in conjunction with canCHANNELDATA_CHANNEL_FLAGS.

#define canCHANNEL_IS_EXCLUSIVE   0x0001
 
#define canCHANNEL_IS_OPEN   0x0002
 
#define canCHANNEL_IS_CANFD   0x0004
 
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
They 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.)
#define canHWTYPE_NONE   0
 
#define canHWTYPE_VIRTUAL   1
 
#define canHWTYPE_LAPCAN   2
 
#define canHWTYPE_CANPARI   3
 
#define canHWTYPE_PCCAN   8
 
#define canHWTYPE_PCICAN   9
 
#define canHWTYPE_USBCAN   11
 
#define canHWTYPE_PCICAN_II   40
 
#define canHWTYPE_USBCAN_II   42
 
#define canHWTYPE_SIMULATED   44
 
#define canHWTYPE_ACQUISITOR   46
 
#define canHWTYPE_LEAF   48
 
#define canHWTYPE_PC104_PLUS   50
 
#define canHWTYPE_PCICANX_II   52
 
#define canHWTYPE_MEMORATOR_II   54
 
#define canHWTYPE_MEMORATOR_PRO   54
 
#define canHWTYPE_USBCAN_PRO   56
 
#define canHWTYPE_IRIS   58
 
#define canHWTYPE_BLACKBIRD   58
 
#define canHWTYPE_MEMORATOR_LIGHT   60
 
#define canHWTYPE_MINIHYDRA   62
 
#define canHWTYPE_EAGLE   62
 
#define canHWTYPE_BAGEL   64
 
#define canHWTYPE_BLACKBIRD_V2   64
 
#define canHWTYPE_MINIPCIE   66
 
#define canHWTYPE_USBCAN_KLINE   68
 
#define canHWTYPE_ETHERCAN   70
 
#define canHWTYPE_USBCAN_LIGHT   72
 
#define canHWTYPE_USBCAN_PRO2   74
 
#define canHWTYPE_PCIE_V2   76
 
#define canHWTYPE_MEMORATOR_PRO2   78
 
#define canHWTYPE_LEAF2   80
 
#define canHWTYPE_MEMORATOR_V2   82
 
#define canHWTYPE_CANLINHYBRID   84
 
canCHANNEL_CAP_xxx

Channel capabilities.

#define canCHANNEL_CAP_EXTENDED_CAN   0x00000001L
 
#define canCHANNEL_CAP_BUS_STATISTICS   0x00000002L
 
#define canCHANNEL_CAP_ERROR_COUNTERS   0x00000004L
 
#define canCHANNEL_CAP_CAN_DIAGNOSTICS   0x00000008L
 
#define canCHANNEL_CAP_GENERATE_ERROR   0x00000010L
 
#define canCHANNEL_CAP_GENERATE_OVERLOAD   0x00000020L
 
#define canCHANNEL_CAP_TXREQUEST   0x00000040L
 
#define canCHANNEL_CAP_TXACKNOWLEDGE   0x00000080L
 
#define canCHANNEL_CAP_VIRTUAL   0x00010000L
 
#define canCHANNEL_CAP_SIMULATED   0x00020000L
 
#define canCHANNEL_CAP_RESERVED_1   0x00040000L
 
#define canCHANNEL_CAP_CAN_FD   0x00080000L
 
#define canCHANNEL_CAP_CAN_FD_NONISO   0x00100000L
 
#define canCHANNEL_CAP_SILENT_MODE   0x00200000L
 
#define canCHANNEL_CAP_SINGLE_SHOT   0x00400000L
 
#define canCHANNEL_CAP_LOGGER   0x00800000L
 
#define canCHANNEL_CAP_REMOTE_ACCESS   0x01000000L
 
#define canCHANNEL_CAP_SCRIPT   0x02000000L
 
#define canCHANNEL_CAP_LIN_FLEX   0x04000000L
 
canDRIVER_CAP_xxx

Driver (transceiver) capabilities.

#define canDRIVER_CAP_HIGHSPEED   0x00000001L
 
canIOCTL_xxx

These defines are used in canIoCtl().

#define canIOCTL_PREFER_EXT   1
 
#define canIOCTL_PREFER_STD   2
 
#define canIOCTL_SET_TIMER_SCALE   6
 
#define canIOCTL_SET_TXACK   7
 
#define canIOCTL_GET_RX_BUFFER_LEVEL   8
 
#define canIOCTL_GET_TX_BUFFER_LEVEL   9
 
#define canIOCTL_FLUSH_RX_BUFFER   10
 
#define canIOCTL_FLUSH_TX_BUFFER   11
 
#define canIOCTL_GET_TIMER_SCALE   12
 
#define canIOCTL_SET_TXRQ   13
 
#define canIOCTL_GET_EVENTHANDLE   14
 
#define canIOCTL_SET_BYPASS_MODE   15
 
#define canIOCTL_SET_WAKEUP   16
 
#define canIOCTL_GET_DRIVERHANDLE   17
 
#define canIOCTL_MAP_RXQUEUE   18
 
#define canIOCTL_GET_WAKEUP   19
 
#define canIOCTL_SET_REPORT_ACCESS_ERRORS   20
 
#define canIOCTL_GET_REPORT_ACCESS_ERRORS   21
 
#define canIOCTL_CONNECT_TO_VIRTUAL_BUS   22
 
#define canIOCTL_DISCONNECT_FROM_VIRTUAL_BUS   23
 
#define canIOCTL_SET_USER_IOPORT   24
 
#define canIOCTL_GET_USER_IOPORT   25
 
#define canIOCTL_SET_BUFFER_WRAPAROUND_MODE   26
 
#define canIOCTL_SET_RX_QUEUE_SIZE   27
 
#define canIOCTL_SET_USB_THROTTLE   28
 
#define canIOCTL_GET_USB_THROTTLE   29
 
#define canIOCTL_SET_BUSON_TIME_AUTO_RESET   30
 
#define canIOCTL_GET_TXACK   31
 
#define canIOCTL_SET_LOCAL_TXECHO   32
 
#define canIOCTL_GET_TREF_LIST   39
 
#define canIOCTL_TX_INTERVAL   40
 
#define canIOCTL_SET_BRLIMIT   43
 
#define canIOCTL_RESET_OVERRUN_COUNT   44
 
canOBJBUF_TYPE_xxx
#define canOBJBUF_TYPE_AUTO_RESPONSE   0x01
 
#define canOBJBUF_TYPE_PERIODIC_TX   0x02
 
canOBJBUF_AUTO_RESPONSE_xxx

These defines are used in canObjBufSetFlags().

#define canOBJBUF_AUTO_RESPONSE_RTR_ONLY   0x01
 
kvLED_ACTION_xxx

The following constants can be used together with the kvFlashLeds() function.

#define kvLED_ACTION_ALL_LEDS_ON   0
 
#define kvLED_ACTION_ALL_LEDS_OFF   1
 
#define kvLED_ACTION_LED_0_ON   2
 
#define kvLED_ACTION_LED_0_OFF   3
 
#define kvLED_ACTION_LED_1_ON   4
 
#define kvLED_ACTION_LED_1_OFF   5
 
#define kvLED_ACTION_LED_2_ON   6
 
#define kvLED_ACTION_LED_2_OFF   7
 
#define kvLED_ACTION_LED_3_ON   8
 
#define kvLED_ACTION_LED_3_OFF   9
 
#define kvLED_ACTION_LED_4_ON   10
 
#define kvLED_ACTION_LED_4_OFF   11
 
#define kvLED_ACTION_LED_5_ON   12
 
#define kvLED_ACTION_LED_5_OFF   13
 
#define kvLED_ACTION_LED_6_ON   14
 
#define kvLED_ACTION_LED_6_OFF   15
 
#define kvLED_ACTION_LED_7_ON   16
 
#define kvLED_ACTION_LED_7_OFF   17
 
#define kvLED_ACTION_LED_8_ON   18
 
#define kvLED_ACTION_LED_8_OFF   19
 
#define kvLED_ACTION_LED_9_ON   20
 
#define kvLED_ACTION_LED_9_OFF   21
 
#define kvLED_ACTION_LED_10_ON   22
 
#define kvLED_ACTION_LED_10_OFF   23
 
#define kvLED_ACTION_LED_11_ON   24
 
#define kvLED_ACTION_LED_11_OFF   25
 
kvENVVAR_TYPE_xxx

These defines are used in kvScriptEnvvarOpen().

#define kvENVVAR_TYPE_INT   1
 
#define kvENVVAR_TYPE_FLOAT   2
 
#define kvENVVAR_TYPE_STRING   3
 
kvEVENT_xxx

These defines are used in kvScriptSendEvent().

#define kvEVENT_TYPE_KEY   1
 
kvSCRIPT_STOP_xxx

Script stop modes. Used by kvScriptStop().

#define kvSCRIPT_STOP_NORMAL   0
 
#define kvSCRIPT_STOP_FORCED   -9
 
kvSCRIPT_STATUS_xxx

Script status flag bits. Used by kvScriptStatus().

#define kvSCRIPT_STATUS_LOADED   1
 
#define kvSCRIPT_STATUS_RUNNING   2
 
kvDEVICE_MODE_xxx

These defines are used in kvDeviceSetMode() and kvDeviceGetMode().

Note
The mode is device specific, which means that not all modes are implemented in all products.
#define kvDEVICE_MODE_INTERFACE   0x00
 
#define kvDEVICE_MODE_LOGGER   0x01
 

Typedefs

typedef int canHandle
 
typedef canHandle CanHandle
 
typedef struct canNotifyData canNotifyData
 
typedef struct canBusStatistics_s canBusStatistics
 
typedef void * kvTimeDomain
 
typedef canStatus kvStatus
 
typedef struct kvTimeDomainData_s kvTimeDomainData
 
typedef void(* kvCallback_t) (CanHandle hnd, void *context, unsigned int notifyEvent)
 
typedef int64_t kvEnvHandle
 

Functions

void canInitializeLibrary (void)
 
canStatus canClose (const CanHandle hnd)
 
canStatus canBusOn (const CanHandle hnd)
 
canStatus canBusOff (const CanHandle hnd)
 
canStatus canSetBusParams (const CanHandle hnd, long freq, unsigned int tseg1, unsigned int tseg2, unsigned int sjw, unsigned int noSamp, unsigned int syncmode)
 
canStatus canSetBusParamsFd (const CanHandle hnd, long freq_brs, unsigned int tseg1_brs, unsigned int tseg2_brs, unsigned int sjw_brs)
 
canStatus canGetBusParams (const CanHandle hnd, long *freq, unsigned int *tseg1, unsigned int *tseg2, unsigned int *sjw, unsigned int *noSamp, unsigned int *syncmode)
 
canStatus canGetBusParamsFd (const CanHandle hnd, long *freq_brs, unsigned int *tseg1_brs, unsigned int *tseg2_brs, unsigned int *sjw_brs)
 
canStatus canSetBusOutputControl (const CanHandle hnd, const unsigned int drivertype)
 
canStatus canGetBusOutputControl (const CanHandle hnd, unsigned int *drivertype)
 
canStatus canAccept (const CanHandle hnd, const long envelope, const unsigned int flag)
 
canStatus canReadStatus (const CanHandle hnd, unsigned long *const flags)
 
canStatus canReadErrorCounters (const CanHandle hnd, unsigned int *txErr, unsigned int *rxErr, unsigned int *ovErr)
 
canStatus canWrite (const CanHandle hnd, long id, void *msg, unsigned int dlc, unsigned int flag)
 
canStatus canWriteSync (const CanHandle hnd, unsigned long timeout)
 
canStatus canRead (const CanHandle hnd, long *id, void *msg, unsigned int *dlc, unsigned int *flag, unsigned long *time)
 
canStatus canReadWait (const CanHandle hnd, long *id, void *msg, unsigned int *dlc, unsigned int *flag, unsigned long *time, unsigned long timeout)
 
canStatus canReadSpecific (const CanHandle hnd, long id, void *msg, unsigned int *dlc, unsigned int *flag, unsigned long *time)
 
canStatus canReadSync (const CanHandle hnd, unsigned long timeout)
 
canStatus canReadSyncSpecific (const CanHandle hnd, long id, unsigned long timeout)
 
canStatus canReadSpecificSkip (const CanHandle hnd, long id, void *msg, unsigned int *dlc, unsigned int *flag, unsigned long *time)
 
canStatus canSetNotify (const CanHandle hnd, void(*callback)(canNotifyData *), unsigned int notifyFlags, void *tag)
 
canStatus canGetRawHandle (const CanHandle hnd, void *pvFd)
 
canStatus canTranslateBaud (long *const freq, unsigned int *const tseg1, unsigned int *const tseg2, unsigned int *const sjw, unsigned int *const nosamp, unsigned int *const syncMode)
 
canStatus canGetErrorText (canStatus err, char *buf, unsigned int bufsiz)
 
unsigned short canGetVersion (void)
 
canStatus canIoCtl (const CanHandle hnd, unsigned int func, void *buf, unsigned int buflen)
 
canStatus canReadTimer (const CanHandle hnd, unsigned long *time)
 
CanHandle canOpenChannel (int channel, int flags)
 
canStatus canGetNumberOfChannels (int *channelCount)
 
canStatus canGetChannelData (int channel, int item, void *buffer, size_t bufsize)
 
canStatus canSetBusParamsC200 (const CanHandle hnd, unsigned char btr0, unsigned char btr1)
 
canStatus canObjBufFreeAll (const CanHandle hnd)
 
canStatus canObjBufAllocate (const CanHandle hnd, int type)
 
canStatus canObjBufFree (const CanHandle hnd, int idx)
 
canStatus canObjBufWrite (const CanHandle hnd, int idx, int id, void *msg, unsigned int dlc, unsigned int flags)
 
canStatus canObjBufSetFilter (const CanHandle hnd, int idx, unsigned int code, unsigned int mask)
 
canStatus canObjBufSetFlags (const CanHandle hnd, int idx, unsigned int flags)
 
canStatus canObjBufSetPeriod (const CanHandle hnd, int idx, unsigned int period)
 
canStatus canObjBufSetMsgCount (const CanHandle hnd, int idx, unsigned int count)
 
canStatus canObjBufEnable (const CanHandle hnd, int idx)
 
canStatus canObjBufDisable (const CanHandle hnd, int idx)
 
canStatus canObjBufSendBurst (const CanHandle hnd, int idx, unsigned int burstlen)
 
canStatus canResetBus (const CanHandle hnd)
 
canStatus canWriteWait (const CanHandle hnd, long id, void *msg, unsigned int dlc, unsigned int flag, unsigned long timeout)
 
canStatus canUnloadLibrary (void)
 
canStatus canFlushReceiveQueue (const CanHandle hnd)
 
canStatus canFlushTransmitQueue (const CanHandle hnd)
 
canStatus kvFlashLeds (const CanHandle hnd, int action, int timeout)
 
canStatus canRequestChipStatus (const CanHandle hnd)
 
canStatus canRequestBusStatistics (const CanHandle hnd)
 
canStatus canGetBusStatistics (const CanHandle hnd, canBusStatistics *stat, size_t bufsiz)
 
canStatus canGetHandleData (const CanHandle hnd, int item, void *buffer, size_t bufsize)
 
kvStatus kvTimeDomainCreate (kvTimeDomain *domain)
 
kvStatus kvTimeDomainDelete (kvTimeDomain domain)
 
kvStatus kvTimeDomainResetTime (kvTimeDomain domain)
 
kvStatus kvTimeDomainGetData (kvTimeDomain domain, kvTimeDomainData *data, size_t bufsiz)
 
kvStatus kvTimeDomainAddHandle (kvTimeDomain domain, const CanHandle hnd)
 
kvStatus kvTimeDomainRemoveHandle (kvTimeDomain domain, const CanHandle hnd)
 
kvStatus kvSetNotifyCallback (const CanHandle hnd, kvCallback_t callback, void *context, unsigned int notifyFlags)
 
kvStatus kvReadDeviceCustomerData (const CanHandle hnd, int userNumber, int itemNumber, void *data, size_t bufsiz)
 
kvStatus kvScriptStart (const CanHandle hnd, int slotNo)
 
kvStatus kvScriptStop (const CanHandle hnd, int slotNo, int mode)
 
kvStatus kvScriptUnload (const CanHandle hnd, int slotNo)
 
kvStatus kvScriptSendEvent (const CanHandle hnd, int slotNo, int eventType, int eventNo, unsigned int data)
 
kvEnvHandle kvScriptEnvvarOpen (const CanHandle hnd, char *envvarName, int *envvarType, int *envvarSize)
 
kvStatus kvScriptEnvvarClose (kvEnvHandle eHnd)
 
kvStatus kvScriptEnvvarSetInt (kvEnvHandle eHnd, int val)
 
kvStatus kvScriptEnvvarGetInt (kvEnvHandle eHnd, int *val)
 
kvStatus kvScriptEnvvarSetFloat (kvEnvHandle eHnd, float val)
 
kvStatus kvScriptEnvvarGetFloat (kvEnvHandle eHnd, float *val)
 
kvStatus kvScriptEnvvarSetData (kvEnvHandle eHnd, void *buf, int start_index, int data_len)
 
kvStatus kvScriptEnvvarGetData (kvEnvHandle eHnd, void *buf, int start_index, int data_len)
 
kvStatus kvScriptLoadFileOnDevice (const CanHandle hnd, int slotNo, char *localFile)
 
kvStatus kvScriptLoadFile (const CanHandle hnd, int slotNo, char *filePathOnPC)
 
kvStatus kvScriptStatus (const CanHandle hnd, int slot, unsigned int *status)
 
kvStatus kvFileCopyToDevice (const CanHandle hnd, char *hostFileName, char *deviceFileName)
 
kvStatus kvFileCopyFromDevice (const CanHandle hnd, char *deviceFileName, char *hostFileName)
 
kvStatus kvFileDelete (const CanHandle hnd, char *deviceFileName)
 
kvStatus kvFileGetName (const CanHandle hnd, int fileNo, char *name, int namelen)
 
kvStatus kvFileGetCount (const CanHandle hnd, int *count)
 
kvStatus kvFileGetSystemData (const CanHandle hnd, int itemCode, int *result)
 
kvStatus kvDeviceSetMode (const CanHandle hnd, int mode)
 
kvStatus kvDeviceGetMode (const CanHandle hnd, int *result)
 
kvStatus kvReadTimer (const CanHandle hnd, unsigned int *time)
 
kvStatus kvReadTimer64 (const CanHandle hnd, uint64_t *time)
 

Detailed Description

This software is dual licensed under the following two licenses:
BSD-new and GPLv2. You may use either one. See the included
COPYING file for details.
License: BSD-new
===============================================================================
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of the <organization> nor the
      names of its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License: GPLv2
===============================================================================
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
---------------------------------------------------------------------------

Definitions for the CANLIB API.

Author
Kvaser AB

Macro Definition Documentation

◆ _CANLIB_H_

#define _CANLIB_H_

◆ canINVALID_HANDLE

#define canINVALID_HANDLE   (-1)

◆ canWANT_EXCLUSIVE

#define canWANT_EXCLUSIVE   0x0008

Don't allow sharing of this circuit between applications.

This define is used in canOpenChannel()

◆ canWANT_EXTENDED

#define canWANT_EXTENDED   0x0010

Don't allow sharing of this circuit between applications.

This define is used in canOpenChannel()

◆ canWANT_VIRTUAL

#define canWANT_VIRTUAL   0x0020

Don't allow sharing of this circuit between applications.

This define is used in canOpenChannel()

◆ canOPEN_EXCLUSIVE

#define canOPEN_EXCLUSIVE   0x0008

Don't allow sharing of this circuit between applications.

This define is used in canOpenChannel()

Examples:
busparms.c, cancount.c, canfdwrite.c, canmonitor.c, simplewrite.c, and writeloop.c.

◆ canOPEN_REQUIRE_EXTENDED

#define canOPEN_REQUIRE_EXTENDED   0x0010

This flag causes two things to happen:

  • The call will fail if the specified circuit doesn't allow extended CAN (CAN 2.0B).
  • If no frame-type flag is specified in a call to canWrite, it is assumed that extended CAN should be used.

This define is used in canOpenChannel().

Examples:
busparms.c, cancount.c, canfdwrite.c, canmonitor.c, simplewrite.c, and writeloop.c.

◆ canOPEN_ACCEPT_VIRTUAL

#define canOPEN_ACCEPT_VIRTUAL   0x0020

Allow opening of virtual channels as well as physical channels.

This define is used in canOpenChannel().

See also
Virtual Channels
Examples:
cancount.c, canmonitor.c, simplewrite.c, and writeloop.c.

◆ canOPEN_ACCEPT_LARGE_DLC

#define canOPEN_ACCEPT_LARGE_DLC   0x0200

The channel will accept 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. If the canOPEN_ACCEPT_LARGE_DLC flag is used, the message will be sent and/or received with the true DLC, which can be at most 15.

Note
The length of the message is always at most 8.

This define is used in canOpenChannel().

◆ canOPEN_CAN_FD

#define canOPEN_CAN_FD   0x0400

The channel will use the CAN FD protocol, ISO compliant. This also means that messages with canFDMSG_xxx flags can now be used.

This define is used in canOpenChannel().

Examples:
canfdmonitor.c, and canfdwrite.c.

◆ canOPEN_CAN_FD_NONISO

#define canOPEN_CAN_FD_NONISO   0x0800

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:

  • The stuff bit counter will not be included in the frame format.
  • Initial value for CRC17 and CRC21 will be zero.

This also means that messages with canFDMSG_xxx flags can now be used.

This define is used in canOpenChannel().

◆ canOPEN_LIN

#define canOPEN_LIN   0x1000

This is for internal use with our LIN interfaces.

This define is used in canOpenChannel().

◆ canFILTER_ACCEPT

#define canFILTER_ACCEPT   1

Sets the code for standard (11-bit) identifiers.

◆ canFILTER_REJECT

#define canFILTER_REJECT   2

Sets the code for standard (11-bit) identifiers.

◆ canFILTER_SET_CODE_STD

#define canFILTER_SET_CODE_STD   3

Sets the code for standard (11-bit) identifiers.

◆ canFILTER_SET_MASK_STD

#define canFILTER_SET_MASK_STD   4

Sets the mask for standard (11-bit) identifiers.

◆ canFILTER_SET_CODE_EXT

#define canFILTER_SET_CODE_EXT   5

Sets the code for extended (29-bit) identifiers.

◆ canFILTER_SET_MASK_EXT

#define canFILTER_SET_MASK_EXT   6

Sets the mask for extended (29-bit) identifiers.

◆ canFILTER_NULL_MASK

#define canFILTER_NULL_MASK   0L

Sets the code for standard (11-bit) identifiers.

◆ canDRIVER_NORMAL

#define canDRIVER_NORMAL   4

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

◆ canDRIVER_SILENT

#define canDRIVER_SILENT   1

Sets the CAN controller in Silent Mode; that is, it doesn't send anything, not even ACK bits, on the bus. Reception works as usual.

Note
The values 2,3,5,6,7 are reserved values for compatibility reasons.

◆ canDRIVER_SELFRECEPTION

#define canDRIVER_SELFRECEPTION   8

Self-reception. Not implemented.

◆ canDRIVER_OFF

#define canDRIVER_OFF   0

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

◆ canBITRATE_1M

#define canBITRATE_1M   (-1)

Used in canSetBusParams() and canSetBusParamsC200(). Indicate a bitrate of 1 Mbit/s.

Examples:
cancount.c, canmonitor.c, simplewrite.c, and writeloop.c.

◆ canBITRATE_500K

#define canBITRATE_500K   (-2)

Used in canSetBusParams() and canSetBusParamsC200(). Indicate a bitrate of 500 kbit/s.

◆ canBITRATE_250K

#define canBITRATE_250K   (-3)

Used in canSetBusParams() and canSetBusParamsC200(). Indicate a bitrate of 250 kbit/s.

◆ canBITRATE_125K

#define canBITRATE_125K   (-4)

Used in canSetBusParams() and canSetBusParamsC200(). Indicate a bitrate of 125 kbit/s.

◆ canBITRATE_100K

#define canBITRATE_100K   (-5)

Used in canSetBusParams() and canSetBusParamsC200(). Indicate a bitrate of 100 kbit/s.

◆ canBITRATE_62K

#define canBITRATE_62K   (-6)

Used in canSetBusParams() and canSetBusParamsC200(). Indicate a bitrate of 62 kbit/s.

◆ canBITRATE_50K

#define canBITRATE_50K   (-7)

Used in canSetBusParams() and canSetBusParamsC200(). Indicate a bitrate of 50 kbit/s.

◆ canBITRATE_83K

#define canBITRATE_83K   (-8)

Used in canSetBusParams() and canSetBusParamsC200(). Indicate a bitrate of 83 kbit/s.

◆ canBITRATE_10K

#define canBITRATE_10K   (-9)

Used in canSetBusParams() and canSetBusParamsC200(). Indicate a bitrate of 10 kbit/s.

◆ canFD_BITRATE_500K_80P

#define canFD_BITRATE_500K_80P   (-1000)

Used in canSetBusParams() and canSetBusParamsFd() when using the CAN FD protocol. Indicates a bitrate of 0.5 Mbit/s and sampling point at 80%.

◆ canFD_BITRATE_1M_80P

#define canFD_BITRATE_1M_80P   (-1001)

Used in canSetBusParams() and canSetBusParamsFd() when using the CAN FD protocol. Indicates a bitrate of 1.0 Mbit/s and sampling point at 80%.

Examples:
canfdmonitor.c, and canfdwrite.c.

◆ canFD_BITRATE_2M_80P

#define canFD_BITRATE_2M_80P   (-1002)

Used in canSetBusParams() and canSetBusParamsFd() when using the CAN FD protocol. Indicates a bitrate of 2.0 Mbit/s and sampling point at 80%.

Examples:
canfdmonitor.c, and canfdwrite.c.

◆ canFD_BITRATE_4M_80P

#define canFD_BITRATE_4M_80P   (-1003)

Used in canSetBusParams() and canSetBusParamsFd() when using the CAN FD protocol. Indicates a bitrate of 4.0 Mbit/s and sampling point at 80%.

◆ canFD_BITRATE_8M_60P

#define canFD_BITRATE_8M_60P   (-1004)

Used in canSetBusParams() and canSetBusParamsFd() when using the CAN FD protocol. Indicates a bitrate of 8.0 Mbit/s and sampling point at 60%.

◆ BAUD_1M

#define BAUD_1M   (-1)

The BAUD_xxx names are deprecated, use canBITRATE_1M instead.

◆ BAUD_500K

#define BAUD_500K   (-2)

The BAUD_xxx names are deprecated, use canBITRATE_500K instead.

◆ BAUD_250K

#define BAUD_250K   (-3)

The BAUD_xxx names are deprecated, use canBITRATE_250K instead.

◆ BAUD_125K

#define BAUD_125K   (-4)

The BAUD_xxx names are deprecated, use canBITRATE_125K instead.

◆ BAUD_100K

#define BAUD_100K   (-5)

The BAUD_xxx names are deprecated, use canBITRATE_100K instead.

◆ BAUD_62K

#define BAUD_62K   (-6)

The BAUD_xxx names are deprecated, use canBITRATE_62K instead.

◆ BAUD_50K

#define BAUD_50K   (-7)

The BAUD_xxx names are deprecated, use canBITRATE_50K instead.

◆ BAUD_83K

#define BAUD_83K   (-8)

The BAUD_xxx names are deprecated, use canBITRATE_83K instead.

◆ kvREMOTE_TYPE_NOT_REMOTE

#define kvREMOTE_TYPE_NOT_REMOTE   0

◆ kvREMOTE_TYPE_WLAN

#define kvREMOTE_TYPE_WLAN   1

◆ kvREMOTE_TYPE_LAN

#define kvREMOTE_TYPE_LAN   2

◆ kvLOGGER_TYPE_NOT_A_LOGGER

#define kvLOGGER_TYPE_NOT_A_LOGGER   0

◆ kvLOGGER_TYPE_V1

#define kvLOGGER_TYPE_V1   1

◆ kvLOGGER_TYPE_V2

#define kvLOGGER_TYPE_V2   2

◆ canCHANNELDATA_CHANNEL_CAP

#define canCHANNELDATA_CHANNEL_CAP   1

This define is used in canGetChannelData(), buffer mentioned below refers to this functions argument.

buffer points to a 32-bit unsigned integer that receives the capabilities of the CAN controller; this is a combination of the canCHANNEL_CAP_xxx flags.

◆ canCHANNELDATA_TRANS_CAP

#define canCHANNELDATA_TRANS_CAP   2

Not implemented.

◆ canCHANNELDATA_CHANNEL_FLAGS

#define canCHANNELDATA_CHANNEL_FLAGS   3

This define is used in canGetChannelData(), buffer mentioned below refers to this functions argument.

Note
Currently not implemented

◆ canCHANNELDATA_CARD_TYPE

#define canCHANNELDATA_CARD_TYPE   4

This define is used in canGetChannelData(), buffer mentioned below refers to this functions argument.

buffer points to a 32-bit unsigned integer that receives the hardware type of the card. This value is any one of the canHWTYPE_xxx constants.

◆ canCHANNELDATA_CARD_NUMBER

#define canCHANNELDATA_CARD_NUMBER   5

Not implemented.

◆ canCHANNELDATA_CHAN_NO_ON_CARD

#define canCHANNELDATA_CHAN_NO_ON_CARD   6

This define is used in canGetChannelData(), buffer mentioned below refers to this functions argument.

buffer points to a 32-bit unsigned integer which receives the channel number on the card.

◆ canCHANNELDATA_CARD_SERIAL_NO

#define canCHANNELDATA_CARD_SERIAL_NO   7

This define is used in canGetChannelData(), buffer mentioned below refers to this functions argument.

buffer points to a 64-bit (8 bytes) area which receives the serial number of the card. If the card doesn't have a serial number, 0 is returned. The serial number is an 8-byte unsigned integer. Currently, no products are using all 8 bytes; at most 4 bytes are used.

Examples:
listChannels.c.

◆ canCHANNELDATA_TRANS_SERIAL_NO

#define canCHANNELDATA_TRANS_SERIAL_NO   8

Not implemented.

◆ canCHANNELDATA_CARD_FIRMWARE_REV

#define canCHANNELDATA_CARD_FIRMWARE_REV   9

This define is used in canGetChannelData(), buffer mentioned below refers to this functions argument.

buffer points to a 64-bit (8 bytes) area which receives the firmware revision number on the card. This number consists of four 16-bit words: the major revision, the minor revision, the release number and the build number, listed in order from the most significant to the least significant.

Examples:
listChannels.c.

◆ canCHANNELDATA_CARD_HARDWARE_REV

#define canCHANNELDATA_CARD_HARDWARE_REV   10

This define is used in canGetChannelData(), buffer mentioned below refers to this functions argument.

buffer points to a 64-bit (8 bytes) area which receives the hardware revision number on the card. This number consists of four 16-bit words; the two most significant are always 0, and the two least significant are the major revision and the minor revision, listed in order from the most significant to the least significant.

◆ canCHANNELDATA_CARD_UPC_NO

#define canCHANNELDATA_CARD_UPC_NO   11

This define is used in canGetChannelData(), buffer mentioned below refers to this functions argument.

buffer points to a 8-byte area which receives the UPC (EAN) number for the card. If there is no UPC number, the buffer is filled with zeros. The UPC (EAN) number is coded as a BCD string with the LSB first, so e.g. 733-0130-00122-0 is coded as 0x30001220 0x00073301.

Examples:
listChannels.c.

◆ canCHANNELDATA_TRANS_UPC_NO

#define canCHANNELDATA_TRANS_UPC_NO   12

Not implemented.

◆ canCHANNELDATA_CHANNEL_NAME

#define canCHANNELDATA_CHANNEL_NAME   13

This define is used in canGetChannelData(), buffer mentioned below refers to this functions argument.

buffer points to an area which receives a zero-terminated string with a clear-text name of the channel.

Note
Use of this item code is no longer recommended. The returned channel name doesn't contain the exact hardware type (it just contains the device family) and uses zero-based channel numbering, which is not user friendly. Instead, use e.g. canCHANNELDATA_DEVDESCR_ASCII and canCHANNELDATA_CHAN_NO_ON_CARD to build your own channel name.
Examples:
listChannels.c.

◆ canCHANNELDATA_DLL_FILE_VERSION

#define canCHANNELDATA_DLL_FILE_VERSION   14

Not implemented.

◆ canCHANNELDATA_DLL_PRODUCT_VERSION

#define canCHANNELDATA_DLL_PRODUCT_VERSION   15

Not implemented.

◆ canCHANNELDATA_DLL_FILETYPE

#define canCHANNELDATA_DLL_FILETYPE   16

Not implemented.

◆ canCHANNELDATA_TRANS_TYPE

#define canCHANNELDATA_TRANS_TYPE   17

Not implemented.

◆ canCHANNELDATA_DEVICE_PHYSICAL_POSITION

#define canCHANNELDATA_DEVICE_PHYSICAL_POSITION   18

This define is used in canGetChannelData(), buffer mentioned below refers to this functions argument.

buffer points to a 32-bit unsigned integer which receives an address indicating where the device is located on its underlying bus. The interpretation of this number is bus-specific. If the address is unknown or the bus driver does not support an address, the bus driver leaves this member at its default value of 0xFFFFFFFF.

The following list describes the information certain bus drivers store in the Address field for their child devices:

  • ISA: Does not supply an address. Defaults to 0xFFFFFFFF.
  • PC Card (PCMCIA): The socket number (typically 0x00 or 0x40)
  • PCI: The device number in the high word and the function number in the low word.
  • USB: The port number. Not implemented.

◆ canCHANNELDATA_UI_NUMBER

#define canCHANNELDATA_UI_NUMBER   19

Not implemented.

◆ canCHANNELDATA_TIMESYNC_ENABLED

#define canCHANNELDATA_TIMESYNC_ENABLED   20

Not implemented.

◆ canCHANNELDATA_DRIVER_FILE_VERSION

#define canCHANNELDATA_DRIVER_FILE_VERSION   21

Not implemented.

◆ canCHANNELDATA_DRIVER_PRODUCT_VERSION

#define canCHANNELDATA_DRIVER_PRODUCT_VERSION   22

Not implemented.

◆ canCHANNELDATA_MFGNAME_UNICODE

#define canCHANNELDATA_MFGNAME_UNICODE   23

Not implemented.

◆ canCHANNELDATA_MFGNAME_ASCII

#define canCHANNELDATA_MFGNAME_ASCII   24

This define is used in canGetChannelData(), buffer mentioned below refers to this functions argument.

buffer points to a buffer which receives the device manufacturer's name as a zero-terminated ASCII string.

◆ canCHANNELDATA_DEVDESCR_UNICODE

#define canCHANNELDATA_DEVDESCR_UNICODE   25

Not implemented.

◆ canCHANNELDATA_DEVDESCR_ASCII

#define canCHANNELDATA_DEVDESCR_ASCII   26

This define is used in canGetChannelData(), buffer mentioned below refers to this functions argument.

buffer points to a buffer which receives the product name of the device as a zero-terminated ASCII string.

Examples:
listChannels.c.

◆ canCHANNELDATA_DRIVER_NAME

#define canCHANNELDATA_DRIVER_NAME   27

This define is used in canGetChannelData(), buffer mentioned below refers to this functions argument.

buffer points to a buffer which receives the name of the device driver (e.g. "kcans") as a zero-terminated ASCII string.

Note
The device driver names have no special meanings and may change from a release to another.

◆ canCHANNELDATA_CHANNEL_QUALITY

#define canCHANNELDATA_CHANNEL_QUALITY   28

Not implemented.

◆ canCHANNELDATA_ROUNDTRIP_TIME

#define canCHANNELDATA_ROUNDTRIP_TIME   29

Not implemented.

◆ canCHANNELDATA_BUS_TYPE

#define canCHANNELDATA_BUS_TYPE   30

Not implemented.

◆ canCHANNELDATA_DEVNAME_ASCII

#define canCHANNELDATA_DEVNAME_ASCII   31

Not implemented.

◆ canCHANNELDATA_TIME_SINCE_LAST_SEEN

#define canCHANNELDATA_TIME_SINCE_LAST_SEEN   32

Not implemented.

◆ canCHANNELDATA_REMOTE_OPERATIONAL_MODE

#define canCHANNELDATA_REMOTE_OPERATIONAL_MODE   33

Not implemented.

◆ canCHANNELDATA_REMOTE_PROFILE_NAME

#define canCHANNELDATA_REMOTE_PROFILE_NAME   34

Not implemented.

◆ canCHANNELDATA_REMOTE_HOST_NAME

#define canCHANNELDATA_REMOTE_HOST_NAME   35

Not implemented.

◆ canCHANNELDATA_REMOTE_MAC

#define canCHANNELDATA_REMOTE_MAC   36

Not implemented.

◆ canCHANNELDATA_MAX_BITRATE

#define canCHANNELDATA_MAX_BITRATE   37

This define is used in canGetChannelData(), buffer mentioned below refers to this functions argument.

buffer points to a 32-bit unsigned integer which receives maximum bitrate of the device. Zero value means no limit on bitrate.

◆ canCHANNELDATA_CHANNEL_CAP_MASK

#define canCHANNELDATA_CHANNEL_CAP_MASK   38

This define is used in canGetChannelData(), buffer mentioned below refers to this functions argument.

buffer points to a 32-bit unsigned integer that receives the capabilities mask of the CAN channel. This mask specifies which capabilities corresponding device is guaranteed to support/not support at the moment, see canCHANNEL_CAP_xxx for info about flags.

◆ canCHANNELDATA_IS_REMOTE

#define canCHANNELDATA_IS_REMOTE   40

This define is used in canGetChannelData(), buffer mentioned below refers to this functions argument.

buffer points to a 32-bit unsigned integer that is 1 if the channel(device) is currently connected as a remote device. 0 if it is not currenty a remote device.

◆ canCHANNELDATA_REMOTE_TYPE

#define canCHANNELDATA_REMOTE_TYPE   41

This define is used in canGetChannelData(), buffer mentioned below refers to this functions argument.

buffer points to a 32-bit unsigned integer that returns the type of remote connection. See kvREMOTE_TYPExxx for returned values.

◆ canCHANNELDATA_LOGGER_TYPE

#define canCHANNELDATA_LOGGER_TYPE   42

This define is used in canGetChannelData(), buffer mentioned below refers to this functions argument.

buffer points to a 32-bit unsigned integer that returns the logger type of the device. See kvLOGGER_TYPE_xxx for returned values.

◆ canCHANNELDATA_HW_STATUS

#define canCHANNELDATA_HW_STATUS   43

This define is used in canGetChannelData(), buffer mentioned below refers to this functions argument.

buffer points to an array of six 32-bit unsigned integers that receives hardware status codes for the device.

This is only intended for internal use.

◆ canCHANNELDATA_FEATURE_EAN

#define canCHANNELDATA_FEATURE_EAN   44

This define is used in canGetChannelData(), buffer mentioned below refers to this functions argument.

buffer points to an array of two 32-bit unsigned integers that returns the feature eanLo and feature eanHi of the device.

This is only intended for internal use.

◆ canCHANNELDATA_CUST_CHANNEL_NAME

#define canCHANNELDATA_CUST_CHANNEL_NAME   39

This define is used in canGetChannelData(), buffer mentioned below refers to this functions argument.

buffer is a user supplied byte array of length 'bufsize' (at least one byte long) to which the null terminated UTF-8 coded channel name will be placed.

Examples:
listChannels.c.

◆ canCHANNEL_IS_EXCLUSIVE

#define canCHANNEL_IS_EXCLUSIVE   0x0001

Used with canCHANNELDATA_CHANNEL_FLAGS, indicates that the channel is opened exclusively.

◆ canCHANNEL_IS_OPEN

#define canCHANNEL_IS_OPEN   0x0002

Used with canCHANNELDATA_CHANNEL_FLAGS, indicates that the channel is opened.

◆ canCHANNEL_IS_CANFD

#define canCHANNEL_IS_CANFD   0x0004

Used with canCHANNELDATA_CHANNEL_FLAGS, indicates that the channel is opened as CAN FD.

◆ canHWTYPE_NONE

#define canHWTYPE_NONE   0

Unknown or undefined.

◆ canHWTYPE_VIRTUAL

#define canHWTYPE_VIRTUAL   1

The virtual CAN bus.

◆ canHWTYPE_LAPCAN

#define canHWTYPE_LAPCAN   2

LAPcan Family.

◆ canHWTYPE_CANPARI

#define canHWTYPE_CANPARI   3

CANpari (obsolete).

◆ canHWTYPE_PCCAN

#define canHWTYPE_PCCAN   8

PCcan Family.

◆ canHWTYPE_PCICAN

#define canHWTYPE_PCICAN   9

PCIcan Family.

◆ canHWTYPE_USBCAN

#define canHWTYPE_USBCAN   11

USBcan (obsolete).

◆ canHWTYPE_PCICAN_II

#define canHWTYPE_PCICAN_II   40

PCIcan II family.

◆ canHWTYPE_USBCAN_II

#define canHWTYPE_USBCAN_II   42

USBcan II, USBcan Rugged, Kvaser Memorator.

◆ canHWTYPE_SIMULATED

#define canHWTYPE_SIMULATED   44

Simulated CAN bus for Kvaser Creator (obsolete).

◆ canHWTYPE_ACQUISITOR

#define canHWTYPE_ACQUISITOR   46

Kvaser Acquisitor (obsolete).

◆ canHWTYPE_LEAF

#define canHWTYPE_LEAF   48

Kvaser Leaf Family.

◆ canHWTYPE_PC104_PLUS

#define canHWTYPE_PC104_PLUS   50

Kvaser PC104+.

◆ canHWTYPE_PCICANX_II

#define canHWTYPE_PCICANX_II   52

Kvaser PCIcanx II.

◆ canHWTYPE_MEMORATOR_II

#define canHWTYPE_MEMORATOR_II   54

Kvaser Memorator Professional family.

◆ canHWTYPE_MEMORATOR_PRO

#define canHWTYPE_MEMORATOR_PRO   54

Kvaser Memorator Professional family.

◆ canHWTYPE_USBCAN_PRO

#define canHWTYPE_USBCAN_PRO   56

Kvaser USBcan Professional.

◆ canHWTYPE_IRIS

#define canHWTYPE_IRIS   58

Obsolete name, use canHWTYPE_BLACKBIRD instead.

◆ canHWTYPE_BLACKBIRD

#define canHWTYPE_BLACKBIRD   58

Kvaser BlackBird.

◆ canHWTYPE_MEMORATOR_LIGHT

#define canHWTYPE_MEMORATOR_LIGHT   60

Kvaser Memorator Light.

◆ canHWTYPE_MINIHYDRA

#define canHWTYPE_MINIHYDRA   62

Obsolete name, use canHWTYPE_EAGLE instead.

◆ canHWTYPE_EAGLE

#define canHWTYPE_EAGLE   62

Kvaser Eagle family.

◆ canHWTYPE_BAGEL

#define canHWTYPE_BAGEL   64

Obsolete name, use canHWTYPE_BLACKBIRD_V2 instead.

◆ canHWTYPE_BLACKBIRD_V2

#define canHWTYPE_BLACKBIRD_V2   64

Kvaser BlackBird v2.

◆ canHWTYPE_MINIPCIE

#define canHWTYPE_MINIPCIE   66

Kvaser Mini PCI Express.

◆ canHWTYPE_USBCAN_KLINE

#define canHWTYPE_USBCAN_KLINE   68

USBcan Pro HS/K-Line.

◆ canHWTYPE_ETHERCAN

#define canHWTYPE_ETHERCAN   70

Kvaser Ethercan.

◆ canHWTYPE_USBCAN_LIGHT

#define canHWTYPE_USBCAN_LIGHT   72

Kvaser USBcan Light.

◆ canHWTYPE_USBCAN_PRO2

#define canHWTYPE_USBCAN_PRO2   74

Kvaser USBcan Pro 5xHS and variants.

◆ canHWTYPE_PCIE_V2

#define canHWTYPE_PCIE_V2   76

Kvaser PCIEcan 4xHS and variants.

◆ canHWTYPE_MEMORATOR_PRO2

#define canHWTYPE_MEMORATOR_PRO2   78

Kvaser Memorator Pro 5xHS and variants.

◆ canHWTYPE_LEAF2

#define canHWTYPE_LEAF2   80

Kvaser Leaf Pro HS v2 and variants.

◆ canHWTYPE_MEMORATOR_V2

#define canHWTYPE_MEMORATOR_V2   82

Kvaser Memorator (2nd generation)

◆ canHWTYPE_CANLINHYBRID

#define canHWTYPE_CANLINHYBRID   84

Kvaser Hybrid CAN/LIN.

◆ canCHANNEL_CAP_EXTENDED_CAN

#define canCHANNEL_CAP_EXTENDED_CAN   0x00000001L

Can use extended identifiers.

◆ canCHANNEL_CAP_BUS_STATISTICS

#define canCHANNEL_CAP_BUS_STATISTICS   0x00000002L

Can report busload etc.

◆ canCHANNEL_CAP_ERROR_COUNTERS

#define canCHANNEL_CAP_ERROR_COUNTERS   0x00000004L

Can return error counters.

◆ canCHANNEL_CAP_CAN_DIAGNOSTICS

#define canCHANNEL_CAP_CAN_DIAGNOSTICS   0x00000008L

Can report CAN diagnostics.

◆ canCHANNEL_CAP_GENERATE_ERROR

#define canCHANNEL_CAP_GENERATE_ERROR   0x00000010L

Can send error frames.

◆ canCHANNEL_CAP_GENERATE_OVERLOAD

#define canCHANNEL_CAP_GENERATE_OVERLOAD   0x00000020L

Can send CAN overload frame.

◆ canCHANNEL_CAP_TXREQUEST

#define canCHANNEL_CAP_TXREQUEST   0x00000040L

Can report when a CAN messsage transmission is initiated.

◆ canCHANNEL_CAP_TXACKNOWLEDGE

#define canCHANNEL_CAP_TXACKNOWLEDGE   0x00000080L

Can report when a CAN messages has been transmitted.

◆ canCHANNEL_CAP_VIRTUAL

#define canCHANNEL_CAP_VIRTUAL   0x00010000L

Virtual CAN channel.

◆ canCHANNEL_CAP_SIMULATED

#define canCHANNEL_CAP_SIMULATED   0x00020000L

Simulated CAN channel.

◆ canCHANNEL_CAP_RESERVED_1

#define canCHANNEL_CAP_RESERVED_1   0x00040000L

Obsolete, use canCHANNEL_CAP_REMOTE_ACCESS or canGetChannelData() instead.

◆ canCHANNEL_CAP_CAN_FD

#define canCHANNEL_CAP_CAN_FD   0x00080000L

CAN-FD ISO compliant channel.

◆ canCHANNEL_CAP_CAN_FD_NONISO

#define canCHANNEL_CAP_CAN_FD_NONISO   0x00100000L

CAN-FD NON-ISO compliant channel.

◆ canCHANNEL_CAP_SILENT_MODE

#define canCHANNEL_CAP_SILENT_MODE   0x00200000L

Channel supports Silent mode.

◆ canCHANNEL_CAP_SINGLE_SHOT

#define canCHANNEL_CAP_SINGLE_SHOT   0x00400000L

Channel supports Single Shot messages.

◆ canCHANNEL_CAP_LOGGER

#define canCHANNEL_CAP_LOGGER   0x00800000L

Channel has logger capabilities.

◆ canCHANNEL_CAP_REMOTE_ACCESS

#define canCHANNEL_CAP_REMOTE_ACCESS   0x01000000L

Channel has remote capabilities.

◆ canCHANNEL_CAP_SCRIPT

#define canCHANNEL_CAP_SCRIPT   0x02000000L

Channel has script capabilities.

◆ canCHANNEL_CAP_LIN_FLEX

#define canCHANNEL_CAP_LIN_FLEX   0x04000000L

Channel has LIN capabilities. //qqq THIS NAME IS NOT FINAL.

◆ canDRIVER_CAP_HIGHSPEED

#define canDRIVER_CAP_HIGHSPEED   0x00000001L

◆ canIOCTL_PREFER_EXT

#define canIOCTL_PREFER_EXT   1

This define is used in canIoCtl(), buf and buflen refers to this functions arguments.

Tells CANLIB to "prefer" extended identifiers; that is, if you send a message with canWrite() and don't specify canMSG_EXT nor canMSG_STD, canMSG_EXT will be assumed. The contents of buf and buflen are ignored. canRead() et al will set canMSG_EXT and/or canMSG_STD as usual and are not affected by this call.

◆ canIOCTL_PREFER_STD

#define canIOCTL_PREFER_STD   2

This define is used in canIoCtl(), buf and buflen refers to this functions arguments.

Tells CANLIB to "prefer" standard identifiers; that is, if you send a message with canWrite() and don't specify canMSG_EXT nor canMSG_STD, canMSG_STD will be assumed. The contents of buf and buflen are ignored. canRead() et al will set canMSG_EXT and/or canMSG_STD as usual and are not affected by this call.

◆ canIOCTL_SET_TIMER_SCALE

#define canIOCTL_SET_TIMER_SCALE   6

This define is used in canIoCtl(), buf and buflen refers to this functions arguments.

Tells CANLIB to "prefer" extended identifiers; that is, if you send a message with canWrite() and don't specify canMSG_EXT nor canMSG_STD, canMSG_EXT will be assumed. The contents of buf and buflen are ignored. canRead() et al will set canMSG_EXT and/or canMSG_STD as usual and are not affected by this call.

◆ canIOCTL_SET_TXACK

#define canIOCTL_SET_TXACK   7

This define is used in canIoCtl(), buf mentioned below refers to this functions argument.

buf points to a DWORD which contains

  • 0: to turn Transmit Acknowledges off.
  • 1: to turn Transmit Acknowledges on.
  • 2: to turn Transmit Acknowledges off, even for the driver's internal usage. This might enhance performance but will cause some other APIs to stop working (for example, the current size of the transmit queue can not be read when this mode is active.)

The default value is 0, Transmit Acknowledge is off.

◆ canIOCTL_GET_RX_BUFFER_LEVEL

#define canIOCTL_GET_RX_BUFFER_LEVEL   8

This define is used in canIoCtl(), buf mentioned below refers to this functions argument.

buf points at a DWORD which receives the current RX queue level. The returned value is approximative (this is because not all hardware supports retrieving the queue levels. In that case a best-effort guess is returned. Also note that a device with embedded CPU will report its queue levels to the host computer after a short delay that depends on the bus traffic intensity, and consequently the value returned by the call to canIoCtl() might be a few milliseconds old.)

◆ canIOCTL_GET_TX_BUFFER_LEVEL

#define canIOCTL_GET_TX_BUFFER_LEVEL   9

This define is used in canIoCtl(), buf mentioned below refers to this functions argument.

buf points at a DWORD which receives the current TX queue level. The returned value is approximative (this is because not all hardware supports retrieving the queue levels. In that case a best-effort guess is returned. Also note that a device with embedded CPU will report its queue levels to the host computer after a short delay that depends on the bus traffic intensity, and consequently the value returned by the call to canIoCtl() might be a few milliseconds old.)

◆ canIOCTL_FLUSH_RX_BUFFER

#define canIOCTL_FLUSH_RX_BUFFER   10

This define is used in canIoCtl(), buf and buflen refers to this functions arguments.

Discard the current contents of the RX queue. The values of buf and buflen are ignored.

Note
This is the same thing as calling canFlushReceiveQueue()

◆ canIOCTL_FLUSH_TX_BUFFER

#define canIOCTL_FLUSH_TX_BUFFER   11

This define is used in canIoCtl(), buf and buflen refers to this functions arguments.

Discard the current contents of the TX queue. The values of buf and buflen are ignored.

Note
This is the same thing as calling canFlushTransmitQueue().

◆ canIOCTL_GET_TIMER_SCALE

#define canIOCTL_GET_TIMER_SCALE   12

This define is used in canIoCtl(), buf mentioned below refers to this functions argument.

buf points to a DWORD which contains the desired time-stamp clock resolution in microseconds. Note that the accuracy of the clock isn't affected. The default value is 1000 microseconds, i.e. one millisecond.

◆ canIOCTL_SET_TXRQ

#define canIOCTL_SET_TXRQ   13

This define is used in canIoCtl(), buf mentioned below refers to this functions argument.

buf points to a DWORD which contains

  • 0 to turn Transmit Requests off.
  • 1 to turn Transmit Requests on.

Default value is 0, Transmit Requests off.

◆ canIOCTL_GET_EVENTHANDLE

#define canIOCTL_GET_EVENTHANDLE   14

This define is used in canIoCtl(), buf mentioned below refers to this functions argument.

buf points at a DWORD which receives a Windows Event handle which can be passed to the Win32 API WaitForSingleObject. The event is signaled when "something" (typically that a CAN message has been received or transmitted) happens in the driver.

Note
There is no more information available as to what happened when this call returns. The call may return on an "internal" event in CANLIB and your application must be prepared to handle this (i.e. go to sleep again.)
Note
You must not set, reset, nor close this handle. Waiting on it is the only supported operation.

◆ canIOCTL_SET_BYPASS_MODE

#define canIOCTL_SET_BYPASS_MODE   15

This define is used in canIoCtl(), buf mentioned below refers to this functions argument.

Note
Not yet implemented.

◆ canIOCTL_SET_WAKEUP

#define canIOCTL_SET_WAKEUP   16

This define is used in canIoCtl().

This is only intended for internal use.

◆ canIOCTL_GET_DRIVERHANDLE

#define canIOCTL_GET_DRIVERHANDLE   17

This define is used in canIoCtl(), buf mentioned below refers to this functions argument.

buf points to a HANDLE which receives the Windows handle related to the CANLIB handle.

◆ canIOCTL_MAP_RXQUEUE

#define canIOCTL_MAP_RXQUEUE   18

This define is used in canIoCtl().

This is only intended for internal use.

◆ canIOCTL_GET_WAKEUP

#define canIOCTL_GET_WAKEUP   19

This define is used in canIoCtl().

This is only intended for internal use.

◆ canIOCTL_SET_REPORT_ACCESS_ERRORS

#define canIOCTL_SET_REPORT_ACCESS_ERRORS   20

This define is used in canIoCtl(), buf mentioned below refers to this functions argument.

buf points to a unsigned char which contains

  • 0 to turn access error reporting off, and
  • 1 to turn access error reporting on.

Default value is 0, access error reporting off.

◆ canIOCTL_GET_REPORT_ACCESS_ERRORS

#define canIOCTL_GET_REPORT_ACCESS_ERRORS   21

This define is used in canIoCtl(), buf mentioned below refers to this functions argument.

buf points to a unsigned char which receives the current setting of the access error reporting (0 or 1.)

◆ canIOCTL_CONNECT_TO_VIRTUAL_BUS

#define canIOCTL_CONNECT_TO_VIRTUAL_BUS   22

This define is used in canIoCtl(), buf mentioned below refers to this functions argument.

Connects the handle to the virtual bus number (0..31) which the buf points to.

◆ canIOCTL_DISCONNECT_FROM_VIRTUAL_BUS

#define canIOCTL_DISCONNECT_FROM_VIRTUAL_BUS   23

This define is used in canIoCtl(), buf mentioned below refers to this functions argument.

Disonnects the handle from the virtual bus number (0..31) which the buf points to.

◆ canIOCTL_SET_USER_IOPORT

#define canIOCTL_SET_USER_IOPORT   24

This define is used in canIoCtl(), buf mentioned below refers to this functions argument.

buf points to a canUserIoPortData struct that contains a port number and a port value to set. This is used by special hardware only.

◆ canIOCTL_GET_USER_IOPORT

#define canIOCTL_GET_USER_IOPORT   25

This define is used in canIoCtl(), buf mentioned below refers to this functions argument.

buf points to a canUserIoPortData struct that contains a port number. After the call, the struct will contain the current value of the I/O port. This is used by special hardware only.

◆ canIOCTL_SET_BUFFER_WRAPAROUND_MODE

#define canIOCTL_SET_BUFFER_WRAPAROUND_MODE   26

This define is used in canIoCtl().

This is only intended for internal use.

◆ canIOCTL_SET_RX_QUEUE_SIZE

#define canIOCTL_SET_RX_QUEUE_SIZE   27

This define is used in canIoCtl(), buf mentioned below refers to this functions argument.

Use this function code to set the size of the receive buffer for a specific handle. buf points to an unsigned integer which contains the new size (number of messages) of the receive buffer.

Note
The receive buffer consumes system nonpaged pool memory, which is a limited resource. Do not increase the receive buffer size unless you have good reasons to do so.
You can't use this function code when the channel is on bus.

◆ canIOCTL_SET_USB_THROTTLE

#define canIOCTL_SET_USB_THROTTLE   28

This define is used in canIoCtl().

This is only intended for internal use.

◆ canIOCTL_GET_USB_THROTTLE

#define canIOCTL_GET_USB_THROTTLE   29

This define is used in canIoCtl().

This is only intended for internal use.

◆ canIOCTL_SET_BUSON_TIME_AUTO_RESET

#define canIOCTL_SET_BUSON_TIME_AUTO_RESET   30

This define is used in canIoCtl(), buf mentioned below refers to this functions argument.

buf points to a DWORD. If the value is zero, the CAN clock will not be reset at buson for the handle. Otherwise, the CAN clock will be reset at buson.

Default value is 1, the CAN clock will be reset at buson.

◆ canIOCTL_GET_TXACK

#define canIOCTL_GET_TXACK   31

This define is used in canIoCtl(), buf mentioned below refers to this functions argument.

Returns the state of the Transmit Acknowledge as a DWORD in buf:

  • 0: Transmit Acknowledges is turned off.
  • 1: Transmit Acknowledges is turned on.
  • 2: Transmit Acknowledges is turned off, even for the driver's internal usage.

◆ canIOCTL_SET_LOCAL_TXECHO

#define canIOCTL_SET_LOCAL_TXECHO   32

This define is used in canIoCtl(), buf mentioned below refers to this functions argument.

buf points to an unsigned byte. If the value is zero, the local transmit echo is turned off for the handle. Otherwise, local transmit echo is turned on.

Local transmit echo is turned on by default on all handles. This means that if two handles are open on the same channel, and a message is transmitted on the first handle, it will be received as a normal message on the second handle. Use the canIOCTL_SET_LOCAL_TXECHO function code to turn this function off, if it is not desired on a certain handle.

◆ canIOCTL_GET_TREF_LIST

#define canIOCTL_GET_TREF_LIST   39

This define is used in canIoCtl(), buf mentioned below refers to this functions argument.

Obtain the time reference list for MagiSync devices.

buf points to an array of pairs of 64-bit ints, one of which will contain the reference number and the other one the timestamp in nanoseconds.

Note
This function is subject to change in future releases and is not supported by Kvaser.

◆ canIOCTL_TX_INTERVAL

#define canIOCTL_TX_INTERVAL   40

This define is used in canIoCtl(), buf mentioned below refers to this functions argument.

buf points to a DWORD that contains the number of microseconds the minimum CAN message transmit interval should be set to, or 0xffffffff to fetch the current setting. The minimum interval can not be set to more than one second.

When a CAN channel goes bus on, the minimum interval is set to zero. I.e. CAN transmissions happen at the maximum speed the device is capable of.

If the device does not support this functionality, or if an invalid minimum interval is requested, an error will be returned.

Note
The minimum CAN messages transmit interval applies to the physical CAN channel. It will thus affect all messages transmitted, even those sent using other CANlib handles to the same physical channel. The interval is defined as the time from the successful completion of one transmit to the beginning of the next one.

◆ canIOCTL_SET_BRLIMIT

#define canIOCTL_SET_BRLIMIT   43

This define is used in canIoCtl(), buf mentioned below refers to this functions argument.

Some hardware have bitrate limits, which must be met when using any of canSetBusParams(), canSetBusParamsC200(), canGetBusParams() functions which can be overriden with this IOCTL. buf points to a long value that contains a user defined bitrate. A value of 0 means that the device should use its own default bitrate limit.

◆ canIOCTL_RESET_OVERRUN_COUNT

#define canIOCTL_RESET_OVERRUN_COUNT   44

This define is used in canIoCtl(), buf mentioned below refers to this functions argument.

This ioctl resets overrun count and flags,

See also
canReadStatus
canGetBusStatistics

◆ canOBJBUF_TYPE_AUTO_RESPONSE

#define canOBJBUF_TYPE_AUTO_RESPONSE   0x01

The buffer is an auto-response buffer.

◆ canOBJBUF_TYPE_PERIODIC_TX

#define canOBJBUF_TYPE_PERIODIC_TX   0x02

The buffer is an auto-transmit buffer.

◆ canOBJBUF_AUTO_RESPONSE_RTR_ONLY

#define canOBJBUF_AUTO_RESPONSE_RTR_ONLY   0x01

This define is used in canObjBufSetFlags().

For auto-response buffers only. When this flag is in effect, the buffer will auto-respond to remote requests only. If this flag is not in effect, the buffer will auto-respond to both remote requests and ordinary data frames.

◆ kvLED_ACTION_ALL_LEDS_ON

#define kvLED_ACTION_ALL_LEDS_ON   0

Turn all LEDs on.

◆ kvLED_ACTION_ALL_LEDS_OFF

#define kvLED_ACTION_ALL_LEDS_OFF   1

Turn all LEDs off.

◆ kvLED_ACTION_LED_0_ON

#define kvLED_ACTION_LED_0_ON   2

Turn LED 0 on.

◆ kvLED_ACTION_LED_0_OFF

#define kvLED_ACTION_LED_0_OFF   3

Turn LED 0 off.

◆ kvLED_ACTION_LED_1_ON

#define kvLED_ACTION_LED_1_ON   4

Turn LED 1 on.

◆ kvLED_ACTION_LED_1_OFF

#define kvLED_ACTION_LED_1_OFF   5

Turn LED 1 off.

◆ kvLED_ACTION_LED_2_ON

#define kvLED_ACTION_LED_2_ON   6

Turn LED 2 on.

◆ kvLED_ACTION_LED_2_OFF

#define kvLED_ACTION_LED_2_OFF   7

Turn LED 2 off.

◆ kvLED_ACTION_LED_3_ON

#define kvLED_ACTION_LED_3_ON   8

Turn LED 3 on.

◆ kvLED_ACTION_LED_3_OFF

#define kvLED_ACTION_LED_3_OFF   9

Turn LED 3 off.

◆ kvLED_ACTION_LED_4_ON

#define kvLED_ACTION_LED_4_ON   10

Turn LED 4 on.

◆ kvLED_ACTION_LED_4_OFF

#define kvLED_ACTION_LED_4_OFF   11

Turn LED 4 off.

◆ kvLED_ACTION_LED_5_ON

#define kvLED_ACTION_LED_5_ON   12

Turn LED 5 on.

◆ kvLED_ACTION_LED_5_OFF

#define kvLED_ACTION_LED_5_OFF   13

Turn LED 5 off.

◆ kvLED_ACTION_LED_6_ON

#define kvLED_ACTION_LED_6_ON   14

Turn LED 6 on.

◆ kvLED_ACTION_LED_6_OFF

#define kvLED_ACTION_LED_6_OFF   15

Turn LED 6 off.

◆ kvLED_ACTION_LED_7_ON

#define kvLED_ACTION_LED_7_ON   16

Turn LED 7 on.

◆ kvLED_ACTION_LED_7_OFF

#define kvLED_ACTION_LED_7_OFF   17

Turn LED 7 off.

◆ kvLED_ACTION_LED_8_ON

#define kvLED_ACTION_LED_8_ON   18

Turn LED 8 on.

◆ kvLED_ACTION_LED_8_OFF

#define kvLED_ACTION_LED_8_OFF   19

Turn LED 8 off.

◆ kvLED_ACTION_LED_9_ON

#define kvLED_ACTION_LED_9_ON   20

Turn LED 9 on.

◆ kvLED_ACTION_LED_9_OFF

#define kvLED_ACTION_LED_9_OFF   21

Turn LED 9 off.

◆ kvLED_ACTION_LED_10_ON

#define kvLED_ACTION_LED_10_ON   22

Turn LED 10 on.

◆ kvLED_ACTION_LED_10_OFF

#define kvLED_ACTION_LED_10_OFF   23

Turn LED 10 off.

◆ kvLED_ACTION_LED_11_ON

#define kvLED_ACTION_LED_11_ON   24

Turn LED 11 on.

◆ kvLED_ACTION_LED_11_OFF

#define kvLED_ACTION_LED_11_OFF   25

Turn LED 11 off.

◆ kvENVVAR_TYPE_INT

#define kvENVVAR_TYPE_INT   1

This define is used in kvScriptEnvvarOpen().

It defines the type of the envvar as int.

◆ kvENVVAR_TYPE_FLOAT

#define kvENVVAR_TYPE_FLOAT   2

This define is used in kvScriptEnvvarOpen().

It defines the type of the envvar as float.

◆ kvENVVAR_TYPE_STRING

#define kvENVVAR_TYPE_STRING   3

This define is used in kvScriptEnvvarOpen().

It defines the type of the envvar as string.

◆ kvEVENT_TYPE_KEY

#define kvEVENT_TYPE_KEY   1

This define is used in kvScriptSendEvent().

It defines an event of type "key pressed".

◆ kvSCRIPT_STOP_NORMAL

#define kvSCRIPT_STOP_NORMAL   0

Stop a running script

◆ kvSCRIPT_STOP_FORCED

#define kvSCRIPT_STOP_FORCED   -9

Request termination of a hanged script

◆ kvSCRIPT_STATUS_LOADED

#define kvSCRIPT_STATUS_LOADED   1

The slot is loaded with a script

◆ kvSCRIPT_STATUS_RUNNING

#define kvSCRIPT_STATUS_RUNNING   2

The slot is running a script.

◆ kvDEVICE_MODE_INTERFACE

#define kvDEVICE_MODE_INTERFACE   0x00

This define is used in kvDeviceSetMode() and kvDeviceGetMode().

Device is running or should be running in interface mode.

◆ kvDEVICE_MODE_LOGGER

#define kvDEVICE_MODE_LOGGER   0x01

This define is used in kvDeviceSetMode() and kvDeviceGetMode().

Device is running or should be running in logger mode.

Typedef Documentation

◆ canHandle

typedef int canHandle

Handle to an opened circuit, created with canOpenChannel().

◆ CanHandle

Handle to an opened circuit, created with canOpenChannel().

◆ canNotifyData

typedef struct canNotifyData canNotifyData

◆ canBusStatistics

This struct is returned by canGetBusStatistics()

The values are cleared when the corresponding channel goes on bus.

◆ kvTimeDomain

typedef void* kvTimeDomain

Used for time domain handling.

◆ kvStatus

Contains status codes according to canSTAT_xxx.

◆ kvTimeDomainData

Used for time domain handling.

◆ kvCallback_t

typedef void( * kvCallback_t) (CanHandle hnd, void *context, unsigned int notifyEvent)

kvCallback_t is used by the function kvSetNotifyCallback()

The callback function is called with the following arguments:

  • hnd - the handle of the CAN channel where the event happened.
  • context - the context pointer you passed to kvSetNotifyCallback().
  • notifyEvent - one of the canNOTIFY_xxx notification codes.
Note
It is really the canNOTIFY_xxx codes, and not the canEVENT_xxx codes that the canSetNotify() API is using.

Function Documentation

◆ kvTimeDomainCreate()

kvStatus kvTimeDomainCreate ( kvTimeDomain domain)

This routine creates an empty time domain.

The variable is set by this function and then used in later calls to other functions using a kvTimeDomain.

Time domains created by kvTimeDomainCreate() can be destroyed with a call to kvTimeDomainDelete().

Note
A time domain is a set of channels with a common time base.
Parameters
[out]domainA pointer to a caller allocated, opaque variable of type kvTimeDomain that holds data to identify a particlar time domain.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
Code Examples
kvTimeDomainDelete()

◆ kvTimeDomainDelete()

kvStatus kvTimeDomainDelete ( kvTimeDomain  domain)

This is a cleanup routine that deletes all members of a domain and then deletes the domain itself.

Note
A time domain is a set of channels with a common time base.
Parameters
[in]domainAn opaque variable set by kvTimeDomainCreate() that identifies the domain to be deleted.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
Code Examples
kvTimeDomainCreate()

◆ kvTimeDomainResetTime()

kvStatus kvTimeDomainResetTime ( kvTimeDomain  domain)

This routine resets the time on all members of a time domain.

After a call to this routine timestamps from all channels with MagiSync™ running have no offset at all any longer. The same applies for channels that reside on the same physical interface.

Note
A time domain is a set of channels with a common time base.
Parameters
[in]domainAn opaque variable set by kvTimeDomainCreate() that identifies the domain to reset the time on.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
Code Examples
kvTimeDomainCreate()

◆ kvTimeDomainGetData()

kvStatus kvTimeDomainGetData ( kvTimeDomain  domain,
kvTimeDomainData data,
size_t  bufsiz 
)

This routine collects some data on a time domain.

Note
A time domain is a set of channels with a common time base.
Parameters
[in]domainAn opaque variable set by kvTimeDomainCreate() that identifies the domain to add a handle to.
[out]dataA pointer to a kvTimeDomainData that is to be filled by the function.
[in]bufsizThe size in bytes of the kvTimeDomainData struct.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
Code Examples
kvTimeDomainCreate()

◆ kvTimeDomainAddHandle()

kvStatus kvTimeDomainAddHandle ( kvTimeDomain  domain,
const CanHandle  hnd 
)

This routine adds an open channel handle to a domain.

Note
A time domain is a set of channels with a common time base.
Parameters
[in]domainAn opaque variable set by kvTimeDomainCreate() that identifies the domain to add a handle to.
[in]hndA handle to an open channel.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
Code Examples
kvTimeDomainCreate(), kvTimeDomainRemoveHandle()

◆ kvTimeDomainRemoveHandle()

kvStatus kvTimeDomainRemoveHandle ( kvTimeDomain  domain,
const CanHandle  hnd 
)

This routine removes an open channel handle from a domain.

Note
A time domain is a set of channels with a common time base.
Parameters
[in]domainAn opaque variable set by kvTimeDomainCreate() that identifies the domain to remove a handle from.
[in]hndA handle to an open channel.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
kvTimeDomainCreate(), kvTimeDomainAddHandle()