kvlclib.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 
100 #ifndef KVLCLIB_H
101 #define KVLCLIB_H
102 
103 #include <stdint.h>
104 #include <stddef.h>
105 #define WINAPI
106 
107 #include "kvaDbLib.h"
108 
109 #ifdef __cplusplus
110 extern "C" {
111 #endif // __cplusplus
112 
113 
118 typedef int KvlcStatus;
119 typedef void *KvlcHandle;
120 typedef uint64_t time_uint64;
121 typedef int64_t time_int64;
122 typedef int64_t int64;
123 typedef uint64_t uint64;
135 #define kvlcOK ((KvlcStatus) 0)
136 #define kvlcFail ((KvlcStatus)-1)
137 #define kvlcERR_PARAM ((KvlcStatus)-2)
138 #define kvlcEOF ((KvlcStatus)-3)
139 #define kvlcERR_NOT_IMPLEMENTED ((KvlcStatus)-4)
140 #define kvlcERR_FILE_ERROR ((KvlcStatus)-5)
141 #define kvlcERR_FILE_EXISTS ((KvlcStatus)-6)
142 #define kvlcERR_INTERNAL_ERROR ((KvlcStatus)-7)
143 #define kvlcERR_NULL_POINTER ((KvlcStatus)-8)
144 #define kvlcERR_FILE_TOO_LARGE ((KvlcStatus)-10)
145 #define kvlcERR_TYPE_MISMATCH ((KvlcStatus)-11)
146 #define kvlcERR_NO_FREE_HANDLES ((KvlcStatus)-12)
147 #define kvlcERR_NO_INPUT_SELECTED ((KvlcStatus)-13)
148 #define kvlcERR_CONVERTING ((KvlcStatus)-14)
149 #define kvlcERR_BUFFER_SIZE ((KvlcStatus)-15)
150 
151 #define kvlcERR_INVALID_LOG_EVENT ((KvlcStatus)-30)
152 #define kvlcERR_NO_TIME_REFERENCE ((KvlcStatus)-31)
153 #define kvlcERR_TIME_DECREASING ((KvlcStatus)-32)
154 #define kvlcERR_MIXED_ENDIANNESS ((KvlcStatus)-33)
155 #define kvlcERR_RESULT_TOO_BIG ((KvlcStatus)-34)
156 #define kvlcERR_UNSUPPORTED_VERSION ((KvlcStatus)-35)
157 
158 
171 #define KVLC_FILE_FORMAT_KME24 1
172 #define KVLC_FILE_FORMAT_KME25 2
173 #define KVLC_FILE_FORMAT_VECTOR_ASC 3
174 #define KVLC_FILE_FORMAT_CSV 4
175 #define KVLC_FILE_FORMAT_PLAIN_ASC 5
176 #define KVLC_FILE_FORMAT_MEMO_LOG 6
177 #define KVLC_FILE_FORMAT_KME40 7
178 #define KVLC_FILE_FORMAT_VECTOR_BLF 8
179 #define KVLC_FILE_FORMAT_KME50 9
180 #define KVLC_FILE_FORMAT_KME60 10
181 
182 #define KVLC_FILE_FORMAT_CSV_SIGNAL 100
183 #define KVLC_FILE_FORMAT_MDF 101
184 #define KVLC_FILE_FORMAT_MATLAB 102
185 #define KVLC_FILE_FORMAT_J1587 103
186 #define KVLC_FILE_FORMAT_J1587_ALT 104
187 #define KVLC_FILE_FORMAT_FAMOS 105
188 #define KVLC_FILE_FORMAT_MDF_SIGNAL 106
189 #define KVLC_FILE_FORMAT_MDF_4X 107
190 #define KVLC_FILE_FORMAT_MDF_4X_SIGNAL 108
191 #define KVLC_FILE_FORMAT_VECTOR_BLF_FD 109
192 #define KVLC_FILE_FORMAT_DIADEM 110
193 #define KVLC_FILE_FORMAT_RPCIII 111
194 
195 #define KVLC_FILE_FORMAT_XCP 200
196 #define KVLC_FILE_FORMAT_FAMOS_XCP 201
197 
198 #define KVLC_FILE_FORMAT_DEBUG 1000
199 
217 #define KVLC_PROPERTY_START_OF_MEASUREMENT 1
218 
224 #define KVLC_PROPERTY_FIRST_TRIGGER 2
225 
231 #define KVLC_PROPERTY_USE_OFFSET 3
232 
237 #define KVLC_PROPERTY_OFFSET 4
238 
243 #define KVLC_PROPERTY_CHANNEL_MASK 5
244 
245 #define KVLC_PROPERTY_HLP_J1939 6
246 #define KVLC_PROPERTY_CALENDAR_TIME_STAMPS 7
247 #define KVLC_PROPERTY_WRITE_HEADER 8
248 #define KVLC_PROPERTY_SEPARATOR_CHAR 9
249 #define KVLC_PROPERTY_DECIMAL_CHAR 10
250 
251 #define KVLC_PROPERTY_ID_IN_HEX 11
252 #define KVLC_PROPERTY_DATA_IN_HEX 12
253 #define KVLC_PROPERTY_NUMBER_OF_TIME_DECIMALS 13
254 #define KVLC_PROPERTY_NAME_MANGLING 14
255 #define KVLC_PROPERTY_FILL_BLANKS 15
256 
257 #define KVLC_PROPERTY_SHOW_UNITS 16
258 #define KVLC_PROPERTY_ISO8601_DECIMALS 17
259 #define KVLC_PROPERTY_MERGE_LINES 18
260 #define KVLC_PROPERTY_RESAMPLE_COLUMN 19
261 #define KVLC_PROPERTY_VERSION 20
262 
263 #define KVLC_PROPERTY_SHOW_COUNTER 21
264 
269 #define KVLC_PROPERTY_CROP_PRETRIGGER 22
270 #define KVLC_PROPERTY_ENUM_VALUES 23
271 #define KVLC_PROPERTY_SIZE_LIMIT 24
272 
273 
278 #define KVLC_PROPERTY_TIME_LIMIT 25
279 
285 #define KVLC_PROPERTY_LIMIT_DATA_BYTES 26
286 #define KVLC_PROPERTY_CREATION_DATE 27
287 
288 
293 #define KVLC_PROPERTY_OVERWRITE 28
294 #define KVLC_PROPERTY_TIMEZONE 29
295 
296 
301 #define KVLC_PROPERTY_FULLY_QUALIFIED_NAMES 30
302 
303 #define KVLC_PROPERTY_NUMBER_OF_DATA_DECIMALS 31
304 
305 
317 #define KVLC_PROPERTY_COMPRESSION_LEVEL 32
318 
326 #define KVLC_PROPERTY_SAMPLE_AND_HOLD_TIMESTEP 33
327 
331 #define KVLC_PROPERTY_SIGNAL_BASED 1001
332 
336 #define KVLC_PROPERTY_SHOW_SIGNAL_SELECT 1002
337 
341 #define KVLC_PROPERTY_ATTACHMENTS 1003
342 
363 KvlcStatus WINAPI kvlcGetErrorText(KvlcStatus error, char *buffer, unsigned int buffer_size);
364 
365 
382 KvlcStatus WINAPI kvlcGetVersion(unsigned int *major, unsigned int *minor, unsigned int *build);
383 
403 KvlcStatus WINAPI kvlcCreateConverter(KvlcHandle *handle, const char *filename, int format);
404 
420 KvlcStatus WINAPI kvlcDeleteConverter(KvlcHandle handle);
421 
443 KvlcStatus WINAPI kvlcEventCount(KvlcHandle handle, unsigned int *count);
444 
461 KvlcStatus WINAPI kvlcEventCountEx(KvlcHandle handle, int64 *count);
462 
477 KvlcStatus WINAPI kvlcConvertEvent(KvlcHandle handle);
478 
479 
498 KvlcStatus WINAPI kvlcSetInputFile(KvlcHandle handle, const char *filename, int format);
499 
500 
521 KvlcStatus WINAPI kvlcNextInputFile(KvlcHandle handle, const char *filename);
522 
542 KvlcStatus WINAPI kvlcFeedSelectFormat(KvlcHandle handle, int format);
543 
564 KvlcStatus WINAPI kvlcFeedLogEvent(KvlcHandle handle, void *event);
565 
585 KvlcStatus WINAPI kvlcFeedNextFile(KvlcHandle handle);
586 
604 KvlcStatus WINAPI kvlcIsOutputFilenameNew(KvlcHandle handle, int *updated);
605 
606 
628 KvlcStatus WINAPI kvlcGetOutputFilename(KvlcHandle handle, char *filename, int len);
629 
655 KvlcStatus WINAPI kvlcGetWriterPropertyDefault(int format, unsigned int property, void *buf, unsigned int len);
656 
679 KvlcStatus WINAPI kvlcSetProperty(KvlcHandle handle, unsigned int property, void *buf, unsigned int len);
680 
681 
704 KvlcStatus WINAPI kvlcGetProperty(KvlcHandle handle, unsigned int property, void *buf, unsigned int len);
705 
706 
727 KvlcStatus WINAPI kvlcIsOverrunActive(KvlcHandle handle, int *overrun);
728 
744 KvlcStatus WINAPI kvlcResetOverrunActive(KvlcHandle handle);
745 
769 KvlcStatus WINAPI kvlcIsDataTruncated (KvlcHandle handle, int *truncated);
770 
786 KvlcStatus WINAPI kvlcResetDataTruncated (KvlcHandle handle);
787 
808 KvlcStatus WINAPI kvlcAttachFile(KvlcHandle handle, const char *filename);
809 
810 
826 KvlcStatus WINAPI kvlcGetFirstWriterFormat(int *format);
827 
828 
846 KvlcStatus WINAPI kvlcGetNextWriterFormat(int currentFormat, int *nextFormat);
847 
848 
864 KvlcStatus WINAPI kvlcGetFirstReaderFormat(int *format);
865 
866 
884 KvlcStatus WINAPI kvlcGetNextReaderFormat(int currentFormat, int *nextFormat);
885 
886 
905 KvlcStatus WINAPI kvlcGetReaderName(int format, char *str, unsigned int len);
906 
907 
926 KvlcStatus WINAPI kvlcGetReaderExtension(int format, char *str, unsigned int len);
927 
928 
947 KvlcStatus WINAPI kvlcGetReaderDescription(int format, char *str, unsigned int len);
948 
949 
975 KvlcStatus WINAPI kvlcGetReaderPropertyDefault(int format, unsigned int property, void *buf, unsigned int len);
976 
977 
996 KvlcStatus WINAPI kvlcGetWriterName(int format, char *str, unsigned int len);
997 
998 
1017 KvlcStatus WINAPI kvlcGetWriterExtension(int format, char *str, unsigned int len);
1018 
1019 
1038 KvlcStatus WINAPI kvlcGetWriterDescription(int format, char *str, unsigned int len);
1039 
1040 
1058 KvlcStatus WINAPI kvlcIsPropertySupported(int format, unsigned int property, int *supported);
1059 
1082 KvlcStatus WINAPI kvlcAddDatabaseFile(KvlcHandle handle, const char *filename, unsigned int channelMask);
1083 
1105 KvlcStatus WINAPI kvlcAddDatabase(KvlcHandle handle, KvaDbHnd dbHandle, unsigned int channelMask);
1106 
1124 KvlcStatus WINAPI kvlcIsDlcMismatch(KvlcHandle handle, int* mismatch);
1125 
1142 KvlcStatus WINAPI kvlcResetDlcMismatch(KvlcHandle handle);
1143 
1162 KvlcStatus WINAPI kvlcGetDlcMismatchList(KvlcHandle handle, unsigned int* MsgIds, unsigned int* MsgDlc, unsigned int* MsgOccurance, unsigned int* length);
1163 
1164 #ifdef __cplusplus
1165 };
1166 #endif
1167 
1168 #endif // KVLCLIB_H
KvlcStatus kvlcFeedNextFile(KvlcHandle handle)
KvlcStatus kvlcAttachFile(KvlcHandle handle, const char *filename)
KvlcStatus kvlcGetWriterExtension(int format, char *str, unsigned int len)
KvlcStatus kvlcIsDlcMismatch(KvlcHandle handle, int *mismatch)
Definitions for the Database API.
void * KvaDbHnd
Database handle.
Definition: kvaDbLib.h:302
KvlcStatus kvlcDeleteConverter(KvlcHandle handle)
KvlcStatus kvlcGetWriterPropertyDefault(int format, unsigned int property, void *buf, unsigned int len)
KvlcStatus kvlcGetWriterName(int format, char *str, unsigned int len)
KvlcStatus kvlcGetDlcMismatchList(KvlcHandle handle, unsigned int *MsgIds, unsigned int *MsgDlc, unsigned int *MsgOccurance, unsigned int *length)
KvlcStatus kvlcGetReaderExtension(int format, char *str, unsigned int len)
void * KvlcHandle
Definition: kvlclib.h:119
uint64_t uint64
Definition: kvlclib.h:123
KvlcStatus kvlcConvertEvent(KvlcHandle handle)
KvlcStatus kvlcAddDatabase(KvlcHandle handle, KvaDbHnd dbHandle, unsigned int channelMask)
KvlcStatus kvlcResetDataTruncated(KvlcHandle handle)
KvlcStatus kvlcGetFirstWriterFormat(int *format)
KvlcStatus kvlcEventCount(KvlcHandle handle, unsigned int *count)
KvlcStatus kvlcGetNextReaderFormat(int currentFormat, int *nextFormat)
int64_t time_int64
Definition: kvlclib.h:121
KvlcStatus kvlcIsDataTruncated(KvlcHandle handle, int *truncated)
KvlcStatus kvlcFeedSelectFormat(KvlcHandle handle, int format)
#define WINAPI
Definition: kvlclib.h:105
KvlcStatus kvlcGetProperty(KvlcHandle handle, unsigned int property, void *buf, unsigned int len)
KvlcStatus kvlcSetProperty(KvlcHandle handle, unsigned int property, void *buf, unsigned int len)
KvlcStatus kvlcResetDlcMismatch(KvlcHandle handle)
KvlcStatus kvlcCreateConverter(KvlcHandle *handle, const char *filename, int format)
KvlcStatus kvlcNextInputFile(KvlcHandle handle, const char *filename)
int KvlcStatus
Definition: kvlclib.h:118
KvlcStatus kvlcIsOutputFilenameNew(KvlcHandle handle, int *updated)
KvlcStatus kvlcEventCountEx(KvlcHandle handle, int64 *count)
KvlcStatus kvlcGetReaderName(int format, char *str, unsigned int len)
KvlcStatus kvlcGetReaderPropertyDefault(int format, unsigned int property, void *buf, unsigned int len)
KvlcStatus kvlcGetFirstReaderFormat(int *format)
KvlcStatus kvlcIsPropertySupported(int format, unsigned int property, int *supported)
KvlcStatus kvlcGetErrorText(KvlcStatus error, char *buffer, unsigned int buffer_size)
KvlcStatus kvlcGetNextWriterFormat(int currentFormat, int *nextFormat)
int64_t int64
Definition: kvlclib.h:122
KvlcStatus kvlcResetOverrunActive(KvlcHandle handle)
uint64_t time_uint64
Definition: kvlclib.h:120
KvlcStatus kvlcGetVersion(unsigned int *major, unsigned int *minor, unsigned int *build)
KvlcStatus kvlcFeedLogEvent(KvlcHandle handle, void *event)
KvlcStatus kvlcGetReaderDescription(int format, char *str, unsigned int len)
KvlcStatus kvlcIsOverrunActive(KvlcHandle handle, int *overrun)
KvlcStatus kvlcSetInputFile(KvlcHandle handle, const char *filename, int format)
KvlcStatus kvlcGetWriterDescription(int format, char *str, unsigned int len)
KvlcStatus kvlcAddDatabaseFile(KvlcHandle handle, const char *filename, unsigned int channelMask)
KvlcStatus kvlcGetOutputFilename(KvlcHandle handle, char *filename, int len)