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 #include "bus_params_tq.h"
154 
156 typedef int canHandle;
157 
158 # define canINVALID_HANDLE (-1)
159 
160 
162 
163 typedef struct canNotifyData {
164  void *tag;
166  union {
167  struct {
168  unsigned long time;
169  } busErr;
170  struct {
171  long id;
172  unsigned long time;
173  } rx;
174  struct {
175  long id;
176  unsigned long time;
177  } tx;
178  struct {
179  unsigned char busStatus;
180  unsigned char txErrorCounter;
181  unsigned char rxErrorCounter;
182  unsigned long time;
183  } status;
184  } info;
185 } canNotifyData;
186 
187 
197 // The canWANT_xxx names are also obsolete, use canOPEN_xxx instead for new developments.
198 #define canWANT_EXCLUSIVE 0x0008
199 #define canWANT_EXTENDED 0x0010
200 #define canWANT_VIRTUAL 0x0020
201 
215 #define canOPEN_EXCLUSIVE 0x0008
216 
228 #define canOPEN_REQUIRE_EXTENDED 0x0010
229 
237 # define canOPEN_ACCEPT_VIRTUAL 0x0020
238 
247 # define canOPEN_OVERRIDE_EXCLUSIVE 0x0040
248 
265 # define canOPEN_REQUIRE_INIT_ACCESS 0x0080
266 
278 # define canOPEN_NO_INIT_ACCESS 0x0100
279 
291 # define canOPEN_ACCEPT_LARGE_DLC 0x0200 // DLC can be greater than 8
292 
299 # define canOPEN_CAN_FD 0x0400
300 
314 # define canOPEN_CAN_FD_NONISO 0x0800
315 
316 
320 # define canOPEN_INTERNAL_L 0x1000
321 
333 #define canFILTER_ACCEPT 1
334 #define canFILTER_REJECT 2
335 
336 #define canFILTER_SET_CODE_STD 3
337 
338 #define canFILTER_SET_MASK_STD 4
339 
340 #define canFILTER_SET_CODE_EXT 5
341 
342 #define canFILTER_SET_MASK_EXT 6
343 
344 #define canFILTER_NULL_MASK 0L
345 
361 #define canDRIVER_NORMAL 4
362 
369 #define canDRIVER_SILENT 1
370 
374 #define canDRIVER_SELFRECEPTION 8
375 
379 #define canDRIVER_OFF 0
380 
403 #define canBITRATE_1M (-1)
404 
405 #define canBITRATE_500K (-2)
406 
407 #define canBITRATE_250K (-3)
408 
409 #define canBITRATE_125K (-4)
410 
411 #define canBITRATE_100K (-5)
412 
413 #define canBITRATE_62K (-6)
414 
415 #define canBITRATE_50K (-7)
416 
417 #define canBITRATE_83K (-8)
418 
419 #define canBITRATE_10K (-9)
420 
421 // CAN FD Bit Rates
425 #define canFD_BITRATE_500K_80P (-1000)
426 
429 #define canFD_BITRATE_1M_80P (-1001)
430 
433 #define canFD_BITRATE_2M_80P (-1002)
434 
437 #define canFD_BITRATE_4M_80P (-1003)
438 
441 #define canFD_BITRATE_8M_60P (-1004)
442 
444 #define BAUD_1M (-1)
445 
446 #define BAUD_500K (-2)
447 
448 #define BAUD_250K (-3)
449 
450 #define BAUD_125K (-4)
451 
452 #define BAUD_100K (-5)
453 
454 #define BAUD_62K (-6)
455 
456 #define BAUD_50K (-7)
457 
458 #define BAUD_83K (-8)
459 
462 //
463 // Define CANLIBAPI unless it's done already.
464 // (canlib.c provides its own definitions of CANLIBAPI, DLLIMPORT
465 // and DLLEXPORT before including this file.)
466 //
467 #ifndef CANLIBAPI
468 # define CANLIBAPI
469 #endif /* CANLIBAPI */
470 
471 
472 #ifdef __cplusplus
473 extern "C" {
474 #endif /* __cplusplus */
475 
497 void CANLIBAPI canInitializeLibrary (void);
498 
520 canStatus CANLIBAPI canEnumHardwareEx (int *channelCount);
521 
546 canStatus CANLIBAPI canClose (const CanHandle hnd);
547 
572 canStatus CANLIBAPI canBusOn (const CanHandle hnd);
573 
594 canStatus CANLIBAPI canBusOff (const CanHandle hnd);
595 
645 canStatus CANLIBAPI canSetBusParams (const CanHandle hnd,
646  long freq,
647  unsigned int tseg1,
648  unsigned int tseg2,
649  unsigned int sjw,
650  unsigned int noSamp,
651  unsigned int syncmode);
652 
678  canStatus CANLIBAPI canSetBusParamsTq(const CanHandle hnd,
679  const kvBusParamsTq nominal);
680 
714 canStatus CANLIBAPI canSetBusParamsFd (const CanHandle hnd,
715  long freq_brs,
716  unsigned int tseg1_brs,
717  unsigned int tseg2_brs,
718  unsigned int sjw_brs);
719 
746 canStatus CANLIBAPI canSetBusParamsFdTq(const CanHandle hnd,
747  const kvBusParamsTq arbitration,
748  const kvBusParamsTq data);
749 
750 
782 canStatus CANLIBAPI canGetBusParams (const CanHandle hnd,
783  long *freq,
784  unsigned int *tseg1,
785  unsigned int *tseg2,
786  unsigned int *sjw,
787  unsigned int *noSamp,
788  unsigned int *syncmode);
789 
809 canStatus CANLIBAPI canGetBusParamsTq(const CanHandle hnd,
810  kvBusParamsTq *nominal);
811 
834 canStatus CANLIBAPI canGetBusParamsFd(const CanHandle hnd,
835  long *freq_brs,
836  unsigned int *tseg1_brs,
837  unsigned int *tseg2_brs,
838  unsigned int *sjw_brs);
839 
860 canStatus CANLIBAPI canGetBusParamsFdTq(const CanHandle hnd,
861  kvBusParamsTq *nominal,
862  kvBusParamsTq *data);
863 
888 canStatus CANLIBAPI canSetBusOutputControl (const CanHandle hnd,
889  const unsigned int drivertype);
890 
925 canStatus CANLIBAPI canGetBusOutputControl (const CanHandle hnd,
926  unsigned int *drivertype);
927 
970 canStatus CANLIBAPI canAccept (const CanHandle hnd,
971  const long envelope,
972  const unsigned int flag);
973 
997 canStatus CANLIBAPI canReadStatus (const CanHandle hnd,
998  unsigned long *const flags);
999 
1036 canStatus CANLIBAPI canReadErrorCounters (const CanHandle hnd,
1037  unsigned int *txErr,
1038  unsigned int *rxErr,
1039  unsigned int *ovErr);
1040 
1082 canStatus CANLIBAPI canWrite (const CanHandle hnd,
1083  long id,
1084  void *msg,
1085  unsigned int dlc,
1086  unsigned int flag);
1087 
1115 canStatus CANLIBAPI canWriteSync (const CanHandle hnd, unsigned long timeout);
1116 
1168 canStatus CANLIBAPI canRead (const CanHandle hnd,
1169  long *id,
1170  void *msg,
1171  unsigned int *dlc,
1172  unsigned int *flag,
1173  unsigned long *time);
1224 canStatus CANLIBAPI canReadWait (const CanHandle hnd,
1225  long *id,
1226  void *msg,
1227  unsigned int *dlc,
1228  unsigned int *flag,
1229  unsigned long *time,
1230  unsigned long timeout);
1231 
1283 canStatus CANLIBAPI canReadSpecific (const CanHandle hnd, long id, void * msg,
1284  unsigned int * dlc, unsigned int * flag,
1285  unsigned long * time);
1286 
1317 canStatus CANLIBAPI canReadSync (const CanHandle hnd, unsigned long timeout);
1318 
1350 canStatus CANLIBAPI canReadSyncSpecific (const CanHandle hnd,
1351  long id,
1352  unsigned long timeout);
1353 
1399 canStatus CANLIBAPI canReadSpecificSkip (const CanHandle hnd,
1400  long id,
1401  void * msg,
1402  unsigned int * dlc,
1403  unsigned int * flag,
1404  unsigned long * time);
1405 
1426 canStatus CANLIBAPI canSetNotify (const CanHandle hnd,
1427  void (*callback)(canNotifyData *),
1428  unsigned int notifyFlags,
1429  void *tag);
1430 
1444 canStatus CANLIBAPI canGetRawHandle (const CanHandle hnd, void *pvFd);
1445 
1480 canStatus CANLIBAPI canTranslateBaud (long *const freq,
1481  unsigned int *const tseg1,
1482  unsigned int *const tseg2,
1483  unsigned int *const sjw,
1484  unsigned int *const nosamp,
1485  unsigned int *const syncMode);
1486 
1509 canStatus CANLIBAPI canGetErrorText (canStatus err, char *buf, unsigned int bufsiz);
1510 
1540 unsigned short CANLIBAPI canGetVersion (void);
1541 
1570 canStatus CANLIBAPI canIoCtl (const CanHandle hnd,
1571  unsigned int func,
1572  void *buf,
1573  unsigned int buflen);
1574 
1575 
1581 canStatus CANLIBAPI canReadTimer (const CanHandle hnd, unsigned long *time);
1582 
1633 CanHandle CANLIBAPI canOpenChannel (int channel, int flags);
1634 
1655 canStatus CANLIBAPI canGetNumberOfChannels (int *channelCount);
1656 
1657 
1665 #define kvREMOTE_TYPE_NOT_REMOTE 0
1666 #define kvREMOTE_TYPE_WLAN 1
1667 #define kvREMOTE_TYPE_LAN 2
1668 
1677 #define kvLOGGER_TYPE_NOT_A_LOGGER 0
1678 #define kvLOGGER_TYPE_V1 1
1679 #define kvLOGGER_TYPE_V2 2
1680 
1713 canStatus CANLIBAPI canGetChannelData (int channel,
1714  int item,
1715  void *buffer,
1716  size_t bufsize);
1717 
1736 #define canCHANNELDATA_CHANNEL_CAP 1
1737 
1747 #define canCHANNELDATA_TRANS_CAP 2
1748 
1757 #define canCHANNELDATA_CHANNEL_FLAGS 3 // available, etc
1758 
1767 #define canCHANNELDATA_CARD_TYPE 4
1768 
1778 #define canCHANNELDATA_CARD_NUMBER 5
1779 
1787 #define canCHANNELDATA_CHAN_NO_ON_CARD 6
1788 
1798 #define canCHANNELDATA_CARD_SERIAL_NO 7
1799 
1809 #define canCHANNELDATA_TRANS_SERIAL_NO 8
1810 
1821 #define canCHANNELDATA_CARD_FIRMWARE_REV 9
1822 
1833 #define canCHANNELDATA_CARD_HARDWARE_REV 10
1834 
1844 #define canCHANNELDATA_CARD_UPC_NO 11
1845 
1856 #define canCHANNELDATA_TRANS_UPC_NO 12
1857 
1875 #define canCHANNELDATA_CHANNEL_NAME 13
1876 
1892 # define canCHANNELDATA_DLL_FILE_VERSION 14
1893 
1909 # define canCHANNELDATA_DLL_PRODUCT_VERSION 15
1910 
1926 # define canCHANNELDATA_DLL_FILETYPE 16
1927 
1936 # define canCHANNELDATA_TRANS_TYPE 17
1937 
1961 # define canCHANNELDATA_DEVICE_PHYSICAL_POSITION 18
1962 
1975 # define canCHANNELDATA_UI_NUMBER 19
1976 
2000 # define canCHANNELDATA_TIMESYNC_ENABLED 20
2001 
2016 # define canCHANNELDATA_DRIVER_FILE_VERSION 21
2017 
2032 # define canCHANNELDATA_DRIVER_PRODUCT_VERSION 22
2033 
2042 # define canCHANNELDATA_MFGNAME_UNICODE 23
2043 
2051 # define canCHANNELDATA_MFGNAME_ASCII 24
2052 
2061 # define canCHANNELDATA_DEVDESCR_UNICODE 25
2062 
2070 # define canCHANNELDATA_DEVDESCR_ASCII 26
2071 
2082 # define canCHANNELDATA_DRIVER_NAME 27
2083 
2096 # define canCHANNELDATA_CHANNEL_QUALITY 28
2097 
2106 # define canCHANNELDATA_ROUNDTRIP_TIME 29
2107 
2116 # define canCHANNELDATA_BUS_TYPE 30
2117 
2130 # define canCHANNELDATA_DEVNAME_ASCII 31
2131 
2142 # define canCHANNELDATA_TIME_SINCE_LAST_SEEN 32
2143 
2153 # define canCHANNELDATA_REMOTE_OPERATIONAL_MODE 33
2154 
2163 # define canCHANNELDATA_REMOTE_PROFILE_NAME 34
2164 
2173 # define canCHANNELDATA_REMOTE_HOST_NAME 35
2174 
2183 # define canCHANNELDATA_REMOTE_MAC 36
2184 
2193 # define canCHANNELDATA_MAX_BITRATE 37
2194 
2205 # define canCHANNELDATA_CHANNEL_CAP_MASK 38
2206 
2218 #define canCHANNELDATA_CUST_CHANNEL_NAME 39
2219 
2229 # define canCHANNELDATA_IS_REMOTE 40
2230 
2239 # define canCHANNELDATA_REMOTE_TYPE 41
2240 
2249 # define canCHANNELDATA_LOGGER_TYPE 42
2250 
2260 # define canCHANNELDATA_HW_STATUS 43
2261 
2271 # define canCHANNELDATA_FEATURE_EAN 44
2272 
2279 #define canCHANNELDATA_BUS_PARAM_LIMITS 45
2280 
2287 #define canCHANNELDATA_CLOCK_INFO 46
2288 
2309 #define canCHANNELDATA_CHANNEL_CAP_EX 47
2310 
2323 typedef struct kvClockInfo {
2324  int version;
2329 }kvClockInfo;
2330 
2338 typedef struct kvBusParamLimits {
2339  int version;
2340  int brp_size;
2343  int sjw_size;
2345 
2356 #define canCHANNEL_IS_EXCLUSIVE 0x0001
2357 
2359 #define canCHANNEL_IS_OPEN 0x0002
2360 
2363 #define canCHANNEL_IS_CANFD 0x0004
2364 
2365 //#define canCHANNEL_IS_CANFD_NON_ISO 0x0008 Reserved for when needed
2366 
2369 #define canCHANNEL_IS_LIN 0x0010
2370 
2373 #define canCHANNEL_IS_LIN_MASTER 0x0020
2374 
2377 #define canCHANNEL_IS_LIN_SLAVE 0x0040
2378 
2379 
2398 #define canHWTYPE_NONE 0
2399 #define canHWTYPE_VIRTUAL 1
2400 #define canHWTYPE_LAPCAN 2
2401 #define canHWTYPE_CANPARI 3
2402 #define canHWTYPE_PCCAN 8
2403 #define canHWTYPE_PCICAN 9
2404 #define canHWTYPE_USBCAN 11
2405 #define canHWTYPE_PCICAN_II 40
2406 #define canHWTYPE_USBCAN_II 42
2407 #define canHWTYPE_SIMULATED 44
2408 #define canHWTYPE_ACQUISITOR 46
2409 #define canHWTYPE_LEAF 48
2410 #define canHWTYPE_PC104_PLUS 50
2411 #define canHWTYPE_PCICANX_II 52
2412 #define canHWTYPE_MEMORATOR_II 54
2413 #define canHWTYPE_MEMORATOR_PRO 54
2414 #define canHWTYPE_USBCAN_PRO 56
2415 #define canHWTYPE_IRIS 58
2416 #define canHWTYPE_BLACKBIRD 58
2417 #define canHWTYPE_MEMORATOR_LIGHT 60
2418 #define canHWTYPE_MINIHYDRA 62
2419 #define canHWTYPE_EAGLE 62
2420 #define canHWTYPE_BAGEL 64
2421 #define canHWTYPE_BLACKBIRD_V2 64
2422 #define canHWTYPE_MINIPCIE 66
2423 #define canHWTYPE_USBCAN_KLINE 68
2424 #define canHWTYPE_ETHERCAN 70
2425 #define canHWTYPE_USBCAN_LIGHT 72
2426 #define canHWTYPE_USBCAN_PRO2 74
2427 #define canHWTYPE_PCIE_V2 76
2428 #define canHWTYPE_MEMORATOR_PRO2 78
2429 #define canHWTYPE_LEAF2 80
2430 #define canHWTYPE_MEMORATOR_V2 82
2431 #define canHWTYPE_CANLINHYBRID 84
2432 #define canHWTYPE_DINRAIL 86
2433 #define canHWTYPE_U100 88
2434 
2435 
2444 #define canCHANNEL_CAP_EXTENDED_CAN 0x00000001L
2445 #define canCHANNEL_CAP_BUS_STATISTICS 0x00000002L
2446 #define canCHANNEL_CAP_ERROR_COUNTERS 0x00000004L
2447 #define canCHANNEL_CAP_RESERVED_2 0x00000008L
2448 #define canCHANNEL_CAP_GENERATE_ERROR 0x00000010L
2449 #define canCHANNEL_CAP_GENERATE_OVERLOAD 0x00000020L
2450 #define canCHANNEL_CAP_TXREQUEST 0x00000040L
2451 #define canCHANNEL_CAP_TXACKNOWLEDGE 0x00000080L
2452 #define canCHANNEL_CAP_VIRTUAL 0x00010000L
2453 #define canCHANNEL_CAP_SIMULATED 0x00020000L
2454 #define canCHANNEL_CAP_RESERVED_1 0x00040000L
2455 #define canCHANNEL_CAP_CAN_FD 0x00080000L
2456 #define canCHANNEL_CAP_CAN_FD_NONISO 0x00100000L
2457 #define canCHANNEL_CAP_SILENT_MODE 0x00200000L
2458 #define canCHANNEL_CAP_SINGLE_SHOT 0x00400000L
2459 #define canCHANNEL_CAP_LOGGER 0x00800000L
2460 #define canCHANNEL_CAP_REMOTE_ACCESS 0x01000000L
2461 #define canCHANNEL_CAP_SCRIPT 0x02000000L
2462 #define canCHANNEL_CAP_LIN_HYBRID 0x04000000L
2463 #define canCHANNEL_CAP_IO_API 0x08000000L
2464 #define canCHANNEL_CAP_DIAGNOSTICS 0x10000000L
2465 
2466 
2472 #define canCHANNEL_CAP_EX_BUSPARAMS_TQ 0x0000000000000001L
2473 
2474 
2486 #define canCHANNEL_OPMODE_NONE 1
2487 
2491 #define canCHANNEL_OPMODE_INFRASTRUCTURE 2
2492 
2496 #define canCHANNEL_OPMODE_RESERVED 3
2497 
2501 #define canCHANNEL_OPMODE_ADHOC 4
2502 
2512 #define canDRIVER_CAP_HIGHSPEED 0x00000001L
2513 
2539 #define canIOCTL_PREFER_EXT 1
2540 
2553 #define canIOCTL_PREFER_STD 2
2554 
2571 #define canIOCTL_CLEAR_ERROR_COUNTERS 5
2572 
2587 #define canIOCTL_SET_TIMER_SCALE 6
2588 
2608 #define canIOCTL_SET_TXACK 7
2609 
2622 #define canIOCTL_GET_RX_BUFFER_LEVEL 8
2623 
2636 #define canIOCTL_GET_TX_BUFFER_LEVEL 9
2637 
2647 #define canIOCTL_FLUSH_RX_BUFFER 10
2648 
2658 #define canIOCTL_FLUSH_TX_BUFFER 11
2659 
2668 #define canIOCTL_GET_TIMER_SCALE 12
2669 
2685 #define canIOCTL_SET_TXRQ 13
2686 
2687 
2694 #define canIOCTL_SET_BYPASS_MODE 15
2695 
2701 #define canIOCTL_SET_WAKEUP 16
2702 
2712 # define canIOCTL_GET_DRIVERHANDLE 17
2713 
2719 # define canIOCTL_MAP_RXQUEUE 18
2720 
2726 # define canIOCTL_GET_WAKEUP 19
2727 
2739 # define canIOCTL_SET_REPORT_ACCESS_ERRORS 20
2740 
2748 # define canIOCTL_GET_REPORT_ACCESS_ERRORS 21
2749 
2759 # define canIOCTL_CONNECT_TO_VIRTUAL_BUS 22
2760 
2770 # define canIOCTL_DISCONNECT_FROM_VIRTUAL_BUS 23
2771 
2781 # define canIOCTL_SET_USER_IOPORT 24
2782 
2793 # define canIOCTL_GET_USER_IOPORT 25
2794 
2800 # define canIOCTL_SET_BUFFER_WRAPAROUND_MODE 26
2801 
2818 # define canIOCTL_SET_RX_QUEUE_SIZE 27
2819 
2825 # define canIOCTL_SET_USB_THROTTLE 28
2826 
2832 # define canIOCTL_GET_USB_THROTTLE 29
2833 
2848 # define canIOCTL_SET_BUSON_TIME_AUTO_RESET 30
2849 
2861 # define canIOCTL_GET_TXACK 31
2862 
2877 # define canIOCTL_SET_LOCAL_TXECHO 32
2878 
2894 # define canIOCTL_SET_ERROR_FRAMES_REPORTING 33
2895 
2909 # define canIOCTL_GET_CHANNEL_QUALITY 34
2910 
2922 # define canIOCTL_GET_ROUNDTRIP_TIME 35
2923 
2932 # define canIOCTL_GET_BUS_TYPE 36
2933 
2946 # define canIOCTL_GET_DEVNAME_ASCII 37
2947 
2959 # define canIOCTL_GET_TIME_SINCE_LAST_SEEN 38
2960 
2974 # define canIOCTL_GET_TREF_LIST 39
2975 
2997 # define canIOCTL_TX_INTERVAL 40
2998 
3010 # define canIOCTL_SET_BRLIMIT 43
3011 
3017 # define canIOCTL_SET_USB_THROTTLE_SCALED 41
3018 
3033 # define canIOCTL_SET_THROTTLE_SCALED 41
3034 
3040 # define canIOCTL_GET_USB_THROTTLE_SCALED 42
3041 
3056 # define canIOCTL_GET_THROTTLE_SCALED 42
3057 
3065 # define canIOCTL_RESET_OVERRUN_COUNT 44
3066 
3075 # define canIOCTL_LIN_MODE 45
3076 
3079 typedef struct {
3080  unsigned int portNo;
3081  unsigned int portValue;
3083 
3084 
3125 canStatus CANLIBAPI canSetBusParamsC200 (const CanHandle hnd, unsigned char btr0, unsigned char btr1);
3126 
3127 
3128 
3164 canStatus CANLIBAPI canSetDriverMode (const CanHandle hnd, int lineMode, int resNet);
3165 
3202 canStatus CANLIBAPI canGetDriverMode (const CanHandle hnd, int *lineMode, int *resNet);
3203 
3223 #define canVERSION_CANLIB32_VERSION 0
3224 
3235 #define canVERSION_CANLIB32_PRODVER 1
3236 
3248 #define canVERSION_CANLIB32_PRODVER32 2
3249 
3260 #define canVERSION_CANLIB32_BETA 3
3261 
3281 unsigned int CANLIBAPI canGetVersionEx (unsigned int itemCode);
3282 
3283 
3303 canStatus CANLIBAPI canObjBufFreeAll (const CanHandle hnd);
3304 
3325 canStatus CANLIBAPI canObjBufAllocate (const CanHandle hnd, int type);
3326 
3335 #define canOBJBUF_TYPE_AUTO_RESPONSE 0x01
3336 #define canOBJBUF_TYPE_PERIODIC_TX 0x02
3337 
3359 canStatus CANLIBAPI canObjBufFree (const CanHandle hnd, int idx);
3360 
3361 // Writes CAN data to the object buffer with the specified index.
3362 
3388 canStatus CANLIBAPI canObjBufWrite (const CanHandle hnd,
3389  int idx,
3390  int id,
3391  void* msg,
3392  unsigned int dlc,
3393  unsigned int flags);
3394 
3420 canStatus CANLIBAPI canObjBufSetFilter (const CanHandle hnd,
3421  int idx,
3422  unsigned int code,
3423  unsigned int mask);
3424 
3445 canStatus CANLIBAPI canObjBufSetFlags (const CanHandle hnd,
3446  int idx,
3447  unsigned int flags);
3448 
3466 # define canOBJBUF_AUTO_RESPONSE_RTR_ONLY 0x01
3467 
3489 canStatus CANLIBAPI canObjBufSetPeriod (const CanHandle hnd,
3490  int idx,
3491  unsigned int period);
3492 
3513 canStatus CANLIBAPI canObjBufSetMsgCount (const CanHandle hnd,
3514  int idx,
3515  unsigned int count);
3516 
3536 canStatus CANLIBAPI canObjBufEnable (const CanHandle hnd, int idx);
3537 
3557 canStatus CANLIBAPI canObjBufDisable (const CanHandle hnd, int idx);
3558 
3582 canStatus CANLIBAPI canObjBufSendBurst (const CanHandle hnd,
3583  int idx,
3584  unsigned int burstlen);
3585 
3586 
3609 canStatus CANLIBAPI canResetBus (const CanHandle hnd);
3610 
3649 canStatus CANLIBAPI canWriteWait (const CanHandle hnd,
3650  long id,
3651  void *msg,
3652  unsigned int dlc,
3653  unsigned int flag,
3654  unsigned long timeout);
3655 
3656 
3682 canStatus CANLIBAPI canUnloadLibrary (void);
3683 
3745 canStatus CANLIBAPI canSetAcceptanceFilter (const CanHandle hnd,
3746  unsigned int code,
3747  unsigned int mask,
3748  int is_extended);
3772 canStatus CANLIBAPI canFlushReceiveQueue (const CanHandle hnd);
3773 
3798 canStatus CANLIBAPI canFlushTransmitQueue (const CanHandle hnd);
3799 
3800 
3809 #define kvLED_ACTION_ALL_LEDS_ON 0
3810 #define kvLED_ACTION_ALL_LEDS_OFF 1
3811 #define kvLED_ACTION_LED_0_ON 2
3812 #define kvLED_ACTION_LED_0_OFF 3
3813 #define kvLED_ACTION_LED_1_ON 4
3814 #define kvLED_ACTION_LED_1_OFF 5
3815 #define kvLED_ACTION_LED_2_ON 6
3816 #define kvLED_ACTION_LED_2_OFF 7
3817 #define kvLED_ACTION_LED_3_ON 8
3818 #define kvLED_ACTION_LED_3_OFF 9
3819 #define kvLED_ACTION_LED_4_ON 10
3820 #define kvLED_ACTION_LED_4_OFF 11
3821 #define kvLED_ACTION_LED_5_ON 12
3822 #define kvLED_ACTION_LED_5_OFF 13
3823 #define kvLED_ACTION_LED_6_ON 14
3824 #define kvLED_ACTION_LED_6_OFF 15
3825 #define kvLED_ACTION_LED_7_ON 16
3826 #define kvLED_ACTION_LED_7_OFF 17
3827 #define kvLED_ACTION_LED_8_ON 18
3828 #define kvLED_ACTION_LED_8_OFF 19
3829 #define kvLED_ACTION_LED_9_ON 20
3830 #define kvLED_ACTION_LED_9_OFF 21
3831 #define kvLED_ACTION_LED_10_ON 22
3832 #define kvLED_ACTION_LED_10_OFF 23
3833 #define kvLED_ACTION_LED_11_ON 24
3834 #define kvLED_ACTION_LED_11_OFF 25
3835 
3836 
3859 canStatus CANLIBAPI kvFlashLeds (const CanHandle hnd, int action, int timeout);
3860 
3880 canStatus CANLIBAPI canRequestChipStatus (const CanHandle hnd);
3881 
3908 canStatus CANLIBAPI canRequestBusStatistics (const CanHandle hnd);
3909 
3915 typedef struct canBusStatistics_s {
3916  unsigned long stdData;
3917  unsigned long stdRemote;
3918  unsigned long extData;
3919  unsigned long extRemote;
3920  unsigned long errFrame;
3921 
3926  unsigned long busLoad;
3927  unsigned long overruns;
3929 
3952 canStatus CANLIBAPI canGetBusStatistics (const CanHandle hnd,
3953  canBusStatistics *stat,
3954  size_t bufsiz);
3955 
3956 
3978 canStatus CANLIBAPI canGetHandleData (const CanHandle hnd,
3979  int item,
3980  void *buffer,
3981  size_t bufsize);
3982 
3984 typedef void *kvTimeDomain;
3985 
3988 
3993 typedef struct kvTimeDomainData_s {
3999 
4028 kvStatus CANLIBAPI kvTimeDomainCreate (kvTimeDomain *domain);
4029 
4052 kvStatus CANLIBAPI kvTimeDomainDelete (kvTimeDomain domain);
4053 
4079 kvStatus CANLIBAPI kvTimeDomainResetTime (kvTimeDomain domain);
4080 
4105 kvStatus CANLIBAPI kvTimeDomainGetData (kvTimeDomain domain,
4106  kvTimeDomainData *data,
4107  size_t bufsiz);
4108 
4131 kvStatus CANLIBAPI kvTimeDomainAddHandle(kvTimeDomain domain,
4132  const CanHandle hnd);
4133 
4155 kvStatus CANLIBAPI kvTimeDomainRemoveHandle (kvTimeDomain domain,
4156  const CanHandle hnd);
4157 
4170 typedef void (CANLIBAPI *kvCallback_t) (CanHandle hnd, void* context, unsigned int notifyEvent);
4171 
4205 kvStatus CANLIBAPI kvSetNotifyCallback (const CanHandle hnd,
4206  kvCallback_t callback,
4207  void* context,
4208  unsigned int notifyFlags);
4209 
4223 #define kvBUSTYPE_NONE 0
4224 
4229 #define kvBUSTYPE_PCI 1
4230 
4235 #define kvBUSTYPE_PCMCIA 2
4236 
4241 #define kvBUSTYPE_USB 3
4242 
4247 #define kvBUSTYPE_WLAN 4
4248 
4253 #define kvBUSTYPE_PCI_EXPRESS 5
4254 
4259 #define kvBUSTYPE_ISA 6
4260 
4265 #define kvBUSTYPE_VIRTUAL 7
4266 
4271 #define kvBUSTYPE_PC104_PLUS 8
4272 
4277 #define kvBUSTYPE_LAN 9
4278 
4294 #define kvBUSTYPE_GROUP_VIRTUAL 1
4295 
4300 #define kvBUSTYPE_GROUP_LOCAL 2
4301 
4306 #define kvBUSTYPE_GROUP_REMOTE 3
4307 
4311 #define kvBUSTYPE_GROUP_INTERNAL 4
4312 
4366 kvStatus CANLIBAPI kvGetSupportedInterfaceInfo (int index,
4367  char *hwName,
4368  size_t nameLen,
4369  int *hwType,
4370  int *hwBusType);
4371 
4396 kvStatus CANLIBAPI kvReadDeviceCustomerData (const CanHandle hnd,
4397  int userNumber,
4398  int itemNumber,
4399  void *data,
4400  size_t bufsiz);
4401 
4415 #define kvENVVAR_TYPE_INT 1
4416 
4422 #define kvENVVAR_TYPE_FLOAT 2
4423 
4429 #define kvENVVAR_TYPE_STRING 3
4430 
4446 #define kvEVENT_TYPE_KEY 1
4447 
4455  typedef int64_t kvEnvHandle;
4456 
4476 kvStatus CANLIBAPI kvScriptStart (const CanHandle hnd, int slotNo);
4477 
4484 #define kvSCRIPT_STOP_NORMAL 0
4485 #define kvSCRIPT_STOP_FORCED -9
4509 kvStatus CANLIBAPI kvScriptStop (const CanHandle hnd, int slotNo, int mode);
4510 
4530 kvStatus CANLIBAPI kvScriptUnload (const CanHandle hnd, int slotNo);
4531 
4556 kvStatus CANLIBAPI kvScriptSendEvent (const CanHandle hnd,
4557  int slotNo,
4558  int eventType,
4559  int eventNo,
4560  unsigned int data);
4561 
4586 kvEnvHandle CANLIBAPI kvScriptEnvvarOpen (const CanHandle hnd,
4587  const char* envvarName,
4588  int *envvarType,
4589  int *envvarSize); // returns scriptHandle
4590 
4608 kvStatus CANLIBAPI kvScriptEnvvarClose (kvEnvHandle eHnd);
4609 
4630 kvStatus CANLIBAPI kvScriptEnvvarSetInt (kvEnvHandle eHnd, int val);
4631 
4653 kvStatus CANLIBAPI kvScriptEnvvarGetInt (kvEnvHandle eHnd, int *val);
4654 
4677 kvStatus CANLIBAPI kvScriptEnvvarSetFloat (kvEnvHandle eHnd, float val);
4678 
4702 kvStatus CANLIBAPI kvScriptEnvvarGetFloat (kvEnvHandle eHnd, float *val);
4703 
4730 kvStatus CANLIBAPI kvScriptEnvvarSetData (kvEnvHandle eHnd,
4731  const void *buf,
4732  int start_index,
4733  int data_len);
4734 
4760 kvStatus CANLIBAPI kvScriptEnvvarGetData (kvEnvHandle eHnd,
4761  void *buf,
4762  int start_index,
4763  int data_len);
4764 
4788 kvStatus CANLIBAPI kvScriptLoadFileOnDevice (const CanHandle hnd,
4789  int slotNo,
4790  char *localFile);
4791 
4820 kvStatus CANLIBAPI kvScriptLoadFile (const CanHandle hnd,
4821  int slotNo,
4822  char *filePathOnPC);
4823 
4824 
4838 #define kvSCRIPT_REQUEST_TEXT_UNSUBSCRIBE 1
4839 
4843 #define kvSCRIPT_REQUEST_TEXT_SUBSCRIBE 2
4844 
4848 #define kvSCRIPT_REQUEST_TEXT_ALL_SLOTS 255
4849 
4873 kvStatus CANLIBAPI kvScriptRequestText(const CanHandle hnd,
4874  unsigned int slot,
4875  unsigned int request);
4876 
4877 
4878 
4901 kvStatus CANLIBAPI kvScriptGetText(const CanHandle hnd,
4902  int *slot,
4903  unsigned long *time,
4904  unsigned int *flags,
4905  char *buf,
4906  size_t bufsize);
4907 
4914 #define kvSCRIPT_STATUS_LOADED 1
4915 #define kvSCRIPT_STATUS_RUNNING 2
4936 kvStatus CANLIBAPI kvScriptStatus(const CanHandle hnd,
4937  int slot,
4938  unsigned int *status);
4939 
4940 
4959 kvStatus CANLIBAPI kvScriptGetMaxEnvvarSize(int hnd, int *envvarSize);
4960 
4991 kvStatus CANLIBAPI kvScriptTxeGetData(const char *filePathOnPC,
4992  int item,
4993  void *buffer,
4994  unsigned int *bufsize);
4995 
5021 #define canTXEDATA_FILE_VERSION 1
5022 
5038 #define canTXEDATA_COMPILER_VERSION 2
5039 
5058 #define canTXEDATA_DATE 3
5059 
5070 #define canTXEDATA_DESCRIPTION 4
5071 
5085 #define canTXEDATA_SOURCE 5
5086 
5096 #define canTXEDATA_SIZE_OF_CODE 6
5097 
5107 #define canTXEDATA_IS_ENCRYPTED 7
5108 
5109 
5135 kvStatus CANLIBAPI kvFileCopyToDevice (const CanHandle hnd,
5136  char *hostFileName,
5137  char *deviceFileName);
5138 
5161 kvStatus CANLIBAPI kvFileCopyFromDevice (const CanHandle hnd,
5162  char *deviceFileName,
5163  char *hostFileName);
5164 
5186 kvStatus CANLIBAPI kvFileDelete (const CanHandle hnd, char *deviceFileName);
5187 
5210 kvStatus CANLIBAPI kvFileGetName (const CanHandle hnd,
5211  int fileNo,
5212  char *name,
5213  int namelen);
5214 
5234 kvStatus CANLIBAPI kvFileGetCount (const CanHandle hnd, int *count);
5235 
5258 kvStatus CANLIBAPI kvFileGetSystemData (const CanHandle hnd,
5259  int itemCode,
5260  int *result);
5261 
5280 kvStatus CANLIBAPI kvFileDiskFormat(const CanHandle hnd);
5281 
5299 #define kvDEVICE_MODE_INTERFACE 0x00
5300 
5305 #define kvDEVICE_MODE_LOGGER 0x01
5306 
5331 kvStatus CANLIBAPI kvDeviceSetMode (const CanHandle hnd, int mode);
5332 
5355 kvStatus CANLIBAPI kvDeviceGetMode (const CanHandle hnd, int *result);
5356 
5357 
5382 kvStatus CANLIBAPI kvReadTimer (const CanHandle hnd, unsigned int *time);
5406 kvStatus CANLIBAPI kvReadTimer64 (const CanHandle hnd, uint64_t *time);
5407 
5424 #define kvIO_INFO_GET_MODULE_TYPE 1
5425 
5431 #define kvIO_INFO_GET_DIRECTION 2
5432 
5438 #define kvIO_INFO_GET_PIN_TYPE 4
5439 
5445 #define kvIO_INFO_GET_NUMBER_OF_BITS 5
5446 
5454 #define kvIO_INFO_GET_RANGE_MIN 6
5455 
5463 #define kvIO_INFO_GET_RANGE_MAX 7
5464 
5472 #define kvIO_INFO_GET_DI_LOW_HIGH_FILTER 8
5473 
5481 #define kvIO_INFO_GET_DI_HIGH_LOW_FILTER 9
5482 
5490 #define kvIO_INFO_GET_AI_LP_FILTER_ORDER 10
5491 
5500 #define kvIO_INFO_GET_AI_HYSTERESIS 11
5501 
5507 #define kvIO_INFO_GET_MODULE_NUMBER 14
5508 
5514 #define kvIO_INFO_GET_SERIAL_NUMBER 15
5515 
5523 #define kvIO_INFO_GET_FW_VERSION 16
5524 
5545 #define kvIO_INFO_SET_DI_LOW_HIGH_FILTER 8
5546 
5554 #define kvIO_INFO_SET_DI_HIGH_LOW_FILTER 9
5555 
5563 #define kvIO_INFO_SET_AI_LP_FILTER_ORDER 10
5564 
5573 #define kvIO_INFO_SET_AI_HYSTERESIS 11
5574 
5591 #define kvIO_MODULE_TYPE_DIGITAL 1
5592 
5596 #define kvIO_MODULE_TYPE_ANALOG 2
5597 
5601 #define kvIO_MODULE_TYPE_RELAY 3
5602 
5606 #define kvIO_MODULE_TYPE_INTERNAL 4
5607 
5622 #define kvIO_PIN_TYPE_DIGITAL 1
5623 
5627 #define kvIO_PIN_TYPE_ANALOG 2
5628 
5632 #define kvIO_PIN_TYPE_RELAY 3
5633 
5648 #define kvIO_PIN_DIRECTION_IN 4
5649 
5653 #define kvIO_PIN_DIRECTION_OUT 8
5654 
5676 canStatus CANLIBAPI kvIoGetNumberOfPins (const CanHandle hnd, unsigned int *pinCount);
5677 
5694 canStatus CANLIBAPI kvIoConfirmConfig (const CanHandle hnd);
5695 
5715 canStatus CANLIBAPI kvIoPinGetInfo (const CanHandle hnd, unsigned int pin, int item, void *buffer, const unsigned int bufsize);
5716 
5736 canStatus CANLIBAPI kvIoPinSetInfo (const CanHandle hnd, unsigned int pin, int item, const void *buffer, const unsigned int bufsize);
5737 
5755 canStatus CANLIBAPI kvIoPinSetDigital (const CanHandle hnd, unsigned int pin, unsigned int value);
5756 
5776 canStatus CANLIBAPI kvIoPinGetDigital (const CanHandle hnd, unsigned int pin, unsigned int *value);
5777 
5799 canStatus CANLIBAPI kvIoPinGetOutputDigital (const CanHandle hnd, unsigned int pin, unsigned int *value);
5800 
5818 canStatus CANLIBAPI kvIoPinSetRelay (const CanHandle hnd, unsigned int pin, unsigned int value);
5819 
5839 canStatus CANLIBAPI kvIoPinGetOutputRelay (const CanHandle hnd, unsigned int pin, unsigned int *value);
5840 
5858 canStatus CANLIBAPI kvIoPinSetAnalog (const CanHandle hnd, unsigned int pin, float value);
5859 
5877 canStatus CANLIBAPI kvIoPinGetAnalog (const CanHandle hnd, unsigned int pin, float* value);
5878 
5898 canStatus CANLIBAPI kvIoPinGetOutputAnalog (const CanHandle hnd, unsigned int pin, float* value);
5899 
5905 typedef struct {
5906  int type;
5907  unsigned char DO1 : 1;
5908  unsigned char DO2 : 1;
5909  unsigned char DO3 : 1;
5910  unsigned char DO4 : 1;
5911  unsigned char DO5 : 1;
5912  unsigned char DO6 : 1;
5913  unsigned char DO7 : 1;
5914  unsigned char DO8 : 1;
5915  unsigned char DO9 : 1;
5916  unsigned char DO10: 1;
5917  unsigned char DO11: 1;
5918  unsigned char DO12: 1;
5919  unsigned char DO13: 1;
5920  unsigned char DO14: 1;
5921  unsigned char DO15: 1;
5922  unsigned char DO16: 1;
5923  unsigned char DI1 : 1;
5924  unsigned char DI2 : 1;
5925  unsigned char DI3 : 1;
5926  unsigned char DI4 : 1;
5927  unsigned char DI5 : 1;
5928  unsigned char DI6 : 1;
5929  unsigned char DI7 : 1;
5930  unsigned char DI8 : 1;
5931  unsigned char DI9 : 1;
5932  unsigned char DI10: 1;
5933  unsigned char DI11: 1;
5934  unsigned char DI12: 1;
5935  unsigned char DI13: 1;
5936  unsigned char DI14: 1;
5937  unsigned char DI15: 1;
5938  unsigned char DI16: 1;
5940 
5941 
5947 typedef struct {
5948  int type;
5949  unsigned char DO: 1;
5950  unsigned char DI: 1;
5952 
5953 
5960 typedef struct {
5961  int type;
5962  unsigned char RO1 : 1;
5963  unsigned char RO2 : 1;
5964  unsigned char RO3 : 1;
5965  unsigned char RO4 : 1;
5966  unsigned char RO5 : 1;
5967  unsigned char RO6 : 1;
5968  unsigned char RO7 : 1;
5969  unsigned char RO8 : 1;
5970  unsigned char DI1 : 1;
5971  unsigned char DI2 : 1;
5972  unsigned char DI3 : 1;
5973  unsigned char DI4 : 1;
5974  unsigned char DI5 : 1;
5975  unsigned char DI6 : 1;
5976  unsigned char DI7 : 1;
5977  unsigned char DI8 : 1;
5978 } kvIoModuleRelay;
5979 
5986 typedef struct {
5987  int type;
5988  float AO1;
5989  float AO2;
5990  float AO3;
5991  float AO4;
5992  float AI1;
5993  float AI2;
5994  float AI3;
5995  float AI4;
5997 
5998 
6021 canStatus CANLIBAPI kvIoGetModulePins (const CanHandle hnd, unsigned int module, void *buffer, const unsigned int bufsize);
6022 
6023 
6047 canStatus CANLIBAPI kvIoSetModulePins (const CanHandle hnd, unsigned int module, const void *buffer, const unsigned int bufsize);
6048 
6049 
6050 #ifdef __cplusplus
6051 }
6052 #endif /* __cplusplus */
6053 
6054 #include "obsolete.h"
6055 
6056 
6057 
6058 
6059 #endif /* _CANLIB_H_ */
struct kvClockInfo kvClockInfo
Definitions which are retained for compatibility.
unsigned char DI10
Definition: canlib.h:5932
kvStatus kvScriptEnvvarGetFloat(kvEnvHandle eHnd, float *val)
unsigned long stdRemote
Number of received standard (11-bit identifiers) remote frames.
Definition: canlib.h:3917
unsigned char DI5
Definition: canlib.h:5927
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:179
unsigned char DI12
Definition: canlib.h:5934
unsigned char RO3
Definition: canlib.h:5964
canStatus canGetBusOutputControl(const CanHandle hnd, unsigned int *drivertype)
kvStatus kvTimeDomainDelete(kvTimeDomain domain)
float AI2
Definition: canlib.h:5993
unsigned char DI8
Definition: canlib.h:5930
canStatus canGetDriverMode(const CanHandle hnd, int *lineMode, int *resNet)
struct canNotifyData::@0::@2 rx
unsigned char DO15
Definition: canlib.h:5921
void canInitializeLibrary(void)
canStatus canGetBusParamsFdTq(const CanHandle hnd, kvBusParamsTq *nominal, kvBusParamsTq *data)
canStatus kvIoPinGetInfo(const CanHandle hnd, unsigned int pin, int item, void *buffer, const unsigned int bufsize)
unsigned char DO8
Definition: canlib.h:5914
int brp_size
Definition: canlib.h:2340
canStatus canReadStatus(const CanHandle hnd, unsigned long *const flags)
kvStatus kvTimeDomainCreate(kvTimeDomain *domain)
unsigned char DI9
Definition: canlib.h:5931
unsigned int portNo
Port number used in e.g. canIOCTL_SET_USER_IOPORT.
Definition: canlib.h:3080
int64_t kvEnvHandle
Definition: canlib.h:4455
int accuracy_ppm
Definition: canlib.h:2328
int nNonMagiSyncCards
number of non MagiSync™ interfaces
Definition: canlib.h:3996
unsigned char RO2
Definition: canlib.h:5963
canStatus kvIoGetNumberOfPins(const CanHandle hnd, unsigned int *pinCount)
canStatus canRequestBusStatistics(const CanHandle hnd)
kvStatus kvDeviceSetMode(const CanHandle hnd, int mode)
void * kvTimeDomain
Definition: canlib.h:3984
unsigned char DI7
Definition: canlib.h:5929
unsigned char DO
Definition: canlib.h:5949
unsigned char rxErrorCounter
Definition: canlib.h:181
unsigned char DO2
Definition: canlib.h:5908
unsigned long extRemote
Number of received extended (29-bit identifiers) remote frames.
Definition: canlib.h:3919
canStatus canClose(const CanHandle hnd)
unsigned char RO5
Definition: canlib.h:5966
int power_of_ten
Definition: canlib.h:2327
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:5987
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:5935
int canHandle
Definition: canlib.h:156
unsigned char DI14
Definition: canlib.h:5936
unsigned char DI1
Definition: canlib.h:5970
canStatus canObjBufDisable(const CanHandle hnd, int idx)
void * tag
Definition: canlib.h:164
unsigned char RO4
Definition: canlib.h:5965
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:5994
int seg1_size
Definition: canlib.h:2341
kvStatus kvScriptEnvvarGetInt(kvEnvHandle eHnd, int *val)
Definitions for the CANLIB API.
kvStatus kvScriptGetMaxEnvvarSize(int hnd, int *envvarSize)
Definition: canlib.h:5960
Definition: canlib.h:5905
canStatus kvIoPinSetInfo(const CanHandle hnd, unsigned int pin, int item, const void *buffer, const unsigned int bufsize)
Definition: canlib.h:5986
canStatus canSetBusOutputControl(const CanHandle hnd, const unsigned int drivertype)
int type
Definition: canlib.h:5961
Definition: canlib.h:2338
int type
Definition: canlib.h:5906
int eventType
Definition: canlib.h:165
float AO3
Definition: canlib.h:5990
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:5948
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:5969
canStatus canBusOn(const CanHandle hnd)
Definition: canlib.h:5947
long id
Definition: canlib.h:171
unsigned char DI
Definition: canlib.h:5950
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:5972
canStatus canObjBufWrite(const CanHandle hnd, int idx, int id, void *msg, unsigned int dlc, unsigned int flags)
kvEnvHandle kvScriptEnvvarOpen(const CanHandle hnd, const char *envvarName, int *envvarType, int *envvarSize)
Definition: canlib.h:163
struct kvTimeDomainData_s kvTimeDomainData
kvStatus kvScriptTxeGetData(const char *filePathOnPC, int item, void *buffer, unsigned int *bufsize)
kvStatus kvScriptEnvvarClose(kvEnvHandle eHnd)
Definition: canlib.h:2323
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:5995
unsigned int portValue
Port value used in e.g. canIOCTL_SET_USER_IOPORT.
Definition: canlib.h:3081
unsigned short canGetVersion(void)
unsigned char DI1
Definition: canlib.h:5923
unsigned char DI2
Definition: canlib.h:5924
unsigned long errFrame
Number of error frames.
Definition: canlib.h:3920
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:5991
canStatus canFlushTransmitQueue(const CanHandle hnd)
kvStatus kvReadTimer64(const CanHandle hnd, uint64_t *time)
unsigned char DO10
Definition: canlib.h:5916
kvStatus kvFileGetName(const CanHandle hnd, int fileNo, char *name, int namelen)
kvStatus kvTimeDomainResetTime(kvTimeDomain domain)
unsigned char DO3
Definition: canlib.h:5909
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:3918
float AO1
Definition: canlib.h:5988
Definition: bus_params_tq.h:104
kvStatus kvReadTimer(const CanHandle hnd, unsigned int *time)
canStatus canObjBufEnable(const CanHandle hnd, int idx)
int denominator
Definition: canlib.h:2326
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:5922
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:5910
unsigned char DI8
Definition: canlib.h:5977
unsigned char DI6
Definition: canlib.h:5928
canStatus canSetNotify(const CanHandle hnd, void(*callback)(canNotifyData *), unsigned int notifyFlags, void *tag)
unsigned char txErrorCounter
Definition: canlib.h:180
canStatus kvIoPinGetAnalog(const CanHandle hnd, unsigned int pin, float *value)
unsigned char DO1
Definition: canlib.h:5907
canStatus canSetBusParamsFdTq(const CanHandle hnd, const kvBusParamsTq arbitration, const kvBusParamsTq data)
canStatus canObjBufSetFlags(const CanHandle hnd, int idx, unsigned int flags)
unsigned char RO7
Definition: canlib.h:5968
unsigned char RO1
Definition: canlib.h:5962
unsigned char DI16
Definition: canlib.h:5938
unsigned char DI5
Definition: canlib.h:5974
void(* kvCallback_t)(CanHandle hnd, void *context, unsigned int notifyEvent)
Definition: canlib.h:4170
canStatus canSetBusParamsC200(const CanHandle hnd, unsigned char btr0, unsigned char btr1)
int nMagiSyncGroups
number of MagiSync™ groups
Definition: canlib.h:3994
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:5933
struct kvBusParamLimits kvBusParamLimits
kvStatus kvDeviceGetMode(const CanHandle hnd, int *result)
canStatus kvIoPinGetOutputDigital(const CanHandle hnd, unsigned int pin, unsigned int *value)
unsigned char RO6
Definition: canlib.h:5967
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:3916
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:3927
kvStatus kvTimeDomainAddHandle(kvTimeDomain domain, const CanHandle hnd)
Definitions for the CANLIB API.
Definition: canlib.h:3993
unsigned char DI3
Definition: canlib.h:5925
canStatus canReadTimer(const CanHandle hnd, unsigned long *time)
unsigned char DO7
Definition: canlib.h:5913
canStatus kvIoPinSetDigital(const CanHandle hnd, unsigned int pin, unsigned int value)
unsigned char DI4
Definition: canlib.h:5926
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:5992
canStatus canGetErrorText(canStatus err, char *buf, unsigned int bufsiz)
unsigned long busLoad
Definition: canlib.h:3926
unsigned char DI7
Definition: canlib.h:5976
unsigned char DO13
Definition: canlib.h:5919
canStatus canRequestChipStatus(const CanHandle hnd)
int version
Definition: canlib.h:2324
Definition: canlib.h:3915
int sjw_size
Definition: canlib.h:2343
canStatus canEnumHardwareEx(int *channelCount)
unsigned char DI4
Definition: canlib.h:5973
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:161
kvStatus kvScriptEnvvarSetData(kvEnvHandle eHnd, const void *buf, int start_index, int data_len)
canStatus kvStatus
Definition: canlib.h:3987
Definition: canlib.h:3079
union canNotifyData::@0 info
canStatus canResetBus(const CanHandle hnd)
canStatus canObjBufAllocate(const CanHandle hnd, int type)
unsigned char DI2
Definition: canlib.h:5971
int nNonMagiSyncedMembers
number of non MagiSync™ members
Definition: canlib.h:3997
canStatus canSetBusParamsTq(const CanHandle hnd, const kvBusParamsTq nominal)
unsigned char DO6
Definition: canlib.h:5912
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:5915
unsigned char DO14
Definition: canlib.h:5920
unsigned long time
Definition: canlib.h:168
canStatus canGetBusParamsTq(const CanHandle hnd, kvBusParamsTq *nominal)
unsigned char DO5
Definition: canlib.h:5911
kvStatus kvFileCopyToDevice(const CanHandle hnd, char *hostFileName, char *deviceFileName)
canStatus canReadSync(const CanHandle hnd, unsigned long timeout)
float AO2
Definition: canlib.h:5989
int version
Definition: canlib.h:2339
int numerator
Definition: canlib.h:2325
kvStatus kvScriptUnload(const CanHandle hnd, int slotNo)
canStatus canObjBufSetPeriod(const CanHandle hnd, int idx, unsigned int period)
unsigned char DI6
Definition: canlib.h:5975
canStatus canObjBufFreeAll(const CanHandle hnd)
canStatus canIoCtl(const CanHandle hnd, unsigned int func, void *buf, unsigned int buflen)
unsigned char DI15
Definition: canlib.h:5937
struct canNotifyData::@0::@4 status
int seg2_size
Definition: canlib.h:2342
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:5917
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:3995
unsigned char DO12
Definition: canlib.h:5918