Converter

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 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)
 

Detailed Description

Function Documentation

◆ kvlcAttachFile()

KvlcStatus kvlcAttachFile ( KvlcHandle  handle,
const char *  filename 
)

Attach a file to be included in the output file, e.g. used to add a database or a movie to the output.

Note
The output format must support the property PROPERTY_ATTACHMENTS.
Parameters
[in]handleAn open handle to a converter.
[out]filenameFile to be included in output, a pointer to a NULL terminated array of chars.
Returns
kvlcOK (zero) if success
kvlcERR_xxx (negative) if failure
See also
kvlcIsPropertySupported()

◆ kvlcConvertEvent()

KvlcStatus kvlcConvertEvent ( KvlcHandle  handle)

Convert one event from input file and write it to output file.

Parameters
[in]handleAn open handle to a converter.
Returns
kvlcOK (zero) if success
kvlcERR_xxx (negative) if failure

◆ kvlcCreateConverter()

KvlcStatus kvlcCreateConverter ( KvlcHandle handle,
const char *  filename,
int  format 
)

Create a new converter.

Parameters
[out]handleAn open handle to a converter.
[in]filenameOutput filename, a pointer to a NULL terminated array of chars.
[in]formatOutput format, use FILE_FORMAT_xxx.
Returns
kvlcOK (zero) if success
kvlcERR_xxx (negative) if failure
Note
No more than 128 converter handles can be open at the same time.
See also
kvlcDeleteConverter()

◆ kvlcDeleteConverter()

KvlcStatus kvlcDeleteConverter ( KvlcHandle  handle)

Delete a converter and close all files.

Parameters
[in]handleAn open handle to a converter.
Returns
kvlcOK (zero) if success
kvlcERR_xxx (negative) if failure
See also
kvlcCreateConverter()

◆ kvlcEventCount()

KvlcStatus kvlcEventCount ( KvlcHandle  handle,
unsigned int *  count 
)

Get the estimated number of remaining events in the input file. This can be useful for displaying progress during conversion.

Parameters
[in]handleAn open handle to a converter.
[out]countThe estimated number of remaining events in the input file.
Returns
kvlcOK (zero) if success
kvlcERR_xxx (negative) if failure

◆ kvlcGetErrorText()

KvlcStatus kvlcGetErrorText ( KvlcStatus  error,
char *  buffer,
unsigned int  buffer_size 
)

Convert a KvlcStatus error code to a text.

Parameters
[in]errorThe error code to convert.
[out]bufferBuffer to receive error text, a pointer to a NULL terminated array of chars.
[in]buffer_sizeBuffer size in bytes.
Returns
kvlcOK (zero) if success
kvlcERR_xxx (negative) if failure

◆ kvlcGetOutputFilename()

KvlcStatus kvlcGetOutputFilename ( KvlcHandle  handle,
char *  filename,
int  len 
)

Get the filename of the current output file.

This function can be used in conjunction with kvlcIsOutputFilenameNew() to report current filename when splitting output into multiple files.

Parameters
[in]handleAn open handle to a converter.
[out]filenameBuffer to receive output filename, a pointer to a NULL terminated array of chars.
[in]lenBuffer size in bytes.
Returns
kvlcOK (zero) if success
kvlcERR_xxx (negative) if failure
See also
kvlcIsOutputFilenameNew()

◆ kvlcGetProperty()

KvlcStatus kvlcGetProperty ( KvlcHandle  handle,
unsigned int  property,
void *  buf,
unsigned int  len 
)

Get a property value. The buffer pointer and length of the data type must match the property specified in PROPERTY_xxx, e.g.

char sep; kvlcGetProperty(hnd, PROPERTY_SEPARATOR_CHAR, &sep, sizeof(sep));

Parameters
[in]handleAn open handle to a converter.
[in]propertyProperty, use PROPERTY_xxx.
[out]bufBuffer to receive property value.
[in]lenBuffer size in bytes.
Returns
kvlcOK (zero) if success
kvlcERR_xxx (negative) if failure
See also
kvlcIsPropertySupported(), kvlcSetProperty(), kvlcGetWriterPropertyDefault()

◆ kvlcGetVersion()

KvlcStatus kvlcGetVersion ( unsigned int *  major,
unsigned int *  minor,
unsigned int *  build 
)

Returns the version of the kvcnvlib DLL.

Parameters
[out]majorMajor version number.
[out]minorMinor version number.
[out]buildBuild version number.
Returns
kvlcOK (zero) if success
kvlcERR_xxx (negative) if failure

◆ kvlcGetWriterPropertyDefault()

KvlcStatus kvlcGetWriterPropertyDefault ( int  format,
unsigned int  property,
void *  buf,
unsigned int  len 
)

Get the default value for a property. The buffer pointer and length of the data type must match the property specified in PROPERTY_xxx, e.g.

time_int64 offset; kvlcGetWriterPropertyDefault(KVLC_PROPERTY_OFFSET, &offset, sizeof(offset));

Parameters
[in]formatOutput format, use FILE_FORMAT_xxx.
[in]propertyProperty, use PROPERTY_xxx.
[out]bufBuffer to receive property value.
[in]lenBuffer size in bytes.
Returns
kvlcOK (zero) if success
kvlcERR_xxx (negative) if failure
See also
kvlcGetFirstWriterFormat(), kvlcIsPropertySupported(), kvlcGetProperty()

◆ kvlcIsDataTruncated()

KvlcStatus kvlcIsDataTruncated ( KvlcHandle  handle,
int *  truncated 
)

Get truncation status.

Truncation occurs when the selected output converter can't write the all bytes in a data frame to file. This can happen if CAN FD data is extracted to a format that only supports up to 8 data bytes, e.g. KVLC_FILE_FORMAT_KME40.

It can also happen if PROPERTY_LIMIT_DATA_BYTES is set to limit the number of data bytes in output.

Parameters
[in]handleAn open handle to a converter.
[out]truncatedNot zero if data is truncated.
Returns
kvlcOK (zero) if success
kvlcERR_xxx (negative) if failure
See also
kvlcIsOverrunActive(), kvlcResetDataTruncated()

◆ kvlcIsOutputFilenameNew()

KvlcStatus kvlcIsOutputFilenameNew ( KvlcHandle  handle,
int *  updated 
)

Check if the converter has created a new file. It is only true once after a new file has been created. Used when splitting output into multiple files.

Parameters
[in]handleAn open handle to a converter.
[out]updatedNot zero if a new file has been created.
Returns
kvlcOK (zero) if success
kvlcERR_xxx (negative) if failure
See also
kvlcGetOutputFilename()

◆ kvlcIsOverrunActive()

KvlcStatus kvlcIsOverrunActive ( KvlcHandle  handle,
int *  overrun 
)

Get overrun status.

Overruns can occur during logging with a Memorator if the bus load exceeds the logging capacity. This is very unusual, but can occur if a Memorator runs complex scripts and triggers.

Parameters
[in]handleAn open handle to a converter.
[out]overrunNot zero if an overrun occurred.
Returns
kvlcOK (zero) if success
kvlcERR_xxx (negative) if failure
See also
kvlcIsDataTruncated()

◆ kvlcNextInputFile()

KvlcStatus kvlcNextInputFile ( KvlcHandle  handle,
const char *  filename 
)

Select next input file.

Note
It is the responsibility of the caller to arrange multiple files in correct time stamp order. Overlapping time stamps are not handled.
Parameters
[in]handleAn open handle to a converter.
[in]filenameNext input filename, a pointer to a NULL terminated array of chars.
Returns
kvlcOK (zero) if success
kvlcERR_xxx (negative) if failure
See also
kvlcSetInputFile()

◆ kvlcResetDataTruncated()

KvlcStatus kvlcResetDataTruncated ( KvlcHandle  handle)

Reset truncation status.

Parameters
[in]handleAn open handle to a converter.
Returns
kvlcOK (zero) if success
kvlcERR_xxx (negative) if failure
See also
kvlcIsDataTruncated()

◆ kvlcResetOverrunActive()

KvlcStatus kvlcResetOverrunActive ( KvlcHandle  handle)

Reset overrun status.

Parameters
[in]handleAn open handle to a converter.
Returns
kvlcOK (zero) if success
kvlcERR_xxx (negative) if failure
See also
kvlcIsOverrunActive()

◆ kvlcSetInputFile()

KvlcStatus kvlcSetInputFile ( KvlcHandle  handle,
const char *  filename,
int  format 
)

Select input file.

Parameters
[in]handleAn open handle to a converter.
[in]filenameInput filename, a pointer to a NULL terminated array of chars.
[in]formatInput format, use FILE_FORMAT_xxx.
Returns
kvlcOK (zero) if success
kvlcERR_xxx (negative) if failure
See also
kvlcNextInputFile()

◆ kvlcSetProperty()

KvlcStatus kvlcSetProperty ( KvlcHandle  handle,
unsigned int  property,
void *  buf,
unsigned int  len 
)

Set a property value. The buffer pointer and length of the data type must match the property specified in PROPERTY_xxx, e.g.

int use_offset = 1; kvlcSetProperty(hnd, PROPERTY_USE_OFFSET, &use_offset, sizeof(use_offset));

Parameters
[in]handleAn open handle to a converter.
[in]propertyProperty, use PROPERTY_xxx.
[in]bufBuffer containing property value.
[in]lenBuffer size in bytes.
Returns
kvlcOK (zero) if success
kvlcERR_xxx (negative) if failure
See also
kvlcIsPropertySupported(), kvlcGetWriterPropertyDefault(), kvlcGetProperty()