Functions
Converter
kvlclib

## 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)
KvlcStatus | kvlcGetReaderPropertyDefault (int format, unsigned int property, void *buf, unsigned int len)

## 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 KVLC_PROPERTY_ATTACHMENTS.

Parameters

  [in] | handle | An open handle to a converter.
  [out] | filename | File 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] | handle | An 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] | handle | An open handle to a converter.
  [in] | filename | Output filename, a pointer to a `NULL` terminated array of chars.
  [in] | format | Output 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] | handle | An 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] | handle | An open handle to a converter.
  [out] | count | The 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] | error | The error code to convert.
  [out] | buffer | Buffer to receive error text, a pointer to a `NULL` terminated array of chars.
  [in] | buffer_size | Buffer 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] | handle | An open handle to a converter.
  [out] | filename | Buffer to receive output filename, a pointer to a `NULL` terminated array of chars.
  [in] | len | Buffer 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, KVLC_PROPERTY_SEPARATOR_CHAR, &sep, sizeof(sep));

Parameters

  [in] | handle | An open handle to a converter.
  [in] | property | Property, use PROPERTY_xxx.
  [out] | buf | Buffer to receive property value.
  [in] | len | Buffer size in bytes.

Returns
  kvlcOK (zero) if success
  kvlcERR_xxx (negative) if failure

See also
  kvlcIsPropertySupported(), kvlcSetProperty(), kvlcGetWriterPropertyDefault()

## ◆ kvlcGetReaderPropertyDefault()

KvlcStatus kvlcGetReaderPropertyDefault | ( | 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; kvlcGetReaderPropertyDefault(KVLC_PROPERTY_OFFSET, &offset, sizeof(offset));

Parameters

  [in] | format | Output format, use FILE_FORMAT_xxx.
  [in] | property | Property, use PROPERTY_xxx.
  [out] | buf | Buffer to receive property value.
  [in] | len | Buffer size in bytes.

Returns
  kvlcOK (zero) if success
  kvlcERR_xxx (negative) if failure

See also
  kvlcGetFirstReaderFormat(), kvlcIsPropertySupported(), kvlcGetProperty()

## ◆ kvlcGetVersion()

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

Returns the version of the kvcnvlib DLL.

Parameters

  [out] | major | Major version number.
  [out] | minor | Minor version number.
  [out] | build | Build 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] | format | Output format, use FILE_FORMAT_xxx.
  [in] | property | Property, use PROPERTY_xxx.
  [out] | buf | Buffer to receive property value.
  [in] | len | Buffer 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 KVLC_PROPERTY_LIMIT_DATA_BYTES is set to limit the number of data bytes in output.

Parameters

  [in] | handle | An open handle to a converter.
  [out] | truncated | Not 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] | handle | An open handle to a converter.
  [out] | updated | Not 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] | handle | An open handle to a converter.
  [out] | overrun | Not 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] | handle | An open handle to a converter.
  [in] | filename | Next 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] | handle | An 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] | handle | An 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] | handle | An open handle to a converter.
  [in] | filename | Input filename, a pointer to a `NULL` terminated array of chars.
  [in] | format | Input 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, KVLC_PROPERTY_USE_OFFSET, &use_offset, sizeof(use_offset));

Parameters

  [in] | handle | An open handle to a converter.
  [in] | property | Property, use PROPERTY_xxx.
  [in] | buf | Buffer containing property value.
  [in] | len | Buffer size in bytes.

Returns
  kvlcOK (zero) if success
  kvlcERR_xxx (negative) if failure

See also
  kvlcIsPropertySupported(), kvlcGetWriterPropertyDefault(), kvlcGetProperty()