![]() |
Kvaser Linux CANLIB: Welcome to Kvaser CANLIB!
|
Typedefs | |
typedef int64_t | kvEnvHandle |
Functions | |
kvStatus | kvScriptStart (const CanHandle hnd, int slotNo) |
kvStatus | kvScriptStop (const CanHandle hnd, int slotNo, int mode) |
kvStatus | kvScriptUnload (const CanHandle hnd, int slotNo) |
kvStatus | kvScriptSendEvent (const CanHandle hnd, int slotNo, int eventType, int eventNo, unsigned int data) |
kvEnvHandle | kvScriptEnvvarOpen (const CanHandle hnd, char *envvarName, int *envvarType, int *envvarSize) |
kvStatus | kvScriptEnvvarClose (kvEnvHandle eHnd) |
kvStatus | kvScriptEnvvarSetInt (kvEnvHandle eHnd, int val) |
kvStatus | kvScriptEnvvarGetInt (kvEnvHandle eHnd, int *val) |
kvStatus | kvScriptEnvvarSetFloat (kvEnvHandle eHnd, float val) |
kvStatus | kvScriptEnvvarGetFloat (kvEnvHandle eHnd, float *val) |
kvStatus | kvScriptEnvvarSetData (kvEnvHandle eHnd, void *buf, int start_index, int data_len) |
kvStatus | kvScriptEnvvarGetData (kvEnvHandle eHnd, void *buf, int start_index, int data_len) |
kvStatus | kvScriptLoadFileOnDevice (const CanHandle hnd, int slotNo, char *localFile) |
kvStatus | kvScriptLoadFile (const CanHandle hnd, int slotNo, char *filePathOnPC) |
kvStatus | kvScriptStatus (const CanHandle hnd, int slot, unsigned int *status) |
kvStatus | kvFileCopyToDevice (const CanHandle hnd, char *hostFileName, char *deviceFileName) |
kvStatus | kvFileCopyFromDevice (const CanHandle hnd, char *deviceFileName, char *hostFileName) |
kvStatus | kvFileDelete (const CanHandle hnd, char *deviceFileName) |
kvStatus | kvFileGetName (const CanHandle hnd, int fileNo, char *name, int namelen) |
kvStatus | kvFileGetCount (const CanHandle hnd, int *count) |
kvStatus | kvFileGetSystemData (const CanHandle hnd, int itemCode, int *result) |
typedef int64_t kvEnvHandle |
A handle to a t-script envvar. Returned by the function kvScriptEnvvarOpen().
The kvScriptStart() function starts a loaded script.
[in] | hnd | An open handle to a CAN channel. |
[in] | slotNo | The slot with the loaded script we want to start. |
The kvScriptStop() function stops a started script.
[in] | hnd | An open handle to a CAN channel. |
[in] | slotNo | The slot with the loaded and running script we want to stop. |
[in] | mode | Stop mode of type kvSCRIPT_STOP_xxx |
The kvScriptUnload() function unloads a stopped script.
[in] | hnd | An open handle to a CAN channel. |
[in] | slotNo | The slot with the loaded and stopped script we want to unload. |
kvStatus kvScriptSendEvent | ( | const CanHandle | hnd, |
int | slotNo, | ||
int | eventType, | ||
int | eventNo, | ||
unsigned int | data | ||
) |
The kvScriptSendEvent() function sends an event of a type, and an event number and associated data to a script running in a specific slot.
[in] | hnd | An open handle to a CAN channel. |
[in] | slotNo | The slot where the script was loaded and is running. |
[in] | eventType | The event to send, of type kvEVENT_xxx |
[in] | eventNo | The event's number. |
[in] | data | The event's data. |
kvEnvHandle kvScriptEnvvarOpen | ( | const CanHandle | hnd, |
char * | envvarName, | ||
int * | envvarType, | ||
int * | envvarSize | ||
) |
The kvScriptEnvvarOpen() opens an existing envvar and returns a handle to it.
[in] | hnd | An open handle to a CAN channel. |
[in] | envvarName | The envvar's name; a pointer to a NULL terminated array of chars. |
[out] | envvarType | A pointer to a 32-bit integer that will receive the kvENVVAR_TYPE_xxx type. |
[out] | envvarSize | A pointer to a 32-bit integer that will receive the size of the envvar in bytes. |
kvStatus kvScriptEnvvarClose | ( | kvEnvHandle | eHnd | ) |
The kvScriptEnvvarClose() function closes an open envvar.
[in] | eHnd | An open handle to an envvar. |
kvStatus kvScriptEnvvarSetInt | ( | kvEnvHandle | eHnd, |
int | val | ||
) |
The kvScriptEnvvarSetInt() sets the value of an int
envvar.
[in] | eHnd | An open handle to an envvar. |
[in] | val | The new value. |
kvStatus kvScriptEnvvarGetInt | ( | kvEnvHandle | eHnd, |
int * | val | ||
) |
The kvScriptEnvvarGetInt() function retrieves the value of an int
envvar.
[in] | eHnd | An open handle to an envvar. |
[out] | val | The current value. |
kvStatus kvScriptEnvvarSetFloat | ( | kvEnvHandle | eHnd, |
float | val | ||
) |
The kvScriptEnvvarSetFloat() sets the value of a float
envvar.
[in] | eHnd | An open handle to an envvar. |
[in] | val | The new value. |
kvStatus kvScriptEnvvarGetFloat | ( | kvEnvHandle | eHnd, |
float * | val | ||
) |
The kvScriptEnvvarGetFloat() function retrieves the value of a float
envvar.
[in] | eHnd | An open handle to an envvar. |
[out] | val | A pointer to a float where the retrieved result should be stored. |
kvStatus kvScriptEnvvarSetData | ( | kvEnvHandle | eHnd, |
void * | buf, | ||
int | start_index, | ||
int | data_len | ||
) |
The kvScriptEnvvarSetData() function sets a range of data bytes in an envvar.
[in] | eHnd | An open handle to an envvar. |
[in] | buf | A pointer to a data area with the new values. |
[in] | start_index | The start index of the envvar's data range that we want to update. |
[in] | data_len | The length in bytes of the envvar's data range that we want to update. |
kvStatus kvScriptEnvvarGetData | ( | kvEnvHandle | eHnd, |
void * | buf, | ||
int | start_index, | ||
int | data_len | ||
) |
The kvScriptEnvvarGetData() function retrieves a range of data bytes from an envvar.
[in] | eHnd | An open handle to an envvar. |
[out] | buf | A pointer to a data area where the retrieved data range should be stored. |
[in] | start_index | The start index of the data range. |
[in] | data_len | The length in bytes of the data range. |
The kvScriptLoadFileOnDevice() function loads a compiled script file (.txe) stored on the device (SD card) into a script slot on the device.
[in] | hnd | An open handle to a CAN channel. |
[in] | slotNo | The slot where to load the script. |
[in] | localFile | The script file name; a pointer to a NULL terminated array of chars. |
The kvScriptLoadFile() function loads a compiled script file (.txe) stored on the host (PC) into a script slot on the device.
[in] | hnd | An open handle to a CAN channel. |
[in] | slotNo | The slot where to load the script. |
[in] | filePathOnPC | The script file name; a pointer to a NULL terminated array of chars. |
The kvScriptStatus() function reads the current status of a script slot.
[in] | hnd | An open handle to a CAN channel. |
[in] | slot | The slot which status we want. |
[out] | status | The script status, as kvSCRIPT_STATUS_xxx flag bits |
The kvFileCopyToDevice() function copies an arbitrary file from the host to the device.
[in] | hnd | An open handle to a CAN channel. |
[in] | hostFileName | The host file name; a pointer to a NULL terminated array of chars. |
[in] | deviceFileName | The target device file name; a pointer to a NULL terminated array of chars. |
The kvFileCopyFromDevice() function copies an arbitrary file from the device to the host.
[in] | hnd | An open handle to a CAN channel. |
[in] | deviceFileName | The device file name; a pointer to a NULL terminated array of chars. |
[in] | hostFileName | The target host file name; a pointer to a NULL terminated array of chars. |
The kvFileDelete() function deletes a file on the device.
[in] | hnd | An open handle to a CAN channel. |
[in] | deviceFileName | The file on the device to delete; a pointer to a NULL terminated array of chars. |
The kvFileGetName() function returns the name of the file with number fileNo.
[in] | hnd | An open handle to a CAN channel. |
[in] | fileNo | The number of the file. |
[out] | name | A buffer that will contain the name of the file. The name is a zero-terminated ASCII string. |
[in] | namelen | The length, in bytes, of the name buffer. |
The kvFileGetCount() function returns the number of files.
[in] | hnd | An open handle to a CAN channel. |
[out] | count | A pointer to a 32-bit integer that will receive the file count. |
The kvFileGetSystemData() function is used for reading disk parameters, e.g. size, max number of (user) files, etc.
[in] | hnd | An open handle to a CAN channel. |
[in] | itemCode | The item we want information on. |
[out] | result | A pointer to a 32-bit integer that will receive the result. |