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 
154 #ifndef _CANLIB_H_
155 #define _CANLIB_H_
156 
157 #include <stdlib.h>
158 
159 #include <stdint.h>
160 
161 #include "canstat.h"
162 #include "bus_params_tq.h"
163 
165 typedef int canHandle;
166 
167 # define canINVALID_HANDLE (-1)
168 
169 
171 
172 typedef struct canNotifyData {
173  void *tag;
175  union {
176  struct {
177  unsigned long time;
178  } busErr;
179  struct {
180  long id;
181  unsigned long time;
182  } rx;
183  struct {
184  long id;
185  unsigned long time;
186  } tx;
187  struct {
188  unsigned char busStatus;
189  unsigned char txErrorCounter;
190  unsigned char rxErrorCounter;
191  unsigned long time;
192  } status;
193  } info;
194 } canNotifyData;
195 
196 
206 // The canWANT_xxx names are also obsolete, use canOPEN_xxx instead for new developments.
207 #define canWANT_EXCLUSIVE 0x0008
208 #define canWANT_EXTENDED 0x0010
209 #define canWANT_VIRTUAL 0x0020
210 
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_4M_80P (-1003)
447 
450 #define canFD_BITRATE_8M_60P (-1004)
451 
454 #define canFD_BITRATE_8M_80P (-1005)
455 
457 #define BAUD_1M (-1)
458 
459 #define BAUD_500K (-2)
460 
461 #define BAUD_250K (-3)
462 
463 #define BAUD_125K (-4)
464 
465 #define BAUD_100K (-5)
466 
467 #define BAUD_62K (-6)
468 
469 #define BAUD_50K (-7)
470 
471 #define BAUD_83K (-8)
472 
475 //
476 // Define CANLIBAPI unless it's done already.
477 // (canlib.c provides its own definitions of CANLIBAPI, DLLIMPORT
478 // and DLLEXPORT before including this file.)
479 //
480 #ifndef CANLIBAPI
481 # define CANLIBAPI
482 #endif /* CANLIBAPI */
483 
484 
485 #ifdef __cplusplus
486 extern "C" {
487 #endif /* __cplusplus */
488 
510 void CANLIBAPI canInitializeLibrary (void);
511 
533 canStatus CANLIBAPI canEnumHardwareEx (int *channelCount);
534 
559 canStatus CANLIBAPI canClose (const CanHandle hnd);
560 
585 canStatus CANLIBAPI canBusOn (const CanHandle hnd);
586 
607 canStatus CANLIBAPI canBusOff (const CanHandle hnd);
608 
658 canStatus CANLIBAPI canSetBusParams (const CanHandle hnd,
659  long freq,
660  unsigned int tseg1,
661  unsigned int tseg2,
662  unsigned int sjw,
663  unsigned int noSamp,
664  unsigned int syncmode);
665 
691  canStatus CANLIBAPI canSetBusParamsTq(const CanHandle hnd,
692  const kvBusParamsTq nominal);
693 
727 canStatus CANLIBAPI canSetBusParamsFd (const CanHandle hnd,
728  long freq_brs,
729  unsigned int tseg1_brs,
730  unsigned int tseg2_brs,
731  unsigned int sjw_brs);
732 
759 canStatus CANLIBAPI canSetBusParamsFdTq(const CanHandle hnd,
760  const kvBusParamsTq arbitration,
761  const kvBusParamsTq data);
762 
763 
795 canStatus CANLIBAPI canGetBusParams (const CanHandle hnd,
796  long *freq,
797  unsigned int *tseg1,
798  unsigned int *tseg2,
799  unsigned int *sjw,
800  unsigned int *noSamp,
801  unsigned int *syncmode);
802 
822 canStatus CANLIBAPI canGetBusParamsTq(const CanHandle hnd,
823  kvBusParamsTq *nominal);
824 
847 canStatus CANLIBAPI canGetBusParamsFd(const CanHandle hnd,
848  long *freq_brs,
849  unsigned int *tseg1_brs,
850  unsigned int *tseg2_brs,
851  unsigned int *sjw_brs);
852 
873 canStatus CANLIBAPI canGetBusParamsFdTq(const CanHandle hnd,
874  kvBusParamsTq *nominal,
875  kvBusParamsTq *data);
876 
901 canStatus CANLIBAPI canSetBusOutputControl (const CanHandle hnd,
902  const unsigned int drivertype);
903 
938 canStatus CANLIBAPI canGetBusOutputControl (const CanHandle hnd,
939  unsigned int *drivertype);
940 
983 canStatus CANLIBAPI canAccept (const CanHandle hnd,
984  const long envelope,
985  const unsigned int flag);
986 
1010 canStatus CANLIBAPI canReadStatus (const CanHandle hnd,
1011  unsigned long *const flags);
1012 
1049 canStatus CANLIBAPI canReadErrorCounters (const CanHandle hnd,
1050  unsigned int *txErr,
1051  unsigned int *rxErr,
1052  unsigned int *ovErr);
1053 
1095 canStatus CANLIBAPI canWrite (const CanHandle hnd,
1096  long id,
1097  void *msg,
1098  unsigned int dlc,
1099  unsigned int flag);
1100 
1128 canStatus CANLIBAPI canWriteSync (const CanHandle hnd, unsigned long timeout);
1129 
1181 canStatus CANLIBAPI canRead (const CanHandle hnd,
1182  long *id,
1183  void *msg,
1184  unsigned int *dlc,
1185  unsigned int *flag,
1186  unsigned long *time);
1237 canStatus CANLIBAPI canReadWait (const CanHandle hnd,
1238  long *id,
1239  void *msg,
1240  unsigned int *dlc,
1241  unsigned int *flag,
1242  unsigned long *time,
1243  unsigned long timeout);
1244 
1296 canStatus CANLIBAPI canReadSpecific (const CanHandle hnd, long id, void * msg,
1297  unsigned int * dlc, unsigned int * flag,
1298  unsigned long * time);
1299 
1330 canStatus CANLIBAPI canReadSync (const CanHandle hnd, unsigned long timeout);
1331 
1363 canStatus CANLIBAPI canReadSyncSpecific (const CanHandle hnd,
1364  long id,
1365  unsigned long timeout);
1366 
1412 canStatus CANLIBAPI canReadSpecificSkip (const CanHandle hnd,
1413  long id,
1414  void * msg,
1415  unsigned int * dlc,
1416  unsigned int * flag,
1417  unsigned long * time);
1418 
1439 canStatus CANLIBAPI canSetNotify (const CanHandle hnd,
1440  void (*callback)(canNotifyData *),
1441  unsigned int notifyFlags,
1442  void *tag);
1443 
1457 canStatus CANLIBAPI canGetRawHandle (const CanHandle hnd, void *pvFd);
1458 
1493 canStatus CANLIBAPI canTranslateBaud (long *const freq,
1494  unsigned int *const tseg1,
1495  unsigned int *const tseg2,
1496  unsigned int *const sjw,
1497  unsigned int *const nosamp,
1498  unsigned int *const syncMode);
1499 
1522 canStatus CANLIBAPI kvBitrateToBusParamsTq (const canHandle hnd,
1523  int freq,
1524  kvBusParamsTq *nominal);
1525 
1551 canStatus CANLIBAPI kvBitrateToBusParamsFdTq (const canHandle hnd,
1552  int freqA,
1553  int freqD,
1554  kvBusParamsTq *arbitration,
1555  kvBusParamsTq *data);
1556 
1579 canStatus CANLIBAPI canGetErrorText (canStatus err, char *buf, unsigned int bufsiz);
1580 
1610 unsigned short CANLIBAPI canGetVersion (void);
1611 
1640 canStatus CANLIBAPI canIoCtl (const CanHandle hnd,
1641  unsigned int func,
1642  void *buf,
1643  unsigned int buflen);
1644 
1645 
1651 canStatus CANLIBAPI canReadTimer (const CanHandle hnd, unsigned long *time);
1652 
1703 CanHandle CANLIBAPI canOpenChannel (int channel, int flags);
1704 
1725 canStatus CANLIBAPI canGetNumberOfChannels (int *channelCount);
1726 
1727 
1735 #define kvREMOTE_TYPE_NOT_REMOTE 0
1736 #define kvREMOTE_TYPE_WLAN 1
1737 #define kvREMOTE_TYPE_LAN 2
1738 
1747 #define kvLOGGER_TYPE_NOT_A_LOGGER 0
1748 #define kvLOGGER_TYPE_V1 1
1749 #define kvLOGGER_TYPE_V2 2
1750 
1783 canStatus CANLIBAPI canGetChannelData (int channel,
1784  int item,
1785  void *buffer,
1786  size_t bufsize);
1787 
1806 #define canCHANNELDATA_CHANNEL_CAP 1
1807 
1817 #define canCHANNELDATA_TRANS_CAP 2
1818 
1827 #define canCHANNELDATA_CHANNEL_FLAGS 3 // available, etc
1828 
1837 #define canCHANNELDATA_CARD_TYPE 4
1838 
1848 #define canCHANNELDATA_CARD_NUMBER 5
1849 
1857 #define canCHANNELDATA_CHAN_NO_ON_CARD 6
1858 
1868 #define canCHANNELDATA_CARD_SERIAL_NO 7
1869 
1879 #define canCHANNELDATA_TRANS_SERIAL_NO 8
1880 
1891 #define canCHANNELDATA_CARD_FIRMWARE_REV 9
1892 
1903 #define canCHANNELDATA_CARD_HARDWARE_REV 10
1904 
1914 #define canCHANNELDATA_CARD_UPC_NO 11
1915 
1926 #define canCHANNELDATA_TRANS_UPC_NO 12
1927 
1945 #define canCHANNELDATA_CHANNEL_NAME 13
1946 
1962 # define canCHANNELDATA_DLL_FILE_VERSION 14
1963 
1979 # define canCHANNELDATA_DLL_PRODUCT_VERSION 15
1980 
1996 # define canCHANNELDATA_DLL_FILETYPE 16
1997 
2006 # define canCHANNELDATA_TRANS_TYPE 17
2007 
2031 # define canCHANNELDATA_DEVICE_PHYSICAL_POSITION 18
2032 
2045 # define canCHANNELDATA_UI_NUMBER 19
2046 
2070 # define canCHANNELDATA_TIMESYNC_ENABLED 20
2071 
2086 # define canCHANNELDATA_DRIVER_FILE_VERSION 21
2087 
2102 # define canCHANNELDATA_DRIVER_PRODUCT_VERSION 22
2103 
2112 # define canCHANNELDATA_MFGNAME_UNICODE 23
2113 
2121 # define canCHANNELDATA_MFGNAME_ASCII 24
2122 
2131 # define canCHANNELDATA_DEVDESCR_UNICODE 25
2132 
2140 # define canCHANNELDATA_DEVDESCR_ASCII 26
2141 
2152 # define canCHANNELDATA_DRIVER_NAME 27
2153 
2166 # define canCHANNELDATA_CHANNEL_QUALITY 28
2167 
2176 # define canCHANNELDATA_ROUNDTRIP_TIME 29
2177 
2186 # define canCHANNELDATA_BUS_TYPE 30
2187 
2200 # define canCHANNELDATA_DEVNAME_ASCII 31
2201 
2212 # define canCHANNELDATA_TIME_SINCE_LAST_SEEN 32
2213 
2223 # define canCHANNELDATA_REMOTE_OPERATIONAL_MODE 33
2224 
2233 # define canCHANNELDATA_REMOTE_PROFILE_NAME 34
2234 
2243 # define canCHANNELDATA_REMOTE_HOST_NAME 35
2244 
2253 # define canCHANNELDATA_REMOTE_MAC 36
2254 
2263 # define canCHANNELDATA_MAX_BITRATE 37
2264 
2275 # define canCHANNELDATA_CHANNEL_CAP_MASK 38
2276 
2288 #define canCHANNELDATA_CUST_CHANNEL_NAME 39
2289 
2299 # define canCHANNELDATA_IS_REMOTE 40
2300 
2309 # define canCHANNELDATA_REMOTE_TYPE 41
2310 
2319 # define canCHANNELDATA_LOGGER_TYPE 42
2320 
2330 # define canCHANNELDATA_HW_STATUS 43
2331 
2341 # define canCHANNELDATA_FEATURE_EAN 44
2342 
2349 #define canCHANNELDATA_BUS_PARAM_LIMITS 45
2350 
2357 #define canCHANNELDATA_CLOCK_INFO 46
2358 
2379 #define canCHANNELDATA_CHANNEL_CAP_EX 47
2380 
2393 typedef struct kvClockInfo {
2394  int version;
2399 }kvClockInfo;
2400 
2415 typedef struct kvBusParamLimits {
2416  int version;
2422 
2433 #define canCHANNEL_IS_EXCLUSIVE 0x0001
2434 
2436 #define canCHANNEL_IS_OPEN 0x0002
2437 
2440 #define canCHANNEL_IS_CANFD 0x0004
2441 
2442 //#define canCHANNEL_IS_CANFD_NON_ISO 0x0008 Reserved for when needed
2443 
2446 #define canCHANNEL_IS_LIN 0x0010
2447 
2450 #define canCHANNEL_IS_LIN_MASTER 0x0020
2451 
2454 #define canCHANNEL_IS_LIN_SLAVE 0x0040
2455 
2456 
2475 #define canHWTYPE_NONE 0
2476 #define canHWTYPE_VIRTUAL 1
2477 #define canHWTYPE_LAPCAN 2
2478 #define canHWTYPE_CANPARI 3
2479 #define canHWTYPE_PCCAN 8
2480 #define canHWTYPE_PCICAN 9
2481 #define canHWTYPE_USBCAN 11
2482 #define canHWTYPE_PCICAN_II 40
2483 #define canHWTYPE_USBCAN_II 42
2484 #define canHWTYPE_SIMULATED 44
2485 #define canHWTYPE_ACQUISITOR 46
2486 #define canHWTYPE_LEAF 48
2487 #define canHWTYPE_PC104_PLUS 50
2488 #define canHWTYPE_PCICANX_II 52
2489 #define canHWTYPE_MEMORATOR_II 54
2490 #define canHWTYPE_MEMORATOR_PRO 54
2491 #define canHWTYPE_USBCAN_PRO 56
2492 #define canHWTYPE_IRIS 58
2493 #define canHWTYPE_BLACKBIRD 58
2494 #define canHWTYPE_MEMORATOR_LIGHT 60
2495 #define canHWTYPE_MINIHYDRA 62
2496 #define canHWTYPE_EAGLE 62
2497 #define canHWTYPE_BAGEL 64
2498 #define canHWTYPE_BLACKBIRD_V2 64
2499 #define canHWTYPE_MINIPCIE 66
2500 #define canHWTYPE_USBCAN_KLINE 68
2501 #define canHWTYPE_ETHERCAN 70
2502 #define canHWTYPE_USBCAN_LIGHT 72
2503 #define canHWTYPE_USBCAN_PRO2 74
2504 #define canHWTYPE_PCIE_V2 76
2505 #define canHWTYPE_MEMORATOR_PRO2 78
2506 #define canHWTYPE_LEAF2 80
2507 #define canHWTYPE_MEMORATOR_V2 82
2508 #define canHWTYPE_CANLINHYBRID 84
2509 #define canHWTYPE_DINRAIL 86
2510 #define canHWTYPE_U100 88
2511 
2512 
2521 #define canCHANNEL_CAP_EXTENDED_CAN 0x00000001L
2522 #define canCHANNEL_CAP_BUS_STATISTICS 0x00000002L
2523 #define canCHANNEL_CAP_ERROR_COUNTERS 0x00000004L
2524 #define canCHANNEL_CAP_RESERVED_2 0x00000008L
2525 #define canCHANNEL_CAP_GENERATE_ERROR 0x00000010L
2526 #define canCHANNEL_CAP_GENERATE_OVERLOAD 0x00000020L
2527 #define canCHANNEL_CAP_TXREQUEST 0x00000040L
2528 #define canCHANNEL_CAP_TXACKNOWLEDGE 0x00000080L
2529 #define canCHANNEL_CAP_VIRTUAL 0x00010000L
2530 #define canCHANNEL_CAP_SIMULATED 0x00020000L
2531 #define canCHANNEL_CAP_RESERVED_1 0x00040000L
2532 #define canCHANNEL_CAP_CAN_FD 0x00080000L
2533 #define canCHANNEL_CAP_CAN_FD_NONISO 0x00100000L
2534 #define canCHANNEL_CAP_SILENT_MODE 0x00200000L
2535 #define canCHANNEL_CAP_SINGLE_SHOT 0x00400000L
2536 #define canCHANNEL_CAP_LOGGER 0x00800000L
2537 #define canCHANNEL_CAP_REMOTE_ACCESS 0x01000000L
2538 #define canCHANNEL_CAP_SCRIPT 0x02000000L
2539 #define canCHANNEL_CAP_LIN_HYBRID 0x04000000L
2540 #define canCHANNEL_CAP_IO_API 0x08000000L
2541 #define canCHANNEL_CAP_DIAGNOSTICS 0x10000000L
2542 
2543 
2549 #define canCHANNEL_CAP_EX_BUSPARAMS_TQ 0x0000000000000001L
2550 
2551 
2563 #define canCHANNEL_OPMODE_NONE 1
2564 
2568 #define canCHANNEL_OPMODE_INFRASTRUCTURE 2
2569 
2573 #define canCHANNEL_OPMODE_RESERVED 3
2574 
2578 #define canCHANNEL_OPMODE_ADHOC 4
2579 
2589 #define canDRIVER_CAP_HIGHSPEED 0x00000001L
2590 
2616 #define canIOCTL_PREFER_EXT 1
2617 
2630 #define canIOCTL_PREFER_STD 2
2631 
2648 #define canIOCTL_CLEAR_ERROR_COUNTERS 5
2649 
2664 #define canIOCTL_SET_TIMER_SCALE 6
2665 
2685 #define canIOCTL_SET_TXACK 7
2686 
2699 #define canIOCTL_GET_RX_BUFFER_LEVEL 8
2700 
2713 #define canIOCTL_GET_TX_BUFFER_LEVEL 9
2714 
2724 #define canIOCTL_FLUSH_RX_BUFFER 10
2725 
2735 #define canIOCTL_FLUSH_TX_BUFFER 11
2736 
2745 #define canIOCTL_GET_TIMER_SCALE 12
2746 
2762 #define canIOCTL_SET_TXRQ 13
2763 
2764 
2771 #define canIOCTL_SET_BYPASS_MODE 15
2772 
2778 #define canIOCTL_SET_WAKEUP 16
2779 
2789 # define canIOCTL_GET_DRIVERHANDLE 17
2790 
2796 # define canIOCTL_MAP_RXQUEUE 18
2797 
2803 # define canIOCTL_GET_WAKEUP 19
2804 
2816 # define canIOCTL_SET_REPORT_ACCESS_ERRORS 20
2817 
2825 # define canIOCTL_GET_REPORT_ACCESS_ERRORS 21
2826 
2836 # define canIOCTL_CONNECT_TO_VIRTUAL_BUS 22
2837 
2847 # define canIOCTL_DISCONNECT_FROM_VIRTUAL_BUS 23
2848 
2858 # define canIOCTL_SET_USER_IOPORT 24
2859 
2870 # define canIOCTL_GET_USER_IOPORT 25
2871 
2877 # define canIOCTL_SET_BUFFER_WRAPAROUND_MODE 26
2878 
2895 # define canIOCTL_SET_RX_QUEUE_SIZE 27
2896 
2902 # define canIOCTL_SET_USB_THROTTLE 28
2903 
2909 # define canIOCTL_GET_USB_THROTTLE 29
2910 
2925 # define canIOCTL_SET_BUSON_TIME_AUTO_RESET 30
2926 
2938 # define canIOCTL_GET_TXACK 31
2939 
2954 # define canIOCTL_SET_LOCAL_TXECHO 32
2955 
2971 # define canIOCTL_SET_ERROR_FRAMES_REPORTING 33
2972 
2986 # define canIOCTL_GET_CHANNEL_QUALITY 34
2987 
2999 # define canIOCTL_GET_ROUNDTRIP_TIME 35
3000 
3009 # define canIOCTL_GET_BUS_TYPE 36
3010 
3023 # define canIOCTL_GET_DEVNAME_ASCII 37
3024 
3036 # define canIOCTL_GET_TIME_SINCE_LAST_SEEN 38
3037 
3051 # define canIOCTL_GET_TREF_LIST 39
3052 
3074 # define canIOCTL_TX_INTERVAL 40
3075 
3087 # define canIOCTL_SET_BRLIMIT 43
3088 
3094 # define canIOCTL_SET_USB_THROTTLE_SCALED 41
3095 
3110 # define canIOCTL_SET_THROTTLE_SCALED 41
3111 
3117 # define canIOCTL_GET_USB_THROTTLE_SCALED 42
3118 
3133 # define canIOCTL_GET_THROTTLE_SCALED 42
3134 
3142 # define canIOCTL_RESET_OVERRUN_COUNT 44
3143 
3152 # define canIOCTL_LIN_MODE 45
3153 
3156 typedef struct {
3157  unsigned int portNo;
3158  unsigned int portValue;
3160 
3161 
3202 canStatus CANLIBAPI canSetBusParamsC200 (const CanHandle hnd, unsigned char btr0, unsigned char btr1);
3203 
3204 
3205 
3241 canStatus CANLIBAPI canSetDriverMode (const CanHandle hnd, int lineMode, int resNet);
3242 
3279 canStatus CANLIBAPI canGetDriverMode (const CanHandle hnd, int *lineMode, int *resNet);
3280 
3300 #define canVERSION_CANLIB32_VERSION 0
3301 
3312 #define canVERSION_CANLIB32_PRODVER 1
3313 
3325 #define canVERSION_CANLIB32_PRODVER32 2
3326 
3337 #define canVERSION_CANLIB32_BETA 3
3338 
3358 unsigned int CANLIBAPI canGetVersionEx (unsigned int itemCode);
3359 
3360 
3380 canStatus CANLIBAPI canObjBufFreeAll (const CanHandle hnd);
3381 
3402 canStatus CANLIBAPI canObjBufAllocate (const CanHandle hnd, int type);
3403 
3412 #define canOBJBUF_TYPE_AUTO_RESPONSE 0x01
3413 #define canOBJBUF_TYPE_PERIODIC_TX 0x02
3414 
3436 canStatus CANLIBAPI canObjBufFree (const CanHandle hnd, int idx);
3437 
3438 // Writes CAN data to the object buffer with the specified index.
3439 
3465 canStatus CANLIBAPI canObjBufWrite (const CanHandle hnd,
3466  int idx,
3467  int id,
3468  void* msg,
3469  unsigned int dlc,
3470  unsigned int flags);
3471 
3497 canStatus CANLIBAPI canObjBufSetFilter (const CanHandle hnd,
3498  int idx,
3499  unsigned int code,
3500  unsigned int mask);
3501 
3522 canStatus CANLIBAPI canObjBufSetFlags (const CanHandle hnd,
3523  int idx,
3524  unsigned int flags);
3525 
3543 # define canOBJBUF_AUTO_RESPONSE_RTR_ONLY 0x01
3544 
3566 canStatus CANLIBAPI canObjBufSetPeriod (const CanHandle hnd,
3567  int idx,
3568  unsigned int period);
3569 
3590 canStatus CANLIBAPI canObjBufSetMsgCount (const CanHandle hnd,
3591  int idx,
3592  unsigned int count);
3593 
3613 canStatus CANLIBAPI canObjBufEnable (const CanHandle hnd, int idx);
3614 
3634 canStatus CANLIBAPI canObjBufDisable (const CanHandle hnd, int idx);
3635 
3659 canStatus CANLIBAPI canObjBufSendBurst (const CanHandle hnd,
3660  int idx,
3661  unsigned int burstlen);
3662 
3663 
3686 canStatus CANLIBAPI canResetBus (const CanHandle hnd);
3687 
3726 canStatus CANLIBAPI canWriteWait (const CanHandle hnd,
3727  long id,
3728  void *msg,
3729  unsigned int dlc,
3730  unsigned int flag,
3731  unsigned long timeout);
3732 
3733 
3759 canStatus CANLIBAPI canUnloadLibrary (void);
3760 
3822 canStatus CANLIBAPI canSetAcceptanceFilter (const CanHandle hnd,
3823  unsigned int code,
3824  unsigned int mask,
3825  int is_extended);
3849 canStatus CANLIBAPI canFlushReceiveQueue (const CanHandle hnd);
3850 
3875 canStatus CANLIBAPI canFlushTransmitQueue (const CanHandle hnd);
3876 
3877 
3886 #define kvLED_ACTION_ALL_LEDS_ON 0
3887 #define kvLED_ACTION_ALL_LEDS_OFF 1
3888 #define kvLED_ACTION_LED_0_ON 2
3889 #define kvLED_ACTION_LED_0_OFF 3
3890 #define kvLED_ACTION_LED_1_ON 4
3891 #define kvLED_ACTION_LED_1_OFF 5
3892 #define kvLED_ACTION_LED_2_ON 6
3893 #define kvLED_ACTION_LED_2_OFF 7
3894 #define kvLED_ACTION_LED_3_ON 8
3895 #define kvLED_ACTION_LED_3_OFF 9
3896 #define kvLED_ACTION_LED_4_ON 10
3897 #define kvLED_ACTION_LED_4_OFF 11
3898 #define kvLED_ACTION_LED_5_ON 12
3899 #define kvLED_ACTION_LED_5_OFF 13
3900 #define kvLED_ACTION_LED_6_ON 14
3901 #define kvLED_ACTION_LED_6_OFF 15
3902 #define kvLED_ACTION_LED_7_ON 16
3903 #define kvLED_ACTION_LED_7_OFF 17
3904 #define kvLED_ACTION_LED_8_ON 18
3905 #define kvLED_ACTION_LED_8_OFF 19
3906 #define kvLED_ACTION_LED_9_ON 20
3907 #define kvLED_ACTION_LED_9_OFF 21
3908 #define kvLED_ACTION_LED_10_ON 22
3909 #define kvLED_ACTION_LED_10_OFF 23
3910 #define kvLED_ACTION_LED_11_ON 24
3911 #define kvLED_ACTION_LED_11_OFF 25
3912 
3913 
3936 canStatus CANLIBAPI kvFlashLeds (const CanHandle hnd, int action, int timeout);
3937 
3957 canStatus CANLIBAPI canRequestChipStatus (const CanHandle hnd);
3958 
3985 canStatus CANLIBAPI canRequestBusStatistics (const CanHandle hnd);
3986 
3992 typedef struct canBusStatistics_s {
3993  unsigned long stdData;
3994  unsigned long stdRemote;
3995  unsigned long extData;
3996  unsigned long extRemote;
3997  unsigned long errFrame;
3998 
4003  unsigned long busLoad;
4004  unsigned long overruns;
4006 
4029 canStatus CANLIBAPI canGetBusStatistics (const CanHandle hnd,
4030  canBusStatistics *stat,
4031  size_t bufsiz);
4032 
4033 
4054 canStatus CANLIBAPI kvAnnounceIdentityEx (const CanHandle hnd,
4055  int type,
4056  void *buf,
4057  size_t bufsiz);
4058 
4080 canStatus CANLIBAPI canGetHandleData (const CanHandle hnd,
4081  int item,
4082  void *buffer,
4083  size_t bufsize);
4084 
4086 typedef void *kvTimeDomain;
4087 
4090 
4095 typedef struct kvTimeDomainData_s {
4101 
4130 kvStatus CANLIBAPI kvTimeDomainCreate (kvTimeDomain *domain);
4131 
4154 kvStatus CANLIBAPI kvTimeDomainDelete (kvTimeDomain domain);
4155 
4181 kvStatus CANLIBAPI kvTimeDomainResetTime (kvTimeDomain domain);
4182 
4207 kvStatus CANLIBAPI kvTimeDomainGetData (kvTimeDomain domain,
4208  kvTimeDomainData *data,
4209  size_t bufsiz);
4210 
4233 kvStatus CANLIBAPI kvTimeDomainAddHandle(kvTimeDomain domain,
4234  const CanHandle hnd);
4235 
4257 kvStatus CANLIBAPI kvTimeDomainRemoveHandle (kvTimeDomain domain,
4258  const CanHandle hnd);
4259 
4277 typedef void (CANLIBAPI *kvCallback_t) (CanHandle hnd, void* context, unsigned int notifyEvent);
4311 kvStatus CANLIBAPI kvSetNotifyCallback (const CanHandle hnd,
4312  kvCallback_t callback,
4313  void* context,
4314  unsigned int notifyFlags);
4315 
4329 #define kvBUSTYPE_NONE 0
4330 
4335 #define kvBUSTYPE_PCI 1
4336 
4341 #define kvBUSTYPE_PCMCIA 2
4342 
4347 #define kvBUSTYPE_USB 3
4348 
4353 #define kvBUSTYPE_WLAN 4
4354 
4359 #define kvBUSTYPE_PCI_EXPRESS 5
4360 
4365 #define kvBUSTYPE_ISA 6
4366 
4371 #define kvBUSTYPE_VIRTUAL 7
4372 
4377 #define kvBUSTYPE_PC104_PLUS 8
4378 
4383 #define kvBUSTYPE_LAN 9
4384 
4400 #define kvBUSTYPE_GROUP_VIRTUAL 1
4401 
4406 #define kvBUSTYPE_GROUP_LOCAL 2
4407 
4412 #define kvBUSTYPE_GROUP_REMOTE 3
4413 
4417 #define kvBUSTYPE_GROUP_INTERNAL 4
4418 
4472 kvStatus CANLIBAPI kvGetSupportedInterfaceInfo (int index,
4473  char *hwName,
4474  size_t nameLen,
4475  int *hwType,
4476  int *hwBusType);
4477 
4502 kvStatus CANLIBAPI kvReadDeviceCustomerData (const CanHandle hnd,
4503  int userNumber,
4504  int itemNumber,
4505  void *data,
4506  size_t bufsiz);
4507 
4521 #define kvENVVAR_TYPE_INT 1
4522 
4528 #define kvENVVAR_TYPE_FLOAT 2
4529 
4535 #define kvENVVAR_TYPE_STRING 3
4536 
4552 #define kvEVENT_TYPE_KEY 1
4553 
4561  typedef int64_t kvEnvHandle;
4562 
4582 kvStatus CANLIBAPI kvScriptStart (const CanHandle hnd, int slotNo);
4583 
4590 #define kvSCRIPT_STOP_NORMAL 0
4591 #define kvSCRIPT_STOP_FORCED -9
4615 kvStatus CANLIBAPI kvScriptStop (const CanHandle hnd, int slotNo, int mode);
4616 
4636 kvStatus CANLIBAPI kvScriptUnload (const CanHandle hnd, int slotNo);
4637 
4662 kvStatus CANLIBAPI kvScriptSendEvent (const CanHandle hnd,
4663  int slotNo,
4664  int eventType,
4665  int eventNo,
4666  unsigned int data);
4667 
4692 kvEnvHandle CANLIBAPI kvScriptEnvvarOpen (const CanHandle hnd,
4693  const char* envvarName,
4694  int *envvarType,
4695  int *envvarSize); // returns scriptHandle
4696 
4714 kvStatus CANLIBAPI kvScriptEnvvarClose (kvEnvHandle eHnd);
4715 
4736 kvStatus CANLIBAPI kvScriptEnvvarSetInt (kvEnvHandle eHnd, int val);
4737 
4759 kvStatus CANLIBAPI kvScriptEnvvarGetInt (kvEnvHandle eHnd, int *val);
4760 
4783 kvStatus CANLIBAPI kvScriptEnvvarSetFloat (kvEnvHandle eHnd, float val);
4784 
4808 kvStatus CANLIBAPI kvScriptEnvvarGetFloat (kvEnvHandle eHnd, float *val);
4809 
4836 kvStatus CANLIBAPI kvScriptEnvvarSetData (kvEnvHandle eHnd,
4837  const void *buf,
4838  int start_index,
4839  int data_len);
4840 
4866 kvStatus CANLIBAPI kvScriptEnvvarGetData (kvEnvHandle eHnd,
4867  void *buf,
4868  int start_index,
4869  int data_len);
4870 
4894 kvStatus CANLIBAPI kvScriptLoadFileOnDevice (const CanHandle hnd,
4895  int slotNo,
4896  char *localFile);
4897 
4926 kvStatus CANLIBAPI kvScriptLoadFile (const CanHandle hnd,
4927  int slotNo,
4928  char *filePathOnPC);
4929 
4930 
4944 #define kvSCRIPT_REQUEST_TEXT_UNSUBSCRIBE 1
4945 
4949 #define kvSCRIPT_REQUEST_TEXT_SUBSCRIBE 2
4950 
4954 #define kvSCRIPT_REQUEST_TEXT_ALL_SLOTS 255
4955 
4979 kvStatus CANLIBAPI kvScriptRequestText(const CanHandle hnd,
4980  unsigned int slot,
4981  unsigned int request);
4982 
4983 
4984 
5007 kvStatus CANLIBAPI kvScriptGetText(const CanHandle hnd,
5008  int *slot,
5009  unsigned long *time,
5010  unsigned int *flags,
5011  char *buf,
5012  size_t bufsize);
5013 
5020 #define kvSCRIPT_STATUS_LOADED 1
5021 #define kvSCRIPT_STATUS_RUNNING 2
5042 kvStatus CANLIBAPI kvScriptStatus(const CanHandle hnd,
5043  int slot,
5044  unsigned int *status);
5045 
5046 
5065 kvStatus CANLIBAPI kvScriptGetMaxEnvvarSize(int hnd, int *envvarSize);
5066 
5097 kvStatus CANLIBAPI kvScriptTxeGetData(const char *filePathOnPC,
5098  int item,
5099  void *buffer,
5100  unsigned int *bufsize);
5101 
5127 #define canTXEDATA_FILE_VERSION 1
5128 
5144 #define canTXEDATA_COMPILER_VERSION 2
5145 
5164 #define canTXEDATA_DATE 3
5165 
5176 #define canTXEDATA_DESCRIPTION 4
5177 
5191 #define canTXEDATA_SOURCE 5
5192 
5202 #define canTXEDATA_SIZE_OF_CODE 6
5203 
5213 #define canTXEDATA_IS_ENCRYPTED 7
5214 
5215 
5242 kvStatus CANLIBAPI kvFileCopyToDevice (const CanHandle hnd,
5243  char *hostFileName,
5244  char *deviceFileName);
5245 
5268 kvStatus CANLIBAPI kvFileCopyFromDevice (const CanHandle hnd,
5269  char *deviceFileName,
5270  char *hostFileName);
5271 
5293 kvStatus CANLIBAPI kvFileDelete (const CanHandle hnd, char *deviceFileName);
5294 
5317 kvStatus CANLIBAPI kvFileGetName (const CanHandle hnd,
5318  int fileNo,
5319  char *name,
5320  int namelen);
5321 
5341 kvStatus CANLIBAPI kvFileGetCount (const CanHandle hnd, int *count);
5342 
5365 kvStatus CANLIBAPI kvFileGetSystemData (const CanHandle hnd,
5366  int itemCode,
5367  int *result);
5368 
5387 kvStatus CANLIBAPI kvFileDiskFormat(const CanHandle hnd);
5388 
5406 #define kvDEVICE_MODE_INTERFACE 0x00
5407 
5412 #define kvDEVICE_MODE_LOGGER 0x01
5413 
5438 kvStatus CANLIBAPI kvDeviceSetMode (const CanHandle hnd, int mode);
5439 
5462 kvStatus CANLIBAPI kvDeviceGetMode (const CanHandle hnd, int *result);
5463 
5464 
5489 kvStatus CANLIBAPI kvReadTimer (const CanHandle hnd, unsigned int *time);
5513 kvStatus CANLIBAPI kvReadTimer64 (const CanHandle hnd, uint64_t *time);
5514 
5531 #define kvIO_INFO_GET_MODULE_TYPE 1
5532 
5538 #define kvIO_INFO_GET_DIRECTION 2
5539 
5545 #define kvIO_INFO_GET_PIN_TYPE 4
5546 
5552 #define kvIO_INFO_GET_NUMBER_OF_BITS 5
5553 
5561 #define kvIO_INFO_GET_RANGE_MIN 6
5562 
5570 #define kvIO_INFO_GET_RANGE_MAX 7
5571 
5579 #define kvIO_INFO_GET_DI_LOW_HIGH_FILTER 8
5580 
5588 #define kvIO_INFO_GET_DI_HIGH_LOW_FILTER 9
5589 
5597 #define kvIO_INFO_GET_AI_LP_FILTER_ORDER 10
5598 
5607 #define kvIO_INFO_GET_AI_HYSTERESIS 11
5608 
5614 #define kvIO_INFO_GET_MODULE_NUMBER 14
5615 
5621 #define kvIO_INFO_GET_SERIAL_NUMBER 15
5622 
5630 #define kvIO_INFO_GET_FW_VERSION 16
5631 
5652 #define kvIO_INFO_SET_DI_LOW_HIGH_FILTER 8
5653 
5661 #define kvIO_INFO_SET_DI_HIGH_LOW_FILTER 9
5662 
5670 #define kvIO_INFO_SET_AI_LP_FILTER_ORDER 10
5671 
5680 #define kvIO_INFO_SET_AI_HYSTERESIS 11
5681 
5698 #define kvIO_MODULE_TYPE_DIGITAL 1
5699 
5703 #define kvIO_MODULE_TYPE_ANALOG 2
5704 
5708 #define kvIO_MODULE_TYPE_RELAY 3
5709 
5713 #define kvIO_MODULE_TYPE_INTERNAL 4
5714 
5729 #define kvIO_PIN_TYPE_DIGITAL 1
5730 
5734 #define kvIO_PIN_TYPE_ANALOG 2
5735 
5739 #define kvIO_PIN_TYPE_RELAY 3
5740 
5755 #define kvIO_PIN_DIRECTION_IN 4
5756 
5760 #define kvIO_PIN_DIRECTION_OUT 8
5761 
5783 canStatus CANLIBAPI kvIoGetNumberOfPins (const CanHandle hnd, unsigned int *pinCount);
5784 
5801 canStatus CANLIBAPI kvIoConfirmConfig (const CanHandle hnd);
5802 
5822 canStatus CANLIBAPI kvIoPinGetInfo (const CanHandle hnd, unsigned int pin, int item, void *buffer, const unsigned int bufsize);
5823 
5843 canStatus CANLIBAPI kvIoPinSetInfo (const CanHandle hnd, unsigned int pin, int item, const void *buffer, const unsigned int bufsize);
5844 
5862 canStatus CANLIBAPI kvIoPinSetDigital (const CanHandle hnd, unsigned int pin, unsigned int value);
5863 
5883 canStatus CANLIBAPI kvIoPinGetDigital (const CanHandle hnd, unsigned int pin, unsigned int *value);
5884 
5906 canStatus CANLIBAPI kvIoPinGetOutputDigital (const CanHandle hnd, unsigned int pin, unsigned int *value);
5907 
5925 canStatus CANLIBAPI kvIoPinSetRelay (const CanHandle hnd, unsigned int pin, unsigned int value);
5926 
5946 canStatus CANLIBAPI kvIoPinGetOutputRelay (const CanHandle hnd, unsigned int pin, unsigned int *value);
5947 
5965 canStatus CANLIBAPI kvIoPinSetAnalog (const CanHandle hnd, unsigned int pin, float value);
5966 
5984 canStatus CANLIBAPI kvIoPinGetAnalog (const CanHandle hnd, unsigned int pin, float* value);
5985 
6005 canStatus CANLIBAPI kvIoPinGetOutputAnalog (const CanHandle hnd, unsigned int pin, float* value);
6006 
6012 typedef struct {
6013  int type;
6014  unsigned char DO1 : 1;
6015  unsigned char DO2 : 1;
6016  unsigned char DO3 : 1;
6017  unsigned char DO4 : 1;
6018  unsigned char DO5 : 1;
6019  unsigned char DO6 : 1;
6020  unsigned char DO7 : 1;
6021  unsigned char DO8 : 1;
6022  unsigned char DO9 : 1;
6023  unsigned char DO10: 1;
6024  unsigned char DO11: 1;
6025  unsigned char DO12: 1;
6026  unsigned char DO13: 1;
6027  unsigned char DO14: 1;
6028  unsigned char DO15: 1;
6029  unsigned char DO16: 1;
6030  unsigned char DI1 : 1;
6031  unsigned char DI2 : 1;
6032  unsigned char DI3 : 1;
6033  unsigned char DI4 : 1;
6034  unsigned char DI5 : 1;
6035  unsigned char DI6 : 1;
6036  unsigned char DI7 : 1;
6037  unsigned char DI8 : 1;
6038  unsigned char DI9 : 1;
6039  unsigned char DI10: 1;
6040  unsigned char DI11: 1;
6041  unsigned char DI12: 1;
6042  unsigned char DI13: 1;
6043  unsigned char DI14: 1;
6044  unsigned char DI15: 1;
6045  unsigned char DI16: 1;
6047 
6048 
6054 typedef struct {
6055  int type;
6056  unsigned char DO: 1;
6057  unsigned char DI: 1;
6059 
6060 
6067 typedef struct {
6068  int type;
6069  unsigned char RO1 : 1;
6070  unsigned char RO2 : 1;
6071  unsigned char RO3 : 1;
6072  unsigned char RO4 : 1;
6073  unsigned char RO5 : 1;
6074  unsigned char RO6 : 1;
6075  unsigned char RO7 : 1;
6076  unsigned char RO8 : 1;
6077  unsigned char DI1 : 1;
6078  unsigned char DI2 : 1;
6079  unsigned char DI3 : 1;
6080  unsigned char DI4 : 1;
6081  unsigned char DI5 : 1;
6082  unsigned char DI6 : 1;
6083  unsigned char DI7 : 1;
6084  unsigned char DI8 : 1;
6085 } kvIoModuleRelay;
6086 
6093 typedef struct {
6094  int type;
6095  float AO1;
6096  float AO2;
6097  float AO3;
6098  float AO4;
6099  float AI1;
6100  float AI2;
6101  float AI3;
6102  float AI4;
6104 
6105 
6128 canStatus CANLIBAPI kvIoGetModulePins (const CanHandle hnd, unsigned int module, void *buffer, const unsigned int bufsize);
6129 
6130 
6154 canStatus CANLIBAPI kvIoSetModulePins (const CanHandle hnd, unsigned int module, const void *buffer, const unsigned int bufsize);
6155 
6156 
6157 #ifdef __cplusplus
6158 }
6159 #endif /* __cplusplus */
6160 
6161 #include "obsolete.h"
6162 
6163 
6164 
6165 
6166 #endif /* _CANLIB_H_ */
struct kvClockInfo kvClockInfo
Definitions which are retained for compatibility.
unsigned char DI10
Definition: canlib.h:6039
kvStatus kvScriptEnvvarGetFloat(kvEnvHandle eHnd, float *val)
unsigned long stdRemote
Number of received standard (11-bit identifiers) remote frames.
Definition: canlib.h:3994
unsigned char DI5
Definition: canlib.h:6034
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:188
unsigned char DI12
Definition: canlib.h:6041
unsigned char RO3
Definition: canlib.h:6071
canStatus canGetBusOutputControl(const CanHandle hnd, unsigned int *drivertype)
kvStatus kvTimeDomainDelete(kvTimeDomain domain)
float AI2
Definition: canlib.h:6100
unsigned char DI8
Definition: canlib.h:6037
canStatus canGetDriverMode(const CanHandle hnd, int *lineMode, int *resNet)
struct canNotifyData::@0::@2 rx
unsigned char DO15
Definition: canlib.h:6028
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:6021
canStatus canReadStatus(const CanHandle hnd, unsigned long *const flags)
kvStatus kvTimeDomainCreate(kvTimeDomain *domain)
unsigned char DI9
Definition: canlib.h:6038
unsigned int portNo
Port number used in e.g. canIOCTL_SET_USER_IOPORT.
Definition: canlib.h:3157
int64_t kvEnvHandle
Definition: canlib.h:4561
int accuracy_ppm
Definition: canlib.h:2398
int nNonMagiSyncCards
number of non MagiSync™ interfaces
Definition: canlib.h:4098
unsigned char RO2
Definition: canlib.h:6070
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:4086
unsigned char DI7
Definition: canlib.h:6036
unsigned char DO
Definition: canlib.h:6056
unsigned char rxErrorCounter
Definition: canlib.h:190
unsigned char DO2
Definition: canlib.h:6015
unsigned long extRemote
Number of received extended (29-bit identifiers) remote frames.
Definition: canlib.h:3996
canStatus canClose(const CanHandle hnd)
unsigned char RO5
Definition: canlib.h:6073
int power_of_ten
Definition: canlib.h:2397
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:6094
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:6042
int canHandle
Definition: canlib.h:165
unsigned char DI14
Definition: canlib.h:6043
unsigned char DI1
Definition: canlib.h:6077
canStatus canObjBufDisable(const CanHandle hnd, int idx)
void * tag
Definition: canlib.h:173
unsigned char RO4
Definition: canlib.h:6072
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:6101
kvStatus kvScriptEnvvarGetInt(kvEnvHandle eHnd, int *val)
Definitions for the CANLIB API.
kvStatus kvScriptGetMaxEnvvarSize(int hnd, int *envvarSize)
Definition: canlib.h:6067
Definition: canlib.h:6012
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:6093
canStatus canSetBusOutputControl(const CanHandle hnd, const unsigned int drivertype)
int type
Definition: canlib.h:6068
Definition: canlib.h:2415
int type
Definition: canlib.h:6013
int eventType
Definition: canlib.h:174
float AO3
Definition: canlib.h:6097
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:6055
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:6076
canStatus canBusOn(const CanHandle hnd)
Definition: canlib.h:6054
long id
Definition: canlib.h:180
unsigned char DI
Definition: canlib.h:6057
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:6079
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:172
struct kvTimeDomainData_s kvTimeDomainData
kvStatus kvScriptTxeGetData(const char *filePathOnPC, int item, void *buffer, unsigned int *bufsize)
kvStatus kvScriptEnvvarClose(kvEnvHandle eHnd)
Definition: canlib.h:2393
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:6102
unsigned int portValue
Port value used in e.g. canIOCTL_SET_USER_IOPORT.
Definition: canlib.h:3158
kvBusParamsTq arbitration_max
Definition: canlib.h:2418
unsigned short canGetVersion(void)
unsigned char DI1
Definition: canlib.h:6030
unsigned char DI2
Definition: canlib.h:6031
unsigned long errFrame
Number of error frames.
Definition: canlib.h:3997
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:6098
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:6023
kvStatus kvTimeDomainResetTime(kvTimeDomain domain)
unsigned char DO3
Definition: canlib.h:6016
kvBusParamsTq data_min
Definition: canlib.h:2419
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:3995
float AO1
Definition: canlib.h:6095
Definition: bus_params_tq.h:104
kvStatus kvReadTimer(const CanHandle hnd, unsigned int *time)
canStatus canObjBufEnable(const CanHandle hnd, int idx)
int denominator
Definition: canlib.h:2396
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:6029
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:6017
unsigned char DI8
Definition: canlib.h:6084
unsigned char DI6
Definition: canlib.h:6035
canStatus canSetNotify(const CanHandle hnd, void(*callback)(canNotifyData *), unsigned int notifyFlags, void *tag)
unsigned char txErrorCounter
Definition: canlib.h:189
canStatus kvIoPinGetAnalog(const CanHandle hnd, unsigned int pin, float *value)
unsigned char DO1
Definition: canlib.h:6014
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:6075
unsigned char RO1
Definition: canlib.h:6069
unsigned char DI16
Definition: canlib.h:6045
kvBusParamsTq arbitration_min
Definition: canlib.h:2417
unsigned char DI5
Definition: canlib.h:6081
void(* kvCallback_t)(CanHandle hnd, void *context, unsigned int notifyEvent)
Definition: canlib.h:4277
canStatus canSetBusParamsC200(const CanHandle hnd, unsigned char btr0, unsigned char btr1)
int nMagiSyncGroups
number of MagiSync™ groups
Definition: canlib.h:4096
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:6040
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:6074
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:3993
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:4004
kvStatus kvTimeDomainAddHandle(kvTimeDomain domain, const CanHandle hnd)
Definitions for the CANLIB API.
kvStatus kvFileCopyToDevice(const CanHandle hnd, char *hostFileName, char *deviceFileName)
Definition: canlib.h:4095
unsigned char DI3
Definition: canlib.h:6032
canStatus canReadTimer(const CanHandle hnd, unsigned long *time)
unsigned char DO7
Definition: canlib.h:6020
canStatus kvIoPinSetDigital(const CanHandle hnd, unsigned int pin, unsigned int value)
unsigned char DI4
Definition: canlib.h:6033
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:6099
canStatus canGetErrorText(canStatus err, char *buf, unsigned int bufsiz)
kvBusParamsTq data_max
Definition: canlib.h:2420
unsigned long busLoad
Definition: canlib.h:4003
unsigned char DI7
Definition: canlib.h:6083
unsigned char DO13
Definition: canlib.h:6026
canStatus canRequestChipStatus(const CanHandle hnd)
int version
Definition: canlib.h:2394
Definition: canlib.h:3992
canStatus canEnumHardwareEx(int *channelCount)
unsigned char DI4
Definition: canlib.h:6080
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:170
kvStatus kvScriptEnvvarSetData(kvEnvHandle eHnd, const void *buf, int start_index, int data_len)
canStatus kvStatus
Definition: canlib.h:4089
Definition: canlib.h:3156
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:6078
int nNonMagiSyncedMembers
number of non MagiSync™ members
Definition: canlib.h:4099
canStatus canSetBusParamsTq(const CanHandle hnd, const kvBusParamsTq nominal)
unsigned char DO6
Definition: canlib.h:6019
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:6022
unsigned char DO14
Definition: canlib.h:6027
unsigned long time
Definition: canlib.h:177
canStatus canGetBusParamsTq(const CanHandle hnd, kvBusParamsTq *nominal)
unsigned char DO5
Definition: canlib.h:6018
canStatus canReadSync(const CanHandle hnd, unsigned long timeout)
float AO2
Definition: canlib.h:6096
int version
Definition: canlib.h:2416
int numerator
Definition: canlib.h:2395
kvStatus kvScriptUnload(const CanHandle hnd, int slotNo)
canStatus canObjBufSetPeriod(const CanHandle hnd, int idx, unsigned int period)
unsigned char DI6
Definition: canlib.h:6082
canStatus canObjBufFreeAll(const CanHandle hnd)
canStatus canIoCtl(const CanHandle hnd, unsigned int func, void *buf, unsigned int buflen)
unsigned char DI15
Definition: canlib.h:6044
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:6024
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:4097
unsigned char DO12
Definition: canlib.h:6025