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
84 #ifndef KVLCLIB_H
85 #define KVLCLIB_H
86
87 #include <stdint.h>
88 #include <stddef.h>
89 #define WINAPI
90
91 #include "kvaDbLib.h"
92
93 #ifdef __cplusplus
94 extern "C" {
95 #endif // __cplusplus
96
97
102 typedef int KvlcStatus;
103 typedef void *KvlcHandle;
104 typedef uint64_t time_uint64;
105 typedef int64_t time_int64;
117 #define kvlcOK ((KvlcStatus) 0)
118 #define kvlcFail ((KvlcStatus)-1)
119 #define kvlcERR_PARAM ((KvlcStatus)-2)
120 #define kvlcEOF ((KvlcStatus)-3)
121 #define kvlcERR_NOT_IMPLEMENTED ((KvlcStatus)-4)
122 #define kvlcERR_FILE_ERROR ((KvlcStatus)-5)
123 #define kvlcERR_FILE_EXISTS ((KvlcStatus)-6)
124 #define kvlcERR_INTERNAL_ERROR ((KvlcStatus)-7)
125 #define kvlcERR_NULL_POINTER ((KvlcStatus)-8)
126 #define kvlcERR_FILE_TOO_LARGE ((KvlcStatus)-10)
127 #define kvlcERR_TYPE_MISMATCH ((KvlcStatus)-11)
128 #define kvlcERR_NO_FREE_HANDLES ((KvlcStatus)-12)
129 #define kvlcERR_NO_INPUT_SELECTED ((KvlcStatus)-13)
130 #define kvlcERR_CONVERTING ((KvlcStatus)-14)
131 #define kvlcERR_BUFFER_SIZE ((KvlcStatus)-15)
132
133 #define kvlcERR_INVALID_LOG_EVENT ((KvlcStatus)-30)
134 #define kvlcERR_NO_TIME_REFERENCE ((KvlcStatus)-31)
135 #define kvlcERR_TIME_DECREASING ((KvlcStatus)-32)
136 #define kvlcERR_MIXED_ENDIANNESS ((KvlcStatus)-33)
137
138
151 #define KVLC_FILE_FORMAT_KME24 1
152 #define KVLC_FILE_FORMAT_KME25 2
153 #define KVLC_FILE_FORMAT_VECTOR_ASC 3
154 #define KVLC_FILE_FORMAT_CSV 4
155 #define KVLC_FILE_FORMAT_PLAIN_ASC 5
156 #define KVLC_FILE_FORMAT_MEMO_LOG 6
157 #define KVLC_FILE_FORMAT_KME40 7
158 #define KVLC_FILE_FORMAT_VECTOR_BLF 8
159 #define KVLC_FILE_FORMAT_KME50 9
160
161 #define KVLC_FILE_FORMAT_CSV_SIGNAL 100
162 #define KVLC_FILE_FORMAT_MDF 101
163 #define KVLC_FILE_FORMAT_MATLAB 102
164 #define KVLC_FILE_FORMAT_J1587 103
165 #define KVLC_FILE_FORMAT_J1587_ALT 104
166 #define KVLC_FILE_FORMAT_FAMOS 105
167 #define KVLC_FILE_FORMAT_MDF_SIGNAL 106
168 #define KVLC_FILE_FORMAT_MDF_4X 107
169 #define KVLC_FILE_FORMAT_MDF_4X_SIGNAL 108
170
171 #define KVLC_FILE_FORMAT_XCP 200
172 #define KVLC_FILE_FORMAT_FAMOS_XCP 201
173
174 #define KVLC_FILE_FORMAT_DEBUG 1000
175
189 #define KVLC_PROPERTY_START_OF_MEASUREMENT 1
190 #define KVLC_PROPERTY_FIRST_TRIGGER 2
191 #define KVLC_PROPERTY_USE_OFFSET 3
192 #define KVLC_PROPERTY_OFFSET 4
193 #define KVLC_PROPERTY_CHANNEL_MASK 5
194
195 #define KVLC_PROPERTY_HLP_J1939 6
196 #define KVLC_PROPERTY_CALENDAR_TIME_STAMPS 7
197 #define KVLC_PROPERTY_WRITE_HEADER 8
198 #define KVLC_PROPERTY_SEPARATOR_CHAR 9
199 #define KVLC_PROPERTY_DECIMAL_CHAR 10
200
201 #define KVLC_PROPERTY_ID_IN_HEX 11
202 #define KVLC_PROPERTY_DATA_IN_HEX 12
203 #define KVLC_PROPERTY_NUMBER_OF_TIME_DECIMALS 13
204 #define KVLC_PROPERTY_NAME_MANGLING 14
205 #define KVLC_PROPERTY_FILL_BLANKS 15
206
207 #define KVLC_PROPERTY_SHOW_UNITS 16
208 #define KVLC_PROPERTY_ISO8601_DECIMALS 17
209 #define KVLC_PROPERTY_MERGE_LINES 18
210 #define KVLC_PROPERTY_RESAMPLE_COLUMN 19
211 #define KVLC_PROPERTY_VERSION 20
212
213 #define KVLC_PROPERTY_SHOW_COUNTER 21
214 #define KVLC_PROPERTY_CROP_PRETRIGGER 22
215 #define KVLC_PROPERTY_ENUM_VALUES 23
216 #define KVLC_PROPERTY_SIZE_LIMIT 24
217 #define KVLC_PROPERTY_TIME_LIMIT 25
218
219 #define KVLC_PROPERTY_LIMIT_DATA_BYTES 26
220 #define KVLC_PROPERTY_CREATION_DATE 27
221 #define KVLC_PROPERTY_OVERWRITE 28
222 #define KVLC_PROPERTY_TIMEZONE 29
223
224 #define KVLC_PROPERTY_FULLY_QUALIFIED_NAMES 30
225
226 #define KVLC_PROPERTY_NUMBER_OF_DATA_DECIMALS 31
227
228 #define KVLC_PROPERTY_SIGNAL_BASED 1001
229 #define KVLC_PROPERTY_SHOW_SIGNAL_SELECT 1002
230 #define KVLC_PROPERTY_ATTACHMENTS 1003
231
232
252 KvlcStatus WINAPI kvlcGetErrorText(KvlcStatus error, char *buffer, unsigned int buffer_size);
253
254
271 KvlcStatus WINAPI kvlcGetVersion(unsigned int *major, unsigned int *minor, unsigned int *build);
272
292 KvlcStatus WINAPI kvlcCreateConverter(KvlcHandle *handle, const char *filename, int format);
293
309 KvlcStatus WINAPI kvlcDeleteConverter(KvlcHandle handle);
310
327 KvlcStatus WINAPI kvlcEventCount(KvlcHandle handle, unsigned int *count);
328
343 KvlcStatus WINAPI kvlcConvertEvent(KvlcHandle handle);
344
345
364 KvlcStatus WINAPI kvlcSetInputFile(KvlcHandle handle, const char *filename, int format);
365
366
387 KvlcStatus WINAPI kvlcNextInputFile(KvlcHandle handle, const char *filename);
388
408 KvlcStatus WINAPI kvlcFeedSelectFormat(KvlcHandle handle, int format);
409
430 KvlcStatus WINAPI kvlcFeedLogEvent(KvlcHandle handle, void *event);
431
451 KvlcStatus WINAPI kvlcFeedNextFile(KvlcHandle handle);
452
470 KvlcStatus WINAPI kvlcIsOutputFilenameNew(KvlcHandle handle, int *updated);
471
472
494 KvlcStatus WINAPI kvlcGetOutputFilename(KvlcHandle handle, char *filename, int len);
495
522 KvlcStatus WINAPI kvlcGetWriterPropertyDefault(int format, unsigned int property, void *buf, unsigned int len);
523
550 KvlcStatus WINAPI kvlcSetProperty(KvlcHandle handle, unsigned int property, void *buf, unsigned int len);
551
552
579 KvlcStatus WINAPI kvlcGetProperty(KvlcHandle handle, unsigned int property, void *buf, unsigned int len);
580
581
602 KvlcStatus WINAPI kvlcIsOverrunActive(KvlcHandle handle, int *overrun);
603
619 KvlcStatus WINAPI kvlcResetOverrunActive(KvlcHandle handle);
620
644 KvlcStatus WINAPI kvlcIsDataTruncated (KvlcHandle handle, int *truncated);
645
661 KvlcStatus WINAPI kvlcResetDataTruncated (KvlcHandle handle);
662
683 KvlcStatus WINAPI kvlcAttachFile(KvlcHandle handle, const char *filename);
684
685
701 KvlcStatus WINAPI kvlcGetFirstWriterFormat(int *format);
702
703
721 KvlcStatus WINAPI kvlcGetNextWriterFormat(int currentFormat, int *nextFormat);
722
723
739 KvlcStatus WINAPI kvlcGetFirstReaderFormat(int *format);
740
741
759 KvlcStatus WINAPI kvlcGetNextReaderFormat(int currentFormat, int *nextFormat);
760
761
780 KvlcStatus WINAPI kvlcGetReaderName(int format, char *str, unsigned int len);
781
782
801 KvlcStatus WINAPI kvlcGetReaderExtension(int format, char *str, unsigned int len);
802
803
822 KvlcStatus WINAPI kvlcGetReaderDescription(int format, char *str, unsigned int len);
823
824
851 KvlcStatus WINAPI kvlcGetReaderPropertyDefault(int format, unsigned int property, void *buf, unsigned int len);
852
853
872 KvlcStatus WINAPI kvlcGetWriterName(int format, char *str, unsigned int len);
873
874
893 KvlcStatus WINAPI kvlcGetWriterExtension(int format, char *str, unsigned int len);
894
895
914 KvlcStatus WINAPI kvlcGetWriterDescription(int format, char *str, unsigned int len);
915
916
934 KvlcStatus WINAPI kvlcIsPropertySupported(int format, unsigned int property, int *supported);
935
958 KvlcStatus WINAPI kvlcAddDatabaseFile(KvlcHandle handle, const char *filename, unsigned int channelMask);
959
981 KvlcStatus WINAPI kvlcAddDatabase(KvlcHandle handle, KvaDbHnd dbHandle, unsigned int channelMask);
982
1009 #ifdef __cplusplus
1010 };
1011 #endif
1012
1013 #endif // KVLCLIB_H
kvlcFeedNextFile
KvlcStatus kvlcFeedNextFile(KvlcHandle handle)
kvlcAttachFile
KvlcStatus kvlcAttachFile(KvlcHandle handle, const char *filename)
kvlcGetWriterExtension
KvlcStatus kvlcGetWriterExtension(int format, char *str, unsigned int len)
kvaDbLib.h
Definitions for the Database API.
KvaDbHnd
void * KvaDbHnd
Database handle.
Definition: kvaDbLib.h:246
kvlcDeleteConverter
KvlcStatus kvlcDeleteConverter(KvlcHandle handle)
kvlcGetWriterPropertyDefault
KvlcStatus kvlcGetWriterPropertyDefault(int format, unsigned int property, void *buf, unsigned int len)
kvlcGetWriterName
KvlcStatus kvlcGetWriterName(int format, char *str, unsigned int len)
kvlcGetReaderExtension
KvlcStatus kvlcGetReaderExtension(int format, char *str, unsigned int len)
KvlcHandle
void * KvlcHandle
Definition: kvlclib.h:103
kvlcConvertEvent
KvlcStatus kvlcConvertEvent(KvlcHandle handle)
kvlcAddDatabase
KvlcStatus kvlcAddDatabase(KvlcHandle handle, KvaDbHnd dbHandle, unsigned int channelMask)
kvlcResetDataTruncated
KvlcStatus kvlcResetDataTruncated(KvlcHandle handle)
kvlcGetFirstWriterFormat
KvlcStatus kvlcGetFirstWriterFormat(int *format)
kvlcEventCount
KvlcStatus kvlcEventCount(KvlcHandle handle, unsigned int *count)
kvlcGetNextReaderFormat
KvlcStatus kvlcGetNextReaderFormat(int currentFormat, int *nextFormat)
time_int64
int64_t time_int64
Definition: kvlclib.h:105
kvlcIsDataTruncated
KvlcStatus kvlcIsDataTruncated(KvlcHandle handle, int *truncated)
kvlcFeedSelectFormat
KvlcStatus kvlcFeedSelectFormat(KvlcHandle handle, int format)
WINAPI
#define WINAPI
Definition: kvlclib.h:89
kvlcGetProperty
KvlcStatus kvlcGetProperty(KvlcHandle handle, unsigned int property, void *buf, unsigned int len)
kvlcSetProperty
KvlcStatus kvlcSetProperty(KvlcHandle handle, unsigned int property, void *buf, unsigned int len)
kvlcCreateConverter
KvlcStatus kvlcCreateConverter(KvlcHandle *handle, const char *filename, int format)
kvlcNextInputFile
KvlcStatus kvlcNextInputFile(KvlcHandle handle, const char *filename)
KvlcStatus
int KvlcStatus
Definition: kvlclib.h:102
kvlcIsOutputFilenameNew
KvlcStatus kvlcIsOutputFilenameNew(KvlcHandle handle, int *updated)
kvlcGetReaderName
KvlcStatus kvlcGetReaderName(int format, char *str, unsigned int len)
kvlcGetReaderPropertyDefault
KvlcStatus kvlcGetReaderPropertyDefault(int format, unsigned int property, void *buf, unsigned int len)
kvlcGetFirstReaderFormat
KvlcStatus kvlcGetFirstReaderFormat(int *format)
kvlcIsPropertySupported
KvlcStatus kvlcIsPropertySupported(int format, unsigned int property, int *supported)
kvlcGetErrorText
KvlcStatus kvlcGetErrorText(KvlcStatus error, char *buffer, unsigned int buffer_size)
kvlcGetNextWriterFormat
KvlcStatus kvlcGetNextWriterFormat(int currentFormat, int *nextFormat)
kvlcResetOverrunActive
KvlcStatus kvlcResetOverrunActive(KvlcHandle handle)
time_uint64
uint64_t time_uint64
Definition: kvlclib.h:104
kvlcGetVersion
KvlcStatus kvlcGetVersion(unsigned int *major, unsigned int *minor, unsigned int *build)
kvlcFeedLogEvent
KvlcStatus kvlcFeedLogEvent(KvlcHandle handle, void *event)
kvlcGetReaderDescription
KvlcStatus kvlcGetReaderDescription(int format, char *str, unsigned int len)
kvlcIsOverrunActive
KvlcStatus kvlcIsOverrunActive(KvlcHandle handle, int *overrun)
kvlcSetInputFile
KvlcStatus kvlcSetInputFile(KvlcHandle handle, const char *filename, int format)
kvlcGetWriterDescription
KvlcStatus kvlcGetWriterDescription(int format, char *str, unsigned int len)
kvlcAddDatabaseFile
KvlcStatus kvlcAddDatabaseFile(KvlcHandle handle, const char *filename, unsigned int channelMask)
kvlcGetOutputFilename
KvlcStatus kvlcGetOutputFilename(KvlcHandle handle, char *filename, int len)