canlib.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 by Kvaser AB, Molndal, Sweden
3  * http://www.kvaser.com
4  *
5  * This software is dual licensed under the following two licenses:
6  * BSD-new and GPLv2. You may use either one. See the included
7  * COPYING file for details.
8  *
9  * License: BSD-new
10  * ==============================================================================
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions are met:
13  * * Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * * Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in the
17  * documentation and/or other materials provided with the distribution.
18  * * Neither the name of the <organization> nor the
19  * names of its contributors may be used to endorse or promote products
20  * derived from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
29  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
30  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *
34  *
35  * License: GPLv2
36  * ==============================================================================
37  * This program is free software; you can redistribute it and/or modify
38  * it under the terms of the GNU General Public License as published by
39  * the Free Software Foundation; either version 2 of the License, or
40  * (at your option) any later version.
41  *
42  * This program is distributed in the hope that it will be useful,
43  * but WITHOUT ANY WARRANTY; without even the implied warranty of
44  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45  * GNU General Public License for more details.
46  *
47  * You should have received a copy of the GNU General Public License
48  * along with this program; if not, write to the Free Software
49  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
50  *
51  *
52  * IMPORTANT NOTICE:
53  * ==============================================================================
54  * This source code is made available for free, as an open license, by Kvaser AB,
55  * for use with its applications. Kvaser AB does not accept any liability
56  * whatsoever for any third party patent or other immaterial property rights
57  * violations that may result from any usage of this source code, regardless of
58  * the combination of source code and various applications that it can be used
59  * in, or with.
60  *
61  * -----------------------------------------------------------------------------
62  */
63 
145 #ifndef _CANLIB_H_
146 #define _CANLIB_H_
147 
148 #include <stdlib.h>
149 
150 #include <stdint.h>
151 
152 #include "canstat.h"
153 
155 typedef int canHandle;
156 
157 # define canINVALID_HANDLE (-1)
158 
159 
161 
162 typedef struct canNotifyData {
163  void *tag;
165  union {
166  struct {
167  unsigned long time;
168  } busErr;
169  struct {
170  long id;
171  unsigned long time;
172  } rx;
173  struct {
174  long id;
175  unsigned long time;
176  } tx;
177  struct {
178  unsigned char busStatus;
179  unsigned char txErrorCounter;
180  unsigned char rxErrorCounter;
181  unsigned long time;
182  } status;
183  } info;
184 } canNotifyData;
185 
186 
196 // The canWANT_xxx names are also obsolete, use canOPEN_xxx instead for new developments.
197 #define canWANT_EXCLUSIVE 0x0008
198 #define canWANT_EXTENDED 0x0010
199 #define canWANT_VIRTUAL 0x0020
200 
214 #define canOPEN_EXCLUSIVE 0x0008
215 
227 #define canOPEN_REQUIRE_EXTENDED 0x0010
228 
236 # define canOPEN_ACCEPT_VIRTUAL 0x0020
237 
246 # define canOPEN_OVERRIDE_EXCLUSIVE 0x0040
247 
264 # define canOPEN_REQUIRE_INIT_ACCESS 0x0080
265 
277 # define canOPEN_NO_INIT_ACCESS 0x0100
278 
290 # define canOPEN_ACCEPT_LARGE_DLC 0x0200 // DLC can be greater than 8
291 
298 # define canOPEN_CAN_FD 0x0400
299 
313 # define canOPEN_CAN_FD_NONISO 0x0800
314 
315 
319 # define canOPEN_INTERNAL_L 0x1000
320 
332 #define canFILTER_ACCEPT 1
333 #define canFILTER_REJECT 2
334 
335 #define canFILTER_SET_CODE_STD 3
336 
337 #define canFILTER_SET_MASK_STD 4
338 
339 #define canFILTER_SET_CODE_EXT 5
340 
341 #define canFILTER_SET_MASK_EXT 6
342 
343 #define canFILTER_NULL_MASK 0L
344 
360 #define canDRIVER_NORMAL 4
361 
368 #define canDRIVER_SILENT 1
369 
373 #define canDRIVER_SELFRECEPTION 8
374 
378 #define canDRIVER_OFF 0
379 
402 #define canBITRATE_1M (-1)
403 
404 #define canBITRATE_500K (-2)
405 
406 #define canBITRATE_250K (-3)
407 
408 #define canBITRATE_125K (-4)
409 
410 #define canBITRATE_100K (-5)
411 
412 #define canBITRATE_62K (-6)
413 
414 #define canBITRATE_50K (-7)
415 
416 #define canBITRATE_83K (-8)
417 
418 #define canBITRATE_10K (-9)
419 
420 // CAN FD Bit Rates
424 #define canFD_BITRATE_500K_80P (-1000)
425 
428 #define canFD_BITRATE_1M_80P (-1001)
429 
432 #define canFD_BITRATE_2M_80P (-1002)
433 
436 #define canFD_BITRATE_4M_80P (-1003)
437 
440 #define canFD_BITRATE_8M_60P (-1004)
441 
443 #define BAUD_1M (-1)
444 
445 #define BAUD_500K (-2)
446 
447 #define BAUD_250K (-3)
448 
449 #define BAUD_125K (-4)
450 
451 #define BAUD_100K (-5)
452 
453 #define BAUD_62K (-6)
454 
455 #define BAUD_50K (-7)
456 
457 #define BAUD_83K (-8)
458 
461 //
462 // Define CANLIBAPI unless it's done already.
463 // (canlib.c provides its own definitions of CANLIBAPI, DLLIMPORT
464 // and DLLEXPORT before including this file.)
465 //
466 #ifndef CANLIBAPI
467 # define CANLIBAPI
468 #endif /* CANLIBAPI */
469 
470 
471 #ifdef __cplusplus
472 extern "C" {
473 #endif /* __cplusplus */
474 
496 void CANLIBAPI canInitializeLibrary (void);
497 
514 canStatus CANLIBAPI canEnumHardwareEx (int *channelCount);
515 
540 canStatus CANLIBAPI canClose (const CanHandle hnd);
541 
566 canStatus CANLIBAPI canBusOn (const CanHandle hnd);
567 
588 canStatus CANLIBAPI canBusOff (const CanHandle hnd);
589 
638 canStatus CANLIBAPI canSetBusParams (const CanHandle hnd,
639  long freq,
640  unsigned int tseg1,
641  unsigned int tseg2,
642  unsigned int sjw,
643  unsigned int noSamp,
644  unsigned int syncmode);
645 
677 canStatus CANLIBAPI canSetBusParamsFd (const CanHandle hnd,
678  long freq_brs,
679  unsigned int tseg1_brs,
680  unsigned int tseg2_brs,
681  unsigned int sjw_brs);
682 
683 
715 canStatus CANLIBAPI canGetBusParams (const CanHandle hnd,
716  long *freq,
717  unsigned int *tseg1,
718  unsigned int *tseg2,
719  unsigned int *sjw,
720  unsigned int *noSamp,
721  unsigned int *syncmode);
722 
723 
746 canStatus CANLIBAPI canGetBusParamsFd(const CanHandle hnd,
747  long *freq_brs,
748  unsigned int *tseg1_brs,
749  unsigned int *tseg2_brs,
750  unsigned int *sjw_brs);
775 canStatus CANLIBAPI canSetBusOutputControl (const CanHandle hnd,
776  const unsigned int drivertype);
777 
812 canStatus CANLIBAPI canGetBusOutputControl (const CanHandle hnd,
813  unsigned int *drivertype);
814 
857 canStatus CANLIBAPI canAccept (const CanHandle hnd,
858  const long envelope,
859  const unsigned int flag);
860 
884 canStatus CANLIBAPI canReadStatus (const CanHandle hnd,
885  unsigned long *const flags);
886 
923 canStatus CANLIBAPI canReadErrorCounters (const CanHandle hnd,
924  unsigned int *txErr,
925  unsigned int *rxErr,
926  unsigned int *ovErr);
927 
969 canStatus CANLIBAPI canWrite (const CanHandle hnd,
970  long id,
971  void *msg,
972  unsigned int dlc,
973  unsigned int flag);
974 
1002 canStatus CANLIBAPI canWriteSync (const CanHandle hnd, unsigned long timeout);
1003 
1055 canStatus CANLIBAPI canRead (const CanHandle hnd,
1056  long *id,
1057  void *msg,
1058  unsigned int *dlc,
1059  unsigned int *flag,
1060  unsigned long *time);
1111 canStatus CANLIBAPI canReadWait (const CanHandle hnd,
1112  long *id,
1113  void *msg,
1114  unsigned int *dlc,
1115  unsigned int *flag,
1116  unsigned long *time,
1117  unsigned long timeout);
1118 
1170 canStatus CANLIBAPI canReadSpecific (const CanHandle hnd, long id, void * msg,
1171  unsigned int * dlc, unsigned int * flag,
1172  unsigned long * time);
1173 
1204 canStatus CANLIBAPI canReadSync (const CanHandle hnd, unsigned long timeout);
1205 
1237 canStatus CANLIBAPI canReadSyncSpecific (const CanHandle hnd,
1238  long id,
1239  unsigned long timeout);
1240 
1286 canStatus CANLIBAPI canReadSpecificSkip (const CanHandle hnd,
1287  long id,
1288  void * msg,
1289  unsigned int * dlc,
1290  unsigned int * flag,
1291  unsigned long * time);
1292 
1313 canStatus CANLIBAPI canSetNotify (const CanHandle hnd,
1314  void (*callback)(canNotifyData *),
1315  unsigned int notifyFlags,
1316  void *tag);
1317 
1331 canStatus CANLIBAPI canGetRawHandle (const CanHandle hnd, void *pvFd);
1332 
1367 canStatus CANLIBAPI canTranslateBaud (long *const freq,
1368  unsigned int *const tseg1,
1369  unsigned int *const tseg2,
1370  unsigned int *const sjw,
1371  unsigned int *const nosamp,
1372  unsigned int *const syncMode);
1373 
1396 canStatus CANLIBAPI canGetErrorText (canStatus err, char *buf, unsigned int bufsiz);
1397 
1427 unsigned short CANLIBAPI canGetVersion (void);
1428 
1457 canStatus CANLIBAPI canIoCtl (const CanHandle hnd,
1458  unsigned int func,
1459  void *buf,
1460  unsigned int buflen);
1461 
1462 
1468 canStatus CANLIBAPI canReadTimer (const CanHandle hnd, unsigned long *time);
1469 
1520 CanHandle CANLIBAPI canOpenChannel (int channel, int flags);
1521 
1542 canStatus CANLIBAPI canGetNumberOfChannels (int *channelCount);
1543 
1544 
1552 #define kvREMOTE_TYPE_NOT_REMOTE 0
1553 #define kvREMOTE_TYPE_WLAN 1
1554 #define kvREMOTE_TYPE_LAN 2
1555 
1564 #define kvLOGGER_TYPE_NOT_A_LOGGER 0
1565 #define kvLOGGER_TYPE_V1 1
1566 #define kvLOGGER_TYPE_V2 2
1567 
1600 canStatus CANLIBAPI canGetChannelData (int channel,
1601  int item,
1602  void *buffer,
1603  size_t bufsize);
1604 
1623 #define canCHANNELDATA_CHANNEL_CAP 1
1624 
1634 #define canCHANNELDATA_TRANS_CAP 2
1635 
1644 #define canCHANNELDATA_CHANNEL_FLAGS 3 // available, etc
1645 
1654 #define canCHANNELDATA_CARD_TYPE 4
1655 
1665 #define canCHANNELDATA_CARD_NUMBER 5
1666 
1674 #define canCHANNELDATA_CHAN_NO_ON_CARD 6
1675 
1685 #define canCHANNELDATA_CARD_SERIAL_NO 7
1686 
1696 #define canCHANNELDATA_TRANS_SERIAL_NO 8
1697 
1708 #define canCHANNELDATA_CARD_FIRMWARE_REV 9
1709 
1720 #define canCHANNELDATA_CARD_HARDWARE_REV 10
1721 
1731 #define canCHANNELDATA_CARD_UPC_NO 11
1732 
1743 #define canCHANNELDATA_TRANS_UPC_NO 12
1744 
1762 #define canCHANNELDATA_CHANNEL_NAME 13
1763 
1779 # define canCHANNELDATA_DLL_FILE_VERSION 14
1780 
1796 # define canCHANNELDATA_DLL_PRODUCT_VERSION 15
1797 
1813 # define canCHANNELDATA_DLL_FILETYPE 16
1814 
1823 # define canCHANNELDATA_TRANS_TYPE 17
1824 
1848 # define canCHANNELDATA_DEVICE_PHYSICAL_POSITION 18
1849 
1862 # define canCHANNELDATA_UI_NUMBER 19
1863 
1887 # define canCHANNELDATA_TIMESYNC_ENABLED 20
1888 
1903 # define canCHANNELDATA_DRIVER_FILE_VERSION 21
1904 
1919 # define canCHANNELDATA_DRIVER_PRODUCT_VERSION 22
1920 
1929 # define canCHANNELDATA_MFGNAME_UNICODE 23
1930 
1938 # define canCHANNELDATA_MFGNAME_ASCII 24
1939 
1948 # define canCHANNELDATA_DEVDESCR_UNICODE 25
1949 
1957 # define canCHANNELDATA_DEVDESCR_ASCII 26
1958 
1969 # define canCHANNELDATA_DRIVER_NAME 27
1970 
1983 # define canCHANNELDATA_CHANNEL_QUALITY 28
1984 
1993 # define canCHANNELDATA_ROUNDTRIP_TIME 29
1994 
2003 # define canCHANNELDATA_BUS_TYPE 30
2004 
2017 # define canCHANNELDATA_DEVNAME_ASCII 31
2018 
2029 # define canCHANNELDATA_TIME_SINCE_LAST_SEEN 32
2030 
2040 # define canCHANNELDATA_REMOTE_OPERATIONAL_MODE 33
2041 
2050 # define canCHANNELDATA_REMOTE_PROFILE_NAME 34
2051 
2060 # define canCHANNELDATA_REMOTE_HOST_NAME 35
2061 
2070 # define canCHANNELDATA_REMOTE_MAC 36
2071 
2080 # define canCHANNELDATA_MAX_BITRATE 37
2081 
2092 # define canCHANNELDATA_CHANNEL_CAP_MASK 38
2093 
2103 # define canCHANNELDATA_IS_REMOTE 40
2104 
2113 # define canCHANNELDATA_REMOTE_TYPE 41
2114 
2123 # define canCHANNELDATA_LOGGER_TYPE 42
2124 
2134 # define canCHANNELDATA_HW_STATUS 43
2135 
2145 # define canCHANNELDATA_FEATURE_EAN 44
2146 
2158 #define canCHANNELDATA_CUST_CHANNEL_NAME 39
2159 
2173 #define canCHANNEL_IS_EXCLUSIVE 0x0001
2174 
2176 #define canCHANNEL_IS_OPEN 0x0002
2177 
2180 #define canCHANNEL_IS_CANFD 0x0004
2181 
2182 //#define canCHANNEL_IS_CANFD_NON_ISO 0x0008 Reserved for when needed
2183 
2186 #define canCHANNEL_IS_LIN 0x0010
2187 
2190 #define canCHANNEL_IS_LIN_MASTER 0x0020
2191 
2194 #define canCHANNEL_IS_LIN_SLAVE 0x0040
2195 
2196 
2215 #define canHWTYPE_NONE 0
2216 #define canHWTYPE_VIRTUAL 1
2217 #define canHWTYPE_LAPCAN 2
2218 #define canHWTYPE_CANPARI 3
2219 #define canHWTYPE_PCCAN 8
2220 #define canHWTYPE_PCICAN 9
2221 #define canHWTYPE_USBCAN 11
2222 #define canHWTYPE_PCICAN_II 40
2223 #define canHWTYPE_USBCAN_II 42
2224 #define canHWTYPE_SIMULATED 44
2225 #define canHWTYPE_ACQUISITOR 46
2226 #define canHWTYPE_LEAF 48
2227 #define canHWTYPE_PC104_PLUS 50
2228 #define canHWTYPE_PCICANX_II 52
2229 #define canHWTYPE_MEMORATOR_II 54
2230 #define canHWTYPE_MEMORATOR_PRO 54
2231 #define canHWTYPE_USBCAN_PRO 56
2232 #define canHWTYPE_IRIS 58
2233 #define canHWTYPE_BLACKBIRD 58
2234 #define canHWTYPE_MEMORATOR_LIGHT 60
2235 #define canHWTYPE_MINIHYDRA 62
2236 #define canHWTYPE_EAGLE 62
2237 #define canHWTYPE_BAGEL 64
2238 #define canHWTYPE_BLACKBIRD_V2 64
2239 #define canHWTYPE_MINIPCIE 66
2240 #define canHWTYPE_USBCAN_KLINE 68
2241 #define canHWTYPE_ETHERCAN 70
2242 #define canHWTYPE_USBCAN_LIGHT 72
2243 #define canHWTYPE_USBCAN_PRO2 74
2244 #define canHWTYPE_PCIE_V2 76
2245 #define canHWTYPE_MEMORATOR_PRO2 78
2246 #define canHWTYPE_LEAF2 80
2247 #define canHWTYPE_MEMORATOR_V2 82
2248 #define canHWTYPE_CANLINHYBRID 84
2249 #define canHWTYPE_DINRAIL 86
2250 
2251 
2260 #define canCHANNEL_CAP_EXTENDED_CAN 0x00000001L
2261 #define canCHANNEL_CAP_BUS_STATISTICS 0x00000002L
2262 #define canCHANNEL_CAP_ERROR_COUNTERS 0x00000004L
2263 #define canCHANNEL_CAP_RESERVED_2 0x00000008L
2264 #define canCHANNEL_CAP_GENERATE_ERROR 0x00000010L
2265 #define canCHANNEL_CAP_GENERATE_OVERLOAD 0x00000020L
2266 #define canCHANNEL_CAP_TXREQUEST 0x00000040L
2267 #define canCHANNEL_CAP_TXACKNOWLEDGE 0x00000080L
2268 #define canCHANNEL_CAP_VIRTUAL 0x00010000L
2269 #define canCHANNEL_CAP_SIMULATED 0x00020000L
2270 #define canCHANNEL_CAP_RESERVED_1 0x00040000L
2271 #define canCHANNEL_CAP_CAN_FD 0x00080000L
2272 #define canCHANNEL_CAP_CAN_FD_NONISO 0x00100000L
2273 #define canCHANNEL_CAP_SILENT_MODE 0x00200000L
2274 #define canCHANNEL_CAP_SINGLE_SHOT 0x00400000L
2275 #define canCHANNEL_CAP_LOGGER 0x00800000L
2276 #define canCHANNEL_CAP_REMOTE_ACCESS 0x01000000L
2277 #define canCHANNEL_CAP_SCRIPT 0x02000000L
2278 #define canCHANNEL_CAP_LIN_HYBRID 0x04000000L
2279 #define canCHANNEL_CAP_IO_API 0x08000000L
2280 #define canCHANNEL_CAP_DIAGNOSTICS 0x10000000L
2281 
2282 
2294 #define canCHANNEL_OPMODE_NONE 1
2295 
2299 #define canCHANNEL_OPMODE_INFRASTRUCTURE 2
2300 
2304 #define canCHANNEL_OPMODE_RESERVED 3
2305 
2309 #define canCHANNEL_OPMODE_ADHOC 4
2310 
2320 #define canDRIVER_CAP_HIGHSPEED 0x00000001L
2321 
2347 #define canIOCTL_PREFER_EXT 1
2348 
2361 #define canIOCTL_PREFER_STD 2
2362 
2379 #define canIOCTL_CLEAR_ERROR_COUNTERS 5
2380 
2395 #define canIOCTL_SET_TIMER_SCALE 6
2396 
2416 #define canIOCTL_SET_TXACK 7
2417 
2430 #define canIOCTL_GET_RX_BUFFER_LEVEL 8
2431 
2444 #define canIOCTL_GET_TX_BUFFER_LEVEL 9
2445 
2455 #define canIOCTL_FLUSH_RX_BUFFER 10
2456 
2466 #define canIOCTL_FLUSH_TX_BUFFER 11
2467 
2476 #define canIOCTL_GET_TIMER_SCALE 12
2477 
2493 #define canIOCTL_SET_TXRQ 13
2494 
2495 
2502 #define canIOCTL_SET_BYPASS_MODE 15
2503 
2509 #define canIOCTL_SET_WAKEUP 16
2510 
2520 # define canIOCTL_GET_DRIVERHANDLE 17
2521 
2527 # define canIOCTL_MAP_RXQUEUE 18
2528 
2534 # define canIOCTL_GET_WAKEUP 19
2535 
2547 # define canIOCTL_SET_REPORT_ACCESS_ERRORS 20
2548 
2556 # define canIOCTL_GET_REPORT_ACCESS_ERRORS 21
2557 
2567 # define canIOCTL_CONNECT_TO_VIRTUAL_BUS 22
2568 
2578 # define canIOCTL_DISCONNECT_FROM_VIRTUAL_BUS 23
2579 
2589 # define canIOCTL_SET_USER_IOPORT 24
2590 
2601 # define canIOCTL_GET_USER_IOPORT 25
2602 
2608 # define canIOCTL_SET_BUFFER_WRAPAROUND_MODE 26
2609 
2626 # define canIOCTL_SET_RX_QUEUE_SIZE 27
2627 
2633 # define canIOCTL_SET_USB_THROTTLE 28
2634 
2640 # define canIOCTL_GET_USB_THROTTLE 29
2641 
2656 # define canIOCTL_SET_BUSON_TIME_AUTO_RESET 30
2657 
2669 # define canIOCTL_GET_TXACK 31
2670 
2685 # define canIOCTL_SET_LOCAL_TXECHO 32
2686 
2702 # define canIOCTL_SET_ERROR_FRAMES_REPORTING 33
2703 
2717 # define canIOCTL_GET_CHANNEL_QUALITY 34
2718 
2730 # define canIOCTL_GET_ROUNDTRIP_TIME 35
2731 
2740 # define canIOCTL_GET_BUS_TYPE 36
2741 
2754 # define canIOCTL_GET_DEVNAME_ASCII 37
2755 
2767 # define canIOCTL_GET_TIME_SINCE_LAST_SEEN 38
2768 
2782 # define canIOCTL_GET_TREF_LIST 39
2783 
2805 # define canIOCTL_TX_INTERVAL 40
2806 
2818 # define canIOCTL_SET_BRLIMIT 43
2819 
2825 # define canIOCTL_SET_USB_THROTTLE_SCALED 41
2826 
2841 # define canIOCTL_SET_THROTTLE_SCALED 41
2842 
2848 # define canIOCTL_GET_USB_THROTTLE_SCALED 42
2849 
2864 # define canIOCTL_GET_THROTTLE_SCALED 42
2865 
2873 # define canIOCTL_RESET_OVERRUN_COUNT 44
2874 
2883 # define canIOCTL_LIN_MODE 45
2884 
2887 typedef struct {
2888  unsigned int portNo;
2889  unsigned int portValue;
2891 
2892 
2932 canStatus CANLIBAPI canSetBusParamsC200 (const CanHandle hnd, unsigned char btr0, unsigned char btr1);
2933 
2934 
2935 
2971 canStatus CANLIBAPI canSetDriverMode (const CanHandle hnd, int lineMode, int resNet);
2972 
3009 canStatus CANLIBAPI canGetDriverMode (const CanHandle hnd, int *lineMode, int *resNet);
3010 
3030 #define canVERSION_CANLIB32_VERSION 0
3031 
3042 #define canVERSION_CANLIB32_PRODVER 1
3043 
3055 #define canVERSION_CANLIB32_PRODVER32 2
3056 
3067 #define canVERSION_CANLIB32_BETA 3
3068 
3088 unsigned int CANLIBAPI canGetVersionEx (unsigned int itemCode);
3089 
3090 
3110 canStatus CANLIBAPI canObjBufFreeAll (const CanHandle hnd);
3111 
3132 canStatus CANLIBAPI canObjBufAllocate (const CanHandle hnd, int type);
3133 
3142 #define canOBJBUF_TYPE_AUTO_RESPONSE 0x01
3143 #define canOBJBUF_TYPE_PERIODIC_TX 0x02
3144 
3166 canStatus CANLIBAPI canObjBufFree (const CanHandle hnd, int idx);
3167 
3168 // Writes CAN data to the object buffer with the specified index.
3169 
3195 canStatus CANLIBAPI canObjBufWrite (const CanHandle hnd,
3196  int idx,
3197  int id,
3198  void* msg,
3199  unsigned int dlc,
3200  unsigned int flags);
3201 
3227 canStatus CANLIBAPI canObjBufSetFilter (const CanHandle hnd,
3228  int idx,
3229  unsigned int code,
3230  unsigned int mask);
3231 
3252 canStatus CANLIBAPI canObjBufSetFlags (const CanHandle hnd,
3253  int idx,
3254  unsigned int flags);
3255 
3273 # define canOBJBUF_AUTO_RESPONSE_RTR_ONLY 0x01
3274 
3296 canStatus CANLIBAPI canObjBufSetPeriod (const CanHandle hnd,
3297  int idx,
3298  unsigned int period);
3299 
3320 canStatus CANLIBAPI canObjBufSetMsgCount (const CanHandle hnd,
3321  int idx,
3322  unsigned int count);
3323 
3343 canStatus CANLIBAPI canObjBufEnable (const CanHandle hnd, int idx);
3344 
3364 canStatus CANLIBAPI canObjBufDisable (const CanHandle hnd, int idx);
3365 
3389 canStatus CANLIBAPI canObjBufSendBurst (const CanHandle hnd,
3390  int idx,
3391  unsigned int burstlen);
3392 
3393 
3416 canStatus CANLIBAPI canResetBus (const CanHandle hnd);
3417 
3456 canStatus CANLIBAPI canWriteWait (const CanHandle hnd,
3457  long id,
3458  void *msg,
3459  unsigned int dlc,
3460  unsigned int flag,
3461  unsigned long timeout);
3462 
3463 
3489 canStatus CANLIBAPI canUnloadLibrary (void);
3490 
3552 canStatus CANLIBAPI canSetAcceptanceFilter (const CanHandle hnd,
3553  unsigned int code,
3554  unsigned int mask,
3555  int is_extended);
3579 canStatus CANLIBAPI canFlushReceiveQueue (const CanHandle hnd);
3580 
3605 canStatus CANLIBAPI canFlushTransmitQueue (const CanHandle hnd);
3606 
3607 
3616 #define kvLED_ACTION_ALL_LEDS_ON 0
3617 #define kvLED_ACTION_ALL_LEDS_OFF 1
3618 #define kvLED_ACTION_LED_0_ON 2
3619 #define kvLED_ACTION_LED_0_OFF 3
3620 #define kvLED_ACTION_LED_1_ON 4
3621 #define kvLED_ACTION_LED_1_OFF 5
3622 #define kvLED_ACTION_LED_2_ON 6
3623 #define kvLED_ACTION_LED_2_OFF 7
3624 #define kvLED_ACTION_LED_3_ON 8
3625 #define kvLED_ACTION_LED_3_OFF 9
3626 #define kvLED_ACTION_LED_4_ON 10
3627 #define kvLED_ACTION_LED_4_OFF 11
3628 #define kvLED_ACTION_LED_5_ON 12
3629 #define kvLED_ACTION_LED_5_OFF 13
3630 #define kvLED_ACTION_LED_6_ON 14
3631 #define kvLED_ACTION_LED_6_OFF 15
3632 #define kvLED_ACTION_LED_7_ON 16
3633 #define kvLED_ACTION_LED_7_OFF 17
3634 #define kvLED_ACTION_LED_8_ON 18
3635 #define kvLED_ACTION_LED_8_OFF 19
3636 #define kvLED_ACTION_LED_9_ON 20
3637 #define kvLED_ACTION_LED_9_OFF 21
3638 #define kvLED_ACTION_LED_10_ON 22
3639 #define kvLED_ACTION_LED_10_OFF 23
3640 #define kvLED_ACTION_LED_11_ON 24
3641 #define kvLED_ACTION_LED_11_OFF 25
3642 
3643 
3666 canStatus CANLIBAPI kvFlashLeds (const CanHandle hnd, int action, int timeout);
3667 
3687 canStatus CANLIBAPI canRequestChipStatus (const CanHandle hnd);
3688 
3715 canStatus CANLIBAPI canRequestBusStatistics (const CanHandle hnd);
3716 
3722 typedef struct canBusStatistics_s {
3723  unsigned long stdData;
3724  unsigned long stdRemote;
3725  unsigned long extData;
3726  unsigned long extRemote;
3727  unsigned long errFrame;
3728 
3733  unsigned long busLoad;
3734  unsigned long overruns;
3736 
3759 canStatus CANLIBAPI canGetBusStatistics (const CanHandle hnd,
3760  canBusStatistics *stat,
3761  size_t bufsiz);
3762 
3763 
3785 canStatus CANLIBAPI canGetHandleData (const CanHandle hnd,
3786  int item,
3787  void *buffer,
3788  size_t bufsize);
3789 
3791 typedef void *kvTimeDomain;
3792 
3795 
3800 typedef struct kvTimeDomainData_s {
3806 
3835 kvStatus CANLIBAPI kvTimeDomainCreate (kvTimeDomain *domain);
3836 
3859 kvStatus CANLIBAPI kvTimeDomainDelete (kvTimeDomain domain);
3860 
3886 kvStatus CANLIBAPI kvTimeDomainResetTime (kvTimeDomain domain);
3887 
3912 kvStatus CANLIBAPI kvTimeDomainGetData (kvTimeDomain domain,
3913  kvTimeDomainData *data,
3914  size_t bufsiz);
3915 
3938 kvStatus CANLIBAPI kvTimeDomainAddHandle(kvTimeDomain domain,
3939  const CanHandle hnd);
3940 
3962 kvStatus CANLIBAPI kvTimeDomainRemoveHandle (kvTimeDomain domain,
3963  const CanHandle hnd);
3964 
3977 typedef void (CANLIBAPI *kvCallback_t) (CanHandle hnd, void* context, unsigned int notifyEvent);
3978 
4012 kvStatus CANLIBAPI kvSetNotifyCallback (const CanHandle hnd,
4013  kvCallback_t callback,
4014  void* context,
4015  unsigned int notifyFlags);
4016 
4030 #define kvBUSTYPE_NONE 0
4031 
4036 #define kvBUSTYPE_PCI 1
4037 
4042 #define kvBUSTYPE_PCMCIA 2
4043 
4048 #define kvBUSTYPE_USB 3
4049 
4054 #define kvBUSTYPE_WLAN 4
4055 
4060 #define kvBUSTYPE_PCI_EXPRESS 5
4061 
4066 #define kvBUSTYPE_ISA 6
4067 
4072 #define kvBUSTYPE_VIRTUAL 7
4073 
4078 #define kvBUSTYPE_PC104_PLUS 8
4079 
4084 #define kvBUSTYPE_LAN 9
4085 
4101 #define kvBUSTYPE_GROUP_VIRTUAL 1
4102 
4107 #define kvBUSTYPE_GROUP_LOCAL 2
4108 
4113 #define kvBUSTYPE_GROUP_REMOTE 3
4114 
4118 #define kvBUSTYPE_GROUP_INTERNAL 4
4119 
4173 kvStatus CANLIBAPI kvGetSupportedInterfaceInfo (int index,
4174  char *hwName,
4175  size_t nameLen,
4176  int *hwType,
4177  int *hwBusType);
4178 
4203 kvStatus CANLIBAPI kvReadDeviceCustomerData (const CanHandle hnd,
4204  int userNumber,
4205  int itemNumber,
4206  void *data,
4207  size_t bufsiz);
4208 
4222 #define kvENVVAR_TYPE_INT 1
4223 
4229 #define kvENVVAR_TYPE_FLOAT 2
4230 
4236 #define kvENVVAR_TYPE_STRING 3
4237 
4253 #define kvEVENT_TYPE_KEY 1
4254 
4262  typedef int64_t kvEnvHandle;
4263 
4283 kvStatus CANLIBAPI kvScriptStart (const CanHandle hnd, int slotNo);
4284 
4291 #define kvSCRIPT_STOP_NORMAL 0
4292 #define kvSCRIPT_STOP_FORCED -9
4316 kvStatus CANLIBAPI kvScriptStop (const CanHandle hnd, int slotNo, int mode);
4317 
4337 kvStatus CANLIBAPI kvScriptUnload (const CanHandle hnd, int slotNo);
4338 
4363 kvStatus CANLIBAPI kvScriptSendEvent (const CanHandle hnd,
4364  int slotNo,
4365  int eventType,
4366  int eventNo,
4367  unsigned int data);
4368 
4393 kvEnvHandle CANLIBAPI kvScriptEnvvarOpen (const CanHandle hnd,
4394  char* envvarName,
4395  int *envvarType,
4396  int *envvarSize); // returns scriptHandle
4397 
4415 kvStatus CANLIBAPI kvScriptEnvvarClose (kvEnvHandle eHnd);
4416 
4437 kvStatus CANLIBAPI kvScriptEnvvarSetInt (kvEnvHandle eHnd, int val);
4438 
4460 kvStatus CANLIBAPI kvScriptEnvvarGetInt (kvEnvHandle eHnd, int *val);
4461 
4484 kvStatus CANLIBAPI kvScriptEnvvarSetFloat (kvEnvHandle eHnd, float val);
4485 
4509 kvStatus CANLIBAPI kvScriptEnvvarGetFloat (kvEnvHandle eHnd, float *val);
4510 
4537 kvStatus CANLIBAPI kvScriptEnvvarSetData (kvEnvHandle eHnd,
4538  void *buf,
4539  int start_index,
4540  int data_len);
4541 
4567 kvStatus CANLIBAPI kvScriptEnvvarGetData (kvEnvHandle eHnd,
4568  void *buf,
4569  int start_index,
4570  int data_len);
4571 
4595 kvStatus CANLIBAPI kvScriptLoadFileOnDevice (const CanHandle hnd,
4596  int slotNo,
4597  char *localFile);
4598 
4627 kvStatus CANLIBAPI kvScriptLoadFile (const CanHandle hnd,
4628  int slotNo,
4629  char *filePathOnPC);
4630 
4631 
4645 #define kvSCRIPT_REQUEST_TEXT_UNSUBSCRIBE 1
4646 
4650 #define kvSCRIPT_REQUEST_TEXT_SUBSCRIBE 2
4651 
4655 #define kvSCRIPT_REQUEST_TEXT_ALL_SLOTS 255
4656 
4680 kvStatus CANLIBAPI kvScriptRequestText(const CanHandle hnd,
4681  unsigned int slot,
4682  unsigned int request);
4683 
4684 
4685 
4708 kvStatus CANLIBAPI kvScriptGetText(const CanHandle hnd,
4709  int *slot,
4710  unsigned long *time,
4711  unsigned int *flags,
4712  char *buf,
4713  size_t bufsize);
4714 
4721 #define kvSCRIPT_STATUS_LOADED 1
4722 #define kvSCRIPT_STATUS_RUNNING 2
4743 kvStatus CANLIBAPI kvScriptStatus(const CanHandle hnd,
4744  int slot,
4745  unsigned int *status);
4746 
4747 
4766 kvStatus CANLIBAPI kvScriptGetMaxEnvvarSize(int hnd, int *envvarSize);
4767 
4798 kvStatus CANLIBAPI kvScriptTxeGetData(const char *filePathOnPC,
4799  int item,
4800  void *buffer,
4801  unsigned int *bufsize);
4802 
4828 #define canTXEDATA_FILE_VERSION 1
4829 
4845 #define canTXEDATA_COMPILER_VERSION 2
4846 
4865 #define canTXEDATA_DATE 3
4866 
4877 #define canTXEDATA_DESCRIPTION 4
4878 
4892 #define canTXEDATA_SOURCE 5
4893 
4903 #define canTXEDATA_SIZE_OF_CODE 6
4904 
4914 #define canTXEDATA_IS_ENCRYPTED 7
4915 
4916 
4942 kvStatus CANLIBAPI kvFileCopyToDevice (const CanHandle hnd,
4943  char *hostFileName,
4944  char *deviceFileName);
4945 
4968 kvStatus CANLIBAPI kvFileCopyFromDevice (const CanHandle hnd,
4969  char *deviceFileName,
4970  char *hostFileName);
4971 
4993 kvStatus CANLIBAPI kvFileDelete (const CanHandle hnd, char *deviceFileName);
4994 
5017 kvStatus CANLIBAPI kvFileGetName (const CanHandle hnd,
5018  int fileNo,
5019  char *name,
5020  int namelen);
5021 
5041 kvStatus CANLIBAPI kvFileGetCount (const CanHandle hnd, int *count);
5042 
5065 kvStatus CANLIBAPI kvFileGetSystemData (const CanHandle hnd,
5066  int itemCode,
5067  int *result);
5068 
5087 kvStatus CANLIBAPI kvFileDiskFormat(const CanHandle hnd);
5088 
5106 #define kvDEVICE_MODE_INTERFACE 0x00
5107 
5112 #define kvDEVICE_MODE_LOGGER 0x01
5113 
5138 kvStatus CANLIBAPI kvDeviceSetMode (const CanHandle hnd, int mode);
5139 
5162 kvStatus CANLIBAPI kvDeviceGetMode (const CanHandle hnd, int *result);
5163 
5164 
5189 kvStatus CANLIBAPI kvReadTimer (const CanHandle hnd, unsigned int *time);
5213 kvStatus CANLIBAPI kvReadTimer64 (const CanHandle hnd, uint64_t *time);
5214 
5231 #define kvIO_INFO_GET_MODULE_TYPE 1
5232 
5238 #define kvIO_INFO_GET_DIRECTION 2
5239 
5245 #define kvIO_INFO_GET_PIN_TYPE 4
5246 
5252 #define kvIO_INFO_GET_NUMBER_OF_BITS 5
5253 
5261 #define kvIO_INFO_GET_RANGE_MIN 6
5262 
5270 #define kvIO_INFO_GET_RANGE_MAX 7
5271 
5279 #define kvIO_INFO_GET_DI_LOW_HIGH_FILTER 8
5280 
5288 #define kvIO_INFO_GET_DI_HIGH_LOW_FILTER 9
5289 
5297 #define kvIO_INFO_GET_AI_LP_FILTER_ORDER 10
5298 
5307 #define kvIO_INFO_GET_AI_HYSTERESIS 11
5308 
5314 #define kvIO_INFO_GET_MODULE_NUMBER 14
5315 
5321 #define kvIO_INFO_GET_SERIAL_NUMBER 15
5322 
5330 #define kvIO_INFO_GET_FW_VERSION 16
5331 
5352 #define kvIO_INFO_SET_DI_LOW_HIGH_FILTER 8
5353 
5361 #define kvIO_INFO_SET_DI_HIGH_LOW_FILTER 9
5362 
5370 #define kvIO_INFO_SET_AI_LP_FILTER_ORDER 10
5371 
5380 #define kvIO_INFO_SET_AI_HYSTERESIS 11
5381 
5398 #define kvIO_MODULE_TYPE_DIGITAL 1
5399 
5403 #define kvIO_MODULE_TYPE_ANALOG 2
5404 
5408 #define kvIO_MODULE_TYPE_RELAY 3
5409 
5413 #define kvIO_MODULE_TYPE_INTERNAL 4
5414 
5429 #define kvIO_PIN_TYPE_DIGITAL 1
5430 
5434 #define kvIO_PIN_TYPE_ANALOG 2
5435 
5439 #define kvIO_PIN_TYPE_RELAY 3
5440 
5455 #define kvIO_PIN_DIRECTION_IN 4
5456 
5460 #define kvIO_PIN_DIRECTION_OUT 8
5461 
5483 canStatus CANLIBAPI kvIoGetNumberOfPins (const CanHandle hnd, unsigned int *pinCount);
5484 
5501 canStatus CANLIBAPI kvIoConfirmConfig (const CanHandle hnd);
5502 
5522 canStatus CANLIBAPI kvIoPinGetInfo (const CanHandle hnd, unsigned int pin, int item, void *buffer, const unsigned int bufsize);
5523 
5543 canStatus CANLIBAPI kvIoPinSetInfo (const CanHandle hnd, unsigned int pin, int item, const void *buffer, const unsigned int bufsize);
5544 
5562 canStatus CANLIBAPI kvIoPinSetDigital (const CanHandle hnd, unsigned int pin, unsigned int value);
5563 
5583 canStatus CANLIBAPI kvIoPinGetDigital (const CanHandle hnd, unsigned int pin, unsigned int *value);
5584 
5606 canStatus CANLIBAPI kvIoPinGetOutputDigital (const CanHandle hnd, unsigned int pin, unsigned int *value);
5607 
5625 canStatus CANLIBAPI kvIoPinSetRelay (const CanHandle hnd, unsigned int pin, unsigned int value);
5626 
5646 canStatus CANLIBAPI kvIoPinGetOutputRelay (const CanHandle hnd, unsigned int pin, unsigned int *value);
5647 
5665 canStatus CANLIBAPI kvIoPinSetAnalog (const CanHandle hnd, unsigned int pin, float value);
5666 
5684 canStatus CANLIBAPI kvIoPinGetAnalog (const CanHandle hnd, unsigned int pin, float* value);
5685 
5705 canStatus CANLIBAPI kvIoPinGetOutputAnalog (const CanHandle hnd, unsigned int pin, float* value);
5706 
5712 typedef struct {
5713  int type;
5714  unsigned char DO1 : 1;
5715  unsigned char DO2 : 1;
5716  unsigned char DO3 : 1;
5717  unsigned char DO4 : 1;
5718  unsigned char DO5 : 1;
5719  unsigned char DO6 : 1;
5720  unsigned char DO7 : 1;
5721  unsigned char DO8 : 1;
5722  unsigned char DO9 : 1;
5723  unsigned char DO10: 1;
5724  unsigned char DO11: 1;
5725  unsigned char DO12: 1;
5726  unsigned char DO13: 1;
5727  unsigned char DO14: 1;
5728  unsigned char DO15: 1;
5729  unsigned char DO16: 1;
5730  unsigned char DI1 : 1;
5731  unsigned char DI2 : 1;
5732  unsigned char DI3 : 1;
5733  unsigned char DI4 : 1;
5734  unsigned char DI5 : 1;
5735  unsigned char DI6 : 1;
5736  unsigned char DI7 : 1;
5737  unsigned char DI8 : 1;
5738  unsigned char DI9 : 1;
5739  unsigned char DI10: 1;
5740  unsigned char DI11: 1;
5741  unsigned char DI12: 1;
5742  unsigned char DI13: 1;
5743  unsigned char DI14: 1;
5744  unsigned char DI15: 1;
5745  unsigned char DI16: 1;
5747 
5748 
5754 typedef struct {
5755  int type;
5756  unsigned char DO: 1;
5757  unsigned char DI: 1;
5759 
5760 
5767 typedef struct {
5768  int type;
5769  unsigned char RO1 : 1;
5770  unsigned char RO2 : 1;
5771  unsigned char RO3 : 1;
5772  unsigned char RO4 : 1;
5773  unsigned char RO5 : 1;
5774  unsigned char RO6 : 1;
5775  unsigned char RO7 : 1;
5776  unsigned char RO8 : 1;
5777  unsigned char DI1 : 1;
5778  unsigned char DI2 : 1;
5779  unsigned char DI3 : 1;
5780  unsigned char DI4 : 1;
5781  unsigned char DI5 : 1;
5782  unsigned char DI6 : 1;
5783  unsigned char DI7 : 1;
5784  unsigned char DI8 : 1;
5785 } kvIoModuleRelay;
5786 
5793 typedef struct {
5794  int type;
5795  float AO1;
5796  float AO2;
5797  float AO3;
5798  float AO4;
5799  float AI1;
5800  float AI2;
5801  float AI3;
5802  float AI4;
5804 
5805 
5823 canStatus CANLIBAPI kvIoGetModulePins (const CanHandle hnd, unsigned int module, void *buffer, const unsigned int bufsize);
5824 
5825 
5844 canStatus CANLIBAPI kvIoSetModulePins (const CanHandle hnd, unsigned int module, const void *buffer, const unsigned int bufsize);
5845 
5846 
5847 #ifdef __cplusplus
5848 }
5849 #endif /* __cplusplus */
5850 
5851 #include "obsolete.h"
5852 
5853 
5854 
5855 
5856 #endif /* _CANLIB_H_ */
Definitions which are retained for compatibility.
unsigned char DI10
Definition: canlib.h:5739
kvStatus kvScriptEnvvarGetFloat(kvEnvHandle eHnd, float *val)
unsigned long stdRemote
Number of received standard (11-bit identifiers) remote frames.
Definition: canlib.h:3724
unsigned char DI5
Definition: canlib.h:5734
canStatus canGetBusParamsFd(const CanHandle hnd, long *freq_brs, unsigned int *tseg1_brs, unsigned int *tseg2_brs, unsigned int *sjw_brs)
canStatus canWriteSync(const CanHandle hnd, unsigned long timeout)
unsigned char busStatus
Definition: canlib.h:178
unsigned char DI12
Definition: canlib.h:5741
unsigned char RO3
Definition: canlib.h:5771
canStatus canGetBusOutputControl(const CanHandle hnd, unsigned int *drivertype)
kvStatus kvTimeDomainDelete(kvTimeDomain domain)
float AI2
Definition: canlib.h:5800
unsigned char DI8
Definition: canlib.h:5737
canStatus canGetDriverMode(const CanHandle hnd, int *lineMode, int *resNet)
struct canNotifyData::@0::@2 rx
unsigned char DO15
Definition: canlib.h:5728
void canInitializeLibrary(void)
canStatus kvIoPinGetInfo(const CanHandle hnd, unsigned int pin, int item, void *buffer, const unsigned int bufsize)
unsigned char DO8
Definition: canlib.h:5721
canStatus canReadStatus(const CanHandle hnd, unsigned long *const flags)
kvStatus kvTimeDomainCreate(kvTimeDomain *domain)
unsigned char DI9
Definition: canlib.h:5738
unsigned int portNo
Port number used in e.g. canIOCTL_SET_USER_IOPORT.
Definition: canlib.h:2888
int64_t kvEnvHandle
Definition: canlib.h:4262
int nNonMagiSyncCards
number of non MagiSync™ interfaces
Definition: canlib.h:3803
unsigned char RO2
Definition: canlib.h:5770
canStatus kvIoGetNumberOfPins(const CanHandle hnd, unsigned int *pinCount)
kvStatus kvScriptEnvvarSetData(kvEnvHandle eHnd, void *buf, int start_index, int data_len)
canStatus canRequestBusStatistics(const CanHandle hnd)
kvStatus kvDeviceSetMode(const CanHandle hnd, int mode)
void * kvTimeDomain
Definition: canlib.h:3791
unsigned char DI7
Definition: canlib.h:5736
unsigned char DO
Definition: canlib.h:5756
unsigned char rxErrorCounter
Definition: canlib.h:180
unsigned char DO2
Definition: canlib.h:5715
unsigned long extRemote
Number of received extended (29-bit identifiers) remote frames.
Definition: canlib.h:3726
canStatus canClose(const CanHandle hnd)
unsigned char RO5
Definition: canlib.h:5773
struct canNotifyData canNotifyData
kvStatus kvFileGetCount(const CanHandle hnd, int *count)
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)
int type
Definition: canlib.h:5794
canStatus canObjBufSetMsgCount(const CanHandle hnd, int idx, unsigned int count)
canStatus kvFlashLeds(const CanHandle hnd, int action, int timeout)
canStatus canSetAcceptanceFilter(const CanHandle hnd, unsigned int code, unsigned int mask, int is_extended)
unsigned char DI13
Definition: canlib.h:5742
int canHandle
Definition: canlib.h:155
unsigned char DI14
Definition: canlib.h:5743
unsigned char DI1
Definition: canlib.h:5777
canStatus canObjBufDisable(const CanHandle hnd, int idx)
void * tag
Definition: canlib.h:163
unsigned char RO4
Definition: canlib.h:5772
canStatus canGetBusParams(const CanHandle hnd, long *freq, unsigned int *tseg1, unsigned int *tseg2, unsigned int *sjw, unsigned int *noSamp, unsigned int *syncmode)
float AI3
Definition: canlib.h:5801
kvStatus kvScriptEnvvarGetInt(kvEnvHandle eHnd, int *val)
Definitions for the CANLIB API.
kvStatus kvScriptGetMaxEnvvarSize(int hnd, int *envvarSize)
Definition: canlib.h:5767
Definition: canlib.h:5712
canStatus kvIoPinSetInfo(const CanHandle hnd, unsigned int pin, int item, const void *buffer, const unsigned int bufsize)
Definition: canlib.h:5793
canStatus canSetBusOutputControl(const CanHandle hnd, const unsigned int drivertype)
int type
Definition: canlib.h:5768
int type
Definition: canlib.h:5713
int eventType
Definition: canlib.h:164
float AO3
Definition: canlib.h:5797
canStatus kvIoPinSetRelay(const CanHandle hnd, unsigned int pin, unsigned int value)
canStatus kvIoPinGetDigital(const CanHandle hnd, unsigned int pin, unsigned int *value)
kvStatus kvFileGetSystemData(const CanHandle hnd, int itemCode, int *result)
int type
Definition: canlib.h:5755
kvStatus kvScriptEnvvarSetInt(kvEnvHandle eHnd, int val)
canStatus canObjBufSendBurst(const CanHandle hnd, int idx, unsigned int burstlen)
canStatus canGetRawHandle(const CanHandle hnd, void *pvFd)
canStatus kvIoPinGetOutputAnalog(const CanHandle hnd, unsigned int pin, float *value)
unsigned int canGetVersionEx(unsigned int itemCode)
unsigned char RO8
Definition: canlib.h:5776
canStatus canBusOn(const CanHandle hnd)
Definition: canlib.h:5754
long id
Definition: canlib.h:170
unsigned char DI
Definition: canlib.h:5757
canStatus canWriteWait(const CanHandle hnd, long id, void *msg, unsigned int dlc, unsigned int flag, unsigned long timeout)
canStatus kvIoSetModulePins(const CanHandle hnd, unsigned int module, const void *buffer, const unsigned int bufsize)
kvStatus kvReadDeviceCustomerData(const CanHandle hnd, int userNumber, int itemNumber, void *data, size_t bufsiz)
canStatus canWrite(const CanHandle hnd, long id, void *msg, unsigned int dlc, unsigned int flag)
unsigned char DI3
Definition: canlib.h:5779
canStatus canObjBufWrite(const CanHandle hnd, int idx, int id, void *msg, unsigned int dlc, unsigned int flags)
Definition: canlib.h:162
struct kvTimeDomainData_s kvTimeDomainData
kvStatus kvScriptTxeGetData(const char *filePathOnPC, int item, void *buffer, unsigned int *bufsize)
kvStatus kvScriptEnvvarClose(kvEnvHandle eHnd)
canStatus canFlushReceiveQueue(const CanHandle hnd)
canStatus kvIoGetModulePins(const CanHandle hnd, unsigned int module, void *buffer, const unsigned int bufsize)
kvStatus kvScriptLoadFile(const CanHandle hnd, int slotNo, char *filePathOnPC)
float AI4
Definition: canlib.h:5802
unsigned int portValue
Port value used in e.g. canIOCTL_SET_USER_IOPORT.
Definition: canlib.h:2889
unsigned short canGetVersion(void)
unsigned char DI1
Definition: canlib.h:5730
unsigned char DI2
Definition: canlib.h:5731
unsigned long errFrame
Number of error frames.
Definition: canlib.h:3727
canStatus kvIoPinSetAnalog(const CanHandle hnd, unsigned int pin, float value)
canStatus canReadWait(const CanHandle hnd, long *id, void *msg, unsigned int *dlc, unsigned int *flag, unsigned long *time, unsigned long timeout)
canStatus canReadSyncSpecific(const CanHandle hnd, long id, unsigned long timeout)
float AO4
Definition: canlib.h:5798
canStatus canFlushTransmitQueue(const CanHandle hnd)
kvStatus kvReadTimer64(const CanHandle hnd, uint64_t *time)
unsigned char DO10
Definition: canlib.h:5723
kvStatus kvFileGetName(const CanHandle hnd, int fileNo, char *name, int namelen)
kvStatus kvTimeDomainResetTime(kvTimeDomain domain)
unsigned char DO3
Definition: canlib.h:5716
kvStatus kvFileDelete(const CanHandle hnd, char *deviceFileName)
canStatus canAccept(const CanHandle hnd, const long envelope, const unsigned int flag)
CanHandle canOpenChannel(int channel, int flags)
kvStatus kvFileDiskFormat(const CanHandle hnd)
kvStatus kvScriptEnvvarSetFloat(kvEnvHandle eHnd, float val)
unsigned long extData
Number of received extended (29-bit identifiers) data frames.
Definition: canlib.h:3725
float AO1
Definition: canlib.h:5795
kvStatus kvReadTimer(const CanHandle hnd, unsigned int *time)
canStatus canObjBufEnable(const CanHandle hnd, int idx)
kvStatus kvScriptRequestText(const CanHandle hnd, unsigned int slot, unsigned int request)
kvStatus kvSetNotifyCallback(const CanHandle hnd, kvCallback_t callback, void *context, unsigned int notifyFlags)
unsigned char DO16
Definition: canlib.h:5729
kvStatus kvScriptSendEvent(const CanHandle hnd, int slotNo, int eventType, int eventNo, unsigned int data)
kvStatus kvTimeDomainGetData(kvTimeDomain domain, kvTimeDomainData *data, size_t bufsiz)
kvStatus kvScriptStart(const CanHandle hnd, int slotNo)
kvStatus kvTimeDomainRemoveHandle(kvTimeDomain domain, const CanHandle hnd)
unsigned char DO4
Definition: canlib.h:5717
unsigned char DI8
Definition: canlib.h:5784
unsigned char DI6
Definition: canlib.h:5735
canStatus canSetNotify(const CanHandle hnd, void(*callback)(canNotifyData *), unsigned int notifyFlags, void *tag)
unsigned char txErrorCounter
Definition: canlib.h:179
canStatus kvIoPinGetAnalog(const CanHandle hnd, unsigned int pin, float *value)
unsigned char DO1
Definition: canlib.h:5714
canStatus canObjBufSetFlags(const CanHandle hnd, int idx, unsigned int flags)
kvEnvHandle kvScriptEnvvarOpen(const CanHandle hnd, char *envvarName, int *envvarType, int *envvarSize)
unsigned char RO7
Definition: canlib.h:5775
unsigned char RO1
Definition: canlib.h:5769
unsigned char DI16
Definition: canlib.h:5745
unsigned char DI5
Definition: canlib.h:5781
void(* kvCallback_t)(CanHandle hnd, void *context, unsigned int notifyEvent)
Definition: canlib.h:3977
canStatus canSetBusParamsC200(const CanHandle hnd, unsigned char btr0, unsigned char btr1)
int nMagiSyncGroups
number of MagiSync™ groups
Definition: canlib.h:3801
canStatus canReadSpecificSkip(const CanHandle hnd, long id, void *msg, unsigned int *dlc, unsigned int *flag, unsigned long *time)
kvStatus kvScriptGetText(const CanHandle hnd, int *slot, unsigned long *time, unsigned int *flags, char *buf, size_t bufsize)
struct canBusStatistics_s canBusStatistics
canStatus canSetBusParamsFd(const CanHandle hnd, long freq_brs, unsigned int tseg1_brs, unsigned int tseg2_brs, unsigned int sjw_brs)
canStatus
Definition: canstat.h:84
kvStatus kvFileCopyFromDevice(const CanHandle hnd, char *deviceFileName, char *hostFileName)
unsigned char DI11
Definition: canlib.h:5740
kvStatus kvDeviceGetMode(const CanHandle hnd, int *result)
canStatus kvIoPinGetOutputDigital(const CanHandle hnd, unsigned int pin, unsigned int *value)
unsigned char RO6
Definition: canlib.h:5774
canStatus canReadErrorCounters(const CanHandle hnd, unsigned int *txErr, unsigned int *rxErr, unsigned int *ovErr)
canStatus kvIoConfirmConfig(const CanHandle hnd)
unsigned long stdData
Number of received standard (11-bit identifiers) data frames.
Definition: canlib.h:3723
canStatus canSetDriverMode(const CanHandle hnd, int lineMode, int resNet)
unsigned long overruns
The number of overruns detected by the hardware, firmware or driver.
Definition: canlib.h:3734
kvStatus kvTimeDomainAddHandle(kvTimeDomain domain, const CanHandle hnd)
Definition: canlib.h:3800
unsigned char DI3
Definition: canlib.h:5732
canStatus canReadTimer(const CanHandle hnd, unsigned long *time)
unsigned char DO7
Definition: canlib.h:5720
canStatus kvIoPinSetDigital(const CanHandle hnd, unsigned int pin, unsigned int value)
unsigned char DI4
Definition: canlib.h:5733
canStatus canGetBusStatistics(const CanHandle hnd, canBusStatistics *stat, size_t bufsiz)
canStatus canBusOff(const CanHandle hnd)
canStatus canReadSpecific(const CanHandle hnd, long id, void *msg, unsigned int *dlc, unsigned int *flag, unsigned long *time)
float AI1
Definition: canlib.h:5799
canStatus canGetErrorText(canStatus err, char *buf, unsigned int bufsiz)
unsigned long busLoad
Definition: canlib.h:3733
unsigned char DI7
Definition: canlib.h:5783
unsigned char DO13
Definition: canlib.h:5726
canStatus canRequestChipStatus(const CanHandle hnd)
Definition: canlib.h:3722
canStatus canEnumHardwareEx(int *channelCount)
unsigned char DI4
Definition: canlib.h:5780
kvStatus kvScriptLoadFileOnDevice(const CanHandle hnd, int slotNo, char *localFile)
canStatus canUnloadLibrary(void)
canStatus kvIoPinGetOutputRelay(const CanHandle hnd, unsigned int pin, unsigned int *value)
struct canNotifyData::@0::@1 busErr
canHandle CanHandle
Definition: canlib.h:160
canStatus kvStatus
Definition: canlib.h:3794
Definition: canlib.h:2887
union canNotifyData::@0 info
canStatus canResetBus(const CanHandle hnd)
canStatus canObjBufAllocate(const CanHandle hnd, int type)
unsigned char DI2
Definition: canlib.h:5778
int nNonMagiSyncedMembers
number of non MagiSync™ members
Definition: canlib.h:3804
unsigned char DO6
Definition: canlib.h:5719
canStatus canGetNumberOfChannels(int *channelCount)
canStatus canGetHandleData(const CanHandle hnd, int item, void *buffer, size_t bufsize)
kvStatus kvScriptEnvvarGetData(kvEnvHandle eHnd, void *buf, int start_index, int data_len)
unsigned char DO9
Definition: canlib.h:5722
unsigned char DO14
Definition: canlib.h:5727
unsigned long time
Definition: canlib.h:167
unsigned char DO5
Definition: canlib.h:5718
kvStatus kvFileCopyToDevice(const CanHandle hnd, char *hostFileName, char *deviceFileName)
canStatus canReadSync(const CanHandle hnd, unsigned long timeout)
float AO2
Definition: canlib.h:5796
kvStatus kvScriptUnload(const CanHandle hnd, int slotNo)
canStatus canObjBufSetPeriod(const CanHandle hnd, int idx, unsigned int period)
unsigned char DI6
Definition: canlib.h:5782
canStatus canObjBufFreeAll(const CanHandle hnd)
canStatus canIoCtl(const CanHandle hnd, unsigned int func, void *buf, unsigned int buflen)
unsigned char DI15
Definition: canlib.h:5744
struct canNotifyData::@0::@4 status
canStatus canSetBusParams(const CanHandle hnd, long freq, unsigned int tseg1, unsigned int tseg2, unsigned int sjw, unsigned int noSamp, unsigned int syncmode)
canStatus canObjBufSetFilter(const CanHandle hnd, int idx, unsigned int code, unsigned int mask)
struct canNotifyData::@0::@3 tx
unsigned char DO11
Definition: canlib.h:5724
kvStatus kvGetSupportedInterfaceInfo(int index, char *hwName, size_t nameLen, int *hwType, int *hwBusType)
canStatus canRead(const CanHandle hnd, long *id, void *msg, unsigned int *dlc, unsigned int *flag, unsigned long *time)
int nMagiSyncedMembers
number of MagiSync™ members
Definition: canlib.h:3802
unsigned char DO12
Definition: canlib.h:5725