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 
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 
225 #define canOPEN_EXCLUSIVE 0x0008
226 
238 #define canOPEN_REQUIRE_EXTENDED 0x0010
239 
247 # define canOPEN_ACCEPT_VIRTUAL 0x0020
248 
257 # define canOPEN_OVERRIDE_EXCLUSIVE 0x0040
258 
275 # define canOPEN_REQUIRE_INIT_ACCESS 0x0080
276 
288 # define canOPEN_NO_INIT_ACCESS 0x0100
289 
301 # define canOPEN_ACCEPT_LARGE_DLC 0x0200 // DLC can be greater than 8
302 
309 # define canOPEN_CAN_FD 0x0400
310 
324 # define canOPEN_CAN_FD_NONISO 0x0800
325 
326 
330 # define canOPEN_INTERNAL_L 0x1000
331 
343 #define canFILTER_ACCEPT 1
344 #define canFILTER_REJECT 2
345 
346 #define canFILTER_SET_CODE_STD 3
347 
348 #define canFILTER_SET_MASK_STD 4
349 
350 #define canFILTER_SET_CODE_EXT 5
351 
352 #define canFILTER_SET_MASK_EXT 6
353 
354 #define canFILTER_NULL_MASK 0L
355 
371 #define canDRIVER_NORMAL 4
372 
379 #define canDRIVER_SILENT 1
380 
384 #define canDRIVER_SELFRECEPTION 8
385 
389 #define canDRIVER_OFF 0
390 
413 #define canBITRATE_1M (-1)
414 
415 #define canBITRATE_500K (-2)
416 
417 #define canBITRATE_250K (-3)
418 
419 #define canBITRATE_125K (-4)
420 
421 #define canBITRATE_100K (-5)
422 
423 #define canBITRATE_62K (-6)
424 
425 #define canBITRATE_50K (-7)
426 
427 #define canBITRATE_83K (-8)
428 
429 #define canBITRATE_10K (-9)
430 
431 // CAN FD Bit Rates
435 #define canFD_BITRATE_500K_80P (-1000)
436 
439 #define canFD_BITRATE_1M_80P (-1001)
440 
443 #define canFD_BITRATE_2M_80P (-1002)
444 
447 #define canFD_BITRATE_4M_80P (-1003)
448 
451 #define canFD_BITRATE_8M_60P (-1004)
452 
455 #define canFD_BITRATE_8M_80P (-1005)
456 
459 #define canFD_BITRATE_8M_70P (-1006)
460 
462 #define BAUD_1M (-1)
463 
464 #define BAUD_500K (-2)
465 
466 #define BAUD_250K (-3)
467 
468 #define BAUD_125K (-4)
469 
470 #define BAUD_100K (-5)
471 
472 #define BAUD_62K (-6)
473 
474 #define BAUD_50K (-7)
475 
476 #define BAUD_83K (-8)
477 
480 //
481 // Define CANLIBAPI unless it's done already.
482 // (canlib.c provides its own definitions of CANLIBAPI, DLLIMPORT
483 // and DLLEXPORT before including this file.)
484 //
485 #ifndef CANLIBAPI
486 # define CANLIBAPI
487 #endif /* CANLIBAPI */
488 
489 
490 #ifdef __cplusplus
491 extern "C" {
492 #endif /* __cplusplus */
493 
515 void CANLIBAPI canInitializeLibrary (void);
516 
538 canStatus CANLIBAPI canEnumHardwareEx (int *channelCount);
539 
564 canStatus CANLIBAPI canClose (const CanHandle hnd);
565 
590 canStatus CANLIBAPI canBusOn (const CanHandle hnd);
591 
612 canStatus CANLIBAPI canBusOff (const CanHandle hnd);
613 
663 canStatus CANLIBAPI canSetBusParams (const CanHandle hnd,
664  long freq,
665  unsigned int tseg1,
666  unsigned int tseg2,
667  unsigned int sjw,
668  unsigned int noSamp,
669  unsigned int syncmode);
670 
700 typedef struct kvBusParamsTq {
701  int tq;
702  int phase1;
703  int phase2;
704  int sjw;
705  int prop;
706  int prescaler;
707 } kvBusParamsTq;
708 
734  canStatus CANLIBAPI canSetBusParamsTq(const CanHandle hnd,
735  const kvBusParamsTq nominal);
736 
770 canStatus CANLIBAPI canSetBusParamsFd (const CanHandle hnd,
771  long freq_brs,
772  unsigned int tseg1_brs,
773  unsigned int tseg2_brs,
774  unsigned int sjw_brs);
775 
802 canStatus CANLIBAPI canSetBusParamsFdTq(const CanHandle hnd,
803  const kvBusParamsTq arbitration,
804  const kvBusParamsTq data);
805 
806 
838 canStatus CANLIBAPI canGetBusParams (const CanHandle hnd,
839  long *freq,
840  unsigned int *tseg1,
841  unsigned int *tseg2,
842  unsigned int *sjw,
843  unsigned int *noSamp,
844  unsigned int *syncmode);
845 
865 canStatus CANLIBAPI canGetBusParamsTq(const CanHandle hnd,
866  kvBusParamsTq *nominal);
867 
890 canStatus CANLIBAPI canGetBusParamsFd(const CanHandle hnd,
891  long *freq_brs,
892  unsigned int *tseg1_brs,
893  unsigned int *tseg2_brs,
894  unsigned int *sjw_brs);
895 
916 canStatus CANLIBAPI canGetBusParamsFdTq(const CanHandle hnd,
917  kvBusParamsTq *nominal,
918  kvBusParamsTq *data);
919 
944 canStatus CANLIBAPI canSetBusOutputControl (const CanHandle hnd,
945  const unsigned int drivertype);
946 
981 canStatus CANLIBAPI canGetBusOutputControl (const CanHandle hnd,
982  unsigned int *drivertype);
983 
1026 canStatus CANLIBAPI canAccept (const CanHandle hnd,
1027  const long envelope,
1028  const unsigned int flag);
1029 
1053 canStatus CANLIBAPI canReadStatus (const CanHandle hnd,
1054  unsigned long *const flags);
1055 
1092 canStatus CANLIBAPI canReadErrorCounters (const CanHandle hnd,
1093  unsigned int *txErr,
1094  unsigned int *rxErr,
1095  unsigned int *ovErr);
1096 
1138 canStatus CANLIBAPI canWrite (const CanHandle hnd,
1139  long id,
1140  void *msg,
1141  unsigned int dlc,
1142  unsigned int flag);
1143 
1171 canStatus CANLIBAPI canWriteSync (const CanHandle hnd, unsigned long timeout);
1172 
1224 canStatus CANLIBAPI canRead (const CanHandle hnd,
1225  long *id,
1226  void *msg,
1227  unsigned int *dlc,
1228  unsigned int *flag,
1229  unsigned long *time);
1280 canStatus CANLIBAPI canReadWait (const CanHandle hnd,
1281  long *id,
1282  void *msg,
1283  unsigned int *dlc,
1284  unsigned int *flag,
1285  unsigned long *time,
1286  unsigned long timeout);
1287 
1339 canStatus CANLIBAPI canReadSpecific (const CanHandle hnd, long id, void * msg,
1340  unsigned int * dlc, unsigned int * flag,
1341  unsigned long * time);
1342 
1373 canStatus CANLIBAPI canReadSync (const CanHandle hnd, unsigned long timeout);
1374 
1406 canStatus CANLIBAPI canReadSyncSpecific (const CanHandle hnd,
1407  long id,
1408  unsigned long timeout);
1409 
1455 canStatus CANLIBAPI canReadSpecificSkip (const CanHandle hnd,
1456  long id,
1457  void * msg,
1458  unsigned int * dlc,
1459  unsigned int * flag,
1460  unsigned long * time);
1461 
1482 canStatus CANLIBAPI canSetNotify (const CanHandle hnd,
1483  void (*callback)(canNotifyData *),
1484  unsigned int notifyFlags,
1485  void *tag);
1486 
1500 canStatus CANLIBAPI canGetRawHandle (const CanHandle hnd, void *pvFd);
1501 
1536 canStatus CANLIBAPI canTranslateBaud (long *const freq,
1537  unsigned int *const tseg1,
1538  unsigned int *const tseg2,
1539  unsigned int *const sjw,
1540  unsigned int *const nosamp,
1541  unsigned int *const syncMode);
1542 
1565 canStatus CANLIBAPI kvBitrateToBusParamsTq (const canHandle hnd,
1566  int freq,
1567  kvBusParamsTq *nominal);
1568 
1594 canStatus CANLIBAPI kvBitrateToBusParamsFdTq (const canHandle hnd,
1595  int freqA,
1596  int freqD,
1597  kvBusParamsTq *arbitration,
1598  kvBusParamsTq *data);
1599 
1622 canStatus CANLIBAPI canGetErrorText (canStatus err, char *buf, unsigned int bufsiz);
1623 
1653 unsigned short CANLIBAPI canGetVersion (void);
1654 
1683 canStatus CANLIBAPI canIoCtl (const CanHandle hnd,
1684  unsigned int func,
1685  void *buf,
1686  unsigned int buflen);
1687 
1688 
1694 canStatus CANLIBAPI canReadTimer (const CanHandle hnd, unsigned long *time);
1695 
1746 CanHandle CANLIBAPI canOpenChannel (int channel, int flags);
1747 
1768 canStatus CANLIBAPI canGetNumberOfChannels (int *channelCount);
1769 
1770 
1778 #define kvREMOTE_TYPE_NOT_REMOTE 0
1779 #define kvREMOTE_TYPE_WLAN 1
1780 #define kvREMOTE_TYPE_LAN 2
1781 
1790 #define kvLOGGER_TYPE_NOT_A_LOGGER 0
1791 #define kvLOGGER_TYPE_V1 1
1792 #define kvLOGGER_TYPE_V2 2
1793 
1826 canStatus CANLIBAPI canGetChannelData (int channel,
1827  int item,
1828  void *buffer,
1829  size_t bufsize);
1830 
1849 #define canCHANNELDATA_CHANNEL_CAP 1
1850 
1860 #define canCHANNELDATA_TRANS_CAP 2
1861 
1870 #define canCHANNELDATA_CHANNEL_FLAGS 3 // available, etc
1871 
1880 #define canCHANNELDATA_CARD_TYPE 4
1881 
1891 #define canCHANNELDATA_CARD_NUMBER 5
1892 
1900 #define canCHANNELDATA_CHAN_NO_ON_CARD 6
1901 
1911 #define canCHANNELDATA_CARD_SERIAL_NO 7
1912 
1922 #define canCHANNELDATA_TRANS_SERIAL_NO 8
1923 
1934 #define canCHANNELDATA_CARD_FIRMWARE_REV 9
1935 
1946 #define canCHANNELDATA_CARD_HARDWARE_REV 10
1947 
1957 #define canCHANNELDATA_CARD_UPC_NO 11
1958 
1969 #define canCHANNELDATA_TRANS_UPC_NO 12
1970 
1988 #define canCHANNELDATA_CHANNEL_NAME 13
1989 
2005 # define canCHANNELDATA_DLL_FILE_VERSION 14
2006 
2022 # define canCHANNELDATA_DLL_PRODUCT_VERSION 15
2023 
2039 # define canCHANNELDATA_DLL_FILETYPE 16
2040 
2049 # define canCHANNELDATA_TRANS_TYPE 17
2050 
2074 # define canCHANNELDATA_DEVICE_PHYSICAL_POSITION 18
2075 
2088 # define canCHANNELDATA_UI_NUMBER 19
2089 
2113 # define canCHANNELDATA_TIMESYNC_ENABLED 20
2114 
2129 # define canCHANNELDATA_DRIVER_FILE_VERSION 21
2130 
2145 # define canCHANNELDATA_DRIVER_PRODUCT_VERSION 22
2146 
2155 # define canCHANNELDATA_MFGNAME_UNICODE 23
2156 
2164 # define canCHANNELDATA_MFGNAME_ASCII 24
2165 
2174 # define canCHANNELDATA_DEVDESCR_UNICODE 25
2175 
2183 # define canCHANNELDATA_DEVDESCR_ASCII 26
2184 
2195 # define canCHANNELDATA_DRIVER_NAME 27
2196 
2209 # define canCHANNELDATA_CHANNEL_QUALITY 28
2210 
2219 # define canCHANNELDATA_ROUNDTRIP_TIME 29
2220 
2229 # define canCHANNELDATA_BUS_TYPE 30
2230 
2243 # define canCHANNELDATA_DEVNAME_ASCII 31
2244 
2255 # define canCHANNELDATA_TIME_SINCE_LAST_SEEN 32
2256 
2266 # define canCHANNELDATA_REMOTE_OPERATIONAL_MODE 33
2267 
2276 # define canCHANNELDATA_REMOTE_PROFILE_NAME 34
2277 
2286 # define canCHANNELDATA_REMOTE_HOST_NAME 35
2287 
2296 # define canCHANNELDATA_REMOTE_MAC 36
2297 
2306 # define canCHANNELDATA_MAX_BITRATE 37
2307 
2318 # define canCHANNELDATA_CHANNEL_CAP_MASK 38
2319 
2331 #define canCHANNELDATA_CUST_CHANNEL_NAME 39
2332 
2342 # define canCHANNELDATA_IS_REMOTE 40
2343 
2352 # define canCHANNELDATA_REMOTE_TYPE 41
2353 
2362 # define canCHANNELDATA_LOGGER_TYPE 42
2363 
2373 # define canCHANNELDATA_HW_STATUS 43
2374 
2384 # define canCHANNELDATA_FEATURE_EAN 44
2385 
2392 #define canCHANNELDATA_BUS_PARAM_LIMITS 45
2393 
2400 #define canCHANNELDATA_CLOCK_INFO 46
2401 
2422 #define canCHANNELDATA_CHANNEL_CAP_EX 47
2423 
2436 typedef struct kvClockInfo {
2437  int version;
2442 }kvClockInfo;
2443 
2458 typedef struct kvBusParamLimits {
2459  int version;
2465 
2476 #define canCHANNEL_IS_EXCLUSIVE 0x0001
2477 
2479 #define canCHANNEL_IS_OPEN 0x0002
2480 
2483 #define canCHANNEL_IS_CANFD 0x0004
2484 
2485 //#define canCHANNEL_IS_CANFD_NON_ISO 0x0008 Reserved for when needed
2486 
2489 #define canCHANNEL_IS_LIN 0x0010
2490 
2493 #define canCHANNEL_IS_LIN_MASTER 0x0020
2494 
2497 #define canCHANNEL_IS_LIN_SLAVE 0x0040
2498 
2499 
2518 #define canHWTYPE_NONE 0
2519 #define canHWTYPE_VIRTUAL 1
2520 #define canHWTYPE_LAPCAN 2
2521 #define canHWTYPE_CANPARI 3
2522 #define canHWTYPE_PCCAN 8
2523 #define canHWTYPE_PCICAN 9
2524 #define canHWTYPE_USBCAN 11
2525 #define canHWTYPE_PCICAN_II 40
2526 #define canHWTYPE_USBCAN_II 42
2527 #define canHWTYPE_SIMULATED 44
2528 #define canHWTYPE_ACQUISITOR 46
2529 #define canHWTYPE_LEAF 48
2530 #define canHWTYPE_PC104_PLUS 50
2531 #define canHWTYPE_PCICANX_II 52
2532 #define canHWTYPE_MEMORATOR_II 54
2533 #define canHWTYPE_MEMORATOR_PRO 54
2534 #define canHWTYPE_USBCAN_PRO 56
2535 #define canHWTYPE_IRIS 58
2536 #define canHWTYPE_BLACKBIRD 58
2537 #define canHWTYPE_MEMORATOR_LIGHT 60
2538 #define canHWTYPE_MINIHYDRA 62
2539 #define canHWTYPE_EAGLE 62
2540 #define canHWTYPE_BAGEL 64
2541 #define canHWTYPE_BLACKBIRD_V2 64
2542 #define canHWTYPE_MINIPCIE 66
2543 #define canHWTYPE_USBCAN_KLINE 68
2544 #define canHWTYPE_ETHERCAN 70
2545 #define canHWTYPE_USBCAN_LIGHT 72
2546 #define canHWTYPE_USBCAN_PRO2 74
2547 #define canHWTYPE_PCIE_V2 76
2548 #define canHWTYPE_MEMORATOR_PRO2 78
2549 #define canHWTYPE_LEAF2 80
2550 #define canHWTYPE_MEMORATOR_V2 82
2551 #define canHWTYPE_CANLINHYBRID 84
2552 #define canHWTYPE_DINRAIL 86
2553 #define canHWTYPE_U100 88
2554 
2555 
2564 #define canCHANNEL_CAP_EXTENDED_CAN 0x00000001L
2565 #define canCHANNEL_CAP_BUS_STATISTICS 0x00000002L
2566 #define canCHANNEL_CAP_ERROR_COUNTERS 0x00000004L
2567 #define canCHANNEL_CAP_RESERVED_2 0x00000008L
2568 #define canCHANNEL_CAP_GENERATE_ERROR 0x00000010L
2569 #define canCHANNEL_CAP_GENERATE_OVERLOAD 0x00000020L
2570 #define canCHANNEL_CAP_TXREQUEST 0x00000040L
2571 #define canCHANNEL_CAP_TXACKNOWLEDGE 0x00000080L
2572 #define canCHANNEL_CAP_VIRTUAL 0x00010000L
2573 #define canCHANNEL_CAP_SIMULATED 0x00020000L
2574 #define canCHANNEL_CAP_RESERVED_1 0x00040000L
2575 #define canCHANNEL_CAP_CAN_FD 0x00080000L
2576 #define canCHANNEL_CAP_CAN_FD_NONISO 0x00100000L
2577 #define canCHANNEL_CAP_SILENT_MODE 0x00200000L
2578 #define canCHANNEL_CAP_SINGLE_SHOT 0x00400000L
2579 #define canCHANNEL_CAP_LOGGER 0x00800000L
2580 #define canCHANNEL_CAP_REMOTE_ACCESS 0x01000000L
2581 #define canCHANNEL_CAP_SCRIPT 0x02000000L
2582 #define canCHANNEL_CAP_LIN_HYBRID 0x04000000L
2583 #define canCHANNEL_CAP_IO_API 0x08000000L
2584 #define canCHANNEL_CAP_CANTEGRITY 0x10000000L
2585 
2586 
2592 #define canCHANNEL_CAP_EX_BUSPARAMS_TQ 0x0000000000000001L
2593 
2594 
2606 #define canCHANNEL_OPMODE_NONE 1
2607 
2611 #define canCHANNEL_OPMODE_INFRASTRUCTURE 2
2612 
2616 #define canCHANNEL_OPMODE_RESERVED 3
2617 
2621 #define canCHANNEL_OPMODE_ADHOC 4
2622 
2632 #define canDRIVER_CAP_HIGHSPEED 0x00000001L
2633 
2659 #define canIOCTL_PREFER_EXT 1
2660 
2673 #define canIOCTL_PREFER_STD 2
2674 
2691 #define canIOCTL_CLEAR_ERROR_COUNTERS 5
2692 
2707 #define canIOCTL_SET_TIMER_SCALE 6
2708 
2728 #define canIOCTL_SET_TXACK 7
2729 
2742 #define canIOCTL_GET_RX_BUFFER_LEVEL 8
2743 
2756 #define canIOCTL_GET_TX_BUFFER_LEVEL 9
2757 
2767 #define canIOCTL_FLUSH_RX_BUFFER 10
2768 
2778 #define canIOCTL_FLUSH_TX_BUFFER 11
2779 
2788 #define canIOCTL_GET_TIMER_SCALE 12
2789 
2805 #define canIOCTL_SET_TXRQ 13
2806 
2807 
2814 #define canIOCTL_SET_BYPASS_MODE 15
2815 
2821 #define canIOCTL_SET_WAKEUP 16
2822 
2832 # define canIOCTL_GET_DRIVERHANDLE 17
2833 
2839 # define canIOCTL_MAP_RXQUEUE 18
2840 
2846 # define canIOCTL_GET_WAKEUP 19
2847 
2859 # define canIOCTL_SET_REPORT_ACCESS_ERRORS 20
2860 
2868 # define canIOCTL_GET_REPORT_ACCESS_ERRORS 21
2869 
2879 # define canIOCTL_CONNECT_TO_VIRTUAL_BUS 22
2880 
2890 # define canIOCTL_DISCONNECT_FROM_VIRTUAL_BUS 23
2891 
2901 # define canIOCTL_SET_USER_IOPORT 24
2902 
2913 # define canIOCTL_GET_USER_IOPORT 25
2914 
2920 # define canIOCTL_SET_BUFFER_WRAPAROUND_MODE 26
2921 
2938 # define canIOCTL_SET_RX_QUEUE_SIZE 27
2939 
2945 # define canIOCTL_SET_USB_THROTTLE 28
2946 
2952 # define canIOCTL_GET_USB_THROTTLE 29
2953 
2968 # define canIOCTL_SET_BUSON_TIME_AUTO_RESET 30
2969 
2981 # define canIOCTL_GET_TXACK 31
2982 
2997 # define canIOCTL_SET_LOCAL_TXECHO 32
2998 
3014 # define canIOCTL_SET_ERROR_FRAMES_REPORTING 33
3015 
3029 # define canIOCTL_GET_CHANNEL_QUALITY 34
3030 
3042 # define canIOCTL_GET_ROUNDTRIP_TIME 35
3043 
3052 # define canIOCTL_GET_BUS_TYPE 36
3053 
3066 # define canIOCTL_GET_DEVNAME_ASCII 37
3067 
3079 # define canIOCTL_GET_TIME_SINCE_LAST_SEEN 38
3080 
3094 # define canIOCTL_GET_TREF_LIST 39
3095 
3117 # define canIOCTL_TX_INTERVAL 40
3118 
3130 # define canIOCTL_SET_BRLIMIT 43
3131 
3137 # define canIOCTL_SET_USB_THROTTLE_SCALED 41
3138 
3153 # define canIOCTL_SET_THROTTLE_SCALED 41
3154 
3160 # define canIOCTL_GET_USB_THROTTLE_SCALED 42
3161 
3176 # define canIOCTL_GET_THROTTLE_SCALED 42
3177 
3185 # define canIOCTL_RESET_OVERRUN_COUNT 44
3186 
3195 # define canIOCTL_LIN_MODE 45
3196 
3199 typedef struct {
3200  unsigned int portNo;
3201  unsigned int portValue;
3203 
3204 
3245 canStatus CANLIBAPI canSetBusParamsC200 (const CanHandle hnd, unsigned char btr0, unsigned char btr1);
3246 
3247 
3248 
3284 canStatus CANLIBAPI canSetDriverMode (const CanHandle hnd, int lineMode, int resNet);
3285 
3322 canStatus CANLIBAPI canGetDriverMode (const CanHandle hnd, int *lineMode, int *resNet);
3323 
3343 #define canVERSION_CANLIB32_VERSION 0
3344 
3355 #define canVERSION_CANLIB32_PRODVER 1
3356 
3368 #define canVERSION_CANLIB32_PRODVER32 2
3369 
3380 #define canVERSION_CANLIB32_BETA 3
3381 
3401 unsigned int CANLIBAPI canGetVersionEx (unsigned int itemCode);
3402 
3403 
3423 canStatus CANLIBAPI canObjBufFreeAll (const CanHandle hnd);
3424 
3445 canStatus CANLIBAPI canObjBufAllocate (const CanHandle hnd, int type);
3446 
3455 #define canOBJBUF_TYPE_AUTO_RESPONSE 0x01
3456 #define canOBJBUF_TYPE_PERIODIC_TX 0x02
3457 
3479 canStatus CANLIBAPI canObjBufFree (const CanHandle hnd, int idx);
3480 
3481 // Writes CAN data to the object buffer with the specified index.
3482 
3508 canStatus CANLIBAPI canObjBufWrite (const CanHandle hnd,
3509  int idx,
3510  int id,
3511  void* msg,
3512  unsigned int dlc,
3513  unsigned int flags);
3514 
3540 canStatus CANLIBAPI canObjBufSetFilter (const CanHandle hnd,
3541  int idx,
3542  unsigned int code,
3543  unsigned int mask);
3544 
3565 canStatus CANLIBAPI canObjBufSetFlags (const CanHandle hnd,
3566  int idx,
3567  unsigned int flags);
3568 
3586 # define canOBJBUF_AUTO_RESPONSE_RTR_ONLY 0x01
3587 
3609 canStatus CANLIBAPI canObjBufSetPeriod (const CanHandle hnd,
3610  int idx,
3611  unsigned int period);
3612 
3633 canStatus CANLIBAPI canObjBufSetMsgCount (const CanHandle hnd,
3634  int idx,
3635  unsigned int count);
3636 
3656 canStatus CANLIBAPI canObjBufEnable (const CanHandle hnd, int idx);
3657 
3677 canStatus CANLIBAPI canObjBufDisable (const CanHandle hnd, int idx);
3678 
3702 canStatus CANLIBAPI canObjBufSendBurst (const CanHandle hnd,
3703  int idx,
3704  unsigned int burstlen);
3705 
3706 
3729 canStatus CANLIBAPI canResetBus (const CanHandle hnd);
3730 
3769 canStatus CANLIBAPI canWriteWait (const CanHandle hnd,
3770  long id,
3771  void *msg,
3772  unsigned int dlc,
3773  unsigned int flag,
3774  unsigned long timeout);
3775 
3776 
3802 canStatus CANLIBAPI canUnloadLibrary (void);
3803 
3865 canStatus CANLIBAPI canSetAcceptanceFilter (const CanHandle hnd,
3866  unsigned int code,
3867  unsigned int mask,
3868  int is_extended);
3892 canStatus CANLIBAPI canFlushReceiveQueue (const CanHandle hnd);
3893 
3918 canStatus CANLIBAPI canFlushTransmitQueue (const CanHandle hnd);
3919 
3920 
3929 #define kvLED_ACTION_ALL_LEDS_ON 0
3930 #define kvLED_ACTION_ALL_LEDS_OFF 1
3931 #define kvLED_ACTION_LED_0_ON 2
3932 #define kvLED_ACTION_LED_0_OFF 3
3933 #define kvLED_ACTION_LED_1_ON 4
3934 #define kvLED_ACTION_LED_1_OFF 5
3935 #define kvLED_ACTION_LED_2_ON 6
3936 #define kvLED_ACTION_LED_2_OFF 7
3937 #define kvLED_ACTION_LED_3_ON 8
3938 #define kvLED_ACTION_LED_3_OFF 9
3939 #define kvLED_ACTION_LED_4_ON 10
3940 #define kvLED_ACTION_LED_4_OFF 11
3941 #define kvLED_ACTION_LED_5_ON 12
3942 #define kvLED_ACTION_LED_5_OFF 13
3943 #define kvLED_ACTION_LED_6_ON 14
3944 #define kvLED_ACTION_LED_6_OFF 15
3945 #define kvLED_ACTION_LED_7_ON 16
3946 #define kvLED_ACTION_LED_7_OFF 17
3947 #define kvLED_ACTION_LED_8_ON 18
3948 #define kvLED_ACTION_LED_8_OFF 19
3949 #define kvLED_ACTION_LED_9_ON 20
3950 #define kvLED_ACTION_LED_9_OFF 21
3951 #define kvLED_ACTION_LED_10_ON 22
3952 #define kvLED_ACTION_LED_10_OFF 23
3953 #define kvLED_ACTION_LED_11_ON 24
3954 #define kvLED_ACTION_LED_11_OFF 25
3955 
3956 
3979 canStatus CANLIBAPI kvFlashLeds (const CanHandle hnd, int action, int timeout);
3980 
4000 canStatus CANLIBAPI canRequestChipStatus (const CanHandle hnd);
4001 
4028 canStatus CANLIBAPI canRequestBusStatistics (const CanHandle hnd);
4029 
4035 typedef struct canBusStatistics_s {
4036  unsigned long stdData;
4037  unsigned long stdRemote;
4038  unsigned long extData;
4039  unsigned long extRemote;
4040  unsigned long errFrame;
4041 
4046  unsigned long busLoad;
4047  unsigned long overruns;
4049 
4072 canStatus CANLIBAPI canGetBusStatistics (const CanHandle hnd,
4073  canBusStatistics *stat,
4074  size_t bufsiz);
4075 
4076 
4097 canStatus CANLIBAPI kvAnnounceIdentityEx (const CanHandle hnd,
4098  int type,
4099  void *buf,
4100  size_t bufsiz);
4101 
4123 canStatus CANLIBAPI canGetHandleData (const CanHandle hnd,
4124  int item,
4125  void *buffer,
4126  size_t bufsize);
4127 
4129 typedef void *kvTimeDomain;
4130 
4133 
4138 typedef struct kvTimeDomainData_s {
4144 
4173 kvStatus CANLIBAPI kvTimeDomainCreate (kvTimeDomain *domain);
4174 
4197 kvStatus CANLIBAPI kvTimeDomainDelete (kvTimeDomain domain);
4198 
4224 kvStatus CANLIBAPI kvTimeDomainResetTime (kvTimeDomain domain);
4225 
4250 kvStatus CANLIBAPI kvTimeDomainGetData (kvTimeDomain domain,
4251  kvTimeDomainData *data,
4252  size_t bufsiz);
4253 
4276 kvStatus CANLIBAPI kvTimeDomainAddHandle(kvTimeDomain domain,
4277  const CanHandle hnd);
4278 
4300 kvStatus CANLIBAPI kvTimeDomainRemoveHandle (kvTimeDomain domain,
4301  const CanHandle hnd);
4302 
4320 typedef void (CANLIBAPI *kvCallback_t) (CanHandle hnd, void* context, unsigned int notifyEvent);
4354 kvStatus CANLIBAPI kvSetNotifyCallback (const CanHandle hnd,
4355  kvCallback_t callback,
4356  void* context,
4357  unsigned int notifyFlags);
4358 
4372 #define kvBUSTYPE_NONE 0
4373 
4378 #define kvBUSTYPE_PCI 1
4379 
4384 #define kvBUSTYPE_PCMCIA 2
4385 
4390 #define kvBUSTYPE_USB 3
4391 
4396 #define kvBUSTYPE_WLAN 4
4397 
4402 #define kvBUSTYPE_PCI_EXPRESS 5
4403 
4408 #define kvBUSTYPE_ISA 6
4409 
4414 #define kvBUSTYPE_VIRTUAL 7
4415 
4420 #define kvBUSTYPE_PC104_PLUS 8
4421 
4426 #define kvBUSTYPE_LAN 9
4427 
4443 #define kvBUSTYPE_GROUP_VIRTUAL 1
4444 
4449 #define kvBUSTYPE_GROUP_LOCAL 2
4450 
4455 #define kvBUSTYPE_GROUP_REMOTE 3
4456 
4460 #define kvBUSTYPE_GROUP_INTERNAL 4
4461 
4515 kvStatus CANLIBAPI kvGetSupportedInterfaceInfo (int index,
4516  char *hwName,
4517  size_t nameLen,
4518  int *hwType,
4519  int *hwBusType);
4520 
4545 kvStatus CANLIBAPI kvReadDeviceCustomerData (const CanHandle hnd,
4546  int userNumber,
4547  int itemNumber,
4548  void *data,
4549  size_t bufsiz);
4550 
4564 #define kvENVVAR_TYPE_INT 1
4565 
4571 #define kvENVVAR_TYPE_FLOAT 2
4572 
4578 #define kvENVVAR_TYPE_STRING 3
4579 
4595 #define kvEVENT_TYPE_KEY 1
4596 
4604  typedef int64_t kvEnvHandle;
4605 
4625 kvStatus CANLIBAPI kvScriptStart (const CanHandle hnd, int slotNo);
4626 
4633 #define kvSCRIPT_STOP_NORMAL 0
4634 #define kvSCRIPT_STOP_FORCED -9
4658 kvStatus CANLIBAPI kvScriptStop (const CanHandle hnd, int slotNo, int mode);
4659 
4679 kvStatus CANLIBAPI kvScriptUnload (const CanHandle hnd, int slotNo);
4680 
4705 kvStatus CANLIBAPI kvScriptSendEvent (const CanHandle hnd,
4706  int slotNo,
4707  int eventType,
4708  int eventNo,
4709  unsigned int data);
4710 
4735 kvEnvHandle CANLIBAPI kvScriptEnvvarOpen (const CanHandle hnd,
4736  const char* envvarName,
4737  int *envvarType,
4738  int *envvarSize); // returns scriptHandle
4739 
4757 kvStatus CANLIBAPI kvScriptEnvvarClose (kvEnvHandle eHnd);
4758 
4779 kvStatus CANLIBAPI kvScriptEnvvarSetInt (kvEnvHandle eHnd, int val);
4780 
4802 kvStatus CANLIBAPI kvScriptEnvvarGetInt (kvEnvHandle eHnd, int *val);
4803 
4826 kvStatus CANLIBAPI kvScriptEnvvarSetFloat (kvEnvHandle eHnd, float val);
4827 
4851 kvStatus CANLIBAPI kvScriptEnvvarGetFloat (kvEnvHandle eHnd, float *val);
4852 
4879 kvStatus CANLIBAPI kvScriptEnvvarSetData (kvEnvHandle eHnd,
4880  const void *buf,
4881  int start_index,
4882  int data_len);
4883 
4909 kvStatus CANLIBAPI kvScriptEnvvarGetData (kvEnvHandle eHnd,
4910  void *buf,
4911  int start_index,
4912  int data_len);
4913 
4937 kvStatus CANLIBAPI kvScriptLoadFileOnDevice (const CanHandle hnd,
4938  int slotNo,
4939  char *localFile);
4940 
4969 kvStatus CANLIBAPI kvScriptLoadFile (const CanHandle hnd,
4970  int slotNo,
4971  char *filePathOnPC);
4972 
4973 
4987 #define kvSCRIPT_REQUEST_TEXT_UNSUBSCRIBE 1
4988 
4992 #define kvSCRIPT_REQUEST_TEXT_SUBSCRIBE 2
4993 
4997 #define kvSCRIPT_REQUEST_TEXT_ALL_SLOTS 255
4998 
5022 kvStatus CANLIBAPI kvScriptRequestText(const CanHandle hnd,
5023  unsigned int slot,
5024  unsigned int request);
5025 
5026 
5027 
5050 kvStatus CANLIBAPI kvScriptGetText(const CanHandle hnd,
5051  int *slot,
5052  unsigned long *time,
5053  unsigned int *flags,
5054  char *buf,
5055  size_t bufsize);
5056 
5063 #define kvSCRIPT_STATUS_LOADED 1
5064 #define kvSCRIPT_STATUS_RUNNING 2
5085 kvStatus CANLIBAPI kvScriptStatus(const CanHandle hnd,
5086  int slot,
5087  unsigned int *status);
5088 
5089 
5108 kvStatus CANLIBAPI kvScriptGetMaxEnvvarSize(int hnd, int *envvarSize);
5109 
5140 kvStatus CANLIBAPI kvScriptTxeGetData(const char *filePathOnPC,
5141  int item,
5142  void *buffer,
5143  unsigned int *bufsize);
5144 
5170 #define canTXEDATA_FILE_VERSION 1
5171 
5187 #define canTXEDATA_COMPILER_VERSION 2
5188 
5207 #define canTXEDATA_DATE 3
5208 
5219 #define canTXEDATA_DESCRIPTION 4
5220 
5234 #define canTXEDATA_SOURCE 5
5235 
5245 #define canTXEDATA_SIZE_OF_CODE 6
5246 
5256 #define canTXEDATA_IS_ENCRYPTED 7
5257 
5258 
5285 kvStatus CANLIBAPI kvFileCopyToDevice (const CanHandle hnd,
5286  char *hostFileName,
5287  char *deviceFileName);
5288 
5311 kvStatus CANLIBAPI kvFileCopyFromDevice (const CanHandle hnd,
5312  char *deviceFileName,
5313  char *hostFileName);
5314 
5336 kvStatus CANLIBAPI kvFileDelete (const CanHandle hnd, char *deviceFileName);
5337 
5360 kvStatus CANLIBAPI kvFileGetName (const CanHandle hnd,
5361  int fileNo,
5362  char *name,
5363  int namelen);
5364 
5384 kvStatus CANLIBAPI kvFileGetCount (const CanHandle hnd, int *count);
5385 
5408 kvStatus CANLIBAPI kvFileGetSystemData (const CanHandle hnd,
5409  int itemCode,
5410  int *result);
5411 
5430 kvStatus CANLIBAPI kvFileDiskFormat(const CanHandle hnd);
5431 
5449 #define kvDEVICE_MODE_INTERFACE 0x00
5450 
5455 #define kvDEVICE_MODE_LOGGER 0x01
5456 
5481 kvStatus CANLIBAPI kvDeviceSetMode (const CanHandle hnd, int mode);
5482 
5505 kvStatus CANLIBAPI kvDeviceGetMode (const CanHandle hnd, int *result);
5506 
5507 
5532 kvStatus CANLIBAPI kvReadTimer (const CanHandle hnd, unsigned int *time);
5556 kvStatus CANLIBAPI kvReadTimer64 (const CanHandle hnd, uint64_t *time);
5557 
5574 #define kvIO_INFO_GET_MODULE_TYPE 1
5575 
5581 #define kvIO_INFO_GET_DIRECTION 2
5582 
5588 #define kvIO_INFO_GET_PIN_TYPE 4
5589 
5595 #define kvIO_INFO_GET_NUMBER_OF_BITS 5
5596 
5604 #define kvIO_INFO_GET_RANGE_MIN 6
5605 
5613 #define kvIO_INFO_GET_RANGE_MAX 7
5614 
5622 #define kvIO_INFO_GET_DI_LOW_HIGH_FILTER 8
5623 
5631 #define kvIO_INFO_GET_DI_HIGH_LOW_FILTER 9
5632 
5640 #define kvIO_INFO_GET_AI_LP_FILTER_ORDER 10
5641 
5650 #define kvIO_INFO_GET_AI_HYSTERESIS 11
5651 
5657 #define kvIO_INFO_GET_MODULE_NUMBER 14
5658 
5664 #define kvIO_INFO_GET_SERIAL_NUMBER 15
5665 
5673 #define kvIO_INFO_GET_FW_VERSION 16
5674 
5695 #define kvIO_INFO_SET_DI_LOW_HIGH_FILTER 8
5696 
5704 #define kvIO_INFO_SET_DI_HIGH_LOW_FILTER 9
5705 
5713 #define kvIO_INFO_SET_AI_LP_FILTER_ORDER 10
5714 
5723 #define kvIO_INFO_SET_AI_HYSTERESIS 11
5724 
5741 #define kvIO_MODULE_TYPE_DIGITAL 1
5742 
5746 #define kvIO_MODULE_TYPE_ANALOG 2
5747 
5751 #define kvIO_MODULE_TYPE_RELAY 3
5752 
5756 #define kvIO_MODULE_TYPE_INTERNAL 4
5757 
5772 #define kvIO_PIN_TYPE_DIGITAL 1
5773 
5777 #define kvIO_PIN_TYPE_ANALOG 2
5778 
5782 #define kvIO_PIN_TYPE_RELAY 3
5783 
5798 #define kvIO_PIN_DIRECTION_IN 4
5799 
5803 #define kvIO_PIN_DIRECTION_OUT 8
5804 
5826 canStatus CANLIBAPI kvIoGetNumberOfPins (const CanHandle hnd, unsigned int *pinCount);
5827 
5844 canStatus CANLIBAPI kvIoConfirmConfig (const CanHandle hnd);
5845 
5865 canStatus CANLIBAPI kvIoPinGetInfo (const CanHandle hnd, unsigned int pin, int item, void *buffer, const unsigned int bufsize);
5866 
5886 canStatus CANLIBAPI kvIoPinSetInfo (const CanHandle hnd, unsigned int pin, int item, const void *buffer, const unsigned int bufsize);
5887 
5905 canStatus CANLIBAPI kvIoPinSetDigital (const CanHandle hnd, unsigned int pin, unsigned int value);
5906 
5926 canStatus CANLIBAPI kvIoPinGetDigital (const CanHandle hnd, unsigned int pin, unsigned int *value);
5927 
5949 canStatus CANLIBAPI kvIoPinGetOutputDigital (const CanHandle hnd, unsigned int pin, unsigned int *value);
5950 
5968 canStatus CANLIBAPI kvIoPinSetRelay (const CanHandle hnd, unsigned int pin, unsigned int value);
5969 
5989 canStatus CANLIBAPI kvIoPinGetOutputRelay (const CanHandle hnd, unsigned int pin, unsigned int *value);
5990 
6008 canStatus CANLIBAPI kvIoPinSetAnalog (const CanHandle hnd, unsigned int pin, float value);
6009 
6027 canStatus CANLIBAPI kvIoPinGetAnalog (const CanHandle hnd, unsigned int pin, float* value);
6028 
6048 canStatus CANLIBAPI kvIoPinGetOutputAnalog (const CanHandle hnd, unsigned int pin, float* value);
6049 
6055 typedef struct {
6056  int type;
6057  unsigned char DO1 : 1;
6058  unsigned char DO2 : 1;
6059  unsigned char DO3 : 1;
6060  unsigned char DO4 : 1;
6061  unsigned char DO5 : 1;
6062  unsigned char DO6 : 1;
6063  unsigned char DO7 : 1;
6064  unsigned char DO8 : 1;
6065  unsigned char DO9 : 1;
6066  unsigned char DO10: 1;
6067  unsigned char DO11: 1;
6068  unsigned char DO12: 1;
6069  unsigned char DO13: 1;
6070  unsigned char DO14: 1;
6071  unsigned char DO15: 1;
6072  unsigned char DO16: 1;
6073  unsigned char DI1 : 1;
6074  unsigned char DI2 : 1;
6075  unsigned char DI3 : 1;
6076  unsigned char DI4 : 1;
6077  unsigned char DI5 : 1;
6078  unsigned char DI6 : 1;
6079  unsigned char DI7 : 1;
6080  unsigned char DI8 : 1;
6081  unsigned char DI9 : 1;
6082  unsigned char DI10: 1;
6083  unsigned char DI11: 1;
6084  unsigned char DI12: 1;
6085  unsigned char DI13: 1;
6086  unsigned char DI14: 1;
6087  unsigned char DI15: 1;
6088  unsigned char DI16: 1;
6090 
6091 
6097 typedef struct {
6098  int type;
6099  unsigned char DO: 1;
6100  unsigned char DI: 1;
6102 
6103 
6110 typedef struct {
6111  int type;
6112  unsigned char RO1 : 1;
6113  unsigned char RO2 : 1;
6114  unsigned char RO3 : 1;
6115  unsigned char RO4 : 1;
6116  unsigned char RO5 : 1;
6117  unsigned char RO6 : 1;
6118  unsigned char RO7 : 1;
6119  unsigned char RO8 : 1;
6120  unsigned char DI1 : 1;
6121  unsigned char DI2 : 1;
6122  unsigned char DI3 : 1;
6123  unsigned char DI4 : 1;
6124  unsigned char DI5 : 1;
6125  unsigned char DI6 : 1;
6126  unsigned char DI7 : 1;
6127  unsigned char DI8 : 1;
6128 } kvIoModuleRelay;
6129 
6136 typedef struct {
6137  int type;
6138  float AO1;
6139  float AO2;
6140  float AO3;
6141  float AO4;
6142  float AI1;
6143  float AI2;
6144  float AI3;
6145  float AI4;
6147 
6148 
6171 canStatus CANLIBAPI kvIoGetModulePins (const CanHandle hnd, unsigned int module, void *buffer, const unsigned int bufsize);
6172 
6173 
6197 canStatus CANLIBAPI kvIoSetModulePins (const CanHandle hnd, unsigned int module, const void *buffer, const unsigned int bufsize);
6198 
6199 
6200 #ifdef __cplusplus
6201 }
6202 #endif /* __cplusplus */
6203 
6204 #include "obsolete.h"
6205 
6206 #endif /* _CANLIB_H_ */
struct kvClockInfo kvClockInfo
Definitions which are retained for compatibility.
unsigned char DI10
Definition: canlib.h:6082
kvStatus kvScriptEnvvarGetFloat(kvEnvHandle eHnd, float *val)
int phase1
Definition: canlib.h:702
unsigned long stdRemote
Number of received standard (11-bit identifiers) remote frames.
Definition: canlib.h:4037
unsigned char DI5
Definition: canlib.h:6077
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)
kvStatus kvFileGetSystemData(const CanHandle hnd, int itemCode, int *result)
unsigned char busStatus
Definition: canlib.h:189
unsigned char DI12
Definition: canlib.h:6084
unsigned char RO3
Definition: canlib.h:6114
canStatus canGetBusOutputControl(const CanHandle hnd, unsigned int *drivertype)
kvStatus kvTimeDomainDelete(kvTimeDomain domain)
float AI2
Definition: canlib.h:6143
unsigned char DI8
Definition: canlib.h:6080
canStatus canGetDriverMode(const CanHandle hnd, int *lineMode, int *resNet)
struct canNotifyData::@0::@2 rx
unsigned char DO15
Definition: canlib.h:6071
void canInitializeLibrary(void)
canStatus canGetBusParamsFdTq(const CanHandle hnd, kvBusParamsTq *nominal, kvBusParamsTq *data)
canStatus kvIoPinGetInfo(const CanHandle hnd, unsigned int pin, int item, void *buffer, const unsigned int bufsize)
unsigned char DO8
Definition: canlib.h:6064
canStatus canReadStatus(const CanHandle hnd, unsigned long *const flags)
kvStatus kvTimeDomainCreate(kvTimeDomain *domain)
unsigned char DI9
Definition: canlib.h:6081
unsigned int portNo
Port number used in e.g. canIOCTL_SET_USER_IOPORT.
Definition: canlib.h:3200
int64_t kvEnvHandle
Definition: canlib.h:4604
int accuracy_ppm
Definition: canlib.h:2441
int nNonMagiSyncCards
number of non MagiSync™ interfaces
Definition: canlib.h:4141
unsigned char RO2
Definition: canlib.h:6113
canStatus kvIoGetNumberOfPins(const CanHandle hnd, unsigned int *pinCount)
canStatus canRequestBusStatistics(const CanHandle hnd)
kvStatus kvDeviceSetMode(const CanHandle hnd, int mode)
void * kvTimeDomain
Definition: canlib.h:4129
unsigned char DI7
Definition: canlib.h:6079
unsigned char DO
Definition: canlib.h:6099
unsigned char rxErrorCounter
Definition: canlib.h:191
unsigned char DO2
Definition: canlib.h:6058
unsigned long extRemote
Number of received extended (29-bit identifiers) remote frames.
Definition: canlib.h:4039
canStatus canClose(const CanHandle hnd)
unsigned char RO5
Definition: canlib.h:6116
int power_of_ten
Definition: canlib.h:2440
kvStatus kvFileGetCount(const CanHandle hnd, int *count)
struct canNotifyData canNotifyData
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:6137
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:6085
int canHandle
Definition: canlib.h:166
unsigned char DI14
Definition: canlib.h:6086
unsigned char DI1
Definition: canlib.h:6120
canStatus canObjBufDisable(const CanHandle hnd, int idx)
void * tag
Definition: canlib.h:174
unsigned char RO4
Definition: canlib.h:6115
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:6144
kvStatus kvScriptEnvvarGetInt(kvEnvHandle eHnd, int *val)
Definitions for the CANLIB API.
kvStatus kvScriptGetMaxEnvvarSize(int hnd, int *envvarSize)
Definition: canlib.h:6110
Definition: canlib.h:6055
canStatus kvIoPinSetInfo(const CanHandle hnd, unsigned int pin, int item, const void *buffer, const unsigned int bufsize)
kvStatus kvFileGetName(const CanHandle hnd, int fileNo, char *name, int namelen)
Definition: canlib.h:6136
canStatus canSetBusOutputControl(const CanHandle hnd, const unsigned int drivertype)
int tq
Definition: canlib.h:701
int type
Definition: canlib.h:6111
Definition: canlib.h:2458
int type
Definition: canlib.h:6056
int eventType
Definition: canlib.h:175
float AO3
Definition: canlib.h:6140
canStatus kvIoPinSetRelay(const CanHandle hnd, unsigned int pin, unsigned int value)
canStatus kvIoPinGetDigital(const CanHandle hnd, unsigned int pin, unsigned int *value)
int type
Definition: canlib.h:6098
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:6119
canStatus canBusOn(const CanHandle hnd)
Definition: canlib.h:6097
long id
Definition: canlib.h:181
unsigned char DI
Definition: canlib.h:6100
int sjw
Definition: canlib.h:704
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:6122
canStatus canObjBufWrite(const CanHandle hnd, int idx, int id, void *msg, unsigned int dlc, unsigned int flags)
kvEnvHandle kvScriptEnvvarOpen(const CanHandle hnd, const char *envvarName, int *envvarType, int *envvarSize)
Definition: canlib.h:173
struct kvTimeDomainData_s kvTimeDomainData
kvStatus kvScriptTxeGetData(const char *filePathOnPC, int item, void *buffer, unsigned int *bufsize)
struct kvBusParamsTq kvBusParamsTq
kvStatus kvScriptEnvvarClose(kvEnvHandle eHnd)
Definition: canlib.h:2436
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:6145
unsigned int portValue
Port value used in e.g. canIOCTL_SET_USER_IOPORT.
Definition: canlib.h:3201
kvBusParamsTq arbitration_max
Definition: canlib.h:2461
unsigned short canGetVersion(void)
unsigned char DI1
Definition: canlib.h:6073
unsigned char DI2
Definition: canlib.h:6074
int phase2
Definition: canlib.h:703
unsigned long errFrame
Number of error frames.
Definition: canlib.h:4040
int prop
Definition: canlib.h:705
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:6141
canStatus canFlushTransmitQueue(const CanHandle hnd)
kvStatus kvReadTimer64(const CanHandle hnd, uint64_t *time)
canStatus kvBitrateToBusParamsTq(const canHandle hnd, int freq, kvBusParamsTq *nominal)
unsigned char DO10
Definition: canlib.h:6066
kvStatus kvTimeDomainResetTime(kvTimeDomain domain)
unsigned char DO3
Definition: canlib.h:6059
kvBusParamsTq data_min
Definition: canlib.h:2462
canStatus canAccept(const CanHandle hnd, const long envelope, const unsigned int flag)
CanHandle canOpenChannel(int channel, int flags)
kvStatus kvScriptEnvvarSetFloat(kvEnvHandle eHnd, float val)
unsigned long extData
Number of received extended (29-bit identifiers) data frames.
Definition: canlib.h:4038
float AO1
Definition: canlib.h:6138
Definition: canlib.h:700
kvStatus kvReadTimer(const CanHandle hnd, unsigned int *time)
canStatus canObjBufEnable(const CanHandle hnd, int idx)
int denominator
Definition: canlib.h:2439
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:6072
kvStatus kvScriptSendEvent(const CanHandle hnd, int slotNo, int eventType, int eventNo, unsigned int data)
canStatus kvBitrateToBusParamsFdTq(const canHandle hnd, int freqA, int freqD, kvBusParamsTq *arbitration, kvBusParamsTq *data)
kvStatus kvTimeDomainGetData(kvTimeDomain domain, kvTimeDomainData *data, size_t bufsiz)
kvStatus kvScriptStart(const CanHandle hnd, int slotNo)
kvStatus kvTimeDomainRemoveHandle(kvTimeDomain domain, const CanHandle hnd)
kvStatus kvFileCopyFromDevice(const CanHandle hnd, char *deviceFileName, char *hostFileName)
unsigned char DO4
Definition: canlib.h:6060
unsigned char DI8
Definition: canlib.h:6127
unsigned char DI6
Definition: canlib.h:6078
canStatus canSetNotify(const CanHandle hnd, void(*callback)(canNotifyData *), unsigned int notifyFlags, void *tag)
unsigned char txErrorCounter
Definition: canlib.h:190
canStatus kvIoPinGetAnalog(const CanHandle hnd, unsigned int pin, float *value)
unsigned char DO1
Definition: canlib.h:6057
canStatus canSetBusParamsFdTq(const CanHandle hnd, const kvBusParamsTq arbitration, const kvBusParamsTq data)
canStatus canObjBufSetFlags(const CanHandle hnd, int idx, unsigned int flags)
kvStatus kvFileDelete(const CanHandle hnd, char *deviceFileName)
unsigned char RO7
Definition: canlib.h:6118
unsigned char RO1
Definition: canlib.h:6112
unsigned char DI16
Definition: canlib.h:6088
kvBusParamsTq arbitration_min
Definition: canlib.h:2460
unsigned char DI5
Definition: canlib.h:6124
void(* kvCallback_t)(CanHandle hnd, void *context, unsigned int notifyEvent)
Definition: canlib.h:4320
int prescaler
Definition: canlib.h:706
canStatus canSetBusParamsC200(const CanHandle hnd, unsigned char btr0, unsigned char btr1)
int nMagiSyncGroups
number of MagiSync™ groups
Definition: canlib.h:4139
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
unsigned char DI11
Definition: canlib.h:6083
struct kvBusParamLimits kvBusParamLimits
kvStatus kvDeviceGetMode(const CanHandle hnd, int *result)
canStatus kvIoPinGetOutputDigital(const CanHandle hnd, unsigned int pin, unsigned int *value)
unsigned char RO6
Definition: canlib.h:6117
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:4036
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:4047
kvStatus kvTimeDomainAddHandle(kvTimeDomain domain, const CanHandle hnd)
kvStatus kvFileCopyToDevice(const CanHandle hnd, char *hostFileName, char *deviceFileName)
Definition: canlib.h:4138
unsigned char DI3
Definition: canlib.h:6075
canStatus canReadTimer(const CanHandle hnd, unsigned long *time)
unsigned char DO7
Definition: canlib.h:6063
canStatus kvIoPinSetDigital(const CanHandle hnd, unsigned int pin, unsigned int value)
unsigned char DI4
Definition: canlib.h:6076
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:6142
canStatus canGetErrorText(canStatus err, char *buf, unsigned int bufsiz)
kvBusParamsTq data_max
Definition: canlib.h:2463
unsigned long busLoad
Definition: canlib.h:4046
unsigned char DI7
Definition: canlib.h:6126
unsigned char DO13
Definition: canlib.h:6069
canStatus canRequestChipStatus(const CanHandle hnd)
int version
Definition: canlib.h:2437
Definition: canlib.h:4035
canStatus canEnumHardwareEx(int *channelCount)
unsigned char DI4
Definition: canlib.h:6123
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:171
kvStatus kvScriptEnvvarSetData(kvEnvHandle eHnd, const void *buf, int start_index, int data_len)
canStatus kvStatus
Definition: canlib.h:4132
Definition: canlib.h:3199
canStatus kvAnnounceIdentityEx(const CanHandle hnd, int type, void *buf, size_t bufsiz)
union canNotifyData::@0 info
canStatus canResetBus(const CanHandle hnd)
canStatus canObjBufAllocate(const CanHandle hnd, int type)
unsigned char DI2
Definition: canlib.h:6121
int nNonMagiSyncedMembers
number of non MagiSync™ members
Definition: canlib.h:4142
canStatus canSetBusParamsTq(const CanHandle hnd, const kvBusParamsTq nominal)
unsigned char DO6
Definition: canlib.h:6062
canStatus canGetNumberOfChannels(int *channelCount)
canStatus canGetHandleData(const CanHandle hnd, int item, void *buffer, size_t bufsize)
kvStatus kvFileDiskFormat(const CanHandle hnd)
kvStatus kvScriptEnvvarGetData(kvEnvHandle eHnd, void *buf, int start_index, int data_len)
unsigned char DO9
Definition: canlib.h:6065
unsigned char DO14
Definition: canlib.h:6070
unsigned long time
Definition: canlib.h:178
canStatus canGetBusParamsTq(const CanHandle hnd, kvBusParamsTq *nominal)
unsigned char DO5
Definition: canlib.h:6061
canStatus canReadSync(const CanHandle hnd, unsigned long timeout)
float AO2
Definition: canlib.h:6139
int version
Definition: canlib.h:2459
int numerator
Definition: canlib.h:2438
kvStatus kvScriptUnload(const CanHandle hnd, int slotNo)
canStatus canObjBufSetPeriod(const CanHandle hnd, int idx, unsigned int period)
unsigned char DI6
Definition: canlib.h:6125
canStatus canObjBufFreeAll(const CanHandle hnd)
canStatus canIoCtl(const CanHandle hnd, unsigned int func, void *buf, unsigned int buflen)
unsigned char DI15
Definition: canlib.h:6087
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:6067
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:4140
unsigned char DO12
Definition: canlib.h:6068