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 
514 canStatus CANLIBAPI canEnumHardwareEx (int *channelCount);
515 
540 canStatus CANLIBAPI canClose (const CanHandle hnd);
541 
566 canStatus CANLIBAPI canBusOn (const CanHandle hnd);
567 
588 canStatus CANLIBAPI canBusOff (const CanHandle hnd);
589 
638 canStatus CANLIBAPI canSetBusParams (const CanHandle hnd,
639  long freq,
640  unsigned int tseg1,
641  unsigned int tseg2,
642  unsigned int sjw,
643  unsigned int noSamp,
644  unsigned int syncmode);
645 
677 canStatus CANLIBAPI canSetBusParamsFd (const CanHandle hnd,
678  long freq_brs,
679  unsigned int tseg1_brs,
680  unsigned int tseg2_brs,
681  unsigned int sjw_brs);
682 
683 
715 canStatus CANLIBAPI canGetBusParams (const CanHandle hnd,
716  long *freq,
717  unsigned int *tseg1,
718  unsigned int *tseg2,
719  unsigned int *sjw,
720  unsigned int *noSamp,
721  unsigned int *syncmode);
722 
723 
746 canStatus CANLIBAPI canGetBusParamsFd(const CanHandle hnd,
747  long *freq_brs,
748  unsigned int *tseg1_brs,
749  unsigned int *tseg2_brs,
750  unsigned int *sjw_brs);
775 canStatus CANLIBAPI canSetBusOutputControl (const CanHandle hnd,
776  const unsigned int drivertype);
777 
812 canStatus CANLIBAPI canGetBusOutputControl (const CanHandle hnd,
813  unsigned int *drivertype);
814 
857 canStatus CANLIBAPI canAccept (const CanHandle hnd,
858  const long envelope,
859  const unsigned int flag);
860 
884 canStatus CANLIBAPI canReadStatus (const CanHandle hnd,
885  unsigned long *const flags);
886 
923 canStatus CANLIBAPI canReadErrorCounters (const CanHandle hnd,
924  unsigned int *txErr,
925  unsigned int *rxErr,
926  unsigned int *ovErr);
927 
969 canStatus CANLIBAPI canWrite (const CanHandle hnd,
970  long id,
971  void *msg,
972  unsigned int dlc,
973  unsigned int flag);
974 
1002 canStatus CANLIBAPI canWriteSync (const CanHandle hnd, unsigned long timeout);
1003 
1055 canStatus CANLIBAPI canRead (const CanHandle hnd,
1056  long *id,
1057  void *msg,
1058  unsigned int *dlc,
1059  unsigned int *flag,
1060  unsigned long *time);
1111 canStatus CANLIBAPI canReadWait (const CanHandle hnd,
1112  long *id,
1113  void *msg,
1114  unsigned int *dlc,
1115  unsigned int *flag,
1116  unsigned long *time,
1117  unsigned long timeout);
1118 
1170 canStatus CANLIBAPI canReadSpecific (const CanHandle hnd, long id, void * msg,
1171  unsigned int * dlc, unsigned int * flag,
1172  unsigned long * time);
1173 
1204 canStatus CANLIBAPI canReadSync (const CanHandle hnd, unsigned long timeout);
1205 
1237 canStatus CANLIBAPI canReadSyncSpecific (const CanHandle hnd,
1238  long id,
1239  unsigned long timeout);
1240 
1286 canStatus CANLIBAPI canReadSpecificSkip (const CanHandle hnd,
1287  long id,
1288  void * msg,
1289  unsigned int * dlc,
1290  unsigned int * flag,
1291  unsigned long * time);
1292 
1313 canStatus CANLIBAPI canSetNotify (const CanHandle hnd,
1314  void (*callback)(canNotifyData *),
1315  unsigned int notifyFlags,
1316  void *tag);
1317 
1331 canStatus CANLIBAPI canGetRawHandle (const CanHandle hnd, void *pvFd);
1332 
1367 canStatus CANLIBAPI canTranslateBaud (long *const freq,
1368  unsigned int *const tseg1,
1369  unsigned int *const tseg2,
1370  unsigned int *const sjw,
1371  unsigned int *const nosamp,
1372  unsigned int *const syncMode);
1373 
1396 canStatus CANLIBAPI canGetErrorText (canStatus err, char *buf, unsigned int bufsiz);
1397 
1427 unsigned short CANLIBAPI canGetVersion (void);
1428 
1457 canStatus CANLIBAPI canIoCtl (const CanHandle hnd,
1458  unsigned int func,
1459  void *buf,
1460  unsigned int buflen);
1461 
1462 
1468 canStatus CANLIBAPI canReadTimer (const CanHandle hnd, unsigned long *time);
1469 
1520 CanHandle CANLIBAPI canOpenChannel (int channel, int flags);
1521 
1542 canStatus CANLIBAPI canGetNumberOfChannels (int *channelCount);
1543 
1544 
1552 #define kvREMOTE_TYPE_NOT_REMOTE 0
1553 #define kvREMOTE_TYPE_WLAN 1
1554 #define kvREMOTE_TYPE_LAN 2
1555 
1564 #define kvLOGGER_TYPE_NOT_A_LOGGER 0
1565 #define kvLOGGER_TYPE_V1 1
1566 #define kvLOGGER_TYPE_V2 2
1567 
1600 canStatus CANLIBAPI canGetChannelData (int channel,
1601  int item,
1602  void *buffer,
1603  size_t bufsize);
1604 
1623 #define canCHANNELDATA_CHANNEL_CAP 1
1624 
1634 #define canCHANNELDATA_TRANS_CAP 2
1635 
1644 #define canCHANNELDATA_CHANNEL_FLAGS 3 // available, etc
1645 
1654 #define canCHANNELDATA_CARD_TYPE 4
1655 
1665 #define canCHANNELDATA_CARD_NUMBER 5
1666 
1674 #define canCHANNELDATA_CHAN_NO_ON_CARD 6
1675 
1685 #define canCHANNELDATA_CARD_SERIAL_NO 7
1686 
1696 #define canCHANNELDATA_TRANS_SERIAL_NO 8
1697 
1708 #define canCHANNELDATA_CARD_FIRMWARE_REV 9
1709 
1720 #define canCHANNELDATA_CARD_HARDWARE_REV 10
1721 
1731 #define canCHANNELDATA_CARD_UPC_NO 11
1732 
1743 #define canCHANNELDATA_TRANS_UPC_NO 12
1744 
1762 #define canCHANNELDATA_CHANNEL_NAME 13
1763 
1779 # define canCHANNELDATA_DLL_FILE_VERSION 14
1780 
1796 # define canCHANNELDATA_DLL_PRODUCT_VERSION 15
1797 
1813 # define canCHANNELDATA_DLL_FILETYPE 16
1814 
1823 # define canCHANNELDATA_TRANS_TYPE 17
1824 
1848 # define canCHANNELDATA_DEVICE_PHYSICAL_POSITION 18
1849 
1862 # define canCHANNELDATA_UI_NUMBER 19
1863 
1887 # define canCHANNELDATA_TIMESYNC_ENABLED 20
1888 
1903 # define canCHANNELDATA_DRIVER_FILE_VERSION 21
1904 
1919 # define canCHANNELDATA_DRIVER_PRODUCT_VERSION 22
1920 
1929 # define canCHANNELDATA_MFGNAME_UNICODE 23
1930 
1938 # define canCHANNELDATA_MFGNAME_ASCII 24
1939 
1948 # define canCHANNELDATA_DEVDESCR_UNICODE 25
1949 
1957 # define canCHANNELDATA_DEVDESCR_ASCII 26
1958 
1969 # define canCHANNELDATA_DRIVER_NAME 27
1970 
1983 # define canCHANNELDATA_CHANNEL_QUALITY 28
1984 
1993 # define canCHANNELDATA_ROUNDTRIP_TIME 29
1994 
2003 # define canCHANNELDATA_BUS_TYPE 30
2004 
2017 # define canCHANNELDATA_DEVNAME_ASCII 31
2018 
2029 # define canCHANNELDATA_TIME_SINCE_LAST_SEEN 32
2030 
2040 # define canCHANNELDATA_REMOTE_OPERATIONAL_MODE 33
2041 
2050 # define canCHANNELDATA_REMOTE_PROFILE_NAME 34
2051 
2060 # define canCHANNELDATA_REMOTE_HOST_NAME 35
2061 
2070 # define canCHANNELDATA_REMOTE_MAC 36
2071 
2080 # define canCHANNELDATA_MAX_BITRATE 37
2081 
2092 # define canCHANNELDATA_CHANNEL_CAP_MASK 38
2093 
2103 # define canCHANNELDATA_IS_REMOTE 40
2104 
2113 # define canCHANNELDATA_REMOTE_TYPE 41
2114 
2123 # define canCHANNELDATA_LOGGER_TYPE 42
2124 
2134 # define canCHANNELDATA_HW_STATUS 43
2135 
2145 # define canCHANNELDATA_FEATURE_EAN 44
2146 
2158 #define canCHANNELDATA_CUST_CHANNEL_NAME 39
2159 
2173 #define canCHANNEL_IS_EXCLUSIVE 0x0001
2174 
2176 #define canCHANNEL_IS_OPEN 0x0002
2177 
2180 #define canCHANNEL_IS_CANFD 0x0004
2181 
2182 //#define canCHANNEL_IS_CANFD_NON_ISO 0x0008 Reserved for when needed
2183 
2186 #define canCHANNEL_IS_LIN 0x0010
2187 
2190 #define canCHANNEL_IS_LIN_MASTER 0x0020
2191 
2194 #define canCHANNEL_IS_LIN_SLAVE 0x0040
2195 
2196 
2215 #define canHWTYPE_NONE 0
2216 #define canHWTYPE_VIRTUAL 1
2217 #define canHWTYPE_LAPCAN 2
2218 #define canHWTYPE_CANPARI 3
2219 #define canHWTYPE_PCCAN 8
2220 #define canHWTYPE_PCICAN 9
2221 #define canHWTYPE_USBCAN 11
2222 #define canHWTYPE_PCICAN_II 40
2223 #define canHWTYPE_USBCAN_II 42
2224 #define canHWTYPE_SIMULATED 44
2225 #define canHWTYPE_ACQUISITOR 46
2226 #define canHWTYPE_LEAF 48
2227 #define canHWTYPE_PC104_PLUS 50
2228 #define canHWTYPE_PCICANX_II 52
2229 #define canHWTYPE_MEMORATOR_II 54
2230 #define canHWTYPE_MEMORATOR_PRO 54
2231 #define canHWTYPE_USBCAN_PRO 56
2232 #define canHWTYPE_IRIS 58
2233 #define canHWTYPE_BLACKBIRD 58
2234 #define canHWTYPE_MEMORATOR_LIGHT 60
2235 #define canHWTYPE_MINIHYDRA 62
2236 #define canHWTYPE_EAGLE 62
2237 #define canHWTYPE_BAGEL 64
2238 #define canHWTYPE_BLACKBIRD_V2 64
2239 #define canHWTYPE_MINIPCIE 66
2240 #define canHWTYPE_USBCAN_KLINE 68
2241 #define canHWTYPE_ETHERCAN 70
2242 #define canHWTYPE_USBCAN_LIGHT 72
2243 #define canHWTYPE_USBCAN_PRO2 74
2244 #define canHWTYPE_PCIE_V2 76
2245 #define canHWTYPE_MEMORATOR_PRO2 78
2246 #define canHWTYPE_LEAF2 80
2247 #define canHWTYPE_MEMORATOR_V2 82
2248 #define canHWTYPE_CANLINHYBRID 84
2249 #define canHWTYPE_DINRAIL 86
2250 #define canHWTYPE_U100 88
2251 
2252 
2261 #define canCHANNEL_CAP_EXTENDED_CAN 0x00000001L
2262 #define canCHANNEL_CAP_BUS_STATISTICS 0x00000002L
2263 #define canCHANNEL_CAP_ERROR_COUNTERS 0x00000004L
2264 #define canCHANNEL_CAP_RESERVED_2 0x00000008L
2265 #define canCHANNEL_CAP_GENERATE_ERROR 0x00000010L
2266 #define canCHANNEL_CAP_GENERATE_OVERLOAD 0x00000020L
2267 #define canCHANNEL_CAP_TXREQUEST 0x00000040L
2268 #define canCHANNEL_CAP_TXACKNOWLEDGE 0x00000080L
2269 #define canCHANNEL_CAP_VIRTUAL 0x00010000L
2270 #define canCHANNEL_CAP_SIMULATED 0x00020000L
2271 #define canCHANNEL_CAP_RESERVED_1 0x00040000L
2272 #define canCHANNEL_CAP_CAN_FD 0x00080000L
2273 #define canCHANNEL_CAP_CAN_FD_NONISO 0x00100000L
2274 #define canCHANNEL_CAP_SILENT_MODE 0x00200000L
2275 #define canCHANNEL_CAP_SINGLE_SHOT 0x00400000L
2276 #define canCHANNEL_CAP_LOGGER 0x00800000L
2277 #define canCHANNEL_CAP_REMOTE_ACCESS 0x01000000L
2278 #define canCHANNEL_CAP_SCRIPT 0x02000000L
2279 #define canCHANNEL_CAP_LIN_HYBRID 0x04000000L
2280 #define canCHANNEL_CAP_IO_API 0x08000000L
2281 #define canCHANNEL_CAP_DIAGNOSTICS 0x10000000L
2282 
2283 
2295 #define canCHANNEL_OPMODE_NONE 1
2296 
2300 #define canCHANNEL_OPMODE_INFRASTRUCTURE 2
2301 
2305 #define canCHANNEL_OPMODE_RESERVED 3
2306 
2310 #define canCHANNEL_OPMODE_ADHOC 4
2311 
2321 #define canDRIVER_CAP_HIGHSPEED 0x00000001L
2322 
2348 #define canIOCTL_PREFER_EXT 1
2349 
2362 #define canIOCTL_PREFER_STD 2
2363 
2380 #define canIOCTL_CLEAR_ERROR_COUNTERS 5
2381 
2396 #define canIOCTL_SET_TIMER_SCALE 6
2397 
2417 #define canIOCTL_SET_TXACK 7
2418 
2431 #define canIOCTL_GET_RX_BUFFER_LEVEL 8
2432 
2445 #define canIOCTL_GET_TX_BUFFER_LEVEL 9
2446 
2456 #define canIOCTL_FLUSH_RX_BUFFER 10
2457 
2467 #define canIOCTL_FLUSH_TX_BUFFER 11
2468 
2477 #define canIOCTL_GET_TIMER_SCALE 12
2478 
2494 #define canIOCTL_SET_TXRQ 13
2495 
2496 
2503 #define canIOCTL_SET_BYPASS_MODE 15
2504 
2510 #define canIOCTL_SET_WAKEUP 16
2511 
2521 # define canIOCTL_GET_DRIVERHANDLE 17
2522 
2528 # define canIOCTL_MAP_RXQUEUE 18
2529 
2535 # define canIOCTL_GET_WAKEUP 19
2536 
2548 # define canIOCTL_SET_REPORT_ACCESS_ERRORS 20
2549 
2557 # define canIOCTL_GET_REPORT_ACCESS_ERRORS 21
2558 
2568 # define canIOCTL_CONNECT_TO_VIRTUAL_BUS 22
2569 
2579 # define canIOCTL_DISCONNECT_FROM_VIRTUAL_BUS 23
2580 
2590 # define canIOCTL_SET_USER_IOPORT 24
2591 
2602 # define canIOCTL_GET_USER_IOPORT 25
2603 
2609 # define canIOCTL_SET_BUFFER_WRAPAROUND_MODE 26
2610 
2627 # define canIOCTL_SET_RX_QUEUE_SIZE 27
2628 
2634 # define canIOCTL_SET_USB_THROTTLE 28
2635 
2641 # define canIOCTL_GET_USB_THROTTLE 29
2642 
2657 # define canIOCTL_SET_BUSON_TIME_AUTO_RESET 30
2658 
2670 # define canIOCTL_GET_TXACK 31
2671 
2686 # define canIOCTL_SET_LOCAL_TXECHO 32
2687 
2703 # define canIOCTL_SET_ERROR_FRAMES_REPORTING 33
2704 
2718 # define canIOCTL_GET_CHANNEL_QUALITY 34
2719 
2731 # define canIOCTL_GET_ROUNDTRIP_TIME 35
2732 
2741 # define canIOCTL_GET_BUS_TYPE 36
2742 
2755 # define canIOCTL_GET_DEVNAME_ASCII 37
2756 
2768 # define canIOCTL_GET_TIME_SINCE_LAST_SEEN 38
2769 
2783 # define canIOCTL_GET_TREF_LIST 39
2784 
2806 # define canIOCTL_TX_INTERVAL 40
2807 
2819 # define canIOCTL_SET_BRLIMIT 43
2820 
2826 # define canIOCTL_SET_USB_THROTTLE_SCALED 41
2827 
2842 # define canIOCTL_SET_THROTTLE_SCALED 41
2843 
2849 # define canIOCTL_GET_USB_THROTTLE_SCALED 42
2850 
2865 # define canIOCTL_GET_THROTTLE_SCALED 42
2866 
2874 # define canIOCTL_RESET_OVERRUN_COUNT 44
2875 
2884 # define canIOCTL_LIN_MODE 45
2885 
2888 typedef struct {
2889  unsigned int portNo;
2890  unsigned int portValue;
2892 
2893 
2933 canStatus CANLIBAPI canSetBusParamsC200 (const CanHandle hnd, unsigned char btr0, unsigned char btr1);
2934 
2935 
2936 
2972 canStatus CANLIBAPI canSetDriverMode (const CanHandle hnd, int lineMode, int resNet);
2973 
3010 canStatus CANLIBAPI canGetDriverMode (const CanHandle hnd, int *lineMode, int *resNet);
3011 
3031 #define canVERSION_CANLIB32_VERSION 0
3032 
3043 #define canVERSION_CANLIB32_PRODVER 1
3044 
3056 #define canVERSION_CANLIB32_PRODVER32 2
3057 
3068 #define canVERSION_CANLIB32_BETA 3
3069 
3089 unsigned int CANLIBAPI canGetVersionEx (unsigned int itemCode);
3090 
3091 
3111 canStatus CANLIBAPI canObjBufFreeAll (const CanHandle hnd);
3112 
3133 canStatus CANLIBAPI canObjBufAllocate (const CanHandle hnd, int type);
3134 
3143 #define canOBJBUF_TYPE_AUTO_RESPONSE 0x01
3144 #define canOBJBUF_TYPE_PERIODIC_TX 0x02
3145 
3167 canStatus CANLIBAPI canObjBufFree (const CanHandle hnd, int idx);
3168 
3169 // Writes CAN data to the object buffer with the specified index.
3170 
3196 canStatus CANLIBAPI canObjBufWrite (const CanHandle hnd,
3197  int idx,
3198  int id,
3199  void* msg,
3200  unsigned int dlc,
3201  unsigned int flags);
3202 
3228 canStatus CANLIBAPI canObjBufSetFilter (const CanHandle hnd,
3229  int idx,
3230  unsigned int code,
3231  unsigned int mask);
3232 
3253 canStatus CANLIBAPI canObjBufSetFlags (const CanHandle hnd,
3254  int idx,
3255  unsigned int flags);
3256 
3274 # define canOBJBUF_AUTO_RESPONSE_RTR_ONLY 0x01
3275 
3297 canStatus CANLIBAPI canObjBufSetPeriod (const CanHandle hnd,
3298  int idx,
3299  unsigned int period);
3300 
3321 canStatus CANLIBAPI canObjBufSetMsgCount (const CanHandle hnd,
3322  int idx,
3323  unsigned int count);
3324 
3344 canStatus CANLIBAPI canObjBufEnable (const CanHandle hnd, int idx);
3345 
3365 canStatus CANLIBAPI canObjBufDisable (const CanHandle hnd, int idx);
3366 
3390 canStatus CANLIBAPI canObjBufSendBurst (const CanHandle hnd,
3391  int idx,
3392  unsigned int burstlen);
3393 
3394 
3417 canStatus CANLIBAPI canResetBus (const CanHandle hnd);
3418 
3457 canStatus CANLIBAPI canWriteWait (const CanHandle hnd,
3458  long id,
3459  void *msg,
3460  unsigned int dlc,
3461  unsigned int flag,
3462  unsigned long timeout);
3463 
3464 
3490 canStatus CANLIBAPI canUnloadLibrary (void);
3491 
3553 canStatus CANLIBAPI canSetAcceptanceFilter (const CanHandle hnd,
3554  unsigned int code,
3555  unsigned int mask,
3556  int is_extended);
3580 canStatus CANLIBAPI canFlushReceiveQueue (const CanHandle hnd);
3581 
3606 canStatus CANLIBAPI canFlushTransmitQueue (const CanHandle hnd);
3607 
3608 
3617 #define kvLED_ACTION_ALL_LEDS_ON 0
3618 #define kvLED_ACTION_ALL_LEDS_OFF 1
3619 #define kvLED_ACTION_LED_0_ON 2
3620 #define kvLED_ACTION_LED_0_OFF 3
3621 #define kvLED_ACTION_LED_1_ON 4
3622 #define kvLED_ACTION_LED_1_OFF 5
3623 #define kvLED_ACTION_LED_2_ON 6
3624 #define kvLED_ACTION_LED_2_OFF 7
3625 #define kvLED_ACTION_LED_3_ON 8
3626 #define kvLED_ACTION_LED_3_OFF 9
3627 #define kvLED_ACTION_LED_4_ON 10
3628 #define kvLED_ACTION_LED_4_OFF 11
3629 #define kvLED_ACTION_LED_5_ON 12
3630 #define kvLED_ACTION_LED_5_OFF 13
3631 #define kvLED_ACTION_LED_6_ON 14
3632 #define kvLED_ACTION_LED_6_OFF 15
3633 #define kvLED_ACTION_LED_7_ON 16
3634 #define kvLED_ACTION_LED_7_OFF 17
3635 #define kvLED_ACTION_LED_8_ON 18
3636 #define kvLED_ACTION_LED_8_OFF 19
3637 #define kvLED_ACTION_LED_9_ON 20
3638 #define kvLED_ACTION_LED_9_OFF 21
3639 #define kvLED_ACTION_LED_10_ON 22
3640 #define kvLED_ACTION_LED_10_OFF 23
3641 #define kvLED_ACTION_LED_11_ON 24
3642 #define kvLED_ACTION_LED_11_OFF 25
3643 
3644 
3667 canStatus CANLIBAPI kvFlashLeds (const CanHandle hnd, int action, int timeout);
3668 
3688 canStatus CANLIBAPI canRequestChipStatus (const CanHandle hnd);
3689 
3716 canStatus CANLIBAPI canRequestBusStatistics (const CanHandle hnd);
3717 
3723 typedef struct canBusStatistics_s {
3724  unsigned long stdData;
3725  unsigned long stdRemote;
3726  unsigned long extData;
3727  unsigned long extRemote;
3728  unsigned long errFrame;
3729 
3734  unsigned long busLoad;
3735  unsigned long overruns;
3737 
3760 canStatus CANLIBAPI canGetBusStatistics (const CanHandle hnd,
3761  canBusStatistics *stat,
3762  size_t bufsiz);
3763 
3764 
3786 canStatus CANLIBAPI canGetHandleData (const CanHandle hnd,
3787  int item,
3788  void *buffer,
3789  size_t bufsize);
3790 
3792 typedef void *kvTimeDomain;
3793 
3796 
3801 typedef struct kvTimeDomainData_s {
3807 
3836 kvStatus CANLIBAPI kvTimeDomainCreate (kvTimeDomain *domain);
3837 
3860 kvStatus CANLIBAPI kvTimeDomainDelete (kvTimeDomain domain);
3861 
3887 kvStatus CANLIBAPI kvTimeDomainResetTime (kvTimeDomain domain);
3888 
3913 kvStatus CANLIBAPI kvTimeDomainGetData (kvTimeDomain domain,
3914  kvTimeDomainData *data,
3915  size_t bufsiz);
3916 
3939 kvStatus CANLIBAPI kvTimeDomainAddHandle(kvTimeDomain domain,
3940  const CanHandle hnd);
3941 
3963 kvStatus CANLIBAPI kvTimeDomainRemoveHandle (kvTimeDomain domain,
3964  const CanHandle hnd);
3965 
3978 typedef void (CANLIBAPI *kvCallback_t) (CanHandle hnd, void* context, unsigned int notifyEvent);
3979 
4013 kvStatus CANLIBAPI kvSetNotifyCallback (const CanHandle hnd,
4014  kvCallback_t callback,
4015  void* context,
4016  unsigned int notifyFlags);
4017 
4031 #define kvBUSTYPE_NONE 0
4032 
4037 #define kvBUSTYPE_PCI 1
4038 
4043 #define kvBUSTYPE_PCMCIA 2
4044 
4049 #define kvBUSTYPE_USB 3
4050 
4055 #define kvBUSTYPE_WLAN 4
4056 
4061 #define kvBUSTYPE_PCI_EXPRESS 5
4062 
4067 #define kvBUSTYPE_ISA 6
4068 
4073 #define kvBUSTYPE_VIRTUAL 7
4074 
4079 #define kvBUSTYPE_PC104_PLUS 8
4080 
4085 #define kvBUSTYPE_LAN 9
4086 
4102 #define kvBUSTYPE_GROUP_VIRTUAL 1
4103 
4108 #define kvBUSTYPE_GROUP_LOCAL 2
4109 
4114 #define kvBUSTYPE_GROUP_REMOTE 3
4115 
4119 #define kvBUSTYPE_GROUP_INTERNAL 4
4120 
4174 kvStatus CANLIBAPI kvGetSupportedInterfaceInfo (int index,
4175  char *hwName,
4176  size_t nameLen,
4177  int *hwType,
4178  int *hwBusType);
4179 
4204 kvStatus CANLIBAPI kvReadDeviceCustomerData (const CanHandle hnd,
4205  int userNumber,
4206  int itemNumber,
4207  void *data,
4208  size_t bufsiz);
4209 
4223 #define kvENVVAR_TYPE_INT 1
4224 
4230 #define kvENVVAR_TYPE_FLOAT 2
4231 
4237 #define kvENVVAR_TYPE_STRING 3
4238 
4254 #define kvEVENT_TYPE_KEY 1
4255 
4263  typedef int64_t kvEnvHandle;
4264 
4284 kvStatus CANLIBAPI kvScriptStart (const CanHandle hnd, int slotNo);
4285 
4292 #define kvSCRIPT_STOP_NORMAL 0
4293 #define kvSCRIPT_STOP_FORCED -9
4317 kvStatus CANLIBAPI kvScriptStop (const CanHandle hnd, int slotNo, int mode);
4318 
4338 kvStatus CANLIBAPI kvScriptUnload (const CanHandle hnd, int slotNo);
4339 
4364 kvStatus CANLIBAPI kvScriptSendEvent (const CanHandle hnd,
4365  int slotNo,
4366  int eventType,
4367  int eventNo,
4368  unsigned int data);
4369 
4394 kvEnvHandle CANLIBAPI kvScriptEnvvarOpen (const CanHandle hnd,
4395  char* envvarName,
4396  int *envvarType,
4397  int *envvarSize); // returns scriptHandle
4398 
4416 kvStatus CANLIBAPI kvScriptEnvvarClose (kvEnvHandle eHnd);
4417 
4438 kvStatus CANLIBAPI kvScriptEnvvarSetInt (kvEnvHandle eHnd, int val);
4439 
4461 kvStatus CANLIBAPI kvScriptEnvvarGetInt (kvEnvHandle eHnd, int *val);
4462 
4485 kvStatus CANLIBAPI kvScriptEnvvarSetFloat (kvEnvHandle eHnd, float val);
4486 
4510 kvStatus CANLIBAPI kvScriptEnvvarGetFloat (kvEnvHandle eHnd, float *val);
4511 
4538 kvStatus CANLIBAPI kvScriptEnvvarSetData (kvEnvHandle eHnd,
4539  void *buf,
4540  int start_index,
4541  int data_len);
4542 
4568 kvStatus CANLIBAPI kvScriptEnvvarGetData (kvEnvHandle eHnd,
4569  void *buf,
4570  int start_index,
4571  int data_len);
4572 
4596 kvStatus CANLIBAPI kvScriptLoadFileOnDevice (const CanHandle hnd,
4597  int slotNo,
4598  char *localFile);
4599 
4628 kvStatus CANLIBAPI kvScriptLoadFile (const CanHandle hnd,
4629  int slotNo,
4630  char *filePathOnPC);
4631 
4632 
4646 #define kvSCRIPT_REQUEST_TEXT_UNSUBSCRIBE 1
4647 
4651 #define kvSCRIPT_REQUEST_TEXT_SUBSCRIBE 2
4652 
4656 #define kvSCRIPT_REQUEST_TEXT_ALL_SLOTS 255
4657 
4681 kvStatus CANLIBAPI kvScriptRequestText(const CanHandle hnd,
4682  unsigned int slot,
4683  unsigned int request);
4684 
4685 
4686 
4709 kvStatus CANLIBAPI kvScriptGetText(const CanHandle hnd,
4710  int *slot,
4711  unsigned long *time,
4712  unsigned int *flags,
4713  char *buf,
4714  size_t bufsize);
4715 
4722 #define kvSCRIPT_STATUS_LOADED 1
4723 #define kvSCRIPT_STATUS_RUNNING 2
4744 kvStatus CANLIBAPI kvScriptStatus(const CanHandle hnd,
4745  int slot,
4746  unsigned int *status);
4747 
4748 
4767 kvStatus CANLIBAPI kvScriptGetMaxEnvvarSize(int hnd, int *envvarSize);
4768 
4799 kvStatus CANLIBAPI kvScriptTxeGetData(const char *filePathOnPC,
4800  int item,
4801  void *buffer,
4802  unsigned int *bufsize);
4803 
4829 #define canTXEDATA_FILE_VERSION 1
4830 
4846 #define canTXEDATA_COMPILER_VERSION 2
4847 
4866 #define canTXEDATA_DATE 3
4867 
4878 #define canTXEDATA_DESCRIPTION 4
4879 
4893 #define canTXEDATA_SOURCE 5
4894 
4904 #define canTXEDATA_SIZE_OF_CODE 6
4905 
4915 #define canTXEDATA_IS_ENCRYPTED 7
4916 
4917 
4943 kvStatus CANLIBAPI kvFileCopyToDevice (const CanHandle hnd,
4944  char *hostFileName,
4945  char *deviceFileName);
4946 
4969 kvStatus CANLIBAPI kvFileCopyFromDevice (const CanHandle hnd,
4970  char *deviceFileName,
4971  char *hostFileName);
4972 
4994 kvStatus CANLIBAPI kvFileDelete (const CanHandle hnd, char *deviceFileName);
4995 
5018 kvStatus CANLIBAPI kvFileGetName (const CanHandle hnd,
5019  int fileNo,
5020  char *name,
5021  int namelen);
5022 
5042 kvStatus CANLIBAPI kvFileGetCount (const CanHandle hnd, int *count);
5043 
5066 kvStatus CANLIBAPI kvFileGetSystemData (const CanHandle hnd,
5067  int itemCode,
5068  int *result);
5069 
5088 kvStatus CANLIBAPI kvFileDiskFormat(const CanHandle hnd);
5089 
5107 #define kvDEVICE_MODE_INTERFACE 0x00
5108 
5113 #define kvDEVICE_MODE_LOGGER 0x01
5114 
5139 kvStatus CANLIBAPI kvDeviceSetMode (const CanHandle hnd, int mode);
5140 
5163 kvStatus CANLIBAPI kvDeviceGetMode (const CanHandle hnd, int *result);
5164 
5165 
5190 kvStatus CANLIBAPI kvReadTimer (const CanHandle hnd, unsigned int *time);
5214 kvStatus CANLIBAPI kvReadTimer64 (const CanHandle hnd, uint64_t *time);
5215 
5232 #define kvIO_INFO_GET_MODULE_TYPE 1
5233 
5239 #define kvIO_INFO_GET_DIRECTION 2
5240 
5246 #define kvIO_INFO_GET_PIN_TYPE 4
5247 
5253 #define kvIO_INFO_GET_NUMBER_OF_BITS 5
5254 
5262 #define kvIO_INFO_GET_RANGE_MIN 6
5263 
5271 #define kvIO_INFO_GET_RANGE_MAX 7
5272 
5280 #define kvIO_INFO_GET_DI_LOW_HIGH_FILTER 8
5281 
5289 #define kvIO_INFO_GET_DI_HIGH_LOW_FILTER 9
5290 
5298 #define kvIO_INFO_GET_AI_LP_FILTER_ORDER 10
5299 
5308 #define kvIO_INFO_GET_AI_HYSTERESIS 11
5309 
5315 #define kvIO_INFO_GET_MODULE_NUMBER 14
5316 
5322 #define kvIO_INFO_GET_SERIAL_NUMBER 15
5323 
5331 #define kvIO_INFO_GET_FW_VERSION 16
5332 
5353 #define kvIO_INFO_SET_DI_LOW_HIGH_FILTER 8
5354 
5362 #define kvIO_INFO_SET_DI_HIGH_LOW_FILTER 9
5363 
5371 #define kvIO_INFO_SET_AI_LP_FILTER_ORDER 10
5372 
5381 #define kvIO_INFO_SET_AI_HYSTERESIS 11
5382 
5399 #define kvIO_MODULE_TYPE_DIGITAL 1
5400 
5404 #define kvIO_MODULE_TYPE_ANALOG 2
5405 
5409 #define kvIO_MODULE_TYPE_RELAY 3
5410 
5414 #define kvIO_MODULE_TYPE_INTERNAL 4
5415 
5430 #define kvIO_PIN_TYPE_DIGITAL 1
5431 
5435 #define kvIO_PIN_TYPE_ANALOG 2
5436 
5440 #define kvIO_PIN_TYPE_RELAY 3
5441 
5456 #define kvIO_PIN_DIRECTION_IN 4
5457 
5461 #define kvIO_PIN_DIRECTION_OUT 8
5462 
5484 canStatus CANLIBAPI kvIoGetNumberOfPins (const CanHandle hnd, unsigned int *pinCount);
5485 
5502 canStatus CANLIBAPI kvIoConfirmConfig (const CanHandle hnd);
5503 
5523 canStatus CANLIBAPI kvIoPinGetInfo (const CanHandle hnd, unsigned int pin, int item, void *buffer, const unsigned int bufsize);
5524 
5544 canStatus CANLIBAPI kvIoPinSetInfo (const CanHandle hnd, unsigned int pin, int item, const void *buffer, const unsigned int bufsize);
5545 
5563 canStatus CANLIBAPI kvIoPinSetDigital (const CanHandle hnd, unsigned int pin, unsigned int value);
5564 
5584 canStatus CANLIBAPI kvIoPinGetDigital (const CanHandle hnd, unsigned int pin, unsigned int *value);
5585 
5607 canStatus CANLIBAPI kvIoPinGetOutputDigital (const CanHandle hnd, unsigned int pin, unsigned int *value);
5608 
5626 canStatus CANLIBAPI kvIoPinSetRelay (const CanHandle hnd, unsigned int pin, unsigned int value);
5627 
5647 canStatus CANLIBAPI kvIoPinGetOutputRelay (const CanHandle hnd, unsigned int pin, unsigned int *value);
5648 
5666 canStatus CANLIBAPI kvIoPinSetAnalog (const CanHandle hnd, unsigned int pin, float value);
5667 
5685 canStatus CANLIBAPI kvIoPinGetAnalog (const CanHandle hnd, unsigned int pin, float* value);
5686 
5706 canStatus CANLIBAPI kvIoPinGetOutputAnalog (const CanHandle hnd, unsigned int pin, float* value);
5707 
5713 typedef struct {
5714  int type;
5715  unsigned char DO1 : 1;
5716  unsigned char DO2 : 1;
5717  unsigned char DO3 : 1;
5718  unsigned char DO4 : 1;
5719  unsigned char DO5 : 1;
5720  unsigned char DO6 : 1;
5721  unsigned char DO7 : 1;
5722  unsigned char DO8 : 1;
5723  unsigned char DO9 : 1;
5724  unsigned char DO10: 1;
5725  unsigned char DO11: 1;
5726  unsigned char DO12: 1;
5727  unsigned char DO13: 1;
5728  unsigned char DO14: 1;
5729  unsigned char DO15: 1;
5730  unsigned char DO16: 1;
5731  unsigned char DI1 : 1;
5732  unsigned char DI2 : 1;
5733  unsigned char DI3 : 1;
5734  unsigned char DI4 : 1;
5735  unsigned char DI5 : 1;
5736  unsigned char DI6 : 1;
5737  unsigned char DI7 : 1;
5738  unsigned char DI8 : 1;
5739  unsigned char DI9 : 1;
5740  unsigned char DI10: 1;
5741  unsigned char DI11: 1;
5742  unsigned char DI12: 1;
5743  unsigned char DI13: 1;
5744  unsigned char DI14: 1;
5745  unsigned char DI15: 1;
5746  unsigned char DI16: 1;
5748 
5749 
5755 typedef struct {
5756  int type;
5757  unsigned char DO: 1;
5758  unsigned char DI: 1;
5760 
5761 
5768 typedef struct {
5769  int type;
5770  unsigned char RO1 : 1;
5771  unsigned char RO2 : 1;
5772  unsigned char RO3 : 1;
5773  unsigned char RO4 : 1;
5774  unsigned char RO5 : 1;
5775  unsigned char RO6 : 1;
5776  unsigned char RO7 : 1;
5777  unsigned char RO8 : 1;
5778  unsigned char DI1 : 1;
5779  unsigned char DI2 : 1;
5780  unsigned char DI3 : 1;
5781  unsigned char DI4 : 1;
5782  unsigned char DI5 : 1;
5783  unsigned char DI6 : 1;
5784  unsigned char DI7 : 1;
5785  unsigned char DI8 : 1;
5786 } kvIoModuleRelay;
5787 
5794 typedef struct {
5795  int type;
5796  float AO1;
5797  float AO2;
5798  float AO3;
5799  float AO4;
5800  float AI1;
5801  float AI2;
5802  float AI3;
5803  float AI4;
5805 
5806 
5824 canStatus CANLIBAPI kvIoGetModulePins (const CanHandle hnd, unsigned int module, void *buffer, const unsigned int bufsize);
5825 
5826 
5845 canStatus CANLIBAPI kvIoSetModulePins (const CanHandle hnd, unsigned int module, const void *buffer, const unsigned int bufsize);
5846 
5847 
5848 #ifdef __cplusplus
5849 }
5850 #endif /* __cplusplus */
5851 
5852 #include "obsolete.h"
5853 
5854 
5855 
5856 
5857 #endif /* _CANLIB_H_ */
Definitions which are retained for compatibility.
unsigned char DI10
Definition: canlib.h:5740
kvStatus kvScriptEnvvarGetFloat(kvEnvHandle eHnd, float *val)
unsigned long stdRemote
Number of received standard (11-bit identifiers) remote frames.
Definition: canlib.h:3725
unsigned char DI5
Definition: canlib.h:5735
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
unsigned char DI12
Definition: canlib.h:5742
unsigned char RO3
Definition: canlib.h:5772
canStatus canGetBusOutputControl(const CanHandle hnd, unsigned int *drivertype)
kvStatus kvTimeDomainDelete(kvTimeDomain domain)
float AI2
Definition: canlib.h:5801
unsigned char DI8
Definition: canlib.h:5738
canStatus canGetDriverMode(const CanHandle hnd, int *lineMode, int *resNet)
struct canNotifyData::@0::@2 rx
unsigned char DO15
Definition: canlib.h:5729
void canInitializeLibrary(void)
canStatus kvIoPinGetInfo(const CanHandle hnd, unsigned int pin, int item, void *buffer, const unsigned int bufsize)
unsigned char DO8
Definition: canlib.h:5722
canStatus canReadStatus(const CanHandle hnd, unsigned long *const flags)
kvStatus kvTimeDomainCreate(kvTimeDomain *domain)
unsigned char DI9
Definition: canlib.h:5739
unsigned int portNo
Port number used in e.g. canIOCTL_SET_USER_IOPORT.
Definition: canlib.h:2889
int64_t kvEnvHandle
Definition: canlib.h:4263
int nNonMagiSyncCards
number of non MagiSync™ interfaces
Definition: canlib.h:3804
unsigned char RO2
Definition: canlib.h:5771
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:3792
unsigned char DI7
Definition: canlib.h:5737
unsigned char DO
Definition: canlib.h:5757
unsigned char rxErrorCounter
Definition: canlib.h:180
unsigned char DO2
Definition: canlib.h:5716
unsigned long extRemote
Number of received extended (29-bit identifiers) remote frames.
Definition: canlib.h:3727
canStatus canClose(const CanHandle hnd)
unsigned char RO5
Definition: canlib.h:5774
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)
int type
Definition: canlib.h:5795
canStatus canObjBufSetMsgCount(const CanHandle hnd, int idx, unsigned int count)
canStatus kvFlashLeds(const CanHandle hnd, int action, int timeout)
canStatus canSetAcceptanceFilter(const CanHandle hnd, unsigned int code, unsigned int mask, int is_extended)
unsigned char DI13
Definition: canlib.h:5743
int canHandle
Definition: canlib.h:155
unsigned char DI14
Definition: canlib.h:5744
unsigned char DI1
Definition: canlib.h:5778
canStatus canObjBufDisable(const CanHandle hnd, int idx)
void * tag
Definition: canlib.h:163
unsigned char RO4
Definition: canlib.h:5773
canStatus canGetBusParams(const CanHandle hnd, long *freq, unsigned int *tseg1, unsigned int *tseg2, unsigned int *sjw, unsigned int *noSamp, unsigned int *syncmode)
float AI3
Definition: canlib.h:5802
kvStatus kvScriptEnvvarGetInt(kvEnvHandle eHnd, int *val)
Definitions for the CANLIB API.
kvStatus kvScriptGetMaxEnvvarSize(int hnd, int *envvarSize)
Definition: canlib.h:5768
Definition: canlib.h:5713
canStatus kvIoPinSetInfo(const CanHandle hnd, unsigned int pin, int item, const void *buffer, const unsigned int bufsize)
Definition: canlib.h:5794
canStatus canSetBusOutputControl(const CanHandle hnd, const unsigned int drivertype)
int type
Definition: canlib.h:5769
int type
Definition: canlib.h:5714
int eventType
Definition: canlib.h:164
float AO3
Definition: canlib.h:5798
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)
int type
Definition: canlib.h:5756
kvStatus kvScriptEnvvarSetInt(kvEnvHandle eHnd, int val)
canStatus canObjBufSendBurst(const CanHandle hnd, int idx, unsigned int burstlen)
canStatus canGetRawHandle(const CanHandle hnd, void *pvFd)
canStatus kvIoPinGetOutputAnalog(const CanHandle hnd, unsigned int pin, float *value)
unsigned int canGetVersionEx(unsigned int itemCode)
unsigned char RO8
Definition: canlib.h:5777
canStatus canBusOn(const CanHandle hnd)
Definition: canlib.h:5755
long id
Definition: canlib.h:170
unsigned char DI
Definition: canlib.h:5758
canStatus canWriteWait(const CanHandle hnd, long id, void *msg, unsigned int dlc, unsigned int flag, unsigned long timeout)
canStatus kvIoSetModulePins(const CanHandle hnd, unsigned int module, const void *buffer, const unsigned int bufsize)
kvStatus kvReadDeviceCustomerData(const CanHandle hnd, int userNumber, int itemNumber, void *data, size_t bufsiz)
canStatus canWrite(const CanHandle hnd, long id, void *msg, unsigned int dlc, unsigned int flag)
unsigned char DI3
Definition: canlib.h:5780
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)
canStatus kvIoGetModulePins(const CanHandle hnd, unsigned int module, void *buffer, const unsigned int bufsize)
kvStatus kvScriptLoadFile(const CanHandle hnd, int slotNo, char *filePathOnPC)
float AI4
Definition: canlib.h:5803
unsigned int portValue
Port value used in e.g. canIOCTL_SET_USER_IOPORT.
Definition: canlib.h:2890
unsigned short canGetVersion(void)
unsigned char DI1
Definition: canlib.h:5731
unsigned char DI2
Definition: canlib.h:5732
unsigned long errFrame
Number of error frames.
Definition: canlib.h:3728
canStatus kvIoPinSetAnalog(const CanHandle hnd, unsigned int pin, float value)
canStatus canReadWait(const CanHandle hnd, long *id, void *msg, unsigned int *dlc, unsigned int *flag, unsigned long *time, unsigned long timeout)
canStatus canReadSyncSpecific(const CanHandle hnd, long id, unsigned long timeout)
float AO4
Definition: canlib.h:5799
canStatus canFlushTransmitQueue(const CanHandle hnd)
kvStatus kvReadTimer64(const CanHandle hnd, uint64_t *time)
unsigned char DO10
Definition: canlib.h:5724
kvStatus kvFileGetName(const CanHandle hnd, int fileNo, char *name, int namelen)
kvStatus kvTimeDomainResetTime(kvTimeDomain domain)
unsigned char DO3
Definition: canlib.h:5717
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:3726
float AO1
Definition: canlib.h:5796
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)
unsigned char DO16
Definition: canlib.h:5730
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)
unsigned char DO4
Definition: canlib.h:5718
unsigned char DI8
Definition: canlib.h:5785
unsigned char DI6
Definition: canlib.h:5736
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)
unsigned char DO1
Definition: canlib.h:5715
canStatus canObjBufSetFlags(const CanHandle hnd, int idx, unsigned int flags)
kvEnvHandle kvScriptEnvvarOpen(const CanHandle hnd, char *envvarName, int *envvarType, int *envvarSize)
unsigned char RO7
Definition: canlib.h:5776
unsigned char RO1
Definition: canlib.h:5770
unsigned char DI16
Definition: canlib.h:5746
unsigned char DI5
Definition: canlib.h:5782
void(* kvCallback_t)(CanHandle hnd, void *context, unsigned int notifyEvent)
Definition: canlib.h:3978
canStatus canSetBusParamsC200(const CanHandle hnd, unsigned char btr0, unsigned char btr1)
int nMagiSyncGroups
number of MagiSync™ groups
Definition: canlib.h:3802
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)
unsigned char DI11
Definition: canlib.h:5741
kvStatus kvDeviceGetMode(const CanHandle hnd, int *result)
canStatus kvIoPinGetOutputDigital(const CanHandle hnd, unsigned int pin, unsigned int *value)
unsigned char RO6
Definition: canlib.h:5775
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:3724
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:3735
kvStatus kvTimeDomainAddHandle(kvTimeDomain domain, const CanHandle hnd)
Definition: canlib.h:3801
unsigned char DI3
Definition: canlib.h:5733
canStatus canReadTimer(const CanHandle hnd, unsigned long *time)
unsigned char DO7
Definition: canlib.h:5721
canStatus kvIoPinSetDigital(const CanHandle hnd, unsigned int pin, unsigned int value)
unsigned char DI4
Definition: canlib.h:5734
canStatus canGetBusStatistics(const CanHandle hnd, canBusStatistics *stat, size_t bufsiz)
canStatus canBusOff(const CanHandle hnd)
canStatus canReadSpecific(const CanHandle hnd, long id, void *msg, unsigned int *dlc, unsigned int *flag, unsigned long *time)
float AI1
Definition: canlib.h:5800
canStatus canGetErrorText(canStatus err, char *buf, unsigned int bufsiz)
unsigned long busLoad
Definition: canlib.h:3734
unsigned char DI7
Definition: canlib.h:5784
unsigned char DO13
Definition: canlib.h:5727
canStatus canRequestChipStatus(const CanHandle hnd)
Definition: canlib.h:3723
canStatus canEnumHardwareEx(int *channelCount)
unsigned char DI4
Definition: canlib.h:5781
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:3795
Definition: canlib.h:2888
union canNotifyData::@0 info
canStatus canResetBus(const CanHandle hnd)
canStatus canObjBufAllocate(const CanHandle hnd, int type)
unsigned char DI2
Definition: canlib.h:5779
int nNonMagiSyncedMembers
number of non MagiSync™ members
Definition: canlib.h:3805
unsigned char DO6
Definition: canlib.h:5720
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 char DO9
Definition: canlib.h:5723
unsigned char DO14
Definition: canlib.h:5728
unsigned long time
Definition: canlib.h:167
unsigned char DO5
Definition: canlib.h:5719
kvStatus kvFileCopyToDevice(const CanHandle hnd, char *hostFileName, char *deviceFileName)
canStatus canReadSync(const CanHandle hnd, unsigned long timeout)
float AO2
Definition: canlib.h:5797
kvStatus kvScriptUnload(const CanHandle hnd, int slotNo)
canStatus canObjBufSetPeriod(const CanHandle hnd, int idx, unsigned int period)
unsigned char DI6
Definition: canlib.h:5783
canStatus canObjBufFreeAll(const CanHandle hnd)
canStatus canIoCtl(const CanHandle hnd, unsigned int func, void *buf, unsigned int buflen)
unsigned char DI15
Definition: canlib.h:5745
struct canNotifyData::@0::@4 status
canStatus canSetBusParams(const CanHandle hnd, long freq, unsigned int tseg1, unsigned int tseg2, unsigned int sjw, unsigned int noSamp, unsigned int syncmode)
canStatus canObjBufSetFilter(const CanHandle hnd, int idx, unsigned int code, unsigned int mask)
struct canNotifyData::@0::@3 tx
unsigned char DO11
Definition: canlib.h:5725
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:3803
unsigned char DO12
Definition: canlib.h:5726