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 
145 #ifndef _CANLIB_H_
146 #define _CANLIB_H_
147 
148 #include <stdlib.h>
149 
150 #include <stdint.h>
151 
152 #include "canstat.h"
153 
155 typedef int canHandle;
156 
157 # define canINVALID_HANDLE (-1)
158 
159 
161 
162 typedef struct canNotifyData {
163  void *tag;
165  union {
166  struct {
167  unsigned long time;
168  } busErr;
169  struct {
170  long id;
171  unsigned long time;
172  } rx;
173  struct {
174  long id;
175  unsigned long time;
176  } tx;
177  struct {
178  unsigned char busStatus;
179  unsigned char txErrorCounter;
180  unsigned char rxErrorCounter;
181  unsigned long time;
182  } status;
183  } info;
184 } canNotifyData;
185 
186 
196 // The canWANT_xxx names are also obsolete, use canOPEN_xxx instead for new developments.
197 #define canWANT_EXCLUSIVE 0x0008
198 #define canWANT_EXTENDED 0x0010
199 #define canWANT_VIRTUAL 0x0020
200 
214 #define canOPEN_EXCLUSIVE 0x0008
215 
227 #define canOPEN_REQUIRE_EXTENDED 0x0010
228 
236 # define canOPEN_ACCEPT_VIRTUAL 0x0020
237 
246 # define canOPEN_OVERRIDE_EXCLUSIVE 0x0040
247 
264 # define canOPEN_REQUIRE_INIT_ACCESS 0x0080
265 
277 # define canOPEN_NO_INIT_ACCESS 0x0100
278 
290 # define canOPEN_ACCEPT_LARGE_DLC 0x0200 // DLC can be greater than 8
291 
298 # define canOPEN_CAN_FD 0x0400
299 
313 # define canOPEN_CAN_FD_NONISO 0x0800
314 
315 
319 # define canOPEN_INTERNAL_L 0x1000
320 
332 #define canFILTER_ACCEPT 1
333 #define canFILTER_REJECT 2
334 
335 #define canFILTER_SET_CODE_STD 3
336 
337 #define canFILTER_SET_MASK_STD 4
338 
339 #define canFILTER_SET_CODE_EXT 5
340 
341 #define canFILTER_SET_MASK_EXT 6
342 
343 #define canFILTER_NULL_MASK 0L
344 
360 #define canDRIVER_NORMAL 4
361 
368 #define canDRIVER_SILENT 1
369 
373 #define canDRIVER_SELFRECEPTION 8
374 
378 #define canDRIVER_OFF 0
379 
402 #define canBITRATE_1M (-1)
403 
404 #define canBITRATE_500K (-2)
405 
406 #define canBITRATE_250K (-3)
407 
408 #define canBITRATE_125K (-4)
409 
410 #define canBITRATE_100K (-5)
411 
412 #define canBITRATE_62K (-6)
413 
414 #define canBITRATE_50K (-7)
415 
416 #define canBITRATE_83K (-8)
417 
418 #define canBITRATE_10K (-9)
419 
420 // CAN FD Bit Rates
424 #define canFD_BITRATE_500K_80P (-1000)
425 
428 #define canFD_BITRATE_1M_80P (-1001)
429 
432 #define canFD_BITRATE_2M_80P (-1002)
433 
436 #define canFD_BITRATE_4M_80P (-1003)
437 
440 #define canFD_BITRATE_8M_60P (-1004)
441 
443 #define BAUD_1M (-1)
444 
445 #define BAUD_500K (-2)
446 
447 #define BAUD_250K (-3)
448 
449 #define BAUD_125K (-4)
450 
451 #define BAUD_100K (-5)
452 
453 #define BAUD_62K (-6)
454 
455 #define BAUD_50K (-7)
456 
457 #define BAUD_83K (-8)
458 
461 //
462 // Define CANLIBAPI unless it's done already.
463 // (canlib.c provides its own definitions of CANLIBAPI, DLLIMPORT
464 // and DLLEXPORT before including this file.)
465 //
466 #ifndef CANLIBAPI
467 # define CANLIBAPI
468 #endif /* CANLIBAPI */
469 
470 
471 #ifdef __cplusplus
472 extern "C" {
473 #endif /* __cplusplus */
474 
496 void CANLIBAPI canInitializeLibrary (void);
497 
522 canStatus CANLIBAPI canClose (const CanHandle hnd);
523 
548 canStatus CANLIBAPI canBusOn (const CanHandle hnd);
549 
570 canStatus CANLIBAPI canBusOff (const CanHandle hnd);
571 
620 canStatus CANLIBAPI canSetBusParams (const CanHandle hnd,
621  long freq,
622  unsigned int tseg1,
623  unsigned int tseg2,
624  unsigned int sjw,
625  unsigned int noSamp,
626  unsigned int syncmode);
627 
659 canStatus CANLIBAPI canSetBusParamsFd (const CanHandle hnd,
660  long freq_brs,
661  unsigned int tseg1_brs,
662  unsigned int tseg2_brs,
663  unsigned int sjw_brs);
664 
665 
697 canStatus CANLIBAPI canGetBusParams (const CanHandle hnd,
698  long *freq,
699  unsigned int *tseg1,
700  unsigned int *tseg2,
701  unsigned int *sjw,
702  unsigned int *noSamp,
703  unsigned int *syncmode);
704 
705 
728 canStatus CANLIBAPI canGetBusParamsFd(const CanHandle hnd,
729  long *freq_brs,
730  unsigned int *tseg1_brs,
731  unsigned int *tseg2_brs,
732  unsigned int *sjw_brs);
757 canStatus CANLIBAPI canSetBusOutputControl (const CanHandle hnd,
758  const unsigned int drivertype);
759 
794 canStatus CANLIBAPI canGetBusOutputControl (const CanHandle hnd,
795  unsigned int *drivertype);
796 
835 canStatus CANLIBAPI canAccept (const CanHandle hnd,
836  const long envelope,
837  const unsigned int flag);
838 
862 canStatus CANLIBAPI canReadStatus (const CanHandle hnd,
863  unsigned long *const flags);
864 
901 canStatus CANLIBAPI canReadErrorCounters (const CanHandle hnd,
902  unsigned int *txErr,
903  unsigned int *rxErr,
904  unsigned int *ovErr);
905 
947 canStatus CANLIBAPI canWrite (const CanHandle hnd,
948  long id,
949  void *msg,
950  unsigned int dlc,
951  unsigned int flag);
952 
980 canStatus CANLIBAPI canWriteSync (const CanHandle hnd, unsigned long timeout);
981 
1033 canStatus CANLIBAPI canRead (const CanHandle hnd,
1034  long *id,
1035  void *msg,
1036  unsigned int *dlc,
1037  unsigned int *flag,
1038  unsigned long *time);
1089 canStatus CANLIBAPI canReadWait (const CanHandle hnd,
1090  long *id,
1091  void *msg,
1092  unsigned int *dlc,
1093  unsigned int *flag,
1094  unsigned long *time,
1095  unsigned long timeout);
1096 
1148 canStatus CANLIBAPI canReadSpecific (const CanHandle hnd, long id, void * msg,
1149  unsigned int * dlc, unsigned int * flag,
1150  unsigned long * time);
1151 
1182 canStatus CANLIBAPI canReadSync (const CanHandle hnd, unsigned long timeout);
1183 
1215 canStatus CANLIBAPI canReadSyncSpecific (const CanHandle hnd,
1216  long id,
1217  unsigned long timeout);
1218 
1264 canStatus CANLIBAPI canReadSpecificSkip (const CanHandle hnd,
1265  long id,
1266  void * msg,
1267  unsigned int * dlc,
1268  unsigned int * flag,
1269  unsigned long * time);
1270 
1291 canStatus CANLIBAPI canSetNotify (const CanHandle hnd,
1292  void (*callback)(canNotifyData *),
1293  unsigned int notifyFlags,
1294  void *tag);
1295 
1309 canStatus CANLIBAPI canGetRawHandle (const CanHandle hnd, void *pvFd);
1310 
1345 canStatus CANLIBAPI canTranslateBaud (long *const freq,
1346  unsigned int *const tseg1,
1347  unsigned int *const tseg2,
1348  unsigned int *const sjw,
1349  unsigned int *const nosamp,
1350  unsigned int *const syncMode);
1351 
1374 canStatus CANLIBAPI canGetErrorText (canStatus err, char *buf, unsigned int bufsiz);
1375 
1405 unsigned short CANLIBAPI canGetVersion (void);
1406 
1436 canStatus CANLIBAPI canIoCtl (const CanHandle hnd,
1437  unsigned int func,
1438  void *buf,
1439  unsigned int buflen);
1440 
1441 
1452 canStatus CANLIBAPI canReadTimer (const CanHandle hnd, unsigned long *time);
1453 
1504 CanHandle CANLIBAPI canOpenChannel (int channel, int flags);
1505 
1526 canStatus CANLIBAPI canGetNumberOfChannels (int *channelCount);
1527 
1528 
1536 #define kvREMOTE_TYPE_NOT_REMOTE 0
1537 #define kvREMOTE_TYPE_WLAN 1
1538 #define kvREMOTE_TYPE_LAN 2
1539 
1548 #define kvLOGGER_TYPE_NOT_A_LOGGER 0
1549 #define kvLOGGER_TYPE_V1 1
1550 #define kvLOGGER_TYPE_V2 2
1551 
1583 canStatus CANLIBAPI canGetChannelData (int channel,
1584  int item,
1585  void *buffer,
1586  size_t bufsize);
1587 
1606 #define canCHANNELDATA_CHANNEL_CAP 1
1607 
1617 #define canCHANNELDATA_TRANS_CAP 2
1618 
1627 #define canCHANNELDATA_CHANNEL_FLAGS 3 // available, etc
1628 
1637 #define canCHANNELDATA_CARD_TYPE 4
1638 
1648 #define canCHANNELDATA_CARD_NUMBER 5
1649 
1657 #define canCHANNELDATA_CHAN_NO_ON_CARD 6
1658 
1668 #define canCHANNELDATA_CARD_SERIAL_NO 7
1669 
1679 #define canCHANNELDATA_TRANS_SERIAL_NO 8
1680 
1691 #define canCHANNELDATA_CARD_FIRMWARE_REV 9
1692 
1703 #define canCHANNELDATA_CARD_HARDWARE_REV 10
1704 
1714 #define canCHANNELDATA_CARD_UPC_NO 11
1715 
1726 #define canCHANNELDATA_TRANS_UPC_NO 12
1727 
1745 #define canCHANNELDATA_CHANNEL_NAME 13
1746 
1762 # define canCHANNELDATA_DLL_FILE_VERSION 14
1763 
1779 # define canCHANNELDATA_DLL_PRODUCT_VERSION 15
1780 
1796 # define canCHANNELDATA_DLL_FILETYPE 16
1797 
1806 # define canCHANNELDATA_TRANS_TYPE 17
1807 
1831 # define canCHANNELDATA_DEVICE_PHYSICAL_POSITION 18
1832 
1845 # define canCHANNELDATA_UI_NUMBER 19
1846 
1870 # define canCHANNELDATA_TIMESYNC_ENABLED 20
1871 
1886 # define canCHANNELDATA_DRIVER_FILE_VERSION 21
1887 
1902 # define canCHANNELDATA_DRIVER_PRODUCT_VERSION 22
1903 
1912 # define canCHANNELDATA_MFGNAME_UNICODE 23
1913 
1921 # define canCHANNELDATA_MFGNAME_ASCII 24
1922 
1931 # define canCHANNELDATA_DEVDESCR_UNICODE 25
1932 
1940 # define canCHANNELDATA_DEVDESCR_ASCII 26
1941 
1952 # define canCHANNELDATA_DRIVER_NAME 27
1953 
1966 # define canCHANNELDATA_CHANNEL_QUALITY 28
1967 
1976 # define canCHANNELDATA_ROUNDTRIP_TIME 29
1977 
1986 # define canCHANNELDATA_BUS_TYPE 30
1987 
2001 # define canCHANNELDATA_DEVNAME_ASCII 31
2002 
2013 # define canCHANNELDATA_TIME_SINCE_LAST_SEEN 32
2014 
2024 # define canCHANNELDATA_REMOTE_OPERATIONAL_MODE 33
2025 
2034 # define canCHANNELDATA_REMOTE_PROFILE_NAME 34
2035 
2044 # define canCHANNELDATA_REMOTE_HOST_NAME 35
2045 
2054 # define canCHANNELDATA_REMOTE_MAC 36
2055 
2064 # define canCHANNELDATA_MAX_BITRATE 37
2065 
2076 # define canCHANNELDATA_CHANNEL_CAP_MASK 38
2077 
2087 # define canCHANNELDATA_IS_REMOTE 40
2088 
2097 # define canCHANNELDATA_REMOTE_TYPE 41
2098 
2107 # define canCHANNELDATA_LOGGER_TYPE 42
2108 
2118 # define canCHANNELDATA_HW_STATUS 43
2119 
2129 # define canCHANNELDATA_FEATURE_EAN 44
2130 
2142 #define canCHANNELDATA_CUST_CHANNEL_NAME 39
2143 
2157 #define canCHANNEL_IS_EXCLUSIVE 0x0001
2158 
2160 #define canCHANNEL_IS_OPEN 0x0002
2161 
2164 #define canCHANNEL_IS_CANFD 0x0004
2165 
2166 //#define canCHANNEL_IS_CANFD_NON_ISO 0x0008 Reserved for when needed
2167 
2170 #define canCHANNEL_IS_LIN 0x0010
2171 
2174 #define canCHANNEL_IS_LIN_MASTER 0x0020
2175 
2178 #define canCHANNEL_IS_LIN_SLAVE 0x0040
2179 
2180 
2199 #define canHWTYPE_NONE 0
2200 #define canHWTYPE_VIRTUAL 1
2201 #define canHWTYPE_LAPCAN 2
2202 #define canHWTYPE_CANPARI 3
2203 #define canHWTYPE_PCCAN 8
2204 #define canHWTYPE_PCICAN 9
2205 #define canHWTYPE_USBCAN 11
2206 #define canHWTYPE_PCICAN_II 40
2207 #define canHWTYPE_USBCAN_II 42
2208 #define canHWTYPE_SIMULATED 44
2209 #define canHWTYPE_ACQUISITOR 46
2210 #define canHWTYPE_LEAF 48
2211 #define canHWTYPE_PC104_PLUS 50
2212 #define canHWTYPE_PCICANX_II 52
2213 #define canHWTYPE_MEMORATOR_II 54
2214 #define canHWTYPE_MEMORATOR_PRO 54
2215 #define canHWTYPE_USBCAN_PRO 56
2216 #define canHWTYPE_IRIS 58
2217 #define canHWTYPE_BLACKBIRD 58
2218 #define canHWTYPE_MEMORATOR_LIGHT 60
2219 #define canHWTYPE_MINIHYDRA 62
2220 #define canHWTYPE_EAGLE 62
2221 #define canHWTYPE_BAGEL 64
2222 #define canHWTYPE_BLACKBIRD_V2 64
2223 #define canHWTYPE_MINIPCIE 66
2224 #define canHWTYPE_USBCAN_KLINE 68
2225 #define canHWTYPE_ETHERCAN 70
2226 #define canHWTYPE_USBCAN_LIGHT 72
2227 #define canHWTYPE_USBCAN_PRO2 74
2228 #define canHWTYPE_PCIE_V2 76
2229 #define canHWTYPE_MEMORATOR_PRO2 78
2230 #define canHWTYPE_LEAF2 80
2231 #define canHWTYPE_MEMORATOR_V2 82
2232 #define canHWTYPE_CANLINHYBRID 84
2233 #define canHWTYPE_DINRAIL 86
2234 
2235 
2244 #define canCHANNEL_CAP_EXTENDED_CAN 0x00000001L
2245 #define canCHANNEL_CAP_BUS_STATISTICS 0x00000002L
2246 #define canCHANNEL_CAP_ERROR_COUNTERS 0x00000004L
2247 #define canCHANNEL_CAP_RESERVED_2 0x00000008L
2248 #define canCHANNEL_CAP_GENERATE_ERROR 0x00000010L
2249 #define canCHANNEL_CAP_GENERATE_OVERLOAD 0x00000020L
2250 #define canCHANNEL_CAP_TXREQUEST 0x00000040L
2251 #define canCHANNEL_CAP_TXACKNOWLEDGE 0x00000080L
2252 #define canCHANNEL_CAP_VIRTUAL 0x00010000L
2253 #define canCHANNEL_CAP_SIMULATED 0x00020000L
2254 #define canCHANNEL_CAP_RESERVED_1 0x00040000L
2255 #define canCHANNEL_CAP_CAN_FD 0x00080000L
2256 #define canCHANNEL_CAP_CAN_FD_NONISO 0x00100000L
2257 #define canCHANNEL_CAP_SILENT_MODE 0x00200000L
2258 #define canCHANNEL_CAP_SINGLE_SHOT 0x00400000L
2259 #define canCHANNEL_CAP_LOGGER 0x00800000L
2260 #define canCHANNEL_CAP_REMOTE_ACCESS 0x01000000L
2261 #define canCHANNEL_CAP_SCRIPT 0x02000000L
2262 #define canCHANNEL_CAP_LIN_HYBRID 0x04000000L
2263 #define canCHANNEL_CAP_IO_API 0x08000000L
2264 #define canCHANNEL_CAP_DIAGNOSTICS 0x10000000L
2265 
2266 
2278 #define canCHANNEL_OPMODE_NONE 1
2279 
2283 #define canCHANNEL_OPMODE_INFRASTRUCTURE 2
2284 
2288 #define canCHANNEL_OPMODE_RESERVED 3
2289 
2293 #define canCHANNEL_OPMODE_ADHOC 4
2294 
2304 #define canDRIVER_CAP_HIGHSPEED 0x00000001L
2305 
2331 #define canIOCTL_PREFER_EXT 1
2332 
2345 #define canIOCTL_PREFER_STD 2
2346 
2363 #define canIOCTL_CLEAR_ERROR_COUNTERS 5
2364 
2379 #define canIOCTL_SET_TIMER_SCALE 6
2380 
2400 #define canIOCTL_SET_TXACK 7
2401 
2414 #define canIOCTL_GET_RX_BUFFER_LEVEL 8
2415 
2428 #define canIOCTL_GET_TX_BUFFER_LEVEL 9
2429 
2439 #define canIOCTL_FLUSH_RX_BUFFER 10
2440 
2450 #define canIOCTL_FLUSH_TX_BUFFER 11
2451 
2460 #define canIOCTL_GET_TIMER_SCALE 12
2461 
2477 #define canIOCTL_SET_TXRQ 13
2478 
2479 
2486 #define canIOCTL_SET_BYPASS_MODE 15
2487 
2493 #define canIOCTL_SET_WAKEUP 16
2494 
2504 # define canIOCTL_GET_DRIVERHANDLE 17
2505 
2511 # define canIOCTL_MAP_RXQUEUE 18
2512 
2518 # define canIOCTL_GET_WAKEUP 19
2519 
2531 # define canIOCTL_SET_REPORT_ACCESS_ERRORS 20
2532 
2540 # define canIOCTL_GET_REPORT_ACCESS_ERRORS 21
2541 
2551 # define canIOCTL_CONNECT_TO_VIRTUAL_BUS 22
2552 
2562 # define canIOCTL_DISCONNECT_FROM_VIRTUAL_BUS 23
2563 
2573 # define canIOCTL_SET_USER_IOPORT 24
2574 
2585 # define canIOCTL_GET_USER_IOPORT 25
2586 
2592 # define canIOCTL_SET_BUFFER_WRAPAROUND_MODE 26
2593 
2610 # define canIOCTL_SET_RX_QUEUE_SIZE 27
2611 
2617 # define canIOCTL_SET_USB_THROTTLE 28
2618 
2624 # define canIOCTL_GET_USB_THROTTLE 29
2625 
2640 # define canIOCTL_SET_BUSON_TIME_AUTO_RESET 30
2641 
2653 # define canIOCTL_GET_TXACK 31
2654 
2669 # define canIOCTL_SET_LOCAL_TXECHO 32
2670 
2686 # define canIOCTL_SET_ERROR_FRAMES_REPORTING 33
2687 
2701 # define canIOCTL_GET_CHANNEL_QUALITY 34
2702 
2714 # define canIOCTL_GET_ROUNDTRIP_TIME 35
2715 
2724 # define canIOCTL_GET_BUS_TYPE 36
2725 
2738 # define canIOCTL_GET_DEVNAME_ASCII 37
2739 
2751 # define canIOCTL_GET_TIME_SINCE_LAST_SEEN 38
2752 
2766 # define canIOCTL_GET_TREF_LIST 39
2767 
2789 # define canIOCTL_TX_INTERVAL 40
2790 
2802 # define canIOCTL_SET_BRLIMIT 43
2803 
2809 # define canIOCTL_SET_USB_THROTTLE_SCALED 41
2810 
2825 # define canIOCTL_SET_THROTTLE_SCALED 41
2826 
2832 # define canIOCTL_GET_USB_THROTTLE_SCALED 42
2833 
2848 # define canIOCTL_GET_THROTTLE_SCALED 42
2849 
2857 # define canIOCTL_RESET_OVERRUN_COUNT 44
2858 
2867 # define canIOCTL_LIN_MODE 45
2868 
2871 typedef struct {
2872  unsigned int portNo;
2873  unsigned int portValue;
2875 
2876 
2916 canStatus CANLIBAPI canSetBusParamsC200 (const CanHandle hnd, unsigned char btr0, unsigned char btr1);
2917 
2918 
2919 
2955 canStatus CANLIBAPI canSetDriverMode (const CanHandle hnd, int lineMode, int resNet);
2956 
2993 canStatus CANLIBAPI canGetDriverMode (const CanHandle hnd, int *lineMode, int *resNet);
2994 
3014 #define canVERSION_CANLIB32_VERSION 0
3015 
3026 #define canVERSION_CANLIB32_PRODVER 1
3027 
3039 #define canVERSION_CANLIB32_PRODVER32 2
3040 
3051 #define canVERSION_CANLIB32_BETA 3
3052 
3072 unsigned int CANLIBAPI canGetVersionEx (unsigned int itemCode);
3073 
3074 
3094 canStatus CANLIBAPI canObjBufFreeAll (const CanHandle hnd);
3095 
3116 canStatus CANLIBAPI canObjBufAllocate (const CanHandle hnd, int type);
3117 
3126 #define canOBJBUF_TYPE_AUTO_RESPONSE 0x01
3127 #define canOBJBUF_TYPE_PERIODIC_TX 0x02
3128 
3150 canStatus CANLIBAPI canObjBufFree (const CanHandle hnd, int idx);
3151 
3152 // Writes CAN data to the object buffer with the specified index.
3153 
3179 canStatus CANLIBAPI canObjBufWrite (const CanHandle hnd,
3180  int idx,
3181  int id,
3182  void* msg,
3183  unsigned int dlc,
3184  unsigned int flags);
3185 
3211 canStatus CANLIBAPI canObjBufSetFilter (const CanHandle hnd,
3212  int idx,
3213  unsigned int code,
3214  unsigned int mask);
3215 
3236 canStatus CANLIBAPI canObjBufSetFlags (const CanHandle hnd,
3237  int idx,
3238  unsigned int flags);
3239 
3257 # define canOBJBUF_AUTO_RESPONSE_RTR_ONLY 0x01
3258 
3280 canStatus CANLIBAPI canObjBufSetPeriod (const CanHandle hnd,
3281  int idx,
3282  unsigned int period);
3283 
3304 canStatus CANLIBAPI canObjBufSetMsgCount (const CanHandle hnd,
3305  int idx,
3306  unsigned int count);
3307 
3327 canStatus CANLIBAPI canObjBufEnable (const CanHandle hnd, int idx);
3328 
3348 canStatus CANLIBAPI canObjBufDisable (const CanHandle hnd, int idx);
3349 
3373 canStatus CANLIBAPI canObjBufSendBurst (const CanHandle hnd,
3374  int idx,
3375  unsigned int burstlen);
3376 
3377 
3400 canStatus CANLIBAPI canResetBus (const CanHandle hnd);
3401 
3440 canStatus CANLIBAPI canWriteWait (const CanHandle hnd,
3441  long id,
3442  void *msg,
3443  unsigned int dlc,
3444  unsigned int flag,
3445  unsigned long timeout);
3446 
3447 
3473 canStatus CANLIBAPI canUnloadLibrary (void);
3474 
3533 canStatus CANLIBAPI canSetAcceptanceFilter (const CanHandle hnd,
3534  unsigned int code,
3535  unsigned int mask,
3536  int is_extended);
3560 canStatus CANLIBAPI canFlushReceiveQueue (const CanHandle hnd);
3561 
3586 canStatus CANLIBAPI canFlushTransmitQueue (const CanHandle hnd);
3587 
3588 
3597 #define kvLED_ACTION_ALL_LEDS_ON 0
3598 #define kvLED_ACTION_ALL_LEDS_OFF 1
3599 #define kvLED_ACTION_LED_0_ON 2
3600 #define kvLED_ACTION_LED_0_OFF 3
3601 #define kvLED_ACTION_LED_1_ON 4
3602 #define kvLED_ACTION_LED_1_OFF 5
3603 #define kvLED_ACTION_LED_2_ON 6
3604 #define kvLED_ACTION_LED_2_OFF 7
3605 #define kvLED_ACTION_LED_3_ON 8
3606 #define kvLED_ACTION_LED_3_OFF 9
3607 #define kvLED_ACTION_LED_4_ON 10
3608 #define kvLED_ACTION_LED_4_OFF 11
3609 #define kvLED_ACTION_LED_5_ON 12
3610 #define kvLED_ACTION_LED_5_OFF 13
3611 #define kvLED_ACTION_LED_6_ON 14
3612 #define kvLED_ACTION_LED_6_OFF 15
3613 #define kvLED_ACTION_LED_7_ON 16
3614 #define kvLED_ACTION_LED_7_OFF 17
3615 #define kvLED_ACTION_LED_8_ON 18
3616 #define kvLED_ACTION_LED_8_OFF 19
3617 #define kvLED_ACTION_LED_9_ON 20
3618 #define kvLED_ACTION_LED_9_OFF 21
3619 #define kvLED_ACTION_LED_10_ON 22
3620 #define kvLED_ACTION_LED_10_OFF 23
3621 #define kvLED_ACTION_LED_11_ON 24
3622 #define kvLED_ACTION_LED_11_OFF 25
3623 
3624 
3647 canStatus CANLIBAPI kvFlashLeds (const CanHandle hnd, int action, int timeout);
3648 
3668 canStatus CANLIBAPI canRequestChipStatus (const CanHandle hnd);
3669 
3696 canStatus CANLIBAPI canRequestBusStatistics (const CanHandle hnd);
3697 
3703 typedef struct canBusStatistics_s {
3704  unsigned long stdData;
3705  unsigned long stdRemote;
3706  unsigned long extData;
3707  unsigned long extRemote;
3708  unsigned long errFrame;
3709 
3714  unsigned long busLoad;
3715  unsigned long overruns;
3717 
3740 canStatus CANLIBAPI canGetBusStatistics (const CanHandle hnd,
3741  canBusStatistics *stat,
3742  size_t bufsiz);
3743 
3744 
3765 canStatus CANLIBAPI canGetHandleData (const CanHandle hnd,
3766  int item,
3767  void *buffer,
3768  size_t bufsize);
3769 
3771 typedef void *kvTimeDomain;
3772 
3775 
3780 typedef struct kvTimeDomainData_s {
3786 
3815 kvStatus CANLIBAPI kvTimeDomainCreate (kvTimeDomain *domain);
3816 
3839 kvStatus CANLIBAPI kvTimeDomainDelete (kvTimeDomain domain);
3840 
3866 kvStatus CANLIBAPI kvTimeDomainResetTime (kvTimeDomain domain);
3867 
3892 kvStatus CANLIBAPI kvTimeDomainGetData (kvTimeDomain domain,
3893  kvTimeDomainData *data,
3894  size_t bufsiz);
3895 
3918 kvStatus CANLIBAPI kvTimeDomainAddHandle(kvTimeDomain domain,
3919  const CanHandle hnd);
3920 
3942 kvStatus CANLIBAPI kvTimeDomainRemoveHandle (kvTimeDomain domain,
3943  const CanHandle hnd);
3944 
3957 typedef void (CANLIBAPI *kvCallback_t) (CanHandle hnd, void* context, unsigned int notifyEvent);
3958 
3992 kvStatus CANLIBAPI kvSetNotifyCallback (const CanHandle hnd,
3993  kvCallback_t callback,
3994  void* context,
3995  unsigned int notifyFlags);
3996 
4010 #define kvBUSTYPE_NONE 0
4011 
4016 #define kvBUSTYPE_PCI 1
4017 
4022 #define kvBUSTYPE_PCMCIA 2
4023 
4028 #define kvBUSTYPE_USB 3
4029 
4034 #define kvBUSTYPE_WLAN 4
4035 
4040 #define kvBUSTYPE_PCI_EXPRESS 5
4041 
4046 #define kvBUSTYPE_ISA 6
4047 
4052 #define kvBUSTYPE_VIRTUAL 7
4053 
4058 #define kvBUSTYPE_PC104_PLUS 8
4059 
4064 #define kvBUSTYPE_LAN 9
4065 
4081 #define kvBUSTYPE_GROUP_VIRTUAL 1
4082 
4087 #define kvBUSTYPE_GROUP_LOCAL 2
4088 
4093 #define kvBUSTYPE_GROUP_REMOTE 3
4094 
4098 #define kvBUSTYPE_GROUP_INTERNAL 4
4099 
4153 kvStatus CANLIBAPI kvGetSupportedInterfaceInfo (int index,
4154  char *hwName,
4155  size_t nameLen,
4156  int *hwType,
4157  int *hwBusType);
4158 
4183 kvStatus CANLIBAPI kvReadDeviceCustomerData (const CanHandle hnd,
4184  int userNumber,
4185  int itemNumber,
4186  void *data,
4187  size_t bufsiz);
4188 
4202 #define kvENVVAR_TYPE_INT 1
4203 
4209 #define kvENVVAR_TYPE_FLOAT 2
4210 
4216 #define kvENVVAR_TYPE_STRING 3
4217 
4233 #define kvEVENT_TYPE_KEY 1
4234 
4242  typedef int64_t kvEnvHandle;
4243 
4263 kvStatus CANLIBAPI kvScriptStart (const CanHandle hnd, int slotNo);
4264 
4271 #define kvSCRIPT_STOP_NORMAL 0
4272 #define kvSCRIPT_STOP_FORCED -9
4296 kvStatus CANLIBAPI kvScriptStop (const CanHandle hnd, int slotNo, int mode);
4297 
4317 kvStatus CANLIBAPI kvScriptUnload (const CanHandle hnd, int slotNo);
4318 
4343 kvStatus CANLIBAPI kvScriptSendEvent (const CanHandle hnd,
4344  int slotNo,
4345  int eventType,
4346  int eventNo,
4347  unsigned int data);
4348 
4373 kvEnvHandle CANLIBAPI kvScriptEnvvarOpen (const CanHandle hnd,
4374  char* envvarName,
4375  int *envvarType,
4376  int *envvarSize); // returns scriptHandle
4377 
4395 kvStatus CANLIBAPI kvScriptEnvvarClose (kvEnvHandle eHnd);
4396 
4417 kvStatus CANLIBAPI kvScriptEnvvarSetInt (kvEnvHandle eHnd, int val);
4418 
4440 kvStatus CANLIBAPI kvScriptEnvvarGetInt (kvEnvHandle eHnd, int *val);
4441 
4464 kvStatus CANLIBAPI kvScriptEnvvarSetFloat (kvEnvHandle eHnd, float val);
4465 
4489 kvStatus CANLIBAPI kvScriptEnvvarGetFloat (kvEnvHandle eHnd, float *val);
4490 
4517 kvStatus CANLIBAPI kvScriptEnvvarSetData (kvEnvHandle eHnd,
4518  void *buf,
4519  int start_index,
4520  int data_len);
4521 
4547 kvStatus CANLIBAPI kvScriptEnvvarGetData (kvEnvHandle eHnd,
4548  void *buf,
4549  int start_index,
4550  int data_len);
4551 
4575 kvStatus CANLIBAPI kvScriptLoadFileOnDevice (const CanHandle hnd,
4576  int slotNo,
4577  char *localFile);
4578 
4607 kvStatus CANLIBAPI kvScriptLoadFile (const CanHandle hnd,
4608  int slotNo,
4609  char *filePathOnPC);
4610 
4611 
4625 #define kvSCRIPT_REQUEST_TEXT_UNSUBSCRIBE 1
4626 
4630 #define kvSCRIPT_REQUEST_TEXT_SUBSCRIBE 2
4631 
4635 #define kvSCRIPT_REQUEST_TEXT_ALL_SLOTS 255
4636 
4660 kvStatus CANLIBAPI kvScriptRequestText(const CanHandle hnd,
4661  unsigned int slot,
4662  unsigned int request);
4663 
4664 
4665 
4688 kvStatus CANLIBAPI kvScriptGetText(const CanHandle hnd,
4689  int *slot,
4690  unsigned long *time,
4691  unsigned int *flags,
4692  char *buf,
4693  size_t bufsize);
4694 
4701 #define kvSCRIPT_STATUS_LOADED 1
4702 #define kvSCRIPT_STATUS_RUNNING 2
4723 kvStatus CANLIBAPI kvScriptStatus(const CanHandle hnd,
4724  int slot,
4725  unsigned int *status);
4726 
4727 
4746 kvStatus CANLIBAPI kvScriptGetMaxEnvvarSize(int hnd, int *envvarSize);
4747 
4778 kvStatus CANLIBAPI kvScriptTxeGetData(const char *filePathOnPC,
4779  int item,
4780  void *buffer,
4781  unsigned int *bufsize);
4782 
4808 #define canTXEDATA_FILE_VERSION 1
4809 
4825 #define canTXEDATA_COMPILER_VERSION 2
4826 
4845 #define canTXEDATA_DATE 3
4846 
4857 #define canTXEDATA_DESCRIPTION 4
4858 
4872 #define canTXEDATA_SOURCE 5
4873 
4883 #define canTXEDATA_SIZE_OF_CODE 6
4884 
4894 #define canTXEDATA_IS_ENCRYPTED 7
4895 
4896 
4922 kvStatus CANLIBAPI kvFileCopyToDevice (const CanHandle hnd,
4923  char *hostFileName,
4924  char *deviceFileName);
4925 
4948 kvStatus CANLIBAPI kvFileCopyFromDevice (const CanHandle hnd,
4949  char *deviceFileName,
4950  char *hostFileName);
4951 
4973 kvStatus CANLIBAPI kvFileDelete (const CanHandle hnd, char *deviceFileName);
4974 
4997 kvStatus CANLIBAPI kvFileGetName (const CanHandle hnd,
4998  int fileNo,
4999  char *name,
5000  int namelen);
5001 
5021 kvStatus CANLIBAPI kvFileGetCount (const CanHandle hnd, int *count);
5022 
5045 kvStatus CANLIBAPI kvFileGetSystemData (const CanHandle hnd,
5046  int itemCode,
5047  int *result);
5048 
5067 kvStatus CANLIBAPI kvFileDiskFormat(const CanHandle hnd);
5068 
5086 #define kvDEVICE_MODE_INTERFACE 0x00
5087 
5092 #define kvDEVICE_MODE_LOGGER 0x01
5093 
5118 kvStatus CANLIBAPI kvDeviceSetMode (const CanHandle hnd, int mode);
5119 
5142 kvStatus CANLIBAPI kvDeviceGetMode (const CanHandle hnd, int *result);
5143 
5144 
5169 kvStatus CANLIBAPI kvReadTimer (const CanHandle hnd, unsigned int *time);
5193 kvStatus CANLIBAPI kvReadTimer64 (const CanHandle hnd, uint64_t *time);
5194 
5211 #define kvIO_INFO_GET_MODULE_TYPE 1
5212 
5218 #define kvIO_INFO_GET_DIRECTION 2
5219 
5225 #define kvIO_INFO_GET_PIN_TYPE 4
5226 
5232 #define kvIO_INFO_GET_NUMBER_OF_BITS 5
5233 
5241 #define kvIO_INFO_GET_RANGE_MIN 6
5242 
5250 #define kvIO_INFO_GET_RANGE_MAX 7
5251 
5259 #define kvIO_INFO_GET_DI_LOW_HIGH_FILTER 8
5260 
5268 #define kvIO_INFO_GET_DI_HIGH_LOW_FILTER 9
5269 
5277 #define kvIO_INFO_GET_AI_LP_FILTER_ORDER 10
5278 
5287 #define kvIO_INFO_GET_AI_HYSTERESIS 11
5288 
5294 #define kvIO_INFO_GET_MODULE_NUMBER 14
5295 
5301 #define kvIO_INFO_GET_SERIAL_NUMBER 15
5302 
5310 #define kvIO_INFO_GET_FW_VERSION 16
5311 
5332 #define kvIO_INFO_SET_DI_LOW_HIGH_FILTER 8
5333 
5341 #define kvIO_INFO_SET_DI_HIGH_LOW_FILTER 9
5342 
5350 #define kvIO_INFO_SET_AI_LP_FILTER_ORDER 10
5351 
5360 #define kvIO_INFO_SET_AI_HYSTERESIS 11
5361 
5378 #define kvIO_MODULE_TYPE_DIGITAL 1
5379 
5383 #define kvIO_MODULE_TYPE_ANALOG 2
5384 
5388 #define kvIO_MODULE_TYPE_RELAY 3
5389 
5404 #define kvIO_PIN_TYPE_DIGITAL 1
5405 
5409 #define kvIO_PIN_TYPE_ANALOG 2
5410 
5414 #define kvIO_PIN_TYPE_RELAY 3
5415 
5430 #define kvIO_PIN_DIRECTION_IN 4
5431 
5435 #define kvIO_PIN_DIRECTION_OUT 8
5436 
5453 canStatus CANLIBAPI kvIoGetNumberOfPins (const CanHandle hnd, unsigned int *pinCount);
5454 
5466 canStatus CANLIBAPI kvIoConfirmConfig (const CanHandle hnd);
5467 
5483 canStatus CANLIBAPI kvIoPinGetInfo (const CanHandle hnd, unsigned int pin, int item, void *buffer, const unsigned int bufsize);
5484 
5500 canStatus CANLIBAPI kvIoPinSetInfo (const CanHandle hnd, unsigned int pin, int item, const void *buffer, const unsigned int bufsize);
5501 
5515 canStatus CANLIBAPI kvIoPinSetDigital (const CanHandle hnd, unsigned int pin, unsigned int value);
5516 
5532 canStatus CANLIBAPI kvIoPinGetDigital (const CanHandle hnd, unsigned int pin, unsigned int *value);
5533 
5551 canStatus CANLIBAPI kvIoPinGetOutputDigital (const CanHandle hnd, unsigned int pin, unsigned int *value);
5552 
5566 canStatus CANLIBAPI kvIoPinSetRelay (const CanHandle hnd, unsigned int pin, unsigned int value);
5567 
5583 canStatus CANLIBAPI kvIoPinGetOutputRelay (const CanHandle hnd, unsigned int pin, unsigned int *value);
5584 
5598 canStatus CANLIBAPI kvIoPinSetAnalog (const CanHandle hnd, unsigned int pin, float value);
5599 
5613 canStatus CANLIBAPI kvIoPinGetAnalog (const CanHandle hnd, unsigned int pin, float* value);
5614 
5630 canStatus CANLIBAPI kvIoPinGetOutputAnalog (const CanHandle hnd, unsigned int pin, float* value);
5631 
5632 #ifdef __cplusplus
5633 }
5634 #endif /* __cplusplus */
5635 
5636 #include "obsolete.h"
5637 
5638 
5639 
5640 
5641 #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:3705
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:178
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:2872
int64_t kvEnvHandle
Definition: canlib.h:4242
int nNonMagiSyncCards
number of non MagiSync™ interfaces
Definition: canlib.h:3783
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:3771
unsigned char rxErrorCounter
Definition: canlib.h:180
unsigned long extRemote
Number of received extended (29-bit identifiers) remote frames.
Definition: canlib.h:3707
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:155
canStatus canObjBufDisable(const CanHandle hnd, int idx)
void * tag
Definition: canlib.h:163
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:164
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:170
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:162
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:2873
unsigned short canGetVersion(void)
unsigned long errFrame
Number of error frames.
Definition: canlib.h:3708
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 kvFileDiskFormat(const CanHandle hnd)
kvStatus kvScriptEnvvarSetFloat(kvEnvHandle eHnd, float val)
unsigned long extData
Number of received extended (29-bit identifiers) data frames.
Definition: canlib.h:3706
kvStatus kvReadTimer(const CanHandle hnd, unsigned int *time)
canStatus canObjBufEnable(const CanHandle hnd, int idx)
kvStatus kvScriptRequestText(const CanHandle hnd, unsigned int slot, unsigned int request)
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:179
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:3957
canStatus canSetBusParamsC200(const CanHandle hnd, unsigned char btr0, unsigned char btr1)
int nMagiSyncGroups
number of MagiSync™ groups
Definition: canlib.h:3781
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
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:3704
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:3715
kvStatus kvTimeDomainAddHandle(kvTimeDomain domain, const CanHandle hnd)
Definition: canlib.h:3780
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:3714
canStatus canRequestChipStatus(const CanHandle hnd)
Definition: canlib.h:3703
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:160
canStatus kvStatus
Definition: canlib.h:3774
Definition: canlib.h:2871
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:3784
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:167
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:3782