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 
144 #ifndef _CANLIB_H_
145 #define _CANLIB_H_
146 
147 #include <stdlib.h>
148 
149 #include <stdint.h>
150 
151 #include "canstat.h"
152 
154 typedef int canHandle;
155 
156 # define canINVALID_HANDLE (-1)
157 
158 
160 
161 typedef struct canNotifyData {
162  void *tag;
164  union {
165  struct {
166  unsigned long time;
167  } busErr;
168  struct {
169  long id;
170  unsigned long time;
171  } rx;
172  struct {
173  long id;
174  unsigned long time;
175  } tx;
176  struct {
177  unsigned char busStatus;
178  unsigned char txErrorCounter;
179  unsigned char rxErrorCounter;
180  unsigned long time;
181  } status;
182  } info;
183 } canNotifyData;
184 
185 
195 // The canWANT_xxx names are also obsolete, use canOPEN_xxx instead for new developments.
196 #define canWANT_EXCLUSIVE 0x0008
197 #define canWANT_EXTENDED 0x0010
198 #define canWANT_VIRTUAL 0x0020
199 
213 #define canOPEN_EXCLUSIVE 0x0008
214 
226 #define canOPEN_REQUIRE_EXTENDED 0x0010
227 
235 # define canOPEN_ACCEPT_VIRTUAL 0x0020
236 
245 # define canOPEN_OVERRIDE_EXCLUSIVE 0x0040
246 
263 # define canOPEN_REQUIRE_INIT_ACCESS 0x0080
264 
276 # define canOPEN_NO_INIT_ACCESS 0x0100
277 
289 # define canOPEN_ACCEPT_LARGE_DLC 0x0200 // DLC can be greater than 8
290 
297 # define canOPEN_CAN_FD 0x0400
298 
312 # define canOPEN_CAN_FD_NONISO 0x0800
313 
314 
318 # define canOPEN_INTERNAL_L 0x1000
319 
331 #define canFILTER_ACCEPT 1
332 #define canFILTER_REJECT 2
333 
334 #define canFILTER_SET_CODE_STD 3
335 
336 #define canFILTER_SET_MASK_STD 4
337 
338 #define canFILTER_SET_CODE_EXT 5
339 
340 #define canFILTER_SET_MASK_EXT 6
341 
342 #define canFILTER_NULL_MASK 0L
343 
359 #define canDRIVER_NORMAL 4
360 
367 #define canDRIVER_SILENT 1
368 
372 #define canDRIVER_SELFRECEPTION 8
373 
377 #define canDRIVER_OFF 0
378 
401 #define canBITRATE_1M (-1)
402 
403 #define canBITRATE_500K (-2)
404 
405 #define canBITRATE_250K (-3)
406 
407 #define canBITRATE_125K (-4)
408 
409 #define canBITRATE_100K (-5)
410 
411 #define canBITRATE_62K (-6)
412 
413 #define canBITRATE_50K (-7)
414 
415 #define canBITRATE_83K (-8)
416 
417 #define canBITRATE_10K (-9)
418 
419 // CAN FD Bit Rates
423 #define canFD_BITRATE_500K_80P (-1000)
424 
427 #define canFD_BITRATE_1M_80P (-1001)
428 
431 #define canFD_BITRATE_2M_80P (-1002)
432 
435 #define canFD_BITRATE_4M_80P (-1003)
436 
439 #define canFD_BITRATE_8M_60P (-1004)
440 
442 #define BAUD_1M (-1)
443 
444 #define BAUD_500K (-2)
445 
446 #define BAUD_250K (-3)
447 
448 #define BAUD_125K (-4)
449 
450 #define BAUD_100K (-5)
451 
452 #define BAUD_62K (-6)
453 
454 #define BAUD_50K (-7)
455 
456 #define BAUD_83K (-8)
457 
460 //
461 // Define CANLIBAPI unless it's done already.
462 // (canlib.c provides its own definitions of CANLIBAPI, DLLIMPORT
463 // and DLLEXPORT before including this file.)
464 //
465 #ifndef CANLIBAPI
466 # define CANLIBAPI
467 #endif /* CANLIBAPI */
468 
469 
470 #ifdef __cplusplus
471 extern "C" {
472 #endif /* __cplusplus */
473 
495 void CANLIBAPI canInitializeLibrary (void);
496 
521 canStatus CANLIBAPI canClose (const CanHandle hnd);
522 
547 canStatus CANLIBAPI canBusOn (const CanHandle hnd);
548 
569 canStatus CANLIBAPI canBusOff (const CanHandle hnd);
570 
619 canStatus CANLIBAPI canSetBusParams (const CanHandle hnd,
620  long freq,
621  unsigned int tseg1,
622  unsigned int tseg2,
623  unsigned int sjw,
624  unsigned int noSamp,
625  unsigned int syncmode);
626 
658 canStatus CANLIBAPI canSetBusParamsFd (const CanHandle hnd,
659  long freq_brs,
660  unsigned int tseg1_brs,
661  unsigned int tseg2_brs,
662  unsigned int sjw_brs);
663 
664 
696 canStatus CANLIBAPI canGetBusParams (const CanHandle hnd,
697  long *freq,
698  unsigned int *tseg1,
699  unsigned int *tseg2,
700  unsigned int *sjw,
701  unsigned int *noSamp,
702  unsigned int *syncmode);
703 
704 
727 canStatus CANLIBAPI canGetBusParamsFd(const CanHandle hnd,
728  long *freq_brs,
729  unsigned int *tseg1_brs,
730  unsigned int *tseg2_brs,
731  unsigned int *sjw_brs);
756 canStatus CANLIBAPI canSetBusOutputControl (const CanHandle hnd,
757  const unsigned int drivertype);
758 
793 canStatus CANLIBAPI canGetBusOutputControl (const CanHandle hnd,
794  unsigned int *drivertype);
795 
834 canStatus CANLIBAPI canAccept (const CanHandle hnd,
835  const long envelope,
836  const unsigned int flag);
837 
861 canStatus CANLIBAPI canReadStatus (const CanHandle hnd,
862  unsigned long *const flags);
863 
900 canStatus CANLIBAPI canReadErrorCounters (const CanHandle hnd,
901  unsigned int *txErr,
902  unsigned int *rxErr,
903  unsigned int *ovErr);
904 
946 canStatus CANLIBAPI canWrite (const CanHandle hnd,
947  long id,
948  void *msg,
949  unsigned int dlc,
950  unsigned int flag);
951 
979 canStatus CANLIBAPI canWriteSync (const CanHandle hnd, unsigned long timeout);
980 
1032 canStatus CANLIBAPI canRead (const CanHandle hnd,
1033  long *id,
1034  void *msg,
1035  unsigned int *dlc,
1036  unsigned int *flag,
1037  unsigned long *time);
1088 canStatus CANLIBAPI canReadWait (const CanHandle hnd,
1089  long *id,
1090  void *msg,
1091  unsigned int *dlc,
1092  unsigned int *flag,
1093  unsigned long *time,
1094  unsigned long timeout);
1095 
1147 canStatus CANLIBAPI canReadSpecific (const CanHandle hnd, long id, void * msg,
1148  unsigned int * dlc, unsigned int * flag,
1149  unsigned long * time);
1150 
1181 canStatus CANLIBAPI canReadSync (const CanHandle hnd, unsigned long timeout);
1182 
1214 canStatus CANLIBAPI canReadSyncSpecific (const CanHandle hnd,
1215  long id,
1216  unsigned long timeout);
1217 
1263 canStatus CANLIBAPI canReadSpecificSkip (const CanHandle hnd,
1264  long id,
1265  void * msg,
1266  unsigned int * dlc,
1267  unsigned int * flag,
1268  unsigned long * time);
1269 
1290 canStatus CANLIBAPI canSetNotify (const CanHandle hnd,
1291  void (*callback)(canNotifyData *),
1292  unsigned int notifyFlags,
1293  void *tag);
1294 
1308 canStatus CANLIBAPI canGetRawHandle (const CanHandle hnd, void *pvFd);
1309 
1344 canStatus CANLIBAPI canTranslateBaud (long *const freq,
1345  unsigned int *const tseg1,
1346  unsigned int *const tseg2,
1347  unsigned int *const sjw,
1348  unsigned int *const nosamp,
1349  unsigned int *const syncMode);
1350 
1373 canStatus CANLIBAPI canGetErrorText (canStatus err, char *buf, unsigned int bufsiz);
1374 
1404 unsigned short CANLIBAPI canGetVersion (void);
1405 
1435 canStatus CANLIBAPI canIoCtl (const CanHandle hnd,
1436  unsigned int func,
1437  void *buf,
1438  unsigned int buflen);
1439 
1440 
1451 canStatus CANLIBAPI canReadTimer (const CanHandle hnd, unsigned long *time);
1452 
1503 CanHandle CANLIBAPI canOpenChannel (int channel, int flags);
1504 
1525 canStatus CANLIBAPI canGetNumberOfChannels (int *channelCount);
1526 
1527 
1535 #define kvREMOTE_TYPE_NOT_REMOTE 0
1536 #define kvREMOTE_TYPE_WLAN 1
1537 #define kvREMOTE_TYPE_LAN 2
1538 
1547 #define kvLOGGER_TYPE_NOT_A_LOGGER 0
1548 #define kvLOGGER_TYPE_V1 1
1549 #define kvLOGGER_TYPE_V2 2
1550 
1582 canStatus CANLIBAPI canGetChannelData (int channel,
1583  int item,
1584  void *buffer,
1585  size_t bufsize);
1586 
1605 #define canCHANNELDATA_CHANNEL_CAP 1
1606 
1616 #define canCHANNELDATA_TRANS_CAP 2
1617 
1624 #define canCHANNELDATA_CHANNEL_FLAGS 3 // available, etc
1625 
1634 #define canCHANNELDATA_CARD_TYPE 4
1635 
1645 #define canCHANNELDATA_CARD_NUMBER 5
1646 
1654 #define canCHANNELDATA_CHAN_NO_ON_CARD 6
1655 
1665 #define canCHANNELDATA_CARD_SERIAL_NO 7
1666 
1676 #define canCHANNELDATA_TRANS_SERIAL_NO 8
1677 
1688 #define canCHANNELDATA_CARD_FIRMWARE_REV 9
1689 
1700 #define canCHANNELDATA_CARD_HARDWARE_REV 10
1701 
1711 #define canCHANNELDATA_CARD_UPC_NO 11
1712 
1723 #define canCHANNELDATA_TRANS_UPC_NO 12
1724 
1742 #define canCHANNELDATA_CHANNEL_NAME 13
1743 
1759 # define canCHANNELDATA_DLL_FILE_VERSION 14
1760 
1776 # define canCHANNELDATA_DLL_PRODUCT_VERSION 15
1777 
1793 # define canCHANNELDATA_DLL_FILETYPE 16
1794 
1803 # define canCHANNELDATA_TRANS_TYPE 17
1804 
1828 # define canCHANNELDATA_DEVICE_PHYSICAL_POSITION 18
1829 
1842 # define canCHANNELDATA_UI_NUMBER 19
1843 
1867 # define canCHANNELDATA_TIMESYNC_ENABLED 20
1868 
1883 # define canCHANNELDATA_DRIVER_FILE_VERSION 21
1884 
1899 # define canCHANNELDATA_DRIVER_PRODUCT_VERSION 22
1900 
1909 # define canCHANNELDATA_MFGNAME_UNICODE 23
1910 
1918 # define canCHANNELDATA_MFGNAME_ASCII 24
1919 
1928 # define canCHANNELDATA_DEVDESCR_UNICODE 25
1929 
1937 # define canCHANNELDATA_DEVDESCR_ASCII 26
1938 
1949 # define canCHANNELDATA_DRIVER_NAME 27
1950 
1963 # define canCHANNELDATA_CHANNEL_QUALITY 28
1964 
1973 # define canCHANNELDATA_ROUNDTRIP_TIME 29
1974 
1983 # define canCHANNELDATA_BUS_TYPE 30
1984 
1998 # define canCHANNELDATA_DEVNAME_ASCII 31
1999 
2010 # define canCHANNELDATA_TIME_SINCE_LAST_SEEN 32
2011 
2021 # define canCHANNELDATA_REMOTE_OPERATIONAL_MODE 33
2022 
2031 # define canCHANNELDATA_REMOTE_PROFILE_NAME 34
2032 
2041 # define canCHANNELDATA_REMOTE_HOST_NAME 35
2042 
2051 # define canCHANNELDATA_REMOTE_MAC 36
2052 
2061 # define canCHANNELDATA_MAX_BITRATE 37
2062 
2073 # define canCHANNELDATA_CHANNEL_CAP_MASK 38
2074 
2084 # define canCHANNELDATA_IS_REMOTE 40
2085 
2094 # define canCHANNELDATA_REMOTE_TYPE 41
2095 
2104 # define canCHANNELDATA_LOGGER_TYPE 42
2105 
2115 # define canCHANNELDATA_HW_STATUS 43
2116 
2126 # define canCHANNELDATA_FEATURE_EAN 44
2127 
2139 #define canCHANNELDATA_CUST_CHANNEL_NAME 39
2140 
2154 #define canCHANNEL_IS_EXCLUSIVE 0x0001
2155 
2157 #define canCHANNEL_IS_OPEN 0x0002
2158 
2161 #define canCHANNEL_IS_CANFD 0x0004
2162 
2163 //#define canCHANNEL_IS_CANFD_NON_ISO 0x0008 Reserved for when needed
2164 
2167 #define canCHANNEL_IS_LIN 0x0010
2168 
2171 #define canCHANNEL_IS_LIN_MASTER 0x0020
2172 
2175 #define canCHANNEL_IS_LIN_SLAVE 0x0040
2176 
2177 
2196 #define canHWTYPE_NONE 0
2197 #define canHWTYPE_VIRTUAL 1
2198 #define canHWTYPE_LAPCAN 2
2199 #define canHWTYPE_CANPARI 3
2200 #define canHWTYPE_PCCAN 8
2201 #define canHWTYPE_PCICAN 9
2202 #define canHWTYPE_USBCAN 11
2203 #define canHWTYPE_PCICAN_II 40
2204 #define canHWTYPE_USBCAN_II 42
2205 #define canHWTYPE_SIMULATED 44
2206 #define canHWTYPE_ACQUISITOR 46
2207 #define canHWTYPE_LEAF 48
2208 #define canHWTYPE_PC104_PLUS 50
2209 #define canHWTYPE_PCICANX_II 52
2210 #define canHWTYPE_MEMORATOR_II 54
2211 #define canHWTYPE_MEMORATOR_PRO 54
2212 #define canHWTYPE_USBCAN_PRO 56
2213 #define canHWTYPE_IRIS 58
2214 #define canHWTYPE_BLACKBIRD 58
2215 #define canHWTYPE_MEMORATOR_LIGHT 60
2216 #define canHWTYPE_MINIHYDRA 62
2217 #define canHWTYPE_EAGLE 62
2218 #define canHWTYPE_BAGEL 64
2219 #define canHWTYPE_BLACKBIRD_V2 64
2220 #define canHWTYPE_MINIPCIE 66
2221 #define canHWTYPE_USBCAN_KLINE 68
2222 #define canHWTYPE_ETHERCAN 70
2223 #define canHWTYPE_USBCAN_LIGHT 72
2224 #define canHWTYPE_USBCAN_PRO2 74
2225 #define canHWTYPE_PCIE_V2 76
2226 #define canHWTYPE_MEMORATOR_PRO2 78
2227 #define canHWTYPE_LEAF2 80
2228 #define canHWTYPE_MEMORATOR_V2 82
2229 #define canHWTYPE_CANLINHYBRID 84
2230 #define canHWTYPE_DINRAIL 86
2231 
2232 
2241 #define canCHANNEL_CAP_EXTENDED_CAN 0x00000001L
2242 #define canCHANNEL_CAP_BUS_STATISTICS 0x00000002L
2243 #define canCHANNEL_CAP_ERROR_COUNTERS 0x00000004L
2244 #define canCHANNEL_CAP_RESERVED_2 0x00000008L
2245 #define canCHANNEL_CAP_GENERATE_ERROR 0x00000010L
2246 #define canCHANNEL_CAP_GENERATE_OVERLOAD 0x00000020L
2247 #define canCHANNEL_CAP_TXREQUEST 0x00000040L
2248 #define canCHANNEL_CAP_TXACKNOWLEDGE 0x00000080L
2249 #define canCHANNEL_CAP_VIRTUAL 0x00010000L
2250 #define canCHANNEL_CAP_SIMULATED 0x00020000L
2251 #define canCHANNEL_CAP_RESERVED_1 0x00040000L
2252 #define canCHANNEL_CAP_CAN_FD 0x00080000L
2253 #define canCHANNEL_CAP_CAN_FD_NONISO 0x00100000L
2254 #define canCHANNEL_CAP_SILENT_MODE 0x00200000L
2255 #define canCHANNEL_CAP_SINGLE_SHOT 0x00400000L
2256 #define canCHANNEL_CAP_LOGGER 0x00800000L
2257 #define canCHANNEL_CAP_REMOTE_ACCESS 0x01000000L
2258 #define canCHANNEL_CAP_SCRIPT 0x02000000L
2259 #define canCHANNEL_CAP_LIN_HYBRID 0x04000000L
2260 #define canCHANNEL_CAP_IO_API 0x08000000L
2261 #define canCHANNEL_CAP_DIAGNOSTICS 0x10000000L
2262 
2263 
2275 #define canCHANNEL_OPMODE_NONE 1
2276 
2280 #define canCHANNEL_OPMODE_INFRASTRUCTURE 2
2281 
2285 #define canCHANNEL_OPMODE_RESERVED 3
2286 
2290 #define canCHANNEL_OPMODE_ADHOC 4
2291 
2301 #define canDRIVER_CAP_HIGHSPEED 0x00000001L
2302 
2328 #define canIOCTL_PREFER_EXT 1
2329 
2342 #define canIOCTL_PREFER_STD 2
2343 
2360 #define canIOCTL_CLEAR_ERROR_COUNTERS 5
2361 
2376 #define canIOCTL_SET_TIMER_SCALE 6
2377 
2397 #define canIOCTL_SET_TXACK 7
2398 
2411 #define canIOCTL_GET_RX_BUFFER_LEVEL 8
2412 
2425 #define canIOCTL_GET_TX_BUFFER_LEVEL 9
2426 
2436 #define canIOCTL_FLUSH_RX_BUFFER 10
2437 
2447 #define canIOCTL_FLUSH_TX_BUFFER 11
2448 
2457 #define canIOCTL_GET_TIMER_SCALE 12
2458 
2474 #define canIOCTL_SET_TXRQ 13
2475 
2476 
2483 #define canIOCTL_SET_BYPASS_MODE 15
2484 
2490 #define canIOCTL_SET_WAKEUP 16
2491 
2501 # define canIOCTL_GET_DRIVERHANDLE 17
2502 
2508 # define canIOCTL_MAP_RXQUEUE 18
2509 
2515 # define canIOCTL_GET_WAKEUP 19
2516 
2528 # define canIOCTL_SET_REPORT_ACCESS_ERRORS 20
2529 
2537 # define canIOCTL_GET_REPORT_ACCESS_ERRORS 21
2538 
2548 # define canIOCTL_CONNECT_TO_VIRTUAL_BUS 22
2549 
2559 # define canIOCTL_DISCONNECT_FROM_VIRTUAL_BUS 23
2560 
2570 # define canIOCTL_SET_USER_IOPORT 24
2571 
2582 # define canIOCTL_GET_USER_IOPORT 25
2583 
2589 # define canIOCTL_SET_BUFFER_WRAPAROUND_MODE 26
2590 
2607 # define canIOCTL_SET_RX_QUEUE_SIZE 27
2608 
2614 # define canIOCTL_SET_USB_THROTTLE 28
2615 
2621 # define canIOCTL_GET_USB_THROTTLE 29
2622 
2637 # define canIOCTL_SET_BUSON_TIME_AUTO_RESET 30
2638 
2650 # define canIOCTL_GET_TXACK 31
2651 
2666 # define canIOCTL_SET_LOCAL_TXECHO 32
2667 
2683 # define canIOCTL_SET_ERROR_FRAMES_REPORTING 33
2684 
2698 # define canIOCTL_GET_CHANNEL_QUALITY 34
2699 
2711 # define canIOCTL_GET_ROUNDTRIP_TIME 35
2712 
2721 # define canIOCTL_GET_BUS_TYPE 36
2722 
2735 # define canIOCTL_GET_DEVNAME_ASCII 37
2736 
2748 # define canIOCTL_GET_TIME_SINCE_LAST_SEEN 38
2749 
2763 # define canIOCTL_GET_TREF_LIST 39
2764 
2786 # define canIOCTL_TX_INTERVAL 40
2787 
2799 # define canIOCTL_SET_BRLIMIT 43
2800 
2806 # define canIOCTL_SET_USB_THROTTLE_SCALED 41
2807 
2822 # define canIOCTL_SET_THROTTLE_SCALED 41
2823 
2829 # define canIOCTL_GET_USB_THROTTLE_SCALED 42
2830 
2845 # define canIOCTL_GET_THROTTLE_SCALED 42
2846 
2853 # define canIOCTL_RESET_OVERRUN_COUNT 44
2854 
2863 # define canIOCTL_LIN_MODE 45
2864 
2867 typedef struct {
2868  unsigned int portNo;
2869  unsigned int portValue;
2871 
2872 
2912 canStatus CANLIBAPI canSetBusParamsC200 (const CanHandle hnd, unsigned char btr0, unsigned char btr1);
2913 
2914 
2915 
2951 canStatus CANLIBAPI canSetDriverMode (const CanHandle hnd, int lineMode, int resNet);
2952 
2989 canStatus CANLIBAPI canGetDriverMode (const CanHandle hnd, int *lineMode, int *resNet);
2990 
3010 #define canVERSION_CANLIB32_VERSION 0
3011 
3022 #define canVERSION_CANLIB32_PRODVER 1
3023 
3035 #define canVERSION_CANLIB32_PRODVER32 2
3036 
3047 #define canVERSION_CANLIB32_BETA 3
3048 
3068 unsigned int CANLIBAPI canGetVersionEx (unsigned int itemCode);
3069 
3070 
3090 canStatus CANLIBAPI canObjBufFreeAll (const CanHandle hnd);
3091 
3112 canStatus CANLIBAPI canObjBufAllocate (const CanHandle hnd, int type);
3113 
3122 #define canOBJBUF_TYPE_AUTO_RESPONSE 0x01
3123 #define canOBJBUF_TYPE_PERIODIC_TX 0x02
3124 
3146 canStatus CANLIBAPI canObjBufFree (const CanHandle hnd, int idx);
3147 
3148 // Writes CAN data to the object buffer with the specified index.
3149 
3175 canStatus CANLIBAPI canObjBufWrite (const CanHandle hnd,
3176  int idx,
3177  int id,
3178  void* msg,
3179  unsigned int dlc,
3180  unsigned int flags);
3181 
3207 canStatus CANLIBAPI canObjBufSetFilter (const CanHandle hnd,
3208  int idx,
3209  unsigned int code,
3210  unsigned int mask);
3211 
3232 canStatus CANLIBAPI canObjBufSetFlags (const CanHandle hnd,
3233  int idx,
3234  unsigned int flags);
3235 
3253 # define canOBJBUF_AUTO_RESPONSE_RTR_ONLY 0x01
3254 
3276 canStatus CANLIBAPI canObjBufSetPeriod (const CanHandle hnd,
3277  int idx,
3278  unsigned int period);
3279 
3300 canStatus CANLIBAPI canObjBufSetMsgCount (const CanHandle hnd,
3301  int idx,
3302  unsigned int count);
3303 
3323 canStatus CANLIBAPI canObjBufEnable (const CanHandle hnd, int idx);
3324 
3344 canStatus CANLIBAPI canObjBufDisable (const CanHandle hnd, int idx);
3345 
3369 canStatus CANLIBAPI canObjBufSendBurst (const CanHandle hnd,
3370  int idx,
3371  unsigned int burstlen);
3372 
3373 
3396 canStatus CANLIBAPI canResetBus (const CanHandle hnd);
3397 
3436 canStatus CANLIBAPI canWriteWait (const CanHandle hnd,
3437  long id,
3438  void *msg,
3439  unsigned int dlc,
3440  unsigned int flag,
3441  unsigned long timeout);
3442 
3443 
3469 canStatus CANLIBAPI canUnloadLibrary (void);
3470 
3529 canStatus CANLIBAPI canSetAcceptanceFilter (const CanHandle hnd,
3530  unsigned int code,
3531  unsigned int mask,
3532  int is_extended);
3556 canStatus CANLIBAPI canFlushReceiveQueue (const CanHandle hnd);
3557 
3582 canStatus CANLIBAPI canFlushTransmitQueue (const CanHandle hnd);
3583 
3584 
3593 #define kvLED_ACTION_ALL_LEDS_ON 0
3594 #define kvLED_ACTION_ALL_LEDS_OFF 1
3595 #define kvLED_ACTION_LED_0_ON 2
3596 #define kvLED_ACTION_LED_0_OFF 3
3597 #define kvLED_ACTION_LED_1_ON 4
3598 #define kvLED_ACTION_LED_1_OFF 5
3599 #define kvLED_ACTION_LED_2_ON 6
3600 #define kvLED_ACTION_LED_2_OFF 7
3601 #define kvLED_ACTION_LED_3_ON 8
3602 #define kvLED_ACTION_LED_3_OFF 9
3603 #define kvLED_ACTION_LED_4_ON 10
3604 #define kvLED_ACTION_LED_4_OFF 11
3605 #define kvLED_ACTION_LED_5_ON 12
3606 #define kvLED_ACTION_LED_5_OFF 13
3607 #define kvLED_ACTION_LED_6_ON 14
3608 #define kvLED_ACTION_LED_6_OFF 15
3609 #define kvLED_ACTION_LED_7_ON 16
3610 #define kvLED_ACTION_LED_7_OFF 17
3611 #define kvLED_ACTION_LED_8_ON 18
3612 #define kvLED_ACTION_LED_8_OFF 19
3613 #define kvLED_ACTION_LED_9_ON 20
3614 #define kvLED_ACTION_LED_9_OFF 21
3615 #define kvLED_ACTION_LED_10_ON 22
3616 #define kvLED_ACTION_LED_10_OFF 23
3617 #define kvLED_ACTION_LED_11_ON 24
3618 #define kvLED_ACTION_LED_11_OFF 25
3619 
3620 
3643 canStatus CANLIBAPI kvFlashLeds (const CanHandle hnd, int action, int timeout);
3644 
3664 canStatus CANLIBAPI canRequestChipStatus (const CanHandle hnd);
3665 
3692 canStatus CANLIBAPI canRequestBusStatistics (const CanHandle hnd);
3693 
3699 typedef struct canBusStatistics_s {
3700  unsigned long stdData;
3701  unsigned long stdRemote;
3702  unsigned long extData;
3703  unsigned long extRemote;
3704  unsigned long errFrame;
3705 
3710  unsigned long busLoad;
3711  unsigned long overruns;
3713 
3736 canStatus CANLIBAPI canGetBusStatistics (const CanHandle hnd,
3737  canBusStatistics *stat,
3738  size_t bufsiz);
3739 
3740 
3761 canStatus CANLIBAPI canGetHandleData (const CanHandle hnd,
3762  int item,
3763  void *buffer,
3764  size_t bufsize);
3765 
3767 typedef void *kvTimeDomain;
3768 
3771 
3776 typedef struct kvTimeDomainData_s {
3782 
3811 kvStatus CANLIBAPI kvTimeDomainCreate (kvTimeDomain *domain);
3812 
3835 kvStatus CANLIBAPI kvTimeDomainDelete (kvTimeDomain domain);
3836 
3862 kvStatus CANLIBAPI kvTimeDomainResetTime (kvTimeDomain domain);
3863 
3888 kvStatus CANLIBAPI kvTimeDomainGetData (kvTimeDomain domain,
3889  kvTimeDomainData *data,
3890  size_t bufsiz);
3891 
3914 kvStatus CANLIBAPI kvTimeDomainAddHandle(kvTimeDomain domain,
3915  const CanHandle hnd);
3916 
3938 kvStatus CANLIBAPI kvTimeDomainRemoveHandle (kvTimeDomain domain,
3939  const CanHandle hnd);
3940 
3953 typedef void (CANLIBAPI *kvCallback_t) (CanHandle hnd, void* context, unsigned int notifyEvent);
3954 
3988 kvStatus CANLIBAPI kvSetNotifyCallback (const CanHandle hnd,
3989  kvCallback_t callback,
3990  void* context,
3991  unsigned int notifyFlags);
3992 
4006 #define kvBUSTYPE_NONE 0
4007 
4012 #define kvBUSTYPE_PCI 1
4013 
4018 #define kvBUSTYPE_PCMCIA 2
4019 
4024 #define kvBUSTYPE_USB 3
4025 
4030 #define kvBUSTYPE_WLAN 4
4031 
4036 #define kvBUSTYPE_PCI_EXPRESS 5
4037 
4042 #define kvBUSTYPE_ISA 6
4043 
4048 #define kvBUSTYPE_VIRTUAL 7
4049 
4054 #define kvBUSTYPE_PC104_PLUS 8
4055 
4060 #define kvBUSTYPE_LAN 9
4061 
4077 #define kvBUSTYPE_GROUP_VIRTUAL 1
4078 
4083 #define kvBUSTYPE_GROUP_LOCAL 2
4084 
4089 #define kvBUSTYPE_GROUP_REMOTE 3
4090 
4094 #define kvBUSTYPE_GROUP_INTERNAL 4
4095 
4149 kvStatus CANLIBAPI kvGetSupportedInterfaceInfo (int index,
4150  char *hwName,
4151  size_t nameLen,
4152  int *hwType,
4153  int *hwBusType);
4154 
4179 kvStatus CANLIBAPI kvReadDeviceCustomerData (const CanHandle hnd,
4180  int userNumber,
4181  int itemNumber,
4182  void *data,
4183  size_t bufsiz);
4184 
4198 #define kvENVVAR_TYPE_INT 1
4199 
4205 #define kvENVVAR_TYPE_FLOAT 2
4206 
4212 #define kvENVVAR_TYPE_STRING 3
4213 
4229 #define kvEVENT_TYPE_KEY 1
4230 
4238  typedef int64_t kvEnvHandle;
4239 
4259 kvStatus CANLIBAPI kvScriptStart (const CanHandle hnd, int slotNo);
4260 
4267 #define kvSCRIPT_STOP_NORMAL 0
4268 #define kvSCRIPT_STOP_FORCED -9
4292 kvStatus CANLIBAPI kvScriptStop (const CanHandle hnd, int slotNo, int mode);
4293 
4313 kvStatus CANLIBAPI kvScriptUnload (const CanHandle hnd, int slotNo);
4314 
4339 kvStatus CANLIBAPI kvScriptSendEvent (const CanHandle hnd,
4340  int slotNo,
4341  int eventType,
4342  int eventNo,
4343  unsigned int data);
4344 
4371 kvEnvHandle CANLIBAPI kvScriptEnvvarOpen (const CanHandle hnd,
4372  char* envvarName,
4373  int *envvarType,
4374  int *envvarSize); // returns scriptHandle
4375 
4395 kvStatus CANLIBAPI kvScriptEnvvarClose (kvEnvHandle eHnd);
4396 
4419 kvStatus CANLIBAPI kvScriptEnvvarSetInt (kvEnvHandle eHnd, int val);
4420 
4444 kvStatus CANLIBAPI kvScriptEnvvarGetInt (kvEnvHandle eHnd, int *val);
4445 
4468 kvStatus CANLIBAPI kvScriptEnvvarSetFloat (kvEnvHandle eHnd, float val);
4469 
4493 kvStatus CANLIBAPI kvScriptEnvvarGetFloat (kvEnvHandle eHnd, float *val);
4494 
4521 kvStatus CANLIBAPI kvScriptEnvvarSetData (kvEnvHandle eHnd,
4522  void *buf,
4523  int start_index,
4524  int data_len);
4525 
4551 kvStatus CANLIBAPI kvScriptEnvvarGetData (kvEnvHandle eHnd,
4552  void *buf,
4553  int start_index,
4554  int data_len);
4555 
4581 kvStatus CANLIBAPI kvScriptLoadFileOnDevice (const CanHandle hnd,
4582  int slotNo,
4583  char *localFile);
4584 
4613 kvStatus CANLIBAPI kvScriptLoadFile (const CanHandle hnd,
4614  int slotNo,
4615  char *filePathOnPC);
4616 
4617 
4618 
4625 #define kvSCRIPT_STATUS_LOADED 1
4626 #define kvSCRIPT_STATUS_RUNNING 2
4649 kvStatus CANLIBAPI kvScriptStatus(const CanHandle hnd,
4650  int slot,
4651  unsigned int *status);
4652 
4653 
4672 kvStatus CANLIBAPI kvScriptGetMaxEnvvarSize(int hnd, int *envvarSize);
4673 
4704 kvStatus CANLIBAPI kvScriptTxeGetData(const char *filePathOnPC,
4705  int item,
4706  void *buffer,
4707  unsigned int *bufsize);
4708 
4734 #define canTXEDATA_FILE_VERSION 1
4735 
4751 #define canTXEDATA_COMPILER_VERSION 2
4752 
4771 #define canTXEDATA_DATE 3
4772 
4783 #define canTXEDATA_DESCRIPTION 4
4784 
4798 #define canTXEDATA_SOURCE 5
4799 
4809 #define canTXEDATA_SIZE_OF_CODE 6
4810 
4820 #define canTXEDATA_IS_ENCRYPTED 7
4821 
4822 
4848 kvStatus CANLIBAPI kvFileCopyToDevice (const CanHandle hnd,
4849  char *hostFileName,
4850  char *deviceFileName);
4851 
4874 kvStatus CANLIBAPI kvFileCopyFromDevice (const CanHandle hnd,
4875  char *deviceFileName,
4876  char *hostFileName);
4877 
4899 kvStatus CANLIBAPI kvFileDelete (const CanHandle hnd, char *deviceFileName);
4900 
4923 kvStatus CANLIBAPI kvFileGetName (const CanHandle hnd,
4924  int fileNo,
4925  char *name,
4926  int namelen);
4927 
4947 kvStatus CANLIBAPI kvFileGetCount (const CanHandle hnd, int *count);
4948 
4971 kvStatus CANLIBAPI kvFileGetSystemData (const CanHandle hnd,
4972  int itemCode,
4973  int *result);
4974 
4992 #define kvDEVICE_MODE_INTERFACE 0x00
4993 
4998 #define kvDEVICE_MODE_LOGGER 0x01
4999 
5024 kvStatus CANLIBAPI kvDeviceSetMode (const CanHandle hnd, int mode);
5025 
5048 kvStatus CANLIBAPI kvDeviceGetMode (const CanHandle hnd, int *result);
5049 
5050 
5075 kvStatus CANLIBAPI kvReadTimer (const CanHandle hnd, unsigned int *time);
5099 kvStatus CANLIBAPI kvReadTimer64 (const CanHandle hnd, uint64_t *time);
5100 
5117 #define kvIO_INFO_GET_MODULE_TYPE 1
5118 
5124 #define kvIO_INFO_GET_DIRECTION 2
5125 
5131 #define kvIO_INFO_GET_PIN_TYPE 4
5132 
5138 #define kvIO_INFO_GET_NUMBER_OF_BITS 5
5139 
5147 #define kvIO_INFO_GET_RANGE_MIN 6
5148 
5156 #define kvIO_INFO_GET_RANGE_MAX 7
5157 
5165 #define kvIO_INFO_GET_DI_LOW_HIGH_FILTER 8
5166 
5174 #define kvIO_INFO_GET_DI_HIGH_LOW_FILTER 9
5175 
5183 #define kvIO_INFO_GET_AI_LP_FILTER_ORDER 10
5184 
5193 #define kvIO_INFO_GET_AI_HYSTERESIS 11
5194 
5200 #define kvIO_INFO_GET_MODULE_NUMBER 14
5201 
5207 #define kvIO_INFO_GET_SERIAL_NUMBER 15
5208 
5216 #define kvIO_INFO_GET_FW_VERSION 16
5217 
5238 #define kvIO_INFO_SET_DI_LOW_HIGH_FILTER 8
5239 
5247 #define kvIO_INFO_SET_DI_HIGH_LOW_FILTER 9
5248 
5256 #define kvIO_INFO_SET_AI_LP_FILTER_ORDER 10
5257 
5266 #define kvIO_INFO_SET_AI_HYSTERESIS 11
5267 
5284 #define kvIO_MODULE_TYPE_DIGITAL 1
5285 
5289 #define kvIO_MODULE_TYPE_ANALOG 2
5290 
5294 #define kvIO_MODULE_TYPE_RELAY 3
5295 
5310 #define kvIO_PIN_TYPE_DIGITAL 1
5311 
5315 #define kvIO_PIN_TYPE_ANALOG 2
5316 
5320 #define kvIO_PIN_TYPE_RELAY 3
5321 
5336 #define kvIO_PIN_DIRECTION_IN 4
5337 
5341 #define kvIO_PIN_DIRECTION_OUT 8
5342 
5359 canStatus CANLIBAPI kvIoGetNumberOfPins (const CanHandle hnd, unsigned int *pinCount);
5360 
5372 canStatus CANLIBAPI kvIoConfirmConfig (const CanHandle hnd);
5373 
5389 canStatus CANLIBAPI kvIoPinGetInfo (const CanHandle hnd, unsigned int pin, int item, void *buffer, const unsigned int bufsize);
5390 
5406 canStatus CANLIBAPI kvIoPinSetInfo (const CanHandle hnd, unsigned int pin, int item, const void *buffer, const unsigned int bufsize);
5407 
5421 canStatus CANLIBAPI kvIoPinSetDigital (const CanHandle hnd, unsigned int pin, unsigned int value);
5422 
5438 canStatus CANLIBAPI kvIoPinGetDigital (const CanHandle hnd, unsigned int pin, unsigned int *value);
5439 
5457 canStatus CANLIBAPI kvIoPinGetOutputDigital (const CanHandle hnd, unsigned int pin, unsigned int *value);
5458 
5472 canStatus CANLIBAPI kvIoPinSetRelay (const CanHandle hnd, unsigned int pin, unsigned int value);
5473 
5489 canStatus CANLIBAPI kvIoPinGetOutputRelay (const CanHandle hnd, unsigned int pin, unsigned int *value);
5490 
5504 canStatus CANLIBAPI kvIoPinSetAnalog (const CanHandle hnd, unsigned int pin, float value);
5505 
5519 canStatus CANLIBAPI kvIoPinGetAnalog (const CanHandle hnd, unsigned int pin, float* value);
5520 
5536 canStatus CANLIBAPI kvIoPinGetOutputAnalog (const CanHandle hnd, unsigned int pin, float* value);
5537 
5538 #ifdef __cplusplus
5539 }
5540 #endif /* __cplusplus */
5541 
5542 #include "obsolete.h"
5543 
5544 
5545 
5546 
5547 #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:3701
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:177
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:2868
int64_t kvEnvHandle
Definition: canlib.h:4238
int nNonMagiSyncCards
number of non MagiSync™ interfaces
Definition: canlib.h:3779
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:3767
unsigned char rxErrorCounter
Definition: canlib.h:179
unsigned long extRemote
Number of received extended (29-bit identifiers) remote frames.
Definition: canlib.h:3703
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:154
canStatus canObjBufDisable(const CanHandle hnd, int idx)
void * tag
Definition: canlib.h:162
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:163
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:169
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:161
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:2869
unsigned short canGetVersion(void)
unsigned long errFrame
Number of error frames.
Definition: canlib.h:3704
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:3702
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:178
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:3953
canStatus canSetBusParamsC200(const CanHandle hnd, unsigned char btr0, unsigned char btr1)
int nMagiSyncGroups
number of MagiSync™ groups
Definition: canlib.h:3777
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:3700
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:3711
kvStatus kvTimeDomainAddHandle(kvTimeDomain domain, const CanHandle hnd)
Definition: canlib.h:3776
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:3710
canStatus canRequestChipStatus(const CanHandle hnd)
Definition: canlib.h:3699
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:159
canStatus kvStatus
Definition: canlib.h:3770
Definition: canlib.h:2867
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:3780
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:166
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:3778