t-script

Starting, stopping scripts, moving files to/from device. More...

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 kvScriptGetMaxEnvvarSize (int hnd, int *envvarSize)
 
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)
 

Detailed Description

Starting, stopping scripts, moving files to/from device.

Function Documentation

◆ kvFileCopyFromDevice()

kvStatus kvFileCopyFromDevice ( const CanHandle  hnd,
char *  deviceFileName,
char *  hostFileName 
)

The kvFileCopyFromDevice() function copies an arbitrary file from the device to the host.

Parameters
[in]hndAn open handle to a CAN channel.
[in]deviceFileNameThe device file name; a pointer to a NULL terminated array of chars.
[in]hostFileNameThe target host file name; a pointer to a NULL terminated array of chars.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
kvFileCopyToDevice()

◆ kvFileCopyToDevice()

kvStatus kvFileCopyToDevice ( const CanHandle  hnd,
char *  hostFileName,
char *  deviceFileName 
)

The kvFileCopyToDevice() function copies an arbitrary file from the host to the device.

Parameters
[in]hndAn open handle to a CAN channel.
[in]hostFileNameThe host file name; a pointer to a NULL terminated array of chars.
[in]deviceFileNameThe target device file name; a pointer to a NULL terminated array of chars.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
kvFileCopyFromDevice(), kvFileDelete()

◆ kvFileDelete()

kvStatus kvFileDelete ( const CanHandle  hnd,
char *  deviceFileName 
)

The kvFileDelete() function deletes a file on the device.

Note
Deleting system files is not recommended.
Parameters
[in]hndAn open handle to a CAN channel.
[in]deviceFileNameThe file on the device to delete; a pointer to a NULL terminated array of chars.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
kvFileCopyToDevice()

◆ kvFileGetCount()

kvStatus kvFileGetCount ( const CanHandle  hnd,
int *  count 
)

The kvFileGetCount() function returns the number of files.

Parameters
[in]hndAn open handle to a CAN channel.
[out]countA pointer to a 32-bit integer that will receive the file count.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
kvFileGetName(), kvFileGetSystemData()

◆ kvFileGetName()

kvStatus kvFileGetName ( const CanHandle  hnd,
int  fileNo,
char *  name,
int  namelen 
)

The kvFileGetName() function returns the name of the file with number fileNo.

Parameters
[in]hndAn open handle to a CAN channel.
[in]fileNoThe number of the file.
[out]nameA buffer that will contain the name of the file. The name is a zero-terminated ASCII string.
[in]namelenThe length, in bytes, of the name buffer.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
kvFileGetCount(), kvFileGetSystemData()

◆ kvFileGetSystemData()

kvStatus kvFileGetSystemData ( const CanHandle  hnd,
int  itemCode,
int *  result 
)

The kvFileGetSystemData() function is used for reading disk parameters, e.g. size, max number of (user) files, etc.

Note
Not yet implemented
Parameters
[in]hndAn open handle to a CAN channel.
[in]itemCodeThe item we want information on.
[out]resultA pointer to a 32-bit integer that will receive the result.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure

◆ kvScriptEnvvarClose()

kvStatus kvScriptEnvvarClose ( kvEnvHandle  eHnd)

The kvScriptEnvvarClose() function closes an open envvar.

Note
Not implemented in linux.
Parameters
[in]eHndAn open handle to an envvar.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
kvScriptEnvvarOpen()

◆ kvScriptEnvvarGetData()

kvStatus kvScriptEnvvarGetData ( kvEnvHandle  eHnd,
void *  buf,
int  start_index,
int  data_len 
)

The kvScriptEnvvarGetData() function retrieves a range of data bytes from an envvar.

Note
Not implemented in linux.
Parameters
[in]eHndAn open handle to an envvar.
[out]bufA pointer to a data area where the retrieved data range should be stored.
[in]start_indexThe start index of the data range.
[in]data_lenThe length in bytes of the data range.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
kvScriptEnvvarXxx Example
kvScriptEnvvarOpen(), kvScriptEnvvarSetData(), kvScriptEnvvarGetInt(), kvScriptEnvvarGetFloat()

◆ kvScriptEnvvarGetFloat()

kvStatus kvScriptEnvvarGetFloat ( kvEnvHandle  eHnd,
float *  val 
)

The kvScriptEnvvarGetFloat() function retrieves the value of a float envvar.

Note
Not implemented in linux.
Parameters
[in]eHndAn open handle to an envvar.
[out]valA pointer to a float where the retrieved result should be stored.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
kvScriptEnvvarXxx Example
kvScriptEnvvarOpen(), kvScriptEnvvarSetFloat(), kvScriptEnvvarGetInt(), kvScriptEnvvarGetData()

◆ kvScriptEnvvarGetInt()

kvStatus kvScriptEnvvarGetInt ( kvEnvHandle  eHnd,
int *  val 
)

The kvScriptEnvvarGetInt() function retrieves the value of an int envvar.

Note
Not implemented in linux.
Parameters
[in]eHndAn open handle to an envvar.
[out]valThe current value.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
kvScriptEnvvarXxx Example
kvScriptEnvvarOpen(), kvScriptEnvvarSetInt(), kvScriptEnvvarGetFloat(), kvScriptEnvvarGetData()

◆ kvScriptEnvvarOpen()

kvEnvHandle kvScriptEnvvarOpen ( const CanHandle  hnd,
char *  envvarName,
int *  envvarType,
int *  envvarSize 
)

The kvScriptEnvvarOpen() opens an existing envvar and returns a handle to it.

Parameters
[in]hndAn open handle to a CAN channel.
[in]envvarNameThe envvar's name; a pointer to a NULL terminated array of chars.
[out]envvarTypeA pointer to a 32-bit integer that will receive the kvENVVAR_TYPE_xxx type.
[out]envvarSizeA pointer to a 32-bit integer that will receive the size of the envvar in bytes.
Note
Not implemented in linux.
Returns
A kvEnvHandle handle (positive) to an envvar if success
canERR_xxx (negative) if failure
See also
kvScriptEnvvarXxx Example
kvScriptEnvvarClose()

◆ kvScriptEnvvarSetData()

kvStatus kvScriptEnvvarSetData ( kvEnvHandle  eHnd,
void *  buf,
int  start_index,
int  data_len 
)

The kvScriptEnvvarSetData() function sets a range of data bytes in an envvar.

Note
Not implemented in linux.
Parameters
[in]eHndAn open handle to an envvar.
[in]bufA pointer to a data area with the new values.
[in]start_indexThe start index of the envvar's data range that we want to update.
[in]data_lenThe length in bytes of the envvar's data range that we want to update.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
kvScriptEnvvarXxx Example
kvScriptEnvvarOpen(), kvScriptEnvvarGetData(), kvScriptEnvvarSetInt(), kvScriptEnvvarSetFloat()

◆ kvScriptEnvvarSetFloat()

kvStatus kvScriptEnvvarSetFloat ( kvEnvHandle  eHnd,
float  val 
)

The kvScriptEnvvarSetFloat() sets the value of a float envvar.

Note
Not implemented in linux.
Parameters
[in]eHndAn open handle to an envvar.
[in]valThe new value.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
kvScriptEnvvarXxx Example
kvScriptEnvvarOpen(), kvScriptEnvvarGetFloat(), kvScriptEnvvarSetInt(), kvScriptEnvvarSetData()

◆ kvScriptEnvvarSetInt()

kvStatus kvScriptEnvvarSetInt ( kvEnvHandle  eHnd,
int  val 
)

The kvScriptEnvvarSetInt() sets the value of an int envvar.

Note
Not implemented in linux.
Parameters
[in]eHndAn open handle to an envvar.
[in]valThe new value.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
kvScriptEnvvarXxx Example
kvScriptEnvvarOpen(), kvScriptEnvvarGetInt(), kvScriptEnvvarSetFloat(), kvScriptEnvvarSetData()

◆ kvScriptGetMaxEnvvarSize()

kvStatus kvScriptGetMaxEnvvarSize ( int  hnd,
int *  envvarSize 
)

The kvScriptGetMaxEnvvarSize() function returns the maximum size of an envvar.

Note
Not implemented in linux.
Parameters
[in]hndAn open handle to a CAN channel.
[out]envvarSizeThe maximum size of an envvar.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure

◆ kvScriptLoadFile()

kvStatus kvScriptLoadFile ( const CanHandle  hnd,
int  slotNo,
char *  filePathOnPC 
)

The kvScriptLoadFile() function loads a compiled script file (.txe) stored on the host (PC) into a script slot on the device.

Parameters
[in]hndAn open handle to a CAN channel.
[in]slotNoThe slot where to load the script.
[in]filePathOnPCThe script file name; a pointer to a NULL terminated array of chars.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
kvScriptStart Example
kvScriptLoadFileOnDevice(), kvFileCopyToDevice(), kvScriptStart(), kvScriptStop()

◆ kvScriptLoadFileOnDevice()

kvStatus kvScriptLoadFileOnDevice ( const CanHandle  hnd,
int  slotNo,
char *  localFile 
)

The kvScriptLoadFileOnDevice() function loads a compiled script file (.txe) stored on the device (SD card) into a script slot on the device.

Note
Not implemented in linux.
Parameters
[in]hndAn open handle to a CAN channel.
[in]slotNoThe slot where to load the script.
[in]localFileThe script file name; a pointer to a NULL terminated array of chars.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
kvScriptStart Example
kvScriptLoadFile(), kvFileCopyToDevice(), kvScriptStart(), kvScriptStop()

◆ kvScriptSendEvent()

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.

Note
Not implemented in linux.
Parameters
[in]hndAn open handle to a CAN channel.
[in]slotNoThe slot where the script was loaded and is running.
[in]eventTypeThe event to send, of type kvEVENT_xxx
[in]eventNoThe event's number.
[in]dataThe event's data.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
kvScriptSendEvent Example

◆ kvScriptStart()

kvStatus kvScriptStart ( const CanHandle  hnd,
int  slotNo 
)

The kvScriptStart() function starts a loaded script.

Parameters
[in]hndAn open handle to a CAN channel.
[in]slotNoThe slot with the loaded script we want to start.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
kvScriptStart Example
kvScriptLoadFile(), kvScriptStop()

◆ kvScriptStatus()

kvStatus kvScriptStatus ( const CanHandle  hnd,
int  slot,
unsigned int *  status 
)

The kvScriptStatus() function reads the current status of a script slot.

Note
Not implemented in linux.
Parameters
[in]hndAn open handle to a CAN channel.
[in]slotThe slot which status we want.
[out]statusThe script status, as kvSCRIPT_STATUS_xxx flag bits
Returns
canOK (zero) if success
canERR_xxx (negative) if failure

◆ kvScriptStop()

kvStatus kvScriptStop ( const CanHandle  hnd,
int  slotNo,
int  mode 
)

The kvScriptStop() function stops a started script.

Parameters
[in]hndAn open handle to a CAN channel.
[in]slotNoThe slot with the loaded and running script we want to stop.
[in]modeStop mode of type kvSCRIPT_STOP_xxx
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
kvScriptStart Example
kvScriptLoadFile(), kvScriptStart()

◆ kvScriptUnload()

kvStatus kvScriptUnload ( const CanHandle  hnd,
int  slotNo 
)

The kvScriptUnload() function unloads a stopped script.

Parameters
[in]hndAn open handle to a CAN channel.
[in]slotNoThe slot with the loaded and stopped script we want to unload.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure
See also
kvScriptLoadFile(), kvScriptStop()