kvlclib.h File Reference

Library for converting Kvaser Memorator log files. More...

#include <stdint.h>
#include <stddef.h>
#include "kvaDbLib.h"

Go to the source code of this file.

Macros

#define WINAPI
 
KvlcStatus

Generally, a return code greater than or equal to zero means success. A value less than zero means failure.

#define kvlcOK   ((KvlcStatus) 0)
 OK. More...
 
#define kvlcFail   ((KvlcStatus)-1)
 Generic error. More...
 
#define kvlcERR_PARAM   ((KvlcStatus)-2)
 Error in supplied parameters. More...
 
#define kvlcEOF   ((KvlcStatus)-3)
 End of input file reached. More...
 
#define kvlcERR_NOT_IMPLEMENTED   ((KvlcStatus)-4)
 Not implemented. More...
 
#define kvlcERR_FILE_ERROR   ((KvlcStatus)-5)
 File I/O error. More...
 
#define kvlcERR_FILE_EXISTS   ((KvlcStatus)-6)
 Output file already exists. More...
 
#define kvlcERR_INTERNAL_ERROR   ((KvlcStatus)-7)
 Unhandled internal error. More...
 
#define kvlcERR_NULL_POINTER   ((KvlcStatus)-8)
 Unexpected null pointer. More...
 
#define kvlcERR_FILE_TOO_LARGE   ((KvlcStatus)-10)
 File size too large for specified format. More...
 
#define kvlcERR_TYPE_MISMATCH   ((KvlcStatus)-11)
 Supplied parameter has incorrect type. More...
 
#define kvlcERR_NO_FREE_HANDLES   ((KvlcStatus)-12)
 Too many open KvlcHandle handles. More...
 
#define kvlcERR_NO_INPUT_SELECTED   ((KvlcStatus)-13)
 Missing call to kvlcSetInputFile or kvlcFeedSelectFormat. More...
 
#define kvlcERR_CONVERTING   ((KvlcStatus)-14)
 Call failed since conversion is running. More...
 
#define kvlcERR_BUFFER_SIZE   ((KvlcStatus)-15)
 The supplied buffer is too small to hold the result. More...
 
#define kvlcERR_INVALID_LOG_EVENT   ((KvlcStatus)-30)
 Event is unknown to converter. More...
 
#define kvlcERR_NO_TIME_REFERENCE   ((KvlcStatus)-31)
 Required timestamp missing. More...
 
#define kvlcERR_TIME_DECREASING   ((KvlcStatus)-32)
 Decreasing time between files. More...
 
#define kvlcERR_MIXED_ENDIANNESS   ((KvlcStatus)-33)
 Wrong data type in MDF. More...
 
FILE_FORMAT_xxx

Format used for input and output, used in kvlcSetInputFile(), kvlcFeedSelectFormat().

Note
Not all formats are valid as both output and input format.
#define KVLC_FILE_FORMAT_KME24   1
 Input and output file format. More...
 
#define KVLC_FILE_FORMAT_KME25   2
 Input and output file format. More...
 
#define KVLC_FILE_FORMAT_VECTOR_ASC   3
 Output file format. More...
 
#define KVLC_FILE_FORMAT_CSV   4
 Output file format. More...
 
#define KVLC_FILE_FORMAT_PLAIN_ASC   5
 Output file format. More...
 
#define KVLC_FILE_FORMAT_MEMO_LOG   6
 Input (internal device logfile format). More...
 
#define KVLC_FILE_FORMAT_KME40   7
 Input and output file format. More...
 
#define KVLC_FILE_FORMAT_VECTOR_BLF   8
 Output file format. More...
 
#define KVLC_FILE_FORMAT_KME50   9
 Input and output file format. More...
 
#define KVLC_FILE_FORMAT_CSV_SIGNAL   100
 Output file format. More...
 
#define KVLC_FILE_FORMAT_MDF   101
 Output file format. More...
 
#define KVLC_FILE_FORMAT_MATLAB   102
 Output file format. More...
 
#define KVLC_FILE_FORMAT_J1587   103
 Output file format. More...
 
#define KVLC_FILE_FORMAT_J1587_ALT   104
 Obsolete. More...
 
#define KVLC_FILE_FORMAT_FAMOS   105
 Output file format. More...
 
#define KVLC_FILE_FORMAT_MDF_SIGNAL   106
 Output file format. More...
 
#define KVLC_FILE_FORMAT_MDF_4X   107
 Output file format. More...
 
#define KVLC_FILE_FORMAT_MDF_4X_SIGNAL   108
 Output file format. More...
 
#define KVLC_FILE_FORMAT_XCP   200
 Not supported. More...
 
#define KVLC_FILE_FORMAT_FAMOS_XCP   201
 Not supported. More...
 
#define KVLC_FILE_FORMAT_DEBUG   1000
 Reserved for debug. More...
 
PROPERTY_xxx

Converter properties used in the output format. These are used in kvlcSetProperty(), kvlcGetProperty(), kvlcGetWriterPropertyDefault() and kvlcIsPropertySupported().

#define KVLC_PROPERTY_START_OF_MEASUREMENT   1
 (int) Use start of measurement as time reference. More...
 
#define KVLC_PROPERTY_FIRST_TRIGGER   2
 (int) Use first trigger as time reference. More...
 
#define KVLC_PROPERTY_USE_OFFSET   3
 (int) Use offset as time reference. More...
 
#define KVLC_PROPERTY_OFFSET   4
 (time_int64) Time reference offset. More...
 
#define KVLC_PROPERTY_CHANNEL_MASK   5
 (unsigned int) Bitmask of the channels that should be used during conversion. More...
 
#define KVLC_PROPERTY_HLP_J1939   6
 (int) Interpret events as J1939. More...
 
#define KVLC_PROPERTY_CALENDAR_TIME_STAMPS   7
 (int) Write calendar time stamps. More...
 
#define KVLC_PROPERTY_WRITE_HEADER   8
 (int) Write informational header. More...
 
#define KVLC_PROPERTY_SEPARATOR_CHAR   9
 (char) Use token as separator. More...
 
#define KVLC_PROPERTY_DECIMAL_CHAR   10
 (char) Use token as decimal separator. More...
 
#define KVLC_PROPERTY_ID_IN_HEX   11
 (int) Write id in hexadecimal format. More...
 
#define KVLC_PROPERTY_DATA_IN_HEX   12
 (int) Write data in hexadecimal format. More...
 
#define KVLC_PROPERTY_NUMBER_OF_TIME_DECIMALS   13
 (int) Number of time decimals (0-9). More...
 
#define KVLC_PROPERTY_NAME_MANGLING   14
 (int) Make signal names safe for use in Matlab. More...
 
#define KVLC_PROPERTY_FILL_BLANKS   15
 (int) Propagate values down to next row in csv-files. More...
 
#define KVLC_PROPERTY_SHOW_UNITS   16
 (int) Show units on their own row. More...
 
#define KVLC_PROPERTY_ISO8601_DECIMALS   17
 (int) Number of time decimals (0-9) to print in the calendar timestamps using ISO8601. More...
 
#define KVLC_PROPERTY_MERGE_LINES   18
 (int) Merge two lines if their signal values are equal. More...
 
#define KVLC_PROPERTY_RESAMPLE_COLUMN   19
 (int) Only print a line when the given column has been accessed. More...
 
#define KVLC_PROPERTY_VERSION   20
 (int) File format version. More...
 
#define KVLC_PROPERTY_SHOW_COUNTER   21
 (int) Add a counter to the output. More...
 
#define KVLC_PROPERTY_CROP_PRETRIGGER   22
 (int) Crop pre-triggers. More...
 
#define KVLC_PROPERTY_ENUM_VALUES   23
 (int) Replace integer values in signals with strings from database. More...
 
#define KVLC_PROPERTY_SIZE_LIMIT   24
 (unsigned int) Maximum file size in megabytes before starting a new output file. More...
 
#define KVLC_PROPERTY_TIME_LIMIT   25
 (unsigned int) Maximum delta time in seconds between first and last event before starting a new output file. More...
 
#define KVLC_PROPERTY_LIMIT_DATA_BYTES   26
 (int) Number of data bytes that a converter will write. More...
 
#define KVLC_PROPERTY_CREATION_DATE   27
 (time_int64) File creation date/time as seconds in standard UNIX format. Used in file headers if not zero More...
 
#define KVLC_PROPERTY_OVERWRITE   28
 (int) Overwrite existing output files More...
 
#define KVLC_PROPERTY_TIMEZONE   29
 (int) Timezone for absolute timestamps More...
 
#define KVLC_PROPERTY_SIGNAL_BASED   1001
 Writes signals and not data frames. Used only with kvlcIsPropertySupported(). More...
 
#define KVLC_PROPERTY_SHOW_SIGNAL_SELECT   1002
 Requires a database. Used only with kvlcIsPropertySupported(). More...
 
#define KVLC_PROPERTY_ATTACHMENTS   1003
 Can attach files to converted data. Use kvlcAttachFile() to add a file. Used only with kvlcIsPropertySupported(). More...
 

Typedefs

typedef int KvlcStatus
 
typedef void * KvlcHandle
 
typedef uint64_t time_uint64
 
typedef int64_t time_int64
 

Functions

KvlcStatus kvlcGetErrorText (KvlcStatus error, char *buffer, unsigned int buffer_size)
 
KvlcStatus kvlcGetVersion (unsigned int *major, unsigned int *minor, unsigned int *build)
 
KvlcStatus kvlcCreateConverter (KvlcHandle *handle, const char *filename, int format)
 
KvlcStatus kvlcDeleteConverter (KvlcHandle handle)
 
KvlcStatus kvlcEventCount (KvlcHandle handle, unsigned int *count)
 
KvlcStatus kvlcConvertEvent (KvlcHandle handle)
 
KvlcStatus kvlcSetInputFile (KvlcHandle handle, const char *filename, int format)
 
KvlcStatus kvlcNextInputFile (KvlcHandle handle, const char *filename)
 
KvlcStatus kvlcFeedSelectFormat (KvlcHandle handle, int format)
 
KvlcStatus kvlcFeedLogEvent (KvlcHandle handle, void *event)
 
KvlcStatus kvlcFeedNextFile (KvlcHandle handle)
 
KvlcStatus kvlcIsOutputFilenameNew (KvlcHandle handle, int *updated)
 
KvlcStatus kvlcGetOutputFilename (KvlcHandle handle, char *filename, int len)
 
KvlcStatus kvlcGetWriterPropertyDefault (int format, unsigned int property, void *buf, unsigned int len)
 
KvlcStatus kvlcSetProperty (KvlcHandle handle, unsigned int property, void *buf, unsigned int len)
 
KvlcStatus kvlcGetProperty (KvlcHandle handle, unsigned int property, void *buf, unsigned int len)
 
KvlcStatus kvlcIsOverrunActive (KvlcHandle handle, int *overrun)
 
KvlcStatus kvlcResetOverrunActive (KvlcHandle handle)
 
KvlcStatus kvlcIsDataTruncated (KvlcHandle handle, int *truncated)
 
KvlcStatus kvlcResetDataTruncated (KvlcHandle handle)
 
KvlcStatus kvlcAttachFile (KvlcHandle handle, const char *filename)
 
KvlcStatus kvlcGetFirstWriterFormat (int *format)
 
KvlcStatus kvlcGetNextWriterFormat (int currentFormat, int *nextFormat)
 
KvlcStatus kvlcGetWriterName (int format, char *str, unsigned int len)
 
KvlcStatus kvlcGetWriterExtension (int format, char *str, unsigned int len)
 
KvlcStatus kvlcGetWriterDescription (int format, char *str, unsigned int len)
 
KvlcStatus kvlcIsPropertySupported (int format, unsigned int property, int *supported)
 
KvlcStatus kvlcAddDatabaseFile (KvlcHandle handle, const char *filename, unsigned int channelMask)
 
KvlcStatus kvlcAddDatabase (KvlcHandle handle, KvaDbHnd dbHandle, unsigned int channelMask)
 

Detailed Description

Library for converting Kvaser Memorator log files.

Macro Definition Documentation

◆ KVLC_FILE_FORMAT_CSV

#define KVLC_FILE_FORMAT_CSV   4

Output file format.

◆ KVLC_FILE_FORMAT_CSV_SIGNAL

#define KVLC_FILE_FORMAT_CSV_SIGNAL   100

Output file format.

◆ KVLC_FILE_FORMAT_DEBUG

#define KVLC_FILE_FORMAT_DEBUG   1000

Reserved for debug.

◆ KVLC_FILE_FORMAT_FAMOS

#define KVLC_FILE_FORMAT_FAMOS   105

Output file format.

◆ KVLC_FILE_FORMAT_FAMOS_XCP

#define KVLC_FILE_FORMAT_FAMOS_XCP   201

Not supported.

◆ KVLC_FILE_FORMAT_J1587

#define KVLC_FILE_FORMAT_J1587   103

Output file format.

◆ KVLC_FILE_FORMAT_J1587_ALT

#define KVLC_FILE_FORMAT_J1587_ALT   104

Obsolete.

◆ KVLC_FILE_FORMAT_KME24

#define KVLC_FILE_FORMAT_KME24   1

Input and output file format.

◆ KVLC_FILE_FORMAT_KME25

#define KVLC_FILE_FORMAT_KME25   2

Input and output file format.

◆ KVLC_FILE_FORMAT_KME40

#define KVLC_FILE_FORMAT_KME40   7

Input and output file format.

◆ KVLC_FILE_FORMAT_KME50

#define KVLC_FILE_FORMAT_KME50   9

Input and output file format.

◆ KVLC_FILE_FORMAT_MATLAB

#define KVLC_FILE_FORMAT_MATLAB   102

Output file format.

◆ KVLC_FILE_FORMAT_MDF

#define KVLC_FILE_FORMAT_MDF   101

Output file format.

◆ KVLC_FILE_FORMAT_MDF_4X

#define KVLC_FILE_FORMAT_MDF_4X   107

Output file format.

◆ KVLC_FILE_FORMAT_MDF_4X_SIGNAL

#define KVLC_FILE_FORMAT_MDF_4X_SIGNAL   108

Output file format.

◆ KVLC_FILE_FORMAT_MDF_SIGNAL

#define KVLC_FILE_FORMAT_MDF_SIGNAL   106

Output file format.

◆ KVLC_FILE_FORMAT_MEMO_LOG

#define KVLC_FILE_FORMAT_MEMO_LOG   6

Input (internal device logfile format).

◆ KVLC_FILE_FORMAT_PLAIN_ASC

#define KVLC_FILE_FORMAT_PLAIN_ASC   5

Output file format.

◆ KVLC_FILE_FORMAT_VECTOR_ASC

#define KVLC_FILE_FORMAT_VECTOR_ASC   3

Output file format.

◆ KVLC_FILE_FORMAT_VECTOR_BLF

#define KVLC_FILE_FORMAT_VECTOR_BLF   8

Output file format.

◆ KVLC_FILE_FORMAT_XCP

#define KVLC_FILE_FORMAT_XCP   200

Not supported.

◆ KVLC_PROPERTY_ATTACHMENTS

#define KVLC_PROPERTY_ATTACHMENTS   1003

Can attach files to converted data. Use kvlcAttachFile() to add a file. Used only with kvlcIsPropertySupported().

◆ KVLC_PROPERTY_CALENDAR_TIME_STAMPS

#define KVLC_PROPERTY_CALENDAR_TIME_STAMPS   7

(int) Write calendar time stamps.

◆ KVLC_PROPERTY_CHANNEL_MASK

#define KVLC_PROPERTY_CHANNEL_MASK   5

(unsigned int) Bitmask of the channels that should be used during conversion.

◆ KVLC_PROPERTY_CREATION_DATE

#define KVLC_PROPERTY_CREATION_DATE   27

(time_int64) File creation date/time as seconds in standard UNIX format. Used in file headers if not zero

◆ KVLC_PROPERTY_CROP_PRETRIGGER

#define KVLC_PROPERTY_CROP_PRETRIGGER   22

(int) Crop pre-triggers.

◆ KVLC_PROPERTY_DATA_IN_HEX

#define KVLC_PROPERTY_DATA_IN_HEX   12

(int) Write data in hexadecimal format.

◆ KVLC_PROPERTY_DECIMAL_CHAR

#define KVLC_PROPERTY_DECIMAL_CHAR   10

(char) Use token as decimal separator.

◆ KVLC_PROPERTY_ENUM_VALUES

#define KVLC_PROPERTY_ENUM_VALUES   23

(int) Replace integer values in signals with strings from database.

◆ KVLC_PROPERTY_FILL_BLANKS

#define KVLC_PROPERTY_FILL_BLANKS   15

(int) Propagate values down to next row in csv-files.

◆ KVLC_PROPERTY_FIRST_TRIGGER

#define KVLC_PROPERTY_FIRST_TRIGGER   2

(int) Use first trigger as time reference.

◆ KVLC_PROPERTY_HLP_J1939

#define KVLC_PROPERTY_HLP_J1939   6

(int) Interpret events as J1939.

◆ KVLC_PROPERTY_ID_IN_HEX

#define KVLC_PROPERTY_ID_IN_HEX   11

(int) Write id in hexadecimal format.

◆ KVLC_PROPERTY_ISO8601_DECIMALS

#define KVLC_PROPERTY_ISO8601_DECIMALS   17

(int) Number of time decimals (0-9) to print in the calendar timestamps using ISO8601.

◆ KVLC_PROPERTY_LIMIT_DATA_BYTES

#define KVLC_PROPERTY_LIMIT_DATA_BYTES   26

(int) Number of data bytes that a converter will write.

◆ KVLC_PROPERTY_MERGE_LINES

#define KVLC_PROPERTY_MERGE_LINES   18

(int) Merge two lines if their signal values are equal.

◆ KVLC_PROPERTY_NAME_MANGLING

#define KVLC_PROPERTY_NAME_MANGLING   14

(int) Make signal names safe for use in Matlab.

◆ KVLC_PROPERTY_NUMBER_OF_TIME_DECIMALS

#define KVLC_PROPERTY_NUMBER_OF_TIME_DECIMALS   13

(int) Number of time decimals (0-9).

◆ KVLC_PROPERTY_OFFSET

#define KVLC_PROPERTY_OFFSET   4

(time_int64) Time reference offset.

◆ KVLC_PROPERTY_OVERWRITE

#define KVLC_PROPERTY_OVERWRITE   28

(int) Overwrite existing output files

◆ KVLC_PROPERTY_RESAMPLE_COLUMN

#define KVLC_PROPERTY_RESAMPLE_COLUMN   19

(int) Only print a line when the given column has been accessed.

◆ KVLC_PROPERTY_SEPARATOR_CHAR

#define KVLC_PROPERTY_SEPARATOR_CHAR   9

(char) Use token as separator.

◆ KVLC_PROPERTY_SHOW_COUNTER

#define KVLC_PROPERTY_SHOW_COUNTER   21

(int) Add a counter to the output.

◆ KVLC_PROPERTY_SHOW_SIGNAL_SELECT

#define KVLC_PROPERTY_SHOW_SIGNAL_SELECT   1002

Requires a database. Used only with kvlcIsPropertySupported().

◆ KVLC_PROPERTY_SHOW_UNITS

#define KVLC_PROPERTY_SHOW_UNITS   16

(int) Show units on their own row.

◆ KVLC_PROPERTY_SIGNAL_BASED

#define KVLC_PROPERTY_SIGNAL_BASED   1001

Writes signals and not data frames. Used only with kvlcIsPropertySupported().

◆ KVLC_PROPERTY_SIZE_LIMIT

#define KVLC_PROPERTY_SIZE_LIMIT   24

(unsigned int) Maximum file size in megabytes before starting a new output file.

◆ KVLC_PROPERTY_START_OF_MEASUREMENT

#define KVLC_PROPERTY_START_OF_MEASUREMENT   1

(int) Use start of measurement as time reference.

◆ KVLC_PROPERTY_TIME_LIMIT

#define KVLC_PROPERTY_TIME_LIMIT   25

(unsigned int) Maximum delta time in seconds between first and last event before starting a new output file.

◆ KVLC_PROPERTY_TIMEZONE

#define KVLC_PROPERTY_TIMEZONE   29

(int) Timezone for absolute timestamps

◆ KVLC_PROPERTY_USE_OFFSET

#define KVLC_PROPERTY_USE_OFFSET   3

(int) Use offset as time reference.

◆ KVLC_PROPERTY_VERSION

#define KVLC_PROPERTY_VERSION   20

(int) File format version.

◆ KVLC_PROPERTY_WRITE_HEADER

#define KVLC_PROPERTY_WRITE_HEADER   8

(int) Write informational header.

◆ kvlcEOF

#define kvlcEOF   ((KvlcStatus)-3)

End of input file reached.

◆ kvlcERR_BUFFER_SIZE

#define kvlcERR_BUFFER_SIZE   ((KvlcStatus)-15)

The supplied buffer is too small to hold the result.

◆ kvlcERR_CONVERTING

#define kvlcERR_CONVERTING   ((KvlcStatus)-14)

Call failed since conversion is running.

◆ kvlcERR_FILE_ERROR

#define kvlcERR_FILE_ERROR   ((KvlcStatus)-5)

File I/O error.

◆ kvlcERR_FILE_EXISTS

#define kvlcERR_FILE_EXISTS   ((KvlcStatus)-6)

Output file already exists.

◆ kvlcERR_FILE_TOO_LARGE

#define kvlcERR_FILE_TOO_LARGE   ((KvlcStatus)-10)

File size too large for specified format.

◆ kvlcERR_INTERNAL_ERROR

#define kvlcERR_INTERNAL_ERROR   ((KvlcStatus)-7)

Unhandled internal error.

◆ kvlcERR_INVALID_LOG_EVENT

#define kvlcERR_INVALID_LOG_EVENT   ((KvlcStatus)-30)

Event is unknown to converter.

◆ kvlcERR_MIXED_ENDIANNESS

#define kvlcERR_MIXED_ENDIANNESS   ((KvlcStatus)-33)

Wrong data type in MDF.

◆ kvlcERR_NO_FREE_HANDLES

#define kvlcERR_NO_FREE_HANDLES   ((KvlcStatus)-12)

Too many open KvlcHandle handles.

◆ kvlcERR_NO_INPUT_SELECTED

#define kvlcERR_NO_INPUT_SELECTED   ((KvlcStatus)-13)

Missing call to kvlcSetInputFile or kvlcFeedSelectFormat.

◆ kvlcERR_NO_TIME_REFERENCE

#define kvlcERR_NO_TIME_REFERENCE   ((KvlcStatus)-31)

Required timestamp missing.

◆ kvlcERR_NOT_IMPLEMENTED

#define kvlcERR_NOT_IMPLEMENTED   ((KvlcStatus)-4)

Not implemented.

◆ kvlcERR_NULL_POINTER

#define kvlcERR_NULL_POINTER   ((KvlcStatus)-8)

Unexpected null pointer.

◆ kvlcERR_PARAM

#define kvlcERR_PARAM   ((KvlcStatus)-2)

Error in supplied parameters.

◆ kvlcERR_TIME_DECREASING

#define kvlcERR_TIME_DECREASING   ((KvlcStatus)-32)

Decreasing time between files.

◆ kvlcERR_TYPE_MISMATCH

#define kvlcERR_TYPE_MISMATCH   ((KvlcStatus)-11)

Supplied parameter has incorrect type.

◆ kvlcFail

#define kvlcFail   ((KvlcStatus)-1)

Generic error.

◆ kvlcOK

#define kvlcOK   ((KvlcStatus) 0)

OK.

◆ WINAPI

#define WINAPI

Typedef Documentation

◆ KvlcHandle

typedef void* KvlcHandle

Type definitions for converter

◆ KvlcStatus

typedef int KvlcStatus

Type definitions for converter

◆ time_int64

typedef int64_t time_int64

Type definitions for converter

◆ time_uint64

typedef uint64_t time_uint64

Type definitions for converter