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 
138 #ifndef _CANLIB_H_
139 #define _CANLIB_H_
140 
141 #include <stdlib.h>
142 
143 #include <stdint.h>
144 
145 #include "canstat.h"
146 
148 typedef int canHandle;
149 
150 # define canINVALID_HANDLE (-1)
151 
154 
155 typedef struct canNotifyData {
156  void *tag;
158  union {
159  struct {
160  unsigned long time;
161  } busErr;
162  struct {
163  long id;
164  unsigned long time;
165  } rx;
166  struct {
167  long id;
168  unsigned long time;
169  } tx;
170  struct {
171  unsigned char busStatus;
172  unsigned char txErrorCounter;
173  unsigned char rxErrorCounter;
174  unsigned long time;
175  } status;
176  } info;
177 } canNotifyData;
178 
179 
189 // The canWANT_xxx names are also obsolete, use canOPEN_xxx instead for new developments.
190 #define canWANT_EXCLUSIVE 0x0008
191 #define canWANT_EXTENDED 0x0010
192 #define canWANT_VIRTUAL 0x0020
193 
199 #define canOPEN_EXCLUSIVE 0x0008
200 
212 #define canOPEN_REQUIRE_EXTENDED 0x0010
213 
221 # define canOPEN_ACCEPT_VIRTUAL 0x0020
222 
231 # define canOPEN_OVERRIDE_EXCLUSIVE 0x0040
232 
249 # define canOPEN_REQUIRE_INIT_ACCESS 0x0080
250 
262 # define canOPEN_NO_INIT_ACCESS 0x0100
263 
275 # define canOPEN_ACCEPT_LARGE_DLC 0x0200 // DLC can be greater than 8
276 
283 # define canOPEN_CAN_FD 0x0400
284 
298 # define canOPEN_CAN_FD_NONISO 0x0800
299 
300 
304 # define canOPEN_INTERNAL_L 0x1000
305 
317 #define canFILTER_ACCEPT 1
318 #define canFILTER_REJECT 2
319 
320 #define canFILTER_SET_CODE_STD 3
321 
322 #define canFILTER_SET_MASK_STD 4
323 
324 #define canFILTER_SET_CODE_EXT 5
325 
326 #define canFILTER_SET_MASK_EXT 6
327 
328 #define canFILTER_NULL_MASK 0L
329 
345 #define canDRIVER_NORMAL 4
346 
353 #define canDRIVER_SILENT 1
354 
358 #define canDRIVER_SELFRECEPTION 8
359 
363 #define canDRIVER_OFF 0
364 
387 #define canBITRATE_1M (-1)
388 
389 #define canBITRATE_500K (-2)
390 
391 #define canBITRATE_250K (-3)
392 
393 #define canBITRATE_125K (-4)
394 
395 #define canBITRATE_100K (-5)
396 
397 #define canBITRATE_62K (-6)
398 
399 #define canBITRATE_50K (-7)
400 
401 #define canBITRATE_83K (-8)
402 
403 #define canBITRATE_10K (-9)
404 
405 // CAN FD Bit Rates
409 #define canFD_BITRATE_500K_80P (-1000)
410 
413 #define canFD_BITRATE_1M_80P (-1001)
414 
417 #define canFD_BITRATE_2M_80P (-1002)
418 
421 #define canFD_BITRATE_4M_80P (-1003)
422 
425 #define canFD_BITRATE_8M_60P (-1004)
426 
428 #define BAUD_1M (-1)
429 
430 #define BAUD_500K (-2)
431 
432 #define BAUD_250K (-3)
433 
434 #define BAUD_125K (-4)
435 
436 #define BAUD_100K (-5)
437 
438 #define BAUD_62K (-6)
439 
440 #define BAUD_50K (-7)
441 
442 #define BAUD_83K (-8)
443 
446 //
447 // Define CANLIBAPI unless it's done already.
448 // (canlib.c provides its own definitions of CANLIBAPI, DLLIMPORT
449 // and DLLEXPORT before including this file.)
450 //
451 #ifndef CANLIBAPI
452 # define CANLIBAPI
453 #endif /* CANLIBAPI */
454 
455 
456 #ifdef __cplusplus
457 extern "C" {
458 #endif /* __cplusplus */
459 
481 void CANLIBAPI canInitializeLibrary (void);
482 
507 canStatus CANLIBAPI canClose (const CanHandle hnd);
508 
533 canStatus CANLIBAPI canBusOn (const CanHandle hnd);
534 
554 canStatus CANLIBAPI canBusOff (const CanHandle hnd);
555 
602 canStatus CANLIBAPI canSetBusParams (const CanHandle hnd,
603  long freq,
604  unsigned int tseg1,
605  unsigned int tseg2,
606  unsigned int sjw,
607  unsigned int noSamp,
608  unsigned int syncmode);
609 
641 canStatus CANLIBAPI canSetBusParamsFd(const CanHandle hnd,
642  long freq_brs,
643  unsigned int tseg1_brs,
644  unsigned int tseg2_brs,
645  unsigned int sjw_brs);
646 
647 
679 canStatus CANLIBAPI canGetBusParams (const CanHandle hnd,
680  long *freq,
681  unsigned int *tseg1,
682  unsigned int *tseg2,
683  unsigned int *sjw,
684  unsigned int *noSamp,
685  unsigned int *syncmode);
686 
687 
710 canStatus CANLIBAPI canGetBusParamsFd(const CanHandle hnd,
711  long *freq_brs,
712  unsigned int *tseg1_brs,
713  unsigned int *tseg2_brs,
714  unsigned int *sjw_brs);
739 canStatus CANLIBAPI canSetBusOutputControl (const CanHandle hnd,
740  const unsigned int drivertype);
741 
776 canStatus CANLIBAPI canGetBusOutputControl (const CanHandle hnd,
777  unsigned int *drivertype);
778 
819 canStatus CANLIBAPI canAccept (const CanHandle hnd,
820  const long envelope,
821  const unsigned int flag);
822 
846 canStatus CANLIBAPI canReadStatus (const CanHandle hnd,
847  unsigned long *const flags);
848 
885 canStatus CANLIBAPI canReadErrorCounters (const CanHandle hnd,
886  unsigned int *txErr,
887  unsigned int *rxErr,
888  unsigned int *ovErr);
889 
931 canStatus CANLIBAPI canWrite (const CanHandle hnd,
932  long id,
933  void *msg,
934  unsigned int dlc,
935  unsigned int flag);
936 
964 canStatus CANLIBAPI canWriteSync (const CanHandle hnd, unsigned long timeout);
965 
1017 canStatus CANLIBAPI canRead (const CanHandle hnd,
1018  long *id,
1019  void *msg,
1020  unsigned int *dlc,
1021  unsigned int *flag,
1022  unsigned long *time);
1073 canStatus CANLIBAPI canReadWait (const CanHandle hnd,
1074  long *id,
1075  void *msg,
1076  unsigned int *dlc,
1077  unsigned int *flag,
1078  unsigned long *time,
1079  unsigned long timeout);
1080 
1132 canStatus CANLIBAPI canReadSpecific (const CanHandle hnd, long id, void * msg,
1133  unsigned int * dlc, unsigned int * flag,
1134  unsigned long * time);
1135 
1166 canStatus CANLIBAPI canReadSync (const CanHandle hnd, unsigned long timeout);
1167 
1199 canStatus CANLIBAPI canReadSyncSpecific (const CanHandle hnd,
1200  long id,
1201  unsigned long timeout);
1202 
1248 canStatus CANLIBAPI canReadSpecificSkip (const CanHandle hnd,
1249  long id,
1250  void * msg,
1251  unsigned int * dlc,
1252  unsigned int * flag,
1253  unsigned long * time);
1254 
1275 canStatus CANLIBAPI canSetNotify (const CanHandle hnd,
1276  void (*callback)(canNotifyData *),
1277  unsigned int notifyFlags,
1278  void *tag);
1279 
1293 canStatus CANLIBAPI canGetRawHandle (const CanHandle hnd, void *pvFd);
1294 
1329 canStatus CANLIBAPI canTranslateBaud (long *const freq,
1330  unsigned int *const tseg1,
1331  unsigned int *const tseg2,
1332  unsigned int *const sjw,
1333  unsigned int *const nosamp,
1334  unsigned int *const syncMode);
1335 
1358 canStatus CANLIBAPI canGetErrorText (canStatus err, char *buf, unsigned int bufsiz);
1359 
1389 unsigned short CANLIBAPI canGetVersion (void);
1390 
1420 canStatus CANLIBAPI canIoCtl (const CanHandle hnd,
1421  unsigned int func,
1422  void *buf,
1423  unsigned int buflen);
1424 
1425 
1436 canStatus CANLIBAPI canReadTimer (const CanHandle hnd, unsigned long *time);
1437 
1488 CanHandle CANLIBAPI canOpenChannel (int channel, int flags);
1489 
1510 canStatus CANLIBAPI canGetNumberOfChannels (int *channelCount);
1511 
1512 
1520 #define kvREMOTE_TYPE_NOT_REMOTE 0
1521 #define kvREMOTE_TYPE_WLAN 1
1522 #define kvREMOTE_TYPE_LAN 2
1523 
1532 #define kvLOGGER_TYPE_NOT_A_LOGGER 0
1533 #define kvLOGGER_TYPE_V1 1
1534 #define kvLOGGER_TYPE_V2 2
1535 
1567 canStatus CANLIBAPI canGetChannelData (int channel,
1568  int item,
1569  void *buffer,
1570  size_t bufsize);
1571 
1590 #define canCHANNELDATA_CHANNEL_CAP 1
1591 
1601 #define canCHANNELDATA_TRANS_CAP 2
1602 
1609 #define canCHANNELDATA_CHANNEL_FLAGS 3 // available, etc
1610 
1619 #define canCHANNELDATA_CARD_TYPE 4
1620 
1630 #define canCHANNELDATA_CARD_NUMBER 5
1631 
1639 #define canCHANNELDATA_CHAN_NO_ON_CARD 6
1640 
1650 #define canCHANNELDATA_CARD_SERIAL_NO 7
1651 
1661 #define canCHANNELDATA_TRANS_SERIAL_NO 8
1662 
1673 #define canCHANNELDATA_CARD_FIRMWARE_REV 9
1674 
1685 #define canCHANNELDATA_CARD_HARDWARE_REV 10
1686 
1696 #define canCHANNELDATA_CARD_UPC_NO 11
1697 
1708 #define canCHANNELDATA_TRANS_UPC_NO 12
1709 
1725 #define canCHANNELDATA_CHANNEL_NAME 13
1726 
1742 # define canCHANNELDATA_DLL_FILE_VERSION 14
1743 
1759 # define canCHANNELDATA_DLL_PRODUCT_VERSION 15
1760 
1776 # define canCHANNELDATA_DLL_FILETYPE 16
1777 
1786 # define canCHANNELDATA_TRANS_TYPE 17
1787 
1811 # define canCHANNELDATA_DEVICE_PHYSICAL_POSITION 18
1812 
1825 # define canCHANNELDATA_UI_NUMBER 19
1826 
1850 # define canCHANNELDATA_TIMESYNC_ENABLED 20
1851 
1866 # define canCHANNELDATA_DRIVER_FILE_VERSION 21
1867 
1882 # define canCHANNELDATA_DRIVER_PRODUCT_VERSION 22
1883 
1892 # define canCHANNELDATA_MFGNAME_UNICODE 23
1893 
1901 # define canCHANNELDATA_MFGNAME_ASCII 24
1902 
1911 # define canCHANNELDATA_DEVDESCR_UNICODE 25
1912 
1920 # define canCHANNELDATA_DEVDESCR_ASCII 26
1921 
1932 # define canCHANNELDATA_DRIVER_NAME 27
1933 
1946 # define canCHANNELDATA_CHANNEL_QUALITY 28
1947 
1956 # define canCHANNELDATA_ROUNDTRIP_TIME 29
1957 
1966 # define canCHANNELDATA_BUS_TYPE 30
1967 
1979 # define canCHANNELDATA_DEVNAME_ASCII 31
1980 
1991 # define canCHANNELDATA_TIME_SINCE_LAST_SEEN 32
1992 
2002 # define canCHANNELDATA_REMOTE_OPERATIONAL_MODE 33
2003 
2012 # define canCHANNELDATA_REMOTE_PROFILE_NAME 34
2013 
2022 # define canCHANNELDATA_REMOTE_HOST_NAME 35
2023 
2032 # define canCHANNELDATA_REMOTE_MAC 36
2033 
2042 # define canCHANNELDATA_MAX_BITRATE 37
2043 
2054 # define canCHANNELDATA_CHANNEL_CAP_MASK 38
2055 
2065 # define canCHANNELDATA_IS_REMOTE 40
2066 
2075 # define canCHANNELDATA_REMOTE_TYPE 41
2076 
2085 # define canCHANNELDATA_LOGGER_TYPE 42
2086 
2096 # define canCHANNELDATA_HW_STATUS 43
2097 
2107 # define canCHANNELDATA_FEATURE_EAN 44
2108 
2117 #define canCHANNELDATA_CUST_CHANNEL_NAME 39
2118 
2132 #define canCHANNEL_IS_EXCLUSIVE 0x0001
2133 
2135 #define canCHANNEL_IS_OPEN 0x0002
2136 
2139 #define canCHANNEL_IS_CANFD 0x0004
2140 
2141 //#define canCHANNEL_IS_CANFD_NON_ISO 0x0008 Reserved for when needed
2142 
2145 #define canCHANNEL_IS_LIN 0x0010
2146 
2149 #define canCHANNEL_IS_LIN_MASTER 0x0020
2150 
2153 #define canCHANNEL_IS_LIN_SLAVE 0x0040
2154 
2155 
2174 #define canHWTYPE_NONE 0
2175 #define canHWTYPE_VIRTUAL 1
2176 #define canHWTYPE_LAPCAN 2
2177 #define canHWTYPE_CANPARI 3
2178 #define canHWTYPE_PCCAN 8
2179 #define canHWTYPE_PCICAN 9
2180 #define canHWTYPE_USBCAN 11
2181 #define canHWTYPE_PCICAN_II 40
2182 #define canHWTYPE_USBCAN_II 42
2183 #define canHWTYPE_SIMULATED 44
2184 #define canHWTYPE_ACQUISITOR 46
2185 #define canHWTYPE_LEAF 48
2186 #define canHWTYPE_PC104_PLUS 50
2187 #define canHWTYPE_PCICANX_II 52
2188 #define canHWTYPE_MEMORATOR_II 54
2189 #define canHWTYPE_MEMORATOR_PRO 54
2190 #define canHWTYPE_USBCAN_PRO 56
2191 #define canHWTYPE_IRIS 58
2192 #define canHWTYPE_BLACKBIRD 58
2193 #define canHWTYPE_MEMORATOR_LIGHT 60
2194 #define canHWTYPE_MINIHYDRA 62
2195 #define canHWTYPE_EAGLE 62
2196 #define canHWTYPE_BAGEL 64
2197 #define canHWTYPE_BLACKBIRD_V2 64
2198 #define canHWTYPE_MINIPCIE 66
2199 #define canHWTYPE_USBCAN_KLINE 68
2200 #define canHWTYPE_ETHERCAN 70
2201 #define canHWTYPE_USBCAN_LIGHT 72
2202 #define canHWTYPE_USBCAN_PRO2 74
2203 #define canHWTYPE_PCIE_V2 76
2204 #define canHWTYPE_MEMORATOR_PRO2 78
2205 #define canHWTYPE_LEAF2 80
2206 #define canHWTYPE_MEMORATOR_V2 82
2207 #define canHWTYPE_CANLINHYBRID 84
2208 #define canHWTYPE_DINRAIL 86
2209 
2210 
2219 #define canCHANNEL_CAP_EXTENDED_CAN 0x00000001L
2220 #define canCHANNEL_CAP_BUS_STATISTICS 0x00000002L
2221 #define canCHANNEL_CAP_ERROR_COUNTERS 0x00000004L
2222 #define canCHANNEL_CAP_RESERVED_2 0x00000008L
2223 #define canCHANNEL_CAP_GENERATE_ERROR 0x00000010L
2224 #define canCHANNEL_CAP_GENERATE_OVERLOAD 0x00000020L
2225 #define canCHANNEL_CAP_TXREQUEST 0x00000040L
2226 #define canCHANNEL_CAP_TXACKNOWLEDGE 0x00000080L
2227 #define canCHANNEL_CAP_VIRTUAL 0x00010000L
2228 #define canCHANNEL_CAP_SIMULATED 0x00020000L
2229 #define canCHANNEL_CAP_RESERVED_1 0x00040000L
2230 #define canCHANNEL_CAP_CAN_FD 0x00080000L
2231 #define canCHANNEL_CAP_CAN_FD_NONISO 0x00100000L
2232 #define canCHANNEL_CAP_SILENT_MODE 0x00200000L
2233 #define canCHANNEL_CAP_SINGLE_SHOT 0x00400000L
2234 #define canCHANNEL_CAP_LOGGER 0x00800000L
2235 #define canCHANNEL_CAP_REMOTE_ACCESS 0x01000000L
2236 #define canCHANNEL_CAP_SCRIPT 0x02000000L
2237 #define canCHANNEL_CAP_LIN_HYBRID 0x04000000L
2238 #define canCHANNEL_CAP_IO_API 0x08000000L
2239 #define canCHANNEL_CAP_DIAGNOSTICS 0x10000000L
2240 
2241 
2253 #define canCHANNEL_OPMODE_NONE 1
2254 
2258 #define canCHANNEL_OPMODE_INFRASTRUCTURE 2
2259 
2263 #define canCHANNEL_OPMODE_RESERVED 3
2264 
2268 #define canCHANNEL_OPMODE_ADHOC 4
2269 
2279 #define canDRIVER_CAP_HIGHSPEED 0x00000001L
2280 
2305 #define canIOCTL_PREFER_EXT 1
2306 
2319 #define canIOCTL_PREFER_STD 2
2320 
2336 #define canIOCTL_CLEAR_ERROR_COUNTERS 5
2337 
2348 #define canIOCTL_SET_TIMER_SCALE 6
2349 
2365 #define canIOCTL_SET_TXACK 7
2366 
2379 #define canIOCTL_GET_RX_BUFFER_LEVEL 8
2380 
2393 #define canIOCTL_GET_TX_BUFFER_LEVEL 9
2394 
2404 #define canIOCTL_FLUSH_RX_BUFFER 10
2405 
2415 #define canIOCTL_FLUSH_TX_BUFFER 11
2416 
2425 #define canIOCTL_GET_TIMER_SCALE 12
2426 
2438 #define canIOCTL_SET_TXRQ 13
2439 
2440 
2447 #define canIOCTL_SET_BYPASS_MODE 15
2448 
2454 #define canIOCTL_SET_WAKEUP 16
2455 
2465 # define canIOCTL_GET_DRIVERHANDLE 17
2466 
2472 # define canIOCTL_MAP_RXQUEUE 18
2473 
2479 # define canIOCTL_GET_WAKEUP 19
2480 
2492 # define canIOCTL_SET_REPORT_ACCESS_ERRORS 20
2493 
2501 # define canIOCTL_GET_REPORT_ACCESS_ERRORS 21
2502 
2512 # define canIOCTL_CONNECT_TO_VIRTUAL_BUS 22
2513 
2523 # define canIOCTL_DISCONNECT_FROM_VIRTUAL_BUS 23
2524 
2534 # define canIOCTL_SET_USER_IOPORT 24
2535 
2546 # define canIOCTL_GET_USER_IOPORT 25
2547 
2553 # define canIOCTL_SET_BUFFER_WRAPAROUND_MODE 26
2554 
2571 # define canIOCTL_SET_RX_QUEUE_SIZE 27
2572 
2578 # define canIOCTL_SET_USB_THROTTLE 28
2579 
2585 # define canIOCTL_GET_USB_THROTTLE 29
2586 
2597 # define canIOCTL_SET_BUSON_TIME_AUTO_RESET 30
2598 
2610 # define canIOCTL_GET_TXACK 31
2611 
2626 # define canIOCTL_SET_LOCAL_TXECHO 32
2627 
2640 # define canIOCTL_SET_ERROR_FRAMES_REPORTING 33
2641 
2655 # define canIOCTL_GET_CHANNEL_QUALITY 34
2656 
2666 # define canIOCTL_GET_ROUNDTRIP_TIME 35
2667 
2676 # define canIOCTL_GET_BUS_TYPE 36
2677 
2690 # define canIOCTL_GET_DEVNAME_ASCII 37
2691 
2703 # define canIOCTL_GET_TIME_SINCE_LAST_SEEN 38
2704 
2718 # define canIOCTL_GET_TREF_LIST 39
2719 
2741 # define canIOCTL_TX_INTERVAL 40
2742 
2754 # define canIOCTL_SET_BRLIMIT 43
2755 
2756 
2771 # define canIOCTL_SET_THROTTLE_SCALED 41
2772 
2773 
2788 # define canIOCTL_GET_THROTTLE_SCALED 42
2789 
2796 # define canIOCTL_RESET_OVERRUN_COUNT 44
2797 
2806 # define canIOCTL_LIN_MODE 45
2807 
2810 typedef struct {
2811  unsigned int portNo;
2812  unsigned int portValue;
2814 
2815 
2856 canStatus CANLIBAPI canSetBusParamsC200 (const CanHandle hnd, unsigned char btr0, unsigned char btr1);
2857 
2858 
2859 
2895 canStatus CANLIBAPI canSetDriverMode (const CanHandle hnd, int lineMode, int resNet);
2896 
2933 canStatus CANLIBAPI canGetDriverMode (const CanHandle hnd, int *lineMode, int *resNet);
2934 
2954 #define canVERSION_CANLIB32_VERSION 0
2955 
2966 #define canVERSION_CANLIB32_PRODVER 1
2967 
2979 #define canVERSION_CANLIB32_PRODVER32 2
2980 
2991 #define canVERSION_CANLIB32_BETA 3
2992 
3012 unsigned int CANLIBAPI canGetVersionEx (unsigned int itemCode);
3013 
3014 
3034 canStatus CANLIBAPI canObjBufFreeAll (const CanHandle hnd);
3035 
3056 canStatus CANLIBAPI canObjBufAllocate (const CanHandle hnd, int type);
3057 
3066 #define canOBJBUF_TYPE_AUTO_RESPONSE 0x01
3067 #define canOBJBUF_TYPE_PERIODIC_TX 0x02
3068 
3090 canStatus CANLIBAPI canObjBufFree (const CanHandle hnd, int idx);
3091 
3092 // Writes CAN data to the object buffer with the specified index.
3093 
3119 canStatus CANLIBAPI canObjBufWrite (const CanHandle hnd,
3120  int idx,
3121  int id,
3122  void* msg,
3123  unsigned int dlc,
3124  unsigned int flags);
3125 
3152 canStatus CANLIBAPI canObjBufSetFilter (const CanHandle hnd,
3153  int idx,
3154  unsigned int code,
3155  unsigned int mask);
3156 
3177 canStatus CANLIBAPI canObjBufSetFlags (const CanHandle hnd,
3178  int idx,
3179  unsigned int flags);
3180 
3198 # define canOBJBUF_AUTO_RESPONSE_RTR_ONLY 0x01
3199 
3221 canStatus CANLIBAPI canObjBufSetPeriod (const CanHandle hnd,
3222  int idx,
3223  unsigned int period);
3224 
3245 canStatus CANLIBAPI canObjBufSetMsgCount (const CanHandle hnd,
3246  int idx,
3247  unsigned int count);
3248 
3268 canStatus CANLIBAPI canObjBufEnable (const CanHandle hnd, int idx);
3269 
3289 canStatus CANLIBAPI canObjBufDisable (const CanHandle hnd, int idx);
3290 
3314 canStatus CANLIBAPI canObjBufSendBurst (const CanHandle hnd,
3315  int idx,
3316  unsigned int burstlen);
3317 
3318 
3341 canStatus CANLIBAPI canResetBus (const CanHandle hnd);
3342 
3381 canStatus CANLIBAPI canWriteWait (const CanHandle hnd,
3382  long id,
3383  void *msg,
3384  unsigned int dlc,
3385  unsigned int flag,
3386  unsigned long timeout);
3387 
3388 
3414 canStatus CANLIBAPI canUnloadLibrary (void);
3415 
3475 canStatus CANLIBAPI canSetAcceptanceFilter (const CanHandle hnd,
3476  unsigned int code,
3477  unsigned int mask,
3478  int is_extended);
3502 canStatus CANLIBAPI canFlushReceiveQueue (const CanHandle hnd);
3503 
3528 canStatus CANLIBAPI canFlushTransmitQueue (const CanHandle hnd);
3529 
3530 
3539 #define kvLED_ACTION_ALL_LEDS_ON 0
3540 #define kvLED_ACTION_ALL_LEDS_OFF 1
3541 #define kvLED_ACTION_LED_0_ON 2
3542 #define kvLED_ACTION_LED_0_OFF 3
3543 #define kvLED_ACTION_LED_1_ON 4
3544 #define kvLED_ACTION_LED_1_OFF 5
3545 #define kvLED_ACTION_LED_2_ON 6
3546 #define kvLED_ACTION_LED_2_OFF 7
3547 #define kvLED_ACTION_LED_3_ON 8
3548 #define kvLED_ACTION_LED_3_OFF 9
3549 #define kvLED_ACTION_LED_4_ON 10
3550 #define kvLED_ACTION_LED_4_OFF 11
3551 #define kvLED_ACTION_LED_5_ON 12
3552 #define kvLED_ACTION_LED_5_OFF 13
3553 #define kvLED_ACTION_LED_6_ON 14
3554 #define kvLED_ACTION_LED_6_OFF 15
3555 #define kvLED_ACTION_LED_7_ON 16
3556 #define kvLED_ACTION_LED_7_OFF 17
3557 #define kvLED_ACTION_LED_8_ON 18
3558 #define kvLED_ACTION_LED_8_OFF 19
3559 #define kvLED_ACTION_LED_9_ON 20
3560 #define kvLED_ACTION_LED_9_OFF 21
3561 #define kvLED_ACTION_LED_10_ON 22
3562 #define kvLED_ACTION_LED_10_OFF 23
3563 #define kvLED_ACTION_LED_11_ON 24
3564 #define kvLED_ACTION_LED_11_OFF 25
3565 
3566 
3589 canStatus CANLIBAPI kvFlashLeds (const CanHandle hnd, int action, int timeout);
3590 
3610 canStatus CANLIBAPI canRequestChipStatus (const CanHandle hnd);
3611 
3638 canStatus CANLIBAPI canRequestBusStatistics (const CanHandle hnd);
3639 
3645 typedef struct canBusStatistics_s {
3646  unsigned long stdData;
3647  unsigned long stdRemote;
3648  unsigned long extData;
3649  unsigned long extRemote;
3650  unsigned long errFrame;
3651 
3656  unsigned long busLoad;
3657  unsigned long overruns;
3659 
3682 canStatus CANLIBAPI canGetBusStatistics (const CanHandle hnd,
3683  canBusStatistics *stat,
3684  size_t bufsiz);
3685 
3686 
3707 canStatus CANLIBAPI canGetHandleData (const CanHandle hnd,
3708  int item,
3709  void *buffer,
3710  size_t bufsize);
3711 
3713 typedef void *kvTimeDomain;
3714 
3717 
3722 typedef struct kvTimeDomainData_s {
3728 
3757 kvStatus CANLIBAPI kvTimeDomainCreate (kvTimeDomain *domain);
3758 
3781 kvStatus CANLIBAPI kvTimeDomainDelete (kvTimeDomain domain);
3782 
3808 kvStatus CANLIBAPI kvTimeDomainResetTime (kvTimeDomain domain);
3809 
3834 kvStatus CANLIBAPI kvTimeDomainGetData (kvTimeDomain domain,
3835  kvTimeDomainData *data,
3836  size_t bufsiz);
3837 
3860 kvStatus CANLIBAPI kvTimeDomainAddHandle(kvTimeDomain domain,
3861  const CanHandle hnd);
3862 
3884 kvStatus CANLIBAPI kvTimeDomainRemoveHandle (kvTimeDomain domain,
3885  const CanHandle hnd);
3886 
3899 typedef void (CANLIBAPI *kvCallback_t) (CanHandle hnd, void* context, unsigned int notifyEvent);
3900 
3934 kvStatus CANLIBAPI kvSetNotifyCallback (const CanHandle hnd,
3935  kvCallback_t callback,
3936  void* context,
3937  unsigned int notifyFlags);
3938 
3952 #define kvBUSTYPE_NONE 0
3953 
3958 #define kvBUSTYPE_PCI 1
3959 
3964 #define kvBUSTYPE_PCMCIA 2
3965 
3970 #define kvBUSTYPE_USB 3
3971 
3976 #define kvBUSTYPE_WLAN 4
3977 
3982 #define kvBUSTYPE_PCI_EXPRESS 5
3983 
3988 #define kvBUSTYPE_ISA 6
3989 
3994 #define kvBUSTYPE_VIRTUAL 7
3995 
4000 #define kvBUSTYPE_PC104_PLUS 8
4001 
4006 #define kvBUSTYPE_LAN 9
4007 
4023 #define kvBUSTYPE_GROUP_VIRTUAL 1
4024 
4029 #define kvBUSTYPE_GROUP_LOCAL 2
4030 
4035 #define kvBUSTYPE_GROUP_REMOTE 3
4036 
4040 #define kvBUSTYPE_GROUP_INTERNAL 4
4041 
4095 kvStatus CANLIBAPI kvGetSupportedInterfaceInfo (int index,
4096  char *hwName,
4097  size_t nameLen,
4098  int *hwType,
4099  int *hwBusType);
4100 
4125 kvStatus CANLIBAPI kvReadDeviceCustomerData (const CanHandle hnd,
4126  int userNumber,
4127  int itemNumber,
4128  void *data,
4129  size_t bufsiz);
4130 
4144 #define kvENVVAR_TYPE_INT 1
4145 
4151 #define kvENVVAR_TYPE_FLOAT 2
4152 
4158 #define kvENVVAR_TYPE_STRING 3
4159 
4175 #define kvEVENT_TYPE_KEY 1
4176 
4184  typedef int64_t kvEnvHandle;
4185 
4205 kvStatus CANLIBAPI kvScriptStart (const CanHandle hnd, int slotNo);
4206 
4213 #define kvSCRIPT_STOP_NORMAL 0
4214 #define kvSCRIPT_STOP_FORCED -9
4238 kvStatus CANLIBAPI kvScriptStop (const CanHandle hnd, int slotNo, int mode);
4239 
4258 kvStatus CANLIBAPI kvScriptUnload (const CanHandle hnd, int slotNo);
4259 
4284 kvStatus CANLIBAPI kvScriptSendEvent (const CanHandle hnd,
4285  int slotNo,
4286  int eventType,
4287  int eventNo,
4288  unsigned int data);
4289 
4316 kvEnvHandle CANLIBAPI kvScriptEnvvarOpen (const CanHandle hnd,
4317  char* envvarName,
4318  int *envvarType,
4319  int *envvarSize); // returns scriptHandle
4320 
4340 kvStatus CANLIBAPI kvScriptEnvvarClose (kvEnvHandle eHnd);
4341 
4364 kvStatus CANLIBAPI kvScriptEnvvarSetInt (kvEnvHandle eHnd, int val);
4365 
4389 kvStatus CANLIBAPI kvScriptEnvvarGetInt (kvEnvHandle eHnd, int *val);
4390 
4413 kvStatus CANLIBAPI kvScriptEnvvarSetFloat (kvEnvHandle eHnd, float val);
4414 
4438 kvStatus CANLIBAPI kvScriptEnvvarGetFloat (kvEnvHandle eHnd, float *val);
4439 
4466 kvStatus CANLIBAPI kvScriptEnvvarSetData (kvEnvHandle eHnd,
4467  void *buf,
4468  int start_index,
4469  int data_len);
4470 
4496 kvStatus CANLIBAPI kvScriptEnvvarGetData (kvEnvHandle eHnd,
4497  void *buf,
4498  int start_index,
4499  int data_len);
4500 
4526 kvStatus CANLIBAPI kvScriptLoadFileOnDevice (const CanHandle hnd,
4527  int slotNo,
4528  char *localFile);
4529 
4558 kvStatus CANLIBAPI kvScriptLoadFile (const CanHandle hnd,
4559  int slotNo,
4560  char *filePathOnPC);
4561 
4562 
4563 
4570 #define kvSCRIPT_STATUS_LOADED 1
4571 #define kvSCRIPT_STATUS_RUNNING 2
4594 kvStatus CANLIBAPI kvScriptStatus(const CanHandle hnd,
4595  int slot,
4596  unsigned int *status);
4597 
4598 
4617 kvStatus CANLIBAPI kvScriptGetMaxEnvvarSize(int hnd, int *envvarSize);
4618 
4649 kvStatus CANLIBAPI kvScriptTxeGetData(const char *filePathOnPC,
4650  int item,
4651  void *buffer,
4652  unsigned int *bufsize);
4653 
4679 #define canTXEDATA_FILE_VERSION 1
4680 
4696 #define canTXEDATA_COMPILER_VERSION 2
4697 
4716 #define canTXEDATA_DATE 3
4717 
4728 #define canTXEDATA_DESCRIPTION 4
4729 
4743 #define canTXEDATA_SOURCE 5
4744 
4754 #define canTXEDATA_SIZE_OF_CODE 6
4755 
4765 #define canTXEDATA_IS_ENCRYPTED 7
4766 
4767 
4793 kvStatus CANLIBAPI kvFileCopyToDevice (const CanHandle hnd,
4794  char *hostFileName,
4795  char *deviceFileName);
4796 
4819 kvStatus CANLIBAPI kvFileCopyFromDevice (const CanHandle hnd,
4820  char *deviceFileName,
4821  char *hostFileName);
4822 
4844 kvStatus CANLIBAPI kvFileDelete (const CanHandle hnd, char *deviceFileName);
4845 
4868 kvStatus CANLIBAPI kvFileGetName (const CanHandle hnd,
4869  int fileNo,
4870  char *name,
4871  int namelen);
4872 
4892 kvStatus CANLIBAPI kvFileGetCount (const CanHandle hnd, int *count);
4893 
4916 kvStatus CANLIBAPI kvFileGetSystemData (const CanHandle hnd,
4917  int itemCode,
4918  int *result);
4919 
4937 #define kvDEVICE_MODE_INTERFACE 0x00
4938 
4943 #define kvDEVICE_MODE_LOGGER 0x01
4944 
4969 kvStatus CANLIBAPI kvDeviceSetMode (const CanHandle hnd, int mode);
4970 
4993 kvStatus CANLIBAPI kvDeviceGetMode (const CanHandle hnd, int *result);
4994 
4995 
5020 kvStatus CANLIBAPI kvReadTimer (const CanHandle hnd, unsigned int *time);
5044 kvStatus CANLIBAPI kvReadTimer64 (const CanHandle hnd, uint64_t *time);
5045 
5062 #define kvIO_INFO_GET_MODULE_TYPE 1
5063 
5069 #define kvIO_INFO_GET_DIRECTION 2
5070 
5076 #define kvIO_INFO_GET_PIN_TYPE 4
5077 
5083 #define kvIO_INFO_GET_NUMBER_OF_BITS 5
5084 
5092 #define kvIO_INFO_GET_RANGE_MIN 6
5093 
5101 #define kvIO_INFO_GET_RANGE_MAX 7
5102 
5110 #define kvIO_INFO_GET_DI_LOW_HIGH_FILTER 8
5111 
5119 #define kvIO_INFO_GET_DI_HIGH_LOW_FILTER 9
5120 
5128 #define kvIO_INFO_GET_AI_LP_FILTER_ORDER 10
5129 
5138 #define kvIO_INFO_GET_AI_HYSTERESIS 11
5139 
5145 #define kvIO_INFO_GET_MODULE_NUMBER 14
5146 
5167 #define kvIO_INFO_SET_DI_LOW_HIGH_FILTER 8
5168 
5176 #define kvIO_INFO_SET_DI_HIGH_LOW_FILTER 9
5177 
5185 #define kvIO_INFO_SET_AI_LP_FILTER_ORDER 10
5186 
5195 #define kvIO_INFO_SET_AI_HYSTERESIS 11
5196 
5213 #define kvIO_MODULE_TYPE_DIGITAL 1
5214 
5218 #define kvIO_MODULE_TYPE_ANALOG 2
5219 
5223 #define kvIO_MODULE_TYPE_RELAY 3
5224 
5239 #define kvIO_PIN_TYPE_DIGITAL 1
5240 
5244 #define kvIO_PIN_TYPE_ANALOG 2
5245 
5249 #define kvIO_PIN_TYPE_RELAY 3
5250 
5265 #define kvIO_PIN_DIRECTION_IN 4
5266 
5270 #define kvIO_PIN_DIRECTION_OUT 8
5271 
5288 canStatus CANLIBAPI kvIoGetNumberOfPins (const CanHandle hnd, unsigned int *pinCount);
5289 
5301 canStatus CANLIBAPI kvIoConfirmConfig (const CanHandle hnd);
5302 
5318 canStatus CANLIBAPI kvIoPinGetInfo (const CanHandle hnd, unsigned int pin, int item, void *buffer, const unsigned int bufsize);
5319 
5335 canStatus CANLIBAPI kvIoPinSetInfo (const CanHandle hnd, unsigned int pin, int item, const void *buffer, const unsigned int bufsize);
5336 
5350 canStatus CANLIBAPI kvIoPinSetDigital (const CanHandle hnd, unsigned int pin, unsigned int value);
5351 
5367 canStatus CANLIBAPI kvIoPinGetDigital (const CanHandle hnd, unsigned int pin, unsigned int *value);
5368 
5386 canStatus CANLIBAPI kvIoPinGetOutputDigital (const CanHandle hnd, unsigned int pin, unsigned int *value);
5387 
5401 canStatus CANLIBAPI kvIoPinSetRelay (const CanHandle hnd, unsigned int pin, unsigned int value);
5402 
5418 canStatus CANLIBAPI kvIoPinGetOutputRelay (const CanHandle hnd, unsigned int pin, unsigned int *value);
5419 
5433 canStatus CANLIBAPI kvIoPinSetAnalog (const CanHandle hnd, unsigned int pin, float value);
5434 
5448 canStatus CANLIBAPI kvIoPinGetAnalog (const CanHandle hnd, unsigned int pin, float* value);
5449 
5465 canStatus CANLIBAPI kvIoPinGetOutputAnalog (const CanHandle hnd, unsigned int pin, float* value);
5466 
5467 #ifdef __cplusplus
5468 }
5469 #endif /* __cplusplus */
5470 
5471 #include "obsolete.h"
5472 
5473 
5474 
5475 
5476 #endif /* _CANLIB_H_ */
Definitions which are retained for compatibility.
kvStatus kvScriptEnvvarGetFloat(kvEnvHandle eHnd, float *val)
unsigned long stdRemote
Number of received standard (11-bit identifiers) remote frames.
Definition: canlib.h:3647
canStatus canGetBusParamsFd(const CanHandle hnd, long *freq_brs, unsigned int *tseg1_brs, unsigned int *tseg2_brs, unsigned int *sjw_brs)
canStatus canWriteSync(const CanHandle hnd, unsigned long timeout)
unsigned char busStatus
Definition: canlib.h:171
canStatus canGetBusOutputControl(const CanHandle hnd, unsigned int *drivertype)
kvStatus kvTimeDomainDelete(kvTimeDomain domain)
canStatus canGetDriverMode(const CanHandle hnd, int *lineMode, int *resNet)
struct canNotifyData::@0::@2 rx
void canInitializeLibrary(void)
canStatus kvIoPinGetInfo(const CanHandle hnd, unsigned int pin, int item, void *buffer, const unsigned int bufsize)
canStatus canReadStatus(const CanHandle hnd, unsigned long *const flags)
kvStatus kvTimeDomainCreate(kvTimeDomain *domain)
unsigned int portNo
Port number used in e.g. canIOCTL_SET_USER_IOPORT.
Definition: canlib.h:2811
int64_t kvEnvHandle
Definition: canlib.h:4184
int nNonMagiSyncCards
number of non MagiSync™ interfaces
Definition: canlib.h:3725
canStatus kvIoGetNumberOfPins(const CanHandle hnd, unsigned int *pinCount)
kvStatus kvScriptEnvvarSetData(kvEnvHandle eHnd, void *buf, int start_index, int data_len)
canStatus canRequestBusStatistics(const CanHandle hnd)
kvStatus kvDeviceSetMode(const CanHandle hnd, int mode)
void * kvTimeDomain
Definition: canlib.h:3713
unsigned char rxErrorCounter
Definition: canlib.h:173
unsigned long extRemote
Number of received extended (29-bit identifiers) remote frames.
Definition: canlib.h:3649
canStatus canClose(const CanHandle hnd)
struct canNotifyData canNotifyData
kvStatus kvFileGetCount(const CanHandle hnd, int *count)
canStatus canTranslateBaud(long *const freq, unsigned int *const tseg1, unsigned int *const tseg2, unsigned int *const sjw, unsigned int *const nosamp, unsigned int *const syncMode)
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)
int canHandle
Definition: canlib.h:148
canStatus canObjBufDisable(const CanHandle hnd, int idx)
void * tag
Definition: canlib.h:156
canStatus canGetBusParams(const CanHandle hnd, long *freq, unsigned int *tseg1, unsigned int *tseg2, unsigned int *sjw, unsigned int *noSamp, unsigned int *syncmode)
kvStatus kvScriptEnvvarGetInt(kvEnvHandle eHnd, int *val)
Definitions for the CANLIB API.
kvStatus kvScriptGetMaxEnvvarSize(int hnd, int *envvarSize)
canStatus kvIoPinSetInfo(const CanHandle hnd, unsigned int pin, int item, const void *buffer, const unsigned int bufsize)
canStatus canSetBusOutputControl(const CanHandle hnd, const unsigned int drivertype)
int eventType
Definition: canlib.h:157
canStatus kvIoPinSetRelay(const CanHandle hnd, unsigned int pin, unsigned int value)
canStatus kvIoPinGetDigital(const CanHandle hnd, unsigned int pin, unsigned int *value)
kvStatus kvFileGetSystemData(const CanHandle hnd, int itemCode, int *result)
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)
canStatus canBusOn(const CanHandle hnd)
long id
Definition: canlib.h:163
canStatus canWriteWait(const CanHandle hnd, long id, void *msg, unsigned int dlc, unsigned int flag, unsigned long timeout)
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)
canStatus canObjBufWrite(const CanHandle hnd, int idx, int id, void *msg, unsigned int dlc, unsigned int flags)
Definition: canlib.h:155
struct kvTimeDomainData_s kvTimeDomainData
kvStatus kvScriptTxeGetData(const char *filePathOnPC, int item, void *buffer, unsigned int *bufsize)
kvStatus kvScriptEnvvarClose(kvEnvHandle eHnd)
canStatus canFlushReceiveQueue(const CanHandle hnd)
kvStatus kvScriptLoadFile(const CanHandle hnd, int slotNo, char *filePathOnPC)
unsigned int portValue
Port value used in e.g. canIOCTL_SET_USER_IOPORT.
Definition: canlib.h:2812
unsigned short canGetVersion(void)
unsigned long errFrame
Number of error frames.
Definition: canlib.h:3650
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)
canStatus canFlushTransmitQueue(const CanHandle hnd)
kvStatus kvReadTimer64(const CanHandle hnd, uint64_t *time)
kvStatus kvFileGetName(const CanHandle hnd, int fileNo, char *name, int namelen)
kvStatus kvTimeDomainResetTime(kvTimeDomain domain)
kvStatus kvFileDelete(const CanHandle hnd, char *deviceFileName)
canStatus canAccept(const CanHandle hnd, const long envelope, const unsigned int flag)
CanHandle canOpenChannel(int channel, int flags)
kvStatus kvScriptEnvvarSetFloat(kvEnvHandle eHnd, float val)
unsigned long extData
Number of received extended (29-bit identifiers) data frames.
Definition: canlib.h:3648
kvStatus kvReadTimer(const CanHandle hnd, unsigned int *time)
canStatus canObjBufEnable(const CanHandle hnd, int idx)
kvStatus kvSetNotifyCallback(const CanHandle hnd, kvCallback_t callback, void *context, unsigned int notifyFlags)
kvStatus kvScriptSendEvent(const CanHandle hnd, int slotNo, int eventType, int eventNo, unsigned int data)
kvStatus kvTimeDomainGetData(kvTimeDomain domain, kvTimeDomainData *data, size_t bufsiz)
kvStatus kvScriptStart(const CanHandle hnd, int slotNo)
kvStatus kvTimeDomainRemoveHandle(kvTimeDomain domain, const CanHandle hnd)
canStatus canSetNotify(const CanHandle hnd, void(*callback)(canNotifyData *), unsigned int notifyFlags, void *tag)
unsigned char txErrorCounter
Definition: canlib.h:172
canStatus kvIoPinGetAnalog(const CanHandle hnd, unsigned int pin, float *value)
canStatus canObjBufSetFlags(const CanHandle hnd, int idx, unsigned int flags)
kvEnvHandle kvScriptEnvvarOpen(const CanHandle hnd, char *envvarName, int *envvarType, int *envvarSize)
void(* kvCallback_t)(CanHandle hnd, void *context, unsigned int notifyEvent)
Definition: canlib.h:3899
canStatus canSetBusParamsC200(const CanHandle hnd, unsigned char btr0, unsigned char btr1)
int nMagiSyncGroups
number of MagiSync™ groups
Definition: canlib.h:3723
canStatus canReadSpecificSkip(const CanHandle hnd, long id, void *msg, unsigned int *dlc, unsigned int *flag, unsigned long *time)
struct canBusStatistics_s canBusStatistics
canStatus canSetBusParamsFd(const CanHandle hnd, long freq_brs, unsigned int tseg1_brs, unsigned int tseg2_brs, unsigned int sjw_brs)
canStatus
Definition: canstat.h:84
kvStatus kvFileCopyFromDevice(const CanHandle hnd, char *deviceFileName, char *hostFileName)
kvStatus kvDeviceGetMode(const CanHandle hnd, int *result)
canStatus kvIoPinGetOutputDigital(const CanHandle hnd, unsigned int pin, unsigned int *value)
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:3646
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:3657
kvStatus kvTimeDomainAddHandle(kvTimeDomain domain, const CanHandle hnd)
Definition: canlib.h:3722
canStatus canReadTimer(const CanHandle hnd, unsigned long *time)
canStatus kvIoPinSetDigital(const CanHandle hnd, unsigned int pin, unsigned int value)
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)
canStatus canGetErrorText(canStatus err, char *buf, unsigned int bufsiz)
unsigned long busLoad
Definition: canlib.h:3656
canStatus canRequestChipStatus(const CanHandle hnd)
Definition: canlib.h:3645
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:153
canStatus kvStatus
Definition: canlib.h:3716
Definition: canlib.h:2810
union canNotifyData::@0 info
canStatus canResetBus(const CanHandle hnd)
canStatus canObjBufAllocate(const CanHandle hnd, int type)
int nNonMagiSyncedMembers
number of non MagiSync™ members
Definition: canlib.h:3726
canStatus canGetNumberOfChannels(int *channelCount)
canStatus canGetHandleData(const CanHandle hnd, int item, void *buffer, size_t bufsize)
kvStatus kvScriptEnvvarGetData(kvEnvHandle eHnd, void *buf, int start_index, int data_len)
unsigned long time
Definition: canlib.h:160
kvStatus kvFileCopyToDevice(const CanHandle hnd, char *hostFileName, char *deviceFileName)
canStatus canReadSync(const CanHandle hnd, unsigned long timeout)
kvStatus kvScriptUnload(const CanHandle hnd, int slotNo)
canStatus canObjBufSetPeriod(const CanHandle hnd, int idx, unsigned int period)
canStatus canObjBufFreeAll(const CanHandle hnd)
canStatus canIoCtl(const CanHandle hnd, unsigned int func, void *buf, unsigned int buflen)
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
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:3724