canlib.h
Go to the documentation of this file.
1 /*
2  * Copyright 2023 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 
156 #ifndef _CANLIB_H_
157 #define _CANLIB_H_
158 
159 #include <stdlib.h>
160 
161 #include <stdint.h>
162 
163 #include "canstat.h"
164 
166 typedef int canHandle;
167 
168 #define canINVALID_HANDLE (-1)
169 
170 
172 
173 typedef struct canNotifyData {
174  void *tag;
176  union {
177  struct {
178  unsigned long time;
179  } busErr;
180  struct {
181  long id;
182  unsigned long time;
183  } rx;
184  struct {
185  long id;
186  unsigned long time;
187  } tx;
188  struct {
189  unsigned char busStatus;
190  unsigned char txErrorCounter;
191  unsigned char rxErrorCounter;
192  unsigned long time;
193  } status;
194  } info;
195 } canNotifyData;
196 
197 
207 // The canWANT_xxx names are also obsolete, use canOPEN_xxx instead for new developments.
208 #define canWANT_EXCLUSIVE 0x0008
209 #define canWANT_EXTENDED 0x0010
210 #define canWANT_VIRTUAL 0x0020
211 
224 #define canOPEN_EXCLUSIVE 0x0008
225 
237 #define canOPEN_REQUIRE_EXTENDED 0x0010
238 
246 #define canOPEN_ACCEPT_VIRTUAL 0x0020
247 
256 #define canOPEN_OVERRIDE_EXCLUSIVE 0x0040
257 
274 #define canOPEN_REQUIRE_INIT_ACCESS 0x0080
275 
287 #define canOPEN_NO_INIT_ACCESS 0x0100
288 
300 #define canOPEN_ACCEPT_LARGE_DLC 0x0200 // DLC can be greater than 8
301 
308 #define canOPEN_CAN_FD 0x0400
309 
323 #define canOPEN_CAN_FD_NONISO 0x0800
324 
325 
329 #define canOPEN_INTERNAL_L 0x1000
330 
342 #define canFILTER_ACCEPT 1
343 #define canFILTER_REJECT 2
344 
345 #define canFILTER_SET_CODE_STD 3
346 
347 #define canFILTER_SET_MASK_STD 4
348 
349 #define canFILTER_SET_CODE_EXT 5
350 
351 #define canFILTER_SET_MASK_EXT 6
352 
353 #define canFILTER_NULL_MASK 0L
354 
370 #define canDRIVER_NORMAL 4
371 
378 #define canDRIVER_SILENT 1
379 
383 #define canDRIVER_SELFRECEPTION 8
384 
388 #define canDRIVER_OFF 0
389 
412 #define canBITRATE_1M (-1)
413 
414 #define canBITRATE_500K (-2)
415 
416 #define canBITRATE_250K (-3)
417 
418 #define canBITRATE_125K (-4)
419 
420 #define canBITRATE_100K (-5)
421 
422 #define canBITRATE_62K (-6)
423 
424 #define canBITRATE_50K (-7)
425 
426 #define canBITRATE_83K (-8)
427 
428 #define canBITRATE_10K (-9)
429 
430 // CAN FD Bit Rates
434 #define canFD_BITRATE_500K_80P (-1000)
435 
438 #define canFD_BITRATE_1M_80P (-1001)
439 
442 #define canFD_BITRATE_2M_80P (-1002)
443 
446 #define canFD_BITRATE_2M_60P (-1007)
447 
450 #define canFD_BITRATE_4M_80P (-1003)
451 
454 #define canFD_BITRATE_8M_60P (-1004)
455 
458 #define canFD_BITRATE_8M_80P (-1005)
459 
462 #define canFD_BITRATE_8M_70P (-1006)
463 
465 #define BAUD_1M (-1)
466 
467 #define BAUD_500K (-2)
468 
469 #define BAUD_250K (-3)
470 
471 #define BAUD_125K (-4)
472 
473 #define BAUD_100K (-5)
474 
475 #define BAUD_62K (-6)
476 
477 #define BAUD_50K (-7)
478 
479 #define BAUD_83K (-8)
480 
483 //
484 // Define CANLIBAPI unless it's done already.
485 // (canlib.c provides its own definitions of CANLIBAPI, DLLIMPORT
486 // and DLLEXPORT before including this file.)
487 //
488 #ifndef CANLIBAPI
489 #define CANLIBAPI
490 #endif /* CANLIBAPI */
491 
492 
493 #ifdef __cplusplus
494 extern "C" {
495 #endif /* __cplusplus */
496 
518 void CANLIBAPI canInitializeLibrary(void);
519 
541 canStatus CANLIBAPI canEnumHardwareEx(int *channelCount);
542 
567 canStatus CANLIBAPI canClose(const CanHandle hnd);
568 
593 canStatus CANLIBAPI canBusOn(const CanHandle hnd);
594 
615 canStatus CANLIBAPI canBusOff(const CanHandle hnd);
616 
666 canStatus CANLIBAPI canSetBusParams(const CanHandle hnd,
667  long freq,
668  unsigned int tseg1,
669  unsigned int tseg2,
670  unsigned int sjw,
671  unsigned int noSamp,
672  unsigned int syncmode);
673 
703 typedef struct kvBusParamsTq {
704  int tq;
705  int phase1;
706  int phase2;
707  int sjw;
708  int prop;
709  int prescaler;
710 } kvBusParamsTq;
711 
737  canStatus CANLIBAPI canSetBusParamsTq(const CanHandle hnd,
738  const kvBusParamsTq nominal);
739 
773 canStatus CANLIBAPI canSetBusParamsFd(const CanHandle hnd,
774  long freq_brs,
775  unsigned int tseg1_brs,
776  unsigned int tseg2_brs,
777  unsigned int sjw_brs);
778 
805 canStatus CANLIBAPI canSetBusParamsFdTq(const CanHandle hnd,
806  const kvBusParamsTq arbitration,
807  const kvBusParamsTq data);
808 
809 
841 canStatus CANLIBAPI canGetBusParams(const CanHandle hnd,
842  long *freq,
843  unsigned int *tseg1,
844  unsigned int *tseg2,
845  unsigned int *sjw,
846  unsigned int *noSamp,
847  unsigned int *syncmode);
848 
868 canStatus CANLIBAPI canGetBusParamsTq(const CanHandle hnd,
869  kvBusParamsTq *nominal);
870 
893 canStatus CANLIBAPI canGetBusParamsFd(const CanHandle hnd,
894  long *freq_brs,
895  unsigned int *tseg1_brs,
896  unsigned int *tseg2_brs,
897  unsigned int *sjw_brs);
898 
919 canStatus CANLIBAPI canGetBusParamsFdTq(const CanHandle hnd,
920  kvBusParamsTq *nominal,
921  kvBusParamsTq *data);
922 
947 canStatus CANLIBAPI canSetBusOutputControl(const CanHandle hnd,
948  const unsigned int drivertype);
949 
984 canStatus CANLIBAPI canGetBusOutputControl(const CanHandle hnd,
985  unsigned int *drivertype);
986 
1029 canStatus CANLIBAPI canAccept(const CanHandle hnd,
1030  const long envelope,
1031  const unsigned int flag);
1032 
1056 canStatus CANLIBAPI canReadStatus(const CanHandle hnd,
1057  unsigned long *const flags);
1058 
1095 canStatus CANLIBAPI canReadErrorCounters(const CanHandle hnd,
1096  unsigned int *txErr,
1097  unsigned int *rxErr,
1098  unsigned int *ovErr);
1099 
1141 canStatus CANLIBAPI canWrite(const CanHandle hnd,
1142  long id,
1143  void *msg,
1144  unsigned int dlc,
1145  unsigned int flag);
1146 
1174 canStatus CANLIBAPI canWriteSync(const CanHandle hnd, unsigned long timeout);
1175 
1229 canStatus CANLIBAPI canRead(const CanHandle hnd,
1230  long *id,
1231  void *msg,
1232  unsigned int *dlc,
1233  unsigned int *flag,
1234  unsigned long *time);
1287 canStatus CANLIBAPI canReadWait(const CanHandle hnd,
1288  long *id,
1289  void *msg,
1290  unsigned int *dlc,
1291  unsigned int *flag,
1292  unsigned long *time,
1293  unsigned long timeout);
1294 
1346 canStatus CANLIBAPI canReadSpecific(const CanHandle hnd, long id, void *msg,
1347  unsigned int *dlc, unsigned int *flag,
1348  unsigned long *time);
1349 
1380 canStatus CANLIBAPI canReadSync(const CanHandle hnd, unsigned long timeout);
1381 
1413 canStatus CANLIBAPI canReadSyncSpecific(const CanHandle hnd,
1414  long id,
1415  unsigned long timeout);
1416 
1462 canStatus CANLIBAPI canReadSpecificSkip(const CanHandle hnd,
1463  long id,
1464  void *msg,
1465  unsigned int *dlc,
1466  unsigned int *flag,
1467  unsigned long *time);
1468 
1489 canStatus CANLIBAPI canSetNotify(const CanHandle hnd,
1490  void (*callback)(canNotifyData *),
1491  unsigned int notifyFlags,
1492  void *tag);
1493 
1507 canStatus CANLIBAPI canGetRawHandle(const CanHandle hnd, void *pvFd);
1508 
1543 canStatus CANLIBAPI canTranslateBaud(long *const freq,
1544  unsigned int *const tseg1,
1545  unsigned int *const tseg2,
1546  unsigned int *const sjw,
1547  unsigned int *const nosamp,
1548  unsigned int *const syncMode);
1549 
1572 canStatus CANLIBAPI kvBitrateToBusParamsTq(const canHandle hnd,
1573  int freq,
1574  kvBusParamsTq *nominal);
1575 
1601 canStatus CANLIBAPI kvBitrateToBusParamsFdTq(const canHandle hnd,
1602  int freqA,
1603  int freqD,
1604  kvBusParamsTq *arbitration,
1605  kvBusParamsTq *data);
1606 
1629 canStatus CANLIBAPI canGetErrorText(canStatus err, char *buf, unsigned int bufsiz);
1630 
1660 unsigned short CANLIBAPI canGetVersion(void);
1661 
1690 canStatus CANLIBAPI canIoCtl(const CanHandle hnd,
1691  unsigned int func,
1692  void *buf,
1693  unsigned int buflen);
1694 
1695 
1701 canStatus CANLIBAPI canReadTimer(const CanHandle hnd, unsigned long *time);
1702 
1753 CanHandle CANLIBAPI canOpenChannel(int channel, int flags);
1754 
1775 canStatus CANLIBAPI canGetNumberOfChannels(int *channelCount);
1776 
1777 
1785 #define kvREMOTE_TYPE_NOT_REMOTE 0
1786 #define kvREMOTE_TYPE_WLAN 1
1787 #define kvREMOTE_TYPE_LAN 2
1788 
1797 #define kvLOGGER_TYPE_NOT_A_LOGGER 0
1798 #define kvLOGGER_TYPE_V1 1
1799 #define kvLOGGER_TYPE_V2 2
1800 
1833 canStatus CANLIBAPI canGetChannelData(int channel,
1834  int item,
1835  void *buffer,
1836  size_t bufsize);
1837 
1856 #define canCHANNELDATA_CHANNEL_CAP 1
1857 
1867 #define canCHANNELDATA_TRANS_CAP 2
1868 
1877 #define canCHANNELDATA_CHANNEL_FLAGS 3 // available, etc
1878 
1887 #define canCHANNELDATA_CARD_TYPE 4
1888 
1898 #define canCHANNELDATA_CARD_NUMBER 5
1899 
1907 #define canCHANNELDATA_CHAN_NO_ON_CARD 6
1908 
1918 #define canCHANNELDATA_CARD_SERIAL_NO 7
1919 
1929 #define canCHANNELDATA_TRANS_SERIAL_NO 8
1930 
1941 #define canCHANNELDATA_CARD_FIRMWARE_REV 9
1942 
1953 #define canCHANNELDATA_CARD_HARDWARE_REV 10
1954 
1964 #define canCHANNELDATA_CARD_UPC_NO 11
1965 
1976 #define canCHANNELDATA_TRANS_UPC_NO 12
1977 
1995 #define canCHANNELDATA_CHANNEL_NAME 13
1996 
2012 #define canCHANNELDATA_DLL_FILE_VERSION 14
2013 
2029 #define canCHANNELDATA_DLL_PRODUCT_VERSION 15
2030 
2046 #define canCHANNELDATA_DLL_FILETYPE 16
2047 
2056 #define canCHANNELDATA_TRANS_TYPE 17
2057 
2081 #define canCHANNELDATA_DEVICE_PHYSICAL_POSITION 18
2082 
2095 #define canCHANNELDATA_UI_NUMBER 19
2096 
2120 #define canCHANNELDATA_TIMESYNC_ENABLED 20
2121 
2136 #define canCHANNELDATA_DRIVER_FILE_VERSION 21
2137 
2152 #define canCHANNELDATA_DRIVER_PRODUCT_VERSION 22
2153 
2162 #define canCHANNELDATA_MFGNAME_UNICODE 23
2163 
2171 #define canCHANNELDATA_MFGNAME_ASCII 24
2172 
2181 #define canCHANNELDATA_DEVDESCR_UNICODE 25
2182 
2190 #define canCHANNELDATA_DEVDESCR_ASCII 26
2191 
2202 #define canCHANNELDATA_DRIVER_NAME 27
2203 
2216 #define canCHANNELDATA_CHANNEL_QUALITY 28
2217 
2226 #define canCHANNELDATA_ROUNDTRIP_TIME 29
2227 
2236 #define canCHANNELDATA_BUS_TYPE 30
2237 
2250 #define canCHANNELDATA_DEVNAME_ASCII 31
2251 
2262 #define canCHANNELDATA_TIME_SINCE_LAST_SEEN 32
2263 
2273 #define canCHANNELDATA_REMOTE_OPERATIONAL_MODE 33
2274 
2283 #define canCHANNELDATA_REMOTE_PROFILE_NAME 34
2284 
2293 #define canCHANNELDATA_REMOTE_HOST_NAME 35
2294 
2303 #define canCHANNELDATA_REMOTE_MAC 36
2304 
2313 #define canCHANNELDATA_MAX_BITRATE 37
2314 
2325 #define canCHANNELDATA_CHANNEL_CAP_MASK 38
2326 
2338 #define canCHANNELDATA_CUST_CHANNEL_NAME 39
2339 
2349 #define canCHANNELDATA_IS_REMOTE 40
2350 
2359 #define canCHANNELDATA_REMOTE_TYPE 41
2360 
2369 #define canCHANNELDATA_LOGGER_TYPE 42
2370 
2380 #define canCHANNELDATA_HW_STATUS 43
2381 
2391 #define canCHANNELDATA_FEATURE_EAN 44
2392 
2399 #define canCHANNELDATA_BUS_PARAM_LIMITS 45
2400 
2407 #define canCHANNELDATA_CLOCK_INFO 46
2408 
2429 #define canCHANNELDATA_CHANNEL_CAP_EX 47
2430 
2443 typedef struct kvClockInfo {
2444  int version;
2449 }kvClockInfo;
2450 
2465 typedef struct kvBusParamLimits {
2466  int version;
2472 
2483 #define canCHANNEL_IS_EXCLUSIVE 0x0001
2484 
2486 #define canCHANNEL_IS_OPEN 0x0002
2487 
2490 #define canCHANNEL_IS_CANFD 0x0004
2491 
2492 //#define canCHANNEL_IS_CANFD_NON_ISO 0x0008 Reserved for when needed
2493 
2496 #define canCHANNEL_IS_LIN 0x0010
2497 
2500 #define canCHANNEL_IS_LIN_MASTER 0x0020
2501 
2504 #define canCHANNEL_IS_LIN_SLAVE 0x0040
2505 
2506 
2525 #define canHWTYPE_NONE 0
2526 #define canHWTYPE_VIRTUAL 1
2527 #define canHWTYPE_LAPCAN 2
2528 #define canHWTYPE_CANPARI 3
2529 #define canHWTYPE_PCCAN 8
2530 #define canHWTYPE_PCICAN 9
2531 #define canHWTYPE_USBCAN 11
2532 #define canHWTYPE_PCICAN_II 40
2533 #define canHWTYPE_USBCAN_II 42
2534 #define canHWTYPE_SIMULATED 44
2535 #define canHWTYPE_ACQUISITOR 46
2536 #define canHWTYPE_LEAF 48
2537 #define canHWTYPE_PC104_PLUS 50
2538 #define canHWTYPE_PCICANX_II 52
2539 #define canHWTYPE_MEMORATOR_II 54
2540 #define canHWTYPE_MEMORATOR_PRO 54
2541 #define canHWTYPE_USBCAN_PRO 56
2542 #define canHWTYPE_IRIS 58
2543 #define canHWTYPE_BLACKBIRD 58
2544 #define canHWTYPE_MEMORATOR_LIGHT 60
2545 #define canHWTYPE_MINIHYDRA 62
2546 #define canHWTYPE_EAGLE 62
2547 #define canHWTYPE_BAGEL 64
2548 #define canHWTYPE_BLACKBIRD_V2 64
2549 #define canHWTYPE_MINIPCIE 66
2550 #define canHWTYPE_USBCAN_KLINE 68
2551 #define canHWTYPE_ETHERCAN 70
2552 #define canHWTYPE_USBCAN_LIGHT 72
2553 #define canHWTYPE_USBCAN_PRO2 74
2554 #define canHWTYPE_PCIE_V2 76
2555 #define canHWTYPE_MEMORATOR_PRO2 78
2556 #define canHWTYPE_LEAF2 80
2557 #define canHWTYPE_MEMORATOR_V2 82
2558 #define canHWTYPE_CANLINHYBRID 84
2559 #define canHWTYPE_DINRAIL 86
2560 #define canHWTYPE_U100 88
2561 #define canHWTYPE_LEAF3 90
2562 
2563 
2571 #define canCHANNEL_CAP_EXTENDED_CAN 0x00000001L
2572 #define canCHANNEL_CAP_BUS_STATISTICS 0x00000002L
2573 #define canCHANNEL_CAP_ERROR_COUNTERS 0x00000004L
2574 #define canCHANNEL_CAP_RESERVED_2 0x00000008L
2575 #define canCHANNEL_CAP_GENERATE_ERROR 0x00000010L
2576 #define canCHANNEL_CAP_GENERATE_OVERLOAD 0x00000020L
2577 #define canCHANNEL_CAP_TXREQUEST 0x00000040L
2578 #define canCHANNEL_CAP_TXACKNOWLEDGE 0x00000080L
2579 #define canCHANNEL_CAP_VIRTUAL 0x00010000L
2580 #define canCHANNEL_CAP_SIMULATED 0x00020000L
2581 #define canCHANNEL_CAP_RESERVED_1 0x00040000L
2582 #define canCHANNEL_CAP_CAN_FD 0x00080000L
2583 #define canCHANNEL_CAP_CAN_FD_NONISO 0x00100000L
2584 #define canCHANNEL_CAP_SILENT_MODE 0x00200000L
2585 #define canCHANNEL_CAP_SINGLE_SHOT 0x00400000L
2586 #define canCHANNEL_CAP_LOGGER 0x00800000L
2587 #define canCHANNEL_CAP_REMOTE_ACCESS 0x01000000L
2588 #define canCHANNEL_CAP_SCRIPT 0x02000000L
2589 #define canCHANNEL_CAP_LIN_HYBRID 0x04000000L
2590 #define canCHANNEL_CAP_IO_API 0x08000000L
2591 #define canCHANNEL_CAP_CANTEGRITY 0x10000000L
2592 
2593 
2604 #define canCHANNEL_CAP_EX_BUSPARAMS_TQ 0x0000000000000001L
2606 #define canCHANNEL_CAP_EX_ERRORFRAME_DATA 0x0000000000000002L
2608 #define canCHANNEL_CAP_EX_CAN 0x0000000000000004L
2610 #define canCHANNEL_CAP_EX_LIN 0x0000000000000008L
2612 
2626 #define canCHANNEL_OPMODE_NONE 1
2627 
2631 #define canCHANNEL_OPMODE_INFRASTRUCTURE 2
2632 
2636 #define canCHANNEL_OPMODE_RESERVED 3
2637 
2641 #define canCHANNEL_OPMODE_ADHOC 4
2642 
2652 #define canDRIVER_CAP_HIGHSPEED 0x00000001L
2653 
2679 #define canIOCTL_PREFER_EXT 1
2680 
2693 #define canIOCTL_PREFER_STD 2
2694 
2711 #define canIOCTL_CLEAR_ERROR_COUNTERS 5
2712 
2726 #define canIOCTL_SET_TIMER_SCALE 6
2727 
2747 #define canIOCTL_SET_TXACK 7
2748 
2761 #define canIOCTL_GET_RX_BUFFER_LEVEL 8
2762 
2775 #define canIOCTL_GET_TX_BUFFER_LEVEL 9
2776 
2786 #define canIOCTL_FLUSH_RX_BUFFER 10
2787 
2797 #define canIOCTL_FLUSH_TX_BUFFER 11
2798 
2807 #define canIOCTL_GET_TIMER_SCALE 12
2808 
2824 #define canIOCTL_SET_TXRQ 13
2825 
2826 
2833 #define canIOCTL_SET_BYPASS_MODE 15
2834 
2840 #define canIOCTL_SET_WAKEUP 16
2841 
2851 #define canIOCTL_GET_DRIVERHANDLE 17
2852 
2858 #define canIOCTL_MAP_RXQUEUE 18
2859 
2865 #define canIOCTL_GET_WAKEUP 19
2866 
2878 #define canIOCTL_SET_REPORT_ACCESS_ERRORS 20
2879 
2887 #define canIOCTL_GET_REPORT_ACCESS_ERRORS 21
2888 
2898 #define canIOCTL_CONNECT_TO_VIRTUAL_BUS 22
2899 
2909 #define canIOCTL_DISCONNECT_FROM_VIRTUAL_BUS 23
2910 
2920 #define canIOCTL_SET_USER_IOPORT 24
2921 
2932 #define canIOCTL_GET_USER_IOPORT 25
2933 
2939 #define canIOCTL_SET_BUFFER_WRAPAROUND_MODE 26
2940 
2957 #define canIOCTL_SET_RX_QUEUE_SIZE 27
2958 
2964 #define canIOCTL_SET_USB_THROTTLE 28
2965 
2971 #define canIOCTL_GET_USB_THROTTLE 29
2972 
2987 #define canIOCTL_SET_BUSON_TIME_AUTO_RESET 30
2988 
3000 #define canIOCTL_GET_TXACK 31
3001 
3016 #define canIOCTL_SET_LOCAL_TXECHO 32
3017 
3033 #define canIOCTL_SET_ERROR_FRAMES_REPORTING 33
3034 
3048 #define canIOCTL_GET_CHANNEL_QUALITY 34
3049 
3061 #define canIOCTL_GET_ROUNDTRIP_TIME 35
3062 
3071 #define canIOCTL_GET_BUS_TYPE 36
3072 
3085 #define canIOCTL_GET_DEVNAME_ASCII 37
3086 
3098 #define canIOCTL_GET_TIME_SINCE_LAST_SEEN 38
3099 
3113 #define canIOCTL_GET_TREF_LIST 39
3114 
3136 #define canIOCTL_TX_INTERVAL 40
3137 
3149 #define canIOCTL_SET_BRLIMIT 43
3150 
3156 #define canIOCTL_SET_USB_THROTTLE_SCALED 41
3157 
3172 #define canIOCTL_SET_THROTTLE_SCALED 41
3173 
3179 #define canIOCTL_GET_USB_THROTTLE_SCALED 42
3180 
3195 #define canIOCTL_GET_THROTTLE_SCALED 42
3196 
3204 #define canIOCTL_RESET_OVERRUN_COUNT 44
3205 
3214 #define canIOCTL_LIN_MODE 45
3215 
3216 
3234 #define canIOCTL_SET_LOCAL_TXACK 46
3235 
3247 #define canIOCTL_SET_NATIVE_TICK_RESOLUTION 47
3248 
3256 #define canIOCTL_GET_NATIVE_TICK_RESOLUTION 48
3257 
3260 typedef struct {
3261  unsigned int portNo;
3262  unsigned int portValue;
3264 
3265 
3306 canStatus CANLIBAPI canSetBusParamsC200(const CanHandle hnd, unsigned char btr0, unsigned char btr1);
3307 
3308 
3309 
3345 canStatus CANLIBAPI canSetDriverMode(const CanHandle hnd, int lineMode, int resNet);
3346 
3383 canStatus CANLIBAPI canGetDriverMode(const CanHandle hnd, int *lineMode, int *resNet);
3384 
3404 #define canVERSION_CANLIB32_VERSION 0
3405 
3416 #define canVERSION_CANLIB32_PRODVER 1
3417 
3429 #define canVERSION_CANLIB32_PRODVER32 2
3430 
3441 #define canVERSION_CANLIB32_BETA 3
3442 
3443 
3464 unsigned int CANLIBAPI canGetVersionEx(unsigned int itemCode);
3465 
3466 
3486 canStatus CANLIBAPI canObjBufFreeAll(const CanHandle hnd);
3487 
3508 canStatus CANLIBAPI canObjBufAllocate(const CanHandle hnd, int type);
3509 
3518 #define canOBJBUF_TYPE_AUTO_RESPONSE 0x01
3519 #define canOBJBUF_TYPE_PERIODIC_TX 0x02
3520 
3542 canStatus CANLIBAPI canObjBufFree(const CanHandle hnd, int idx);
3543 
3544 // Writes CAN data to the object buffer with the specified index.
3545 
3571 canStatus CANLIBAPI canObjBufWrite(const CanHandle hnd,
3572  int idx,
3573  int id,
3574  void *msg,
3575  unsigned int dlc,
3576  unsigned int flags);
3577 
3603 canStatus CANLIBAPI canObjBufSetFilter(const CanHandle hnd,
3604  int idx,
3605  unsigned int code,
3606  unsigned int mask);
3607 
3628 canStatus CANLIBAPI canObjBufSetFlags(const CanHandle hnd,
3629  int idx,
3630  unsigned int flags);
3631 
3649 #define canOBJBUF_AUTO_RESPONSE_RTR_ONLY 0x01
3650 
3672 canStatus CANLIBAPI canObjBufSetPeriod(const CanHandle hnd,
3673  int idx,
3674  unsigned int period);
3675 
3696 canStatus CANLIBAPI canObjBufSetMsgCount(const CanHandle hnd,
3697  int idx,
3698  unsigned int count);
3699 
3719 canStatus CANLIBAPI canObjBufEnable(const CanHandle hnd, int idx);
3720 
3740 canStatus CANLIBAPI canObjBufDisable(const CanHandle hnd, int idx);
3741 
3765 canStatus CANLIBAPI canObjBufSendBurst(const CanHandle hnd,
3766  int idx,
3767  unsigned int burstlen);
3768 
3769 
3792 canStatus CANLIBAPI canResetBus(const CanHandle hnd);
3793 
3834 canStatus CANLIBAPI canWriteWait(const CanHandle hnd,
3835  long id,
3836  void *msg,
3837  unsigned int dlc,
3838  unsigned int flag,
3839  unsigned long timeout);
3840 
3841 
3867 canStatus CANLIBAPI canUnloadLibrary(void);
3868 
3930 canStatus CANLIBAPI canSetAcceptanceFilter(const CanHandle hnd,
3931  unsigned int code,
3932  unsigned int mask,
3933  int is_extended);
3957 canStatus CANLIBAPI canFlushReceiveQueue(const CanHandle hnd);
3958 
3983 canStatus CANLIBAPI canFlushTransmitQueue(const CanHandle hnd);
3984 
3985 
3994 #define kvLED_ACTION_ALL_LEDS_ON 0
3995 #define kvLED_ACTION_ALL_LEDS_OFF 1
3996 #define kvLED_ACTION_LED_0_ON 2
3997 #define kvLED_ACTION_LED_0_OFF 3
3998 #define kvLED_ACTION_LED_1_ON 4
3999 #define kvLED_ACTION_LED_1_OFF 5
4000 #define kvLED_ACTION_LED_2_ON 6
4001 #define kvLED_ACTION_LED_2_OFF 7
4002 #define kvLED_ACTION_LED_3_ON 8
4003 #define kvLED_ACTION_LED_3_OFF 9
4004 #define kvLED_ACTION_LED_4_ON 10
4005 #define kvLED_ACTION_LED_4_OFF 11
4006 #define kvLED_ACTION_LED_5_ON 12
4007 #define kvLED_ACTION_LED_5_OFF 13
4008 #define kvLED_ACTION_LED_6_ON 14
4009 #define kvLED_ACTION_LED_6_OFF 15
4010 #define kvLED_ACTION_LED_7_ON 16
4011 #define kvLED_ACTION_LED_7_OFF 17
4012 #define kvLED_ACTION_LED_8_ON 18
4013 #define kvLED_ACTION_LED_8_OFF 19
4014 #define kvLED_ACTION_LED_9_ON 20
4015 #define kvLED_ACTION_LED_9_OFF 21
4016 #define kvLED_ACTION_LED_10_ON 22
4017 #define kvLED_ACTION_LED_10_OFF 23
4018 #define kvLED_ACTION_LED_11_ON 24
4019 #define kvLED_ACTION_LED_11_OFF 25
4020 
4021 
4044 canStatus CANLIBAPI kvFlashLeds (const CanHandle hnd, int action, int timeout);
4045 
4065 canStatus CANLIBAPI canRequestChipStatus(const CanHandle hnd);
4066 
4093 canStatus CANLIBAPI canRequestBusStatistics (const CanHandle hnd);
4094 
4100 typedef struct canBusStatistics_s {
4101  unsigned long stdData;
4102  unsigned long stdRemote;
4103  unsigned long extData;
4104  unsigned long extRemote;
4105  unsigned long errFrame;
4106 
4111  unsigned long busLoad;
4112  unsigned long overruns;
4114 
4137 canStatus CANLIBAPI canGetBusStatistics(const CanHandle hnd,
4138  canBusStatistics *stat,
4139  size_t bufsiz);
4140 
4141 
4162 canStatus CANLIBAPI kvAnnounceIdentityEx(const CanHandle hnd,
4163  int type,
4164  void *buf,
4165  size_t bufsiz);
4166 
4188 canStatus CANLIBAPI canGetHandleData(const CanHandle hnd,
4189  int item,
4190  void *buffer,
4191  size_t bufsize);
4192 
4194 typedef void *kvTimeDomain;
4195 
4198 
4203 typedef struct kvTimeDomainData_s {
4209 
4238 kvStatus CANLIBAPI kvTimeDomainCreate(kvTimeDomain *domain);
4239 
4262 kvStatus CANLIBAPI kvTimeDomainDelete(kvTimeDomain domain);
4263 
4289 kvStatus CANLIBAPI kvTimeDomainResetTime(kvTimeDomain domain);
4290 
4315 kvStatus CANLIBAPI kvTimeDomainGetData(kvTimeDomain domain,
4316  kvTimeDomainData *data,
4317  size_t bufsiz);
4318 
4341 kvStatus CANLIBAPI kvTimeDomainAddHandle(kvTimeDomain domain,
4342  const CanHandle hnd);
4343 
4365 kvStatus CANLIBAPI kvTimeDomainRemoveHandle(kvTimeDomain domain,
4366  const CanHandle hnd);
4367 
4385 typedef void(CANLIBAPI *kvCallback_t)(CanHandle hnd, void *context, unsigned int notifyEvent);
4419 kvStatus CANLIBAPI kvSetNotifyCallback(const CanHandle hnd,
4420  kvCallback_t callback,
4421  void *context,
4422  unsigned int notifyFlags);
4423 
4437 #define kvBUSTYPE_NONE 0
4438 
4443 #define kvBUSTYPE_PCI 1
4444 
4449 #define kvBUSTYPE_PCMCIA 2
4450 
4455 #define kvBUSTYPE_USB 3
4456 
4461 #define kvBUSTYPE_WLAN 4
4462 
4467 #define kvBUSTYPE_PCI_EXPRESS 5
4468 
4473 #define kvBUSTYPE_ISA 6
4474 
4479 #define kvBUSTYPE_VIRTUAL 7
4480 
4485 #define kvBUSTYPE_PC104_PLUS 8
4486 
4491 #define kvBUSTYPE_LAN 9
4492 
4508 #define kvBUSTYPE_GROUP_VIRTUAL 1
4509 
4514 #define kvBUSTYPE_GROUP_LOCAL 2
4515 
4520 #define kvBUSTYPE_GROUP_REMOTE 3
4521 
4525 #define kvBUSTYPE_GROUP_INTERNAL 4
4526 
4580 kvStatus CANLIBAPI kvGetSupportedInterfaceInfo(int index,
4581  char *hwName,
4582  size_t nameLen,
4583  int *hwType,
4584  int *hwBusType);
4585 
4610 kvStatus CANLIBAPI kvReadDeviceCustomerData(const CanHandle hnd,
4611  int userNumber,
4612  int itemNumber,
4613  void *data,
4614  size_t bufsiz);
4615 
4629 #define kvENVVAR_TYPE_INT 1
4630 
4636 #define kvENVVAR_TYPE_FLOAT 2
4637 
4643 #define kvENVVAR_TYPE_STRING 3
4644 
4660 #define kvEVENT_TYPE_KEY 1
4661 
4669 typedef int64_t kvEnvHandle;
4670 
4690 kvStatus CANLIBAPI kvScriptStart(const CanHandle hnd, int slotNo);
4691 
4698 #define kvSCRIPT_STOP_NORMAL 0
4699 #define kvSCRIPT_STOP_FORCED -9
4723 kvStatus CANLIBAPI kvScriptStop(const CanHandle hnd, int slotNo, int mode);
4724 
4744 kvStatus CANLIBAPI kvScriptUnload(const CanHandle hnd, int slotNo);
4745 
4770 kvStatus CANLIBAPI kvScriptSendEvent(const CanHandle hnd,
4771  int slotNo,
4772  int eventType,
4773  int eventNo,
4774  unsigned int data);
4775 
4800 kvEnvHandle CANLIBAPI kvScriptEnvvarOpen(const CanHandle hnd,
4801  const char *envvarName,
4802  int *envvarType,
4803  int *envvarSize); // returns scriptHandle
4804 
4822 kvStatus CANLIBAPI kvScriptEnvvarClose(kvEnvHandle eHnd);
4823 
4844 kvStatus CANLIBAPI kvScriptEnvvarSetInt(kvEnvHandle eHnd, int val);
4845 
4867 kvStatus CANLIBAPI kvScriptEnvvarGetInt(kvEnvHandle eHnd, int *val);
4868 
4891 kvStatus CANLIBAPI kvScriptEnvvarSetFloat(kvEnvHandle eHnd, float val);
4892 
4916 kvStatus CANLIBAPI kvScriptEnvvarGetFloat(kvEnvHandle eHnd, float *val);
4917 
4944 kvStatus CANLIBAPI kvScriptEnvvarSetData(kvEnvHandle eHnd,
4945  const void *buf,
4946  int start_index,
4947  int data_len);
4948 
4974 kvStatus CANLIBAPI kvScriptEnvvarGetData(kvEnvHandle eHnd,
4975  void *buf,
4976  int start_index,
4977  int data_len);
4978 
5002 kvStatus CANLIBAPI kvScriptLoadFileOnDevice(const CanHandle hnd,
5003  int slotNo,
5004  char *localFile);
5005 
5034 kvStatus CANLIBAPI kvScriptLoadFile(const CanHandle hnd,
5035  int slotNo,
5036  char *filePathOnPC);
5037 
5038 
5052 #define kvSCRIPT_REQUEST_TEXT_UNSUBSCRIBE 1
5053 
5057 #define kvSCRIPT_REQUEST_TEXT_SUBSCRIBE 2
5058 
5062 #define kvSCRIPT_REQUEST_TEXT_ALL_SLOTS 255
5063 
5087 kvStatus CANLIBAPI kvScriptRequestText(const CanHandle hnd,
5088  unsigned int slot,
5089  unsigned int request);
5090 
5091 
5092 
5115 kvStatus CANLIBAPI kvScriptGetText(const CanHandle hnd,
5116  int *slot,
5117  unsigned long *time,
5118  unsigned int *flags,
5119  char *buf,
5120  size_t bufsize);
5121 
5128 #define kvSCRIPT_STATUS_LOADED 1
5129 #define kvSCRIPT_STATUS_RUNNING 2
5150 kvStatus CANLIBAPI kvScriptStatus(const CanHandle hnd,
5151  int slot,
5152  unsigned int *status);
5153 
5154 
5173 kvStatus CANLIBAPI kvScriptGetMaxEnvvarSize(int hnd, int *envvarSize);
5174 
5205 kvStatus CANLIBAPI kvScriptTxeGetData(const char *filePathOnPC,
5206  int item,
5207  void *buffer,
5208  unsigned int *bufsize);
5209 
5235 #define canTXEDATA_FILE_VERSION 1
5236 
5252 #define canTXEDATA_COMPILER_VERSION 2
5253 
5272 #define canTXEDATA_DATE 3
5273 
5284 #define canTXEDATA_DESCRIPTION 4
5285 
5299 #define canTXEDATA_SOURCE 5
5300 
5310 #define canTXEDATA_SIZE_OF_CODE 6
5311 
5321 #define canTXEDATA_IS_ENCRYPTED 7
5322 
5323 
5350 kvStatus CANLIBAPI kvFileCopyToDevice(const CanHandle hnd,
5351  char *hostFileName,
5352  char *deviceFileName);
5353 
5376 kvStatus CANLIBAPI kvFileCopyFromDevice(const CanHandle hnd,
5377  char *deviceFileName,
5378  char *hostFileName);
5379 
5401 kvStatus CANLIBAPI kvFileDelete(const CanHandle hnd, char *deviceFileName);
5402 
5425 kvStatus CANLIBAPI kvFileGetName(const CanHandle hnd,
5426  int fileNo,
5427  char *name,
5428  int namelen);
5429 
5449 kvStatus CANLIBAPI kvFileGetCount(const CanHandle hnd, int *count);
5450 
5473 kvStatus CANLIBAPI kvFileGetSystemData(const CanHandle hnd,
5474  int itemCode,
5475  int *result);
5476 
5495 kvStatus CANLIBAPI kvFileDiskFormat(const CanHandle hnd);
5496 
5514 #define kvDEVICE_MODE_INTERFACE 0x00
5515 
5520 #define kvDEVICE_MODE_LOGGER 0x01
5521 
5546 kvStatus CANLIBAPI kvDeviceSetMode(const CanHandle hnd, int mode);
5547 
5570 kvStatus CANLIBAPI kvDeviceGetMode(const CanHandle hnd, int *result);
5571 
5572 
5597 kvStatus CANLIBAPI kvReadTimer(const CanHandle hnd, unsigned int *time);
5621 kvStatus CANLIBAPI kvReadTimer64(const CanHandle hnd, uint64_t *time);
5622 
5639 #define kvIO_INFO_GET_MODULE_TYPE 1
5640 
5646 #define kvIO_INFO_GET_DIRECTION 2
5647 
5653 #define kvIO_INFO_GET_PIN_TYPE 4
5654 
5660 #define kvIO_INFO_GET_NUMBER_OF_BITS 5
5661 
5669 #define kvIO_INFO_GET_RANGE_MIN 6
5670 
5678 #define kvIO_INFO_GET_RANGE_MAX 7
5679 
5687 #define kvIO_INFO_GET_DI_LOW_HIGH_FILTER 8
5688 
5696 #define kvIO_INFO_GET_DI_HIGH_LOW_FILTER 9
5697 
5705 #define kvIO_INFO_GET_AI_LP_FILTER_ORDER 10
5706 
5715 #define kvIO_INFO_GET_AI_HYSTERESIS 11
5716 
5722 #define kvIO_INFO_GET_MODULE_NUMBER 14
5723 
5729 #define kvIO_INFO_GET_SERIAL_NUMBER 15
5730 
5738 #define kvIO_INFO_GET_FW_VERSION 16
5739 
5760 #define kvIO_INFO_SET_DI_LOW_HIGH_FILTER 8
5761 
5769 #define kvIO_INFO_SET_DI_HIGH_LOW_FILTER 9
5770 
5778 #define kvIO_INFO_SET_AI_LP_FILTER_ORDER 10
5779 
5788 #define kvIO_INFO_SET_AI_HYSTERESIS 11
5789 
5806 #define kvIO_MODULE_TYPE_DIGITAL 1
5807 
5811 #define kvIO_MODULE_TYPE_ANALOG 2
5812 
5816 #define kvIO_MODULE_TYPE_RELAY 3
5817 
5821 #define kvIO_MODULE_TYPE_INTERNAL 4
5822 
5837 #define kvIO_PIN_TYPE_DIGITAL 1
5838 
5842 #define kvIO_PIN_TYPE_ANALOG 2
5843 
5847 #define kvIO_PIN_TYPE_RELAY 3
5848 
5863 #define kvIO_PIN_DIRECTION_IN 4
5864 
5868 #define kvIO_PIN_DIRECTION_OUT 8
5869 
5891 canStatus CANLIBAPI kvIoGetNumberOfPins(const CanHandle hnd, unsigned int *pinCount);
5892 
5909 canStatus CANLIBAPI kvIoConfirmConfig(const CanHandle hnd);
5910 
5930 canStatus CANLIBAPI kvIoPinGetInfo(const CanHandle hnd, unsigned int pin, int item, void *buffer, const unsigned int bufsize);
5931 
5951 canStatus CANLIBAPI kvIoPinSetInfo(const CanHandle hnd, unsigned int pin, int item, const void *buffer, const unsigned int bufsize);
5952 
5970 canStatus CANLIBAPI kvIoPinSetDigital(const CanHandle hnd, unsigned int pin, unsigned int value);
5971 
5991 canStatus CANLIBAPI kvIoPinGetDigital(const CanHandle hnd, unsigned int pin, unsigned int *value);
5992 
6014 canStatus CANLIBAPI kvIoPinGetOutputDigital(const CanHandle hnd, unsigned int pin, unsigned int *value);
6015 
6033 canStatus CANLIBAPI kvIoPinSetRelay(const CanHandle hnd, unsigned int pin, unsigned int value);
6034 
6054 canStatus CANLIBAPI kvIoPinGetOutputRelay(const CanHandle hnd, unsigned int pin, unsigned int *value);
6055 
6073 canStatus CANLIBAPI kvIoPinSetAnalog(const CanHandle hnd, unsigned int pin, float value);
6074 
6092 canStatus CANLIBAPI kvIoPinGetAnalog(const CanHandle hnd, unsigned int pin, float *value);
6093 
6113 canStatus CANLIBAPI kvIoPinGetOutputAnalog(const CanHandle hnd, unsigned int pin, float *value);
6114 
6120 typedef struct {
6121  int type;
6122  unsigned char DO1 : 1;
6123  unsigned char DO2 : 1;
6124  unsigned char DO3 : 1;
6125  unsigned char DO4 : 1;
6126  unsigned char DO5 : 1;
6127  unsigned char DO6 : 1;
6128  unsigned char DO7 : 1;
6129  unsigned char DO8 : 1;
6130  unsigned char DO9 : 1;
6131  unsigned char DO10: 1;
6132  unsigned char DO11: 1;
6133  unsigned char DO12: 1;
6134  unsigned char DO13: 1;
6135  unsigned char DO14: 1;
6136  unsigned char DO15: 1;
6137  unsigned char DO16: 1;
6138  unsigned char DI1 : 1;
6139  unsigned char DI2 : 1;
6140  unsigned char DI3 : 1;
6141  unsigned char DI4 : 1;
6142  unsigned char DI5 : 1;
6143  unsigned char DI6 : 1;
6144  unsigned char DI7 : 1;
6145  unsigned char DI8 : 1;
6146  unsigned char DI9 : 1;
6147  unsigned char DI10: 1;
6148  unsigned char DI11: 1;
6149  unsigned char DI12: 1;
6150  unsigned char DI13: 1;
6151  unsigned char DI14: 1;
6152  unsigned char DI15: 1;
6153  unsigned char DI16: 1;
6155 
6156 
6162 typedef struct {
6163  int type;
6164  unsigned char DO: 1;
6165  unsigned char DI: 1;
6167 
6168 
6175 typedef struct {
6176  int type;
6177  unsigned char RO1 : 1;
6178  unsigned char RO2 : 1;
6179  unsigned char RO3 : 1;
6180  unsigned char RO4 : 1;
6181  unsigned char RO5 : 1;
6182  unsigned char RO6 : 1;
6183  unsigned char RO7 : 1;
6184  unsigned char RO8 : 1;
6185  unsigned char DI1 : 1;
6186  unsigned char DI2 : 1;
6187  unsigned char DI3 : 1;
6188  unsigned char DI4 : 1;
6189  unsigned char DI5 : 1;
6190  unsigned char DI6 : 1;
6191  unsigned char DI7 : 1;
6192  unsigned char DI8 : 1;
6193 } kvIoModuleRelay;
6194 
6201 typedef struct {
6202  int type;
6203  float AO1;
6204  float AO2;
6205  float AO3;
6206  float AO4;
6207  float AI1;
6208  float AI2;
6209  float AI3;
6210  float AI4;
6212 
6213 
6236 canStatus CANLIBAPI kvIoGetModulePins(const CanHandle hnd, unsigned int module, void *buffer, const unsigned int bufsize);
6237 
6238 
6262 canStatus CANLIBAPI kvIoSetModulePins(const CanHandle hnd, unsigned int module, const void *buffer, const unsigned int bufsize);
6263 
6264 
6265 #ifdef __cplusplus
6266 }
6267 #endif /* __cplusplus */
6268 
6269 #endif /* _CANLIB_H_ */
canStatus canGetBusParamsTq(const CanHandle hnd, kvBusParamsTq *nominal)
struct canNotifyData::@0::@4 status
unsigned char DO7
Definition: canlib.h:6128
unsigned char DO8
Definition: canlib.h:6129
kvStatus kvScriptUnload(const CanHandle hnd, int slotNo)
kvStatus kvScriptEnvvarGetData(kvEnvHandle eHnd, void *buf, int start_index, int data_len)
canStatus canWriteWait(const CanHandle hnd, long id, void *msg, unsigned int dlc, unsigned int flag, unsigned long timeout)
unsigned char busStatus
Definition: canlib.h:189
int sjw
Definition: canlib.h:707
kvStatus kvFileDiskFormat(const CanHandle hnd)
canStatus kvIoPinSetAnalog(const CanHandle hnd, unsigned int pin, float value)
unsigned char DI6
Definition: canlib.h:6143
int phase1
Definition: canlib.h:705
unsigned char DI1
Definition: canlib.h:6138
canStatus
Definition: canstat.h:83
canStatus canReadSpecific(const CanHandle hnd, long id, void *msg, unsigned int *dlc, unsigned int *flag, unsigned long *time)
unsigned char RO1
Definition: canlib.h:6177
unsigned char DO13
Definition: canlib.h:6134
Definition: canlib.h:6162
canStatus kvBitrateToBusParamsFdTq(const canHandle hnd, int freqA, int freqD, kvBusParamsTq *arbitration, kvBusParamsTq *data)
unsigned char RO7
Definition: canlib.h:6183
kvStatus kvScriptLoadFile(const CanHandle hnd, int slotNo, char *filePathOnPC)
unsigned char DI5
Definition: canlib.h:6142
unsigned char DI8
Definition: canlib.h:6192
unsigned char DO12
Definition: canlib.h:6133
canStatus canObjBufSetMsgCount(const CanHandle hnd, int idx, unsigned int count)
canStatus kvFlashLeds(const CanHandle hnd, int action, int timeout)
int power_of_ten
Definition: canlib.h:2447
canStatus canGetBusParamsFdTq(const CanHandle hnd, kvBusParamsTq *nominal, kvBusParamsTq *data)
Definition: canlib.h:4203
kvStatus kvScriptGetText(const CanHandle hnd, int *slot, unsigned long *time, unsigned int *flags, char *buf, size_t bufsize)
struct canBusStatistics_s canBusStatistics
Definition: canlib.h:2465
canStatus canGetDriverMode(const CanHandle hnd, int *lineMode, int *resNet)
canStatus canSetBusParamsC200(const CanHandle hnd, unsigned char btr0, unsigned char btr1)
canStatus canEnumHardwareEx(int *channelCount)
unsigned char DO15
Definition: canlib.h:6136
canStatus canGetHandleData(const CanHandle hnd, int item, void *buffer, size_t bufsize)
unsigned char DI10
Definition: canlib.h:6147
canStatus canSetNotify(const CanHandle hnd, void(*callback)(canNotifyData *), unsigned int notifyFlags, void *tag)
unsigned char DI13
Definition: canlib.h:6150
canStatus canGetNumberOfChannels(int *channelCount)
kvStatus kvFileDelete(const CanHandle hnd, char *deviceFileName)
kvStatus kvScriptSendEvent(const CanHandle hnd, int slotNo, int eventType, int eventNo, unsigned int data)
canStatus canReadStatus(const CanHandle hnd, unsigned long *const flags)
kvStatus kvScriptEnvvarClose(kvEnvHandle eHnd)
kvStatus kvScriptEnvvarSetInt(kvEnvHandle eHnd, int val)
canStatus canSetAcceptanceFilter(const CanHandle hnd, unsigned int code, unsigned int mask, int is_extended)
unsigned char DI7
Definition: canlib.h:6191
canStatus kvIoPinSetDigital(const CanHandle hnd, unsigned int pin, unsigned int value)
unsigned int canGetVersionEx(unsigned int itemCode)
canStatus kvStatus
Definition: canlib.h:4197
unsigned char DI2
Definition: canlib.h:6186
canStatus canClose(const CanHandle hnd)
canStatus canReadWait(const CanHandle hnd, long *id, void *msg, unsigned int *dlc, unsigned int *flag, unsigned long *time, unsigned long timeout)
unsigned long stdRemote
Number of received standard (11-bit identifiers) remote frames.
Definition: canlib.h:4102
int prescaler
Definition: canlib.h:709
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)
struct canNotifyData::@0::@1 busErr
unsigned long errFrame
Number of error frames.
Definition: canlib.h:4105
canStatus canObjBufDisable(const CanHandle hnd, int idx)
unsigned char DI7
Definition: canlib.h:6144
canStatus kvAnnounceIdentityEx(const CanHandle hnd, int type, void *buf, size_t bufsiz)
unsigned char DI3
Definition: canlib.h:6140
kvStatus kvTimeDomainDelete(kvTimeDomain domain)
canStatus canRequestChipStatus(const CanHandle hnd)
unsigned char DI4
Definition: canlib.h:6188
Definition: canlib.h:2443
kvBusParamsTq data_min
Definition: canlib.h:2469
int64_t kvEnvHandle
Definition: canlib.h:4669
canStatus canRequestBusStatistics(const CanHandle hnd)
unsigned char DI1
Definition: canlib.h:6185
kvStatus kvSetNotifyCallback(const CanHandle hnd, kvCallback_t callback, void *context, unsigned int notifyFlags)
kvStatus kvDeviceGetMode(const CanHandle hnd, int *result)
unsigned char DI2
Definition: canlib.h:6139
canStatus canSetBusParamsFdTq(const CanHandle hnd, const kvBusParamsTq arbitration, const kvBusParamsTq data)
kvStatus kvFileCopyFromDevice(const CanHandle hnd, char *deviceFileName, char *hostFileName)
unsigned char DI12
Definition: canlib.h:6149
float AO1
Definition: canlib.h:6203
canStatus canGetRawHandle(const CanHandle hnd, void *pvFd)
kvBusParamsTq data_max
Definition: canlib.h:2470
unsigned char DO14
Definition: canlib.h:6135
unsigned char DI4
Definition: canlib.h:6141
unsigned char DO11
Definition: canlib.h:6132
Definition: canlib.h:6120
union canNotifyData::@0 info
unsigned char DI15
Definition: canlib.h:6152
kvStatus kvScriptEnvvarSetData(kvEnvHandle eHnd, const void *buf, int start_index, int data_len)
unsigned long overruns
The number of overruns detected by the hardware, firmware or driver.
Definition: canlib.h:4112
unsigned short canGetVersion(void)
int nNonMagiSyncedMembers
number of non MagiSync™ members
Definition: canlib.h:4207
kvStatus kvFileGetSystemData(const CanHandle hnd, int itemCode, int *result)
int nNonMagiSyncCards
number of non MagiSync™ interfaces
Definition: canlib.h:4206
canStatus canObjBufEnable(const CanHandle hnd, int idx)
canStatus canSetDriverMode(const CanHandle hnd, int lineMode, int resNet)
canStatus canResetBus(const CanHandle hnd)
kvStatus kvTimeDomainGetData(kvTimeDomain domain, kvTimeDomainData *data, size_t bufsiz)
kvStatus kvScriptLoadFileOnDevice(const CanHandle hnd, int slotNo, char *localFile)
unsigned char RO4
Definition: canlib.h:6180
unsigned char rxErrorCounter
Definition: canlib.h:191
kvStatus kvTimeDomainCreate(kvTimeDomain *domain)
float AI2
Definition: canlib.h:6208
canStatus canReadTimer(const CanHandle hnd, unsigned long *time)
int eventType
Definition: canlib.h:175
kvStatus kvFileCopyToDevice(const CanHandle hnd, char *hostFileName, char *deviceFileName)
Definition: canlib.h:173
kvStatus kvReadTimer(const CanHandle hnd, unsigned int *time)
canStatus canSetBusParamsTq(const CanHandle hnd, const kvBusParamsTq nominal)
long id
Definition: canlib.h:181
int type
Definition: canlib.h:6176
unsigned char DO6
Definition: canlib.h:6127
float AO2
Definition: canlib.h:6204
int prop
Definition: canlib.h:708
unsigned long stdData
Number of received standard (11-bit identifiers) data frames.
Definition: canlib.h:4101
canStatus canBusOn(const CanHandle hnd)
int version
Definition: canlib.h:2444
int tq
Definition: canlib.h:704
kvStatus kvScriptTxeGetData(const char *filePathOnPC, int item, void *buffer, unsigned int *bufsize)
int type
Definition: canlib.h:6163
canStatus canReadSyncSpecific(const CanHandle hnd, long id, unsigned long timeout)
int nMagiSyncedMembers
number of MagiSync™ members
Definition: canlib.h:4205
int version
Definition: canlib.h:2466
struct kvTimeDomainData_s kvTimeDomainData
unsigned char RO2
Definition: canlib.h:6178
void(* kvCallback_t)(CanHandle hnd, void *context, unsigned int notifyEvent)
Definition: canlib.h:4385
unsigned char DO5
Definition: canlib.h:6126
unsigned char DI5
Definition: canlib.h:6189
canHandle CanHandle
Definition: canlib.h:171
unsigned char DI6
Definition: canlib.h:6190
int phase2
Definition: canlib.h:706
canStatus canGetBusParams(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)
kvStatus kvGetSupportedInterfaceInfo(int index, char *hwName, size_t nameLen, int *hwType, int *hwBusType)
canStatus canFlushReceiveQueue(const CanHandle hnd)
canStatus canAccept(const CanHandle hnd, const long envelope, const unsigned int flag)
unsigned char DO10
Definition: canlib.h:6131
unsigned char RO5
Definition: canlib.h:6181
unsigned char DO1
Definition: canlib.h:6122
kvEnvHandle kvScriptEnvvarOpen(const CanHandle hnd, const char *envvarName, int *envvarType, int *envvarSize)
float AI1
Definition: canlib.h:6207
unsigned long time
Definition: canlib.h:178
int nMagiSyncGroups
number of MagiSync™ groups
Definition: canlib.h:4204
canStatus canObjBufFreeAll(const CanHandle hnd)
kvStatus kvScriptRequestText(const CanHandle hnd, unsigned int slot, unsigned int request)
struct canNotifyData::@0::@2 rx
Definition: canlib.h:6201
canStatus canObjBufWrite(const CanHandle hnd, int idx, int id, void *msg, unsigned int dlc, unsigned int flags)
int denominator
Definition: canlib.h:2446
struct kvBusParamLimits kvBusParamLimits
canStatus canBusOff(const CanHandle hnd)
unsigned long extData
Number of received extended (29-bit identifiers) data frames.
Definition: canlib.h:4103
int accuracy_ppm
Definition: canlib.h:2448
canStatus kvIoGetNumberOfPins(const CanHandle hnd, unsigned int *pinCount)
struct kvClockInfo kvClockInfo
float AI3
Definition: canlib.h:6209
canStatus canWrite(const CanHandle hnd, long id, void *msg, unsigned int dlc, unsigned int flag)
canStatus kvIoGetModulePins(const CanHandle hnd, unsigned int module, void *buffer, const unsigned int bufsize)
unsigned char DI9
Definition: canlib.h:6146
struct kvBusParamsTq kvBusParamsTq
kvStatus kvFileGetCount(const CanHandle hnd, int *count)
Definition: canlib.h:703
Definition: canlib.h:3260
canStatus canSetBusOutputControl(const CanHandle hnd, const unsigned int drivertype)
canStatus canUnloadLibrary(void)
CanHandle canOpenChannel(int channel, int flags)
Definitions for the CANLIB API.
unsigned char DO3
Definition: canlib.h:6124
unsigned char RO6
Definition: canlib.h:6182
canStatus kvIoPinSetRelay(const CanHandle hnd, unsigned int pin, unsigned int value)
kvStatus kvFileGetName(const CanHandle hnd, int fileNo, char *name, int namelen)
Definition: canlib.h:4100
unsigned char DO9
Definition: canlib.h:6130
canStatus canRead(const CanHandle hnd, long *id, void *msg, unsigned int *dlc, unsigned int *flag, unsigned long *time)
canStatus canReadSync(const CanHandle hnd, unsigned long timeout)
unsigned char RO3
Definition: canlib.h:6179
kvStatus kvTimeDomainRemoveHandle(kvTimeDomain domain, const CanHandle hnd)
canStatus canWriteSync(const CanHandle hnd, unsigned long timeout)
unsigned char DO
Definition: canlib.h:6164
Definition: canlib.h:6175
canStatus canReadSpecificSkip(const CanHandle hnd, long id, void *msg, unsigned int *dlc, unsigned int *flag, unsigned long *time)
unsigned char DO16
Definition: canlib.h:6137
unsigned long busLoad
Definition: canlib.h:4111
void canInitializeLibrary(void)
struct canNotifyData::@0::@3 tx
canStatus kvBitrateToBusParamsTq(const canHandle hnd, int freq, kvBusParamsTq *nominal)
float AO3
Definition: canlib.h:6205
canStatus canObjBufSendBurst(const CanHandle hnd, int idx, unsigned int burstlen)
canStatus canObjBufSetPeriod(const CanHandle hnd, int idx, unsigned int period)
unsigned char DI8
Definition: canlib.h:6145
float AO4
Definition: canlib.h:6206
kvStatus kvTimeDomainResetTime(kvTimeDomain domain)
kvStatus kvTimeDomainAddHandle(kvTimeDomain domain, const CanHandle hnd)
canStatus canGetBusOutputControl(const CanHandle hnd, unsigned int *drivertype)
canStatus kvIoPinGetDigital(const CanHandle hnd, unsigned int pin, unsigned int *value)
unsigned int portNo
Port number used in e.g. canIOCTL_SET_USER_IOPORT.
Definition: canlib.h:3261
unsigned char DI16
Definition: canlib.h:6153
canStatus canReadErrorCounters(const CanHandle hnd, unsigned int *txErr, unsigned int *rxErr, unsigned int *ovErr)
void * tag
Definition: canlib.h:174
canStatus kvIoPinGetOutputDigital(const CanHandle hnd, unsigned int pin, unsigned int *value)
kvBusParamsTq arbitration_min
Definition: canlib.h:2467
canStatus canGetBusStatistics(const CanHandle hnd, canBusStatistics *stat, size_t bufsiz)
kvStatus kvReadDeviceCustomerData(const CanHandle hnd, int userNumber, int itemNumber, void *data, size_t bufsiz)
unsigned char DI11
Definition: canlib.h:6148
canStatus kvIoPinSetInfo(const CanHandle hnd, unsigned int pin, int item, const void *buffer, const unsigned int bufsize)
canStatus canObjBufAllocate(const CanHandle hnd, int type)
canStatus canGetBusParamsFd(const CanHandle hnd, long *freq_brs, unsigned int *tseg1_brs, unsigned int *tseg2_brs, unsigned int *sjw_brs)
unsigned char DI3
Definition: canlib.h:6187
canStatus kvIoPinGetAnalog(const CanHandle hnd, unsigned int pin, float *value)
canStatus canFlushTransmitQueue(const CanHandle hnd)
kvStatus kvScriptGetMaxEnvvarSize(int hnd, int *envvarSize)
int type
Definition: canlib.h:6202
kvStatus kvScriptStart(const CanHandle hnd, int slotNo)
canStatus canObjBufSetFilter(const CanHandle hnd, int idx, unsigned int code, unsigned int mask)
unsigned char DI14
Definition: canlib.h:6151
kvStatus kvScriptEnvvarSetFloat(kvEnvHandle eHnd, float val)
unsigned char DO2
Definition: canlib.h:6123
kvStatus kvDeviceSetMode(const CanHandle hnd, int mode)
canStatus canGetErrorText(canStatus err, char *buf, unsigned int bufsiz)
void * kvTimeDomain
Definition: canlib.h:4194
unsigned int portValue
Port value used in e.g. canIOCTL_SET_USER_IOPORT.
Definition: canlib.h:3262
canStatus kvIoSetModulePins(const CanHandle hnd, unsigned int module, const void *buffer, const unsigned int bufsize)
unsigned long extRemote
Number of received extended (29-bit identifiers) remote frames.
Definition: canlib.h:4104
unsigned char txErrorCounter
Definition: canlib.h:190
canStatus kvIoPinGetOutputAnalog(const CanHandle hnd, unsigned int pin, float *value)
struct canNotifyData canNotifyData
unsigned char DI
Definition: canlib.h:6165
kvBusParamsTq arbitration_max
Definition: canlib.h:2468
int canHandle
Definition: canlib.h:166
canStatus canSetBusParams(const CanHandle hnd, long freq, unsigned int tseg1, unsigned int tseg2, unsigned int sjw, unsigned int noSamp, unsigned int syncmode)
canStatus kvIoConfirmConfig(const CanHandle hnd)
canStatus canObjBufSetFlags(const CanHandle hnd, int idx, unsigned int flags)
unsigned char DO4
Definition: canlib.h:6125
canStatus kvIoPinGetOutputRelay(const CanHandle hnd, unsigned int pin, unsigned int *value)
int numerator
Definition: canlib.h:2445
kvStatus kvScriptEnvvarGetFloat(kvEnvHandle eHnd, float *val)
canStatus canIoCtl(const CanHandle hnd, unsigned int func, void *buf, unsigned int buflen)
canStatus kvIoPinGetInfo(const CanHandle hnd, unsigned int pin, int item, void *buffer, const unsigned int bufsize)
kvStatus kvReadTimer64(const CanHandle hnd, uint64_t *time)
unsigned char RO8
Definition: canlib.h:6184
float AI4
Definition: canlib.h:6210
kvStatus kvScriptEnvvarGetInt(kvEnvHandle eHnd, int *val)
int type
Definition: canlib.h:6121