Functions
Device Connection
kvmlib

## Functions
kvmStatus | kvmClose (kvmHandle h)
kvmHandle | kvmDeviceOpen (int32 cardNr, kvmStatus *status, int32 deviceType)
kvmStatus | kvmDeviceMountKmf (kvmHandle h)
kvmStatus | kvmDeviceMountKmfEx (kvmHandle h, int *ldfMajor, int *ldfMinor)
kvmHandle | kvmKmfOpen (const char *filename, kvmStatus *status, int32 deviceType)
kvmHandle | kvmKmfOpenEx (const char *filename, kvmStatus *status, int32 deviceType, int *ldfMajor, int *ldfMinor)

## Detailed Description

## Function Documentation

## ◆ kvmClose()

kvmStatus kvmClose | ( | kvmHandle | h | ) |

Close the connection to the Memorator (device or file) opened with kvmDeviceOpen() or kvmDeviceMountKmf(). The handle becomes invalid.

Parameters

  [in] | h | An open kvmHandle.

Returns
  kvmOK (zero) if success
  kvmERR_xxx (negative) if failure

See also
  kvmDeviceMountKmf(), kvmDeviceOpen(), kvmDeviceMountKmfEx()

## ◆ kvmDeviceMountKmf()

kvmStatus kvmDeviceMountKmf | ( | kvmHandle | h | ) |

Mount the log area on the SD card on a connected Kvaser Memorator.

Note
  Must be called after kvmDeviceOpen before any subsequent log operations are called.

param[in] h An open kvmHandle.

Returns
  kvmOK (zero) if success
  kvmERR_xxx (negative) if failure

kvmClose(), kvmDeviceOpen()

## ◆ kvmDeviceMountKmfEx()

kvmStatus kvmDeviceMountKmfEx | ( | kvmHandle | h,
|  | int * | ldfMajor,
|  | int * | ldfMinor
| ) |  |

Mount the log area on the SD card on a connected Kvaser Memorator and return the logger data format (LDF) version.

Note
  Must be called after kvmDeviceOpen before any subsequent log operations are called.

param[in] h An open kvmHandle. param[out] ldfMajor Major LDF version kvmLDF_MAJOR_xxx. param[out] ldfMinor Minor LDF version.

Returns
  kvmOK (zero) if success
  kvmERR_xxx (negative) if failure

See also
  kvmClose(), kvmDeviceOpen()

## ◆ kvmDeviceOpen()

kvmHandle kvmDeviceOpen | ( | int32 | cardNr,
|  | kvmStatus * | status,
|  | int32 | deviceType
| ) |  |

Connect to a Memorator device and obtain a handle for subsequent device operations. The argument cardNr is the Card Number property (decreased by one) displayed in Kvaser Hardware.

Parameters

  [in] | cardNr | Card number
  [out] | status | kvmOK if completely successful, kvmERR_xxx (negative) if failure
  [in] | deviceType | kvmDEVICE_xxx

Returns
  Returns an open handle to a Memorator on success.

See also
  kvmClose(), kvmLogFileMount()

## ◆ kvmKmfOpen()

kvmHandle kvmKmfOpen | ( | const char * | filename,
|  | kvmStatus * | status,
|  | int32 | deviceType
| ) |  |

Open a KMF file on a hard disk or SD card reader and obtain a handle for subsequent operations. deviceType is the device type that generated the file.

Note
  Only the path of the argument filename is used. This function will then look for all relevantly named files (e.g. LOG00000.KMF, LOG00001.KMF...) in the directory specified by this path.

Parameters

  [in] | filename | KMF filename
  [out] | status | kvmOK if successful, otherwise kvmERR_xxx
  [in] | deviceType | kvmDEVICE_xxx

Returns
  Returns an open handle to a Memorator on success, otherwise INVALID_HANDLE_VALUE

See also
  kvmClose(), kvmDeviceOpen()

## ◆ kvmKmfOpenEx()

kvmHandle kvmKmfOpenEx | ( | const char * | filename,
|  | kvmStatus * | status,
|  | int32 | deviceType,
|  | int * | ldfMajor,
|  | int * | ldfMinor
| ) |  |

Open a KMF file on a hard disk or SD card reader and obtain a handle for subsequent operations and return the logger data format (LDF) version. deviceType is the device type that generated the file.

Note
  Only the path of the argument filename is used. This function will then look for all relevantly named files (e.g. LOG00000.KMF, LOG00001.KMF...) in the directory specified by this path.

Parameters

  [in] | filename | KMF filename
  [out] | status | kvmOK if successful, otherwise kvmERR_xxx
  [in] | deviceType | kvmDEVICE_xxx
  [out] | ldfMajor | Major LDF version kvmLDF_MAJOR_xxx.
  [out] | ldfMinor | Minor LDF version.

Returns
  Returns an open handle to a Memorator on success, otherwise INVALID_HANDLE_VALUE

See also
  kvmClose(), kvmDeviceOpen()