Starting, stopping scripts, moving files to/from device.
More...
|
kvStatus | kvScriptStart (const int hnd, int slotNo) |
|
kvStatus | kvScriptStop (const int hnd, int slotNo, int mode) |
|
kvStatus | kvScriptUnload (const int hnd, int slotNo) |
|
kvStatus | kvScriptSendEvent (const int hnd, int slotNo, int eventType, int eventNo, unsigned int data) |
|
kvEnvHandle | kvScriptEnvvarOpen (const int hnd, const 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, const void *buf, int start_index, int data_len) |
|
kvStatus | kvScriptEnvvarGetData (kvEnvHandle eHnd, void *buf, int start_index, int data_len) |
|
kvStatus | kvScriptLoadFileOnDevice (const int hnd, int slotNo, char *localFile) |
|
kvStatus | kvScriptLoadFile (const int hnd, int slotNo, char *filePathOnPC) |
|
kvStatus | kvScriptRequestText (const int hnd, unsigned int slot, unsigned int request) |
|
kvStatus | kvScriptGetText (const int hnd, int *slot, unsigned long *time, unsigned int *flags, char *buf, size_t bufsize) |
|
kvStatus | kvScriptStatus (const int hnd, int slot, unsigned int *status) |
|
kvStatus | kvScriptGetMaxEnvvarSize (int hnd, int *envvarSize) |
|
kvStatus | kvScriptTxeGetData (const char *filePathOnPC, int item, void *buffer, unsigned int *bufsize) |
|
Starting, stopping scripts, moving files to/from device.
◆ kvScriptEnvvarClose()
◆ kvScriptEnvvarGetData()
◆ kvScriptEnvvarGetFloat()
◆ kvScriptEnvvarGetInt()
◆ kvScriptEnvvarOpen()
kvEnvHandle kvScriptEnvvarOpen |
( |
const int |
hnd, |
|
|
const char * |
envvarName, |
|
|
int * |
envvarType, |
|
|
int * |
envvarSize |
|
) |
| |
- C#
- static kvEnvHandle kvScriptEnvvarOpen(CanHandle hnd, String envvarName, out Int32 envvarType, out Int32 envvarSize);
- Delphi
- function kvScriptEnvvarOpen(const hnd: canHandle; envvarName: PAnsiChar; var envvarType: Integer; var envvarSize: Integer): kvEnvHandle;
The kvScriptEnvvarOpen() opens an existing envvar and returns a handle to it.
- Parameters
-
[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. |
- Returns
- A kvEnvHandle handle (positive) to an envvar if success
-
canERR_xxx (negative) if failure
- See also
- Environment Variable
-
kvScriptEnvvarClose()
- Examples:
- example/c/tscript/envvar/envvar.c.
◆ kvScriptEnvvarSetData()
kvStatus kvScriptEnvvarSetData |
( |
kvEnvHandle |
eHnd, |
|
|
const void * |
buf, |
|
|
int |
start_index, |
|
|
int |
data_len |
|
) |
| |
◆ kvScriptEnvvarSetFloat()
◆ kvScriptEnvvarSetInt()
◆ kvScriptGetMaxEnvvarSize()
kvStatus kvScriptGetMaxEnvvarSize |
( |
int |
hnd, |
|
|
int * |
envvarSize |
|
) |
| |
- C#
- static Canlib.kvStatus kvScriptGetMaxEnvvarSize(CanHandle hnd, out Int32 size);
- Delphi
- function kvScriptGetMaxEnvvarSize(hnd: canHandle; var envvarSize: Integer): kvStatus;
The kvScriptGetMaxEnvvarSize() function returns the maximum size of an envvar.
- Note
- Not implemented in linux.
- Parameters
-
[in] | hnd | An open handle to a CAN channel. |
[out] | envvarSize | The maximum size of an envvar. |
- Returns
- canOK (zero) if success
-
canERR_xxx (negative) if failure
◆ kvScriptGetText()
kvStatus kvScriptGetText |
( |
const int |
hnd, |
|
|
int * |
slot, |
|
|
unsigned long * |
time, |
|
|
unsigned int * |
flags, |
|
|
char * |
buf, |
|
|
size_t |
bufsize |
|
) |
| |
- C#
- static Canlib.kvStatus kvScriptGetText(CanHandle hnd, out Int32 slot, out Int64 time, out Int32 flags, out String buf);
- Delphi
- function kvScriptGetText(hnd: canHandle; var slot: integer; var time: Cardinal; var flags: Cardinal; buf: PAnsiChar; bufsize: size_t): kvStatus;
The kvScriptGetText() Reads a printf from a subscribed script slot. Set up a subscription with kvScriptRequestText().
- Parameters
-
[in] | hnd | An open handle to a CAN channel. |
[out] | slot | The slot where the printf originated. |
[out] | time | The printf timestamp. |
[out] | flags | Printf flags. A combination of canSTAT_xxx flags. |
[out] | buf | Buffer to hold the printf string. |
[in] | bufsize | Size of the buffer. |
- Returns
- canOK (zero) if success
-
canERR_xxx (negative) if failure
◆ kvScriptLoadFile()
kvStatus kvScriptLoadFile |
( |
const int |
hnd, |
|
|
int |
slotNo, |
|
|
char * |
filePathOnPC |
|
) |
| |
- C#
- static Canlib.kvStatus kvScriptLoadFile(CanHandle hnd, Int32 slotNo, String filePathOnPC);
- Delphi
- function kvScriptLoadFile(hnd: canHandle; slotNo: Integer; filePathOnPC: PAnsiChar): kvStatus;
The kvScriptLoadFile() function loads a compiled script file (.txe) stored on the host (PC) into a script slot on the device.
- Note
- The canHandle is used to determine what channel is set as the default channel for the loaded script. If your canHandle was opened via a device's second channel, the default channel number will be set to 1 (the numbering of channel on the card starts from 0).
- Parameters
-
[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. |
- Returns
- canOK (zero) if success
-
canERR_xxx (negative) if failure
- See also
- Load and Unload Script
-
kvScriptLoadFileOnDevice(), kvFileCopyToDevice(), kvScriptStart(), kvScriptStop()
- Examples:
- example/c/tscript/envvar/envvar.c.
◆ kvScriptLoadFileOnDevice()
kvStatus kvScriptLoadFileOnDevice |
( |
const int |
hnd, |
|
|
int |
slotNo, |
|
|
char * |
localFile |
|
) |
| |
- C#
- static Canlib.kvStatus kvScriptLoadFileOnDevice(CanHandle hnd, Int32 slotNo, String localFile);
- Delphi
- function kvScriptLoadFileOnDevice(hnd: canHandle; slotNo: Integer; localFile: PAnsiChar): kvStatus;
The kvScriptLoadFileOnDevice() function loads a compiled script file (.txe) stored on the device (SD card) into a script slot on the device.
- Parameters
-
[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. |
- Returns
- canOK (zero) if success
-
canERR_xxx (negative) if failure
- See also
- Load and Unload Script
-
kvScriptLoadFile(), kvFileCopyToDevice(), kvScriptStart(), kvScriptStop()
◆ kvScriptRequestText()
kvStatus kvScriptRequestText |
( |
const int |
hnd, |
|
|
unsigned int |
slot, |
|
|
unsigned int |
request |
|
) |
| |
- C#
- static Canlib.kvStatus kvScriptRequestText(CanHandle hnd, Int32 slot, Int32 request);
- Delphi
- function kvScriptRequestText(hnd: canHandle; slotNo: cardinal; request: cardinal): kvStatus;
The kvScriptRequestText() Sets up a printf subscription to a selected script slot. Read the printf messages with kvScriptGetText().
- Parameters
-
[in] | hnd | An open handle to a CAN channel. |
[in] | slot | The slot to subscribe to. |
[in] | request | Subscription request i.e. kvSCRIPT_REQUEST_TEXT_xxx. |
- Returns
- canOK (zero) if success
-
canERR_xxx (negative) if failure
◆ kvScriptSendEvent()
kvStatus kvScriptSendEvent |
( |
const int |
hnd, |
|
|
int |
slotNo, |
|
|
int |
eventType, |
|
|
int |
eventNo, |
|
|
unsigned int |
data |
|
) |
| |
- C#
- static Canlib.kvStatus kvScriptSendEvent(CanHandle hnd, Int32 slotNo, Int32 eventType, Int32 eventNo, Int32 data);
- Delphi
- function kvScriptSendEvent(const hnd: canHandle; slotNo: integer; eventType: integer; eventNo: integer; data: Cardinal): kvStatus;
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] | 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. |
- Returns
- canOK (zero) if success
-
canERR_xxx (negative) if failure
- See also
- Send Event
◆ kvScriptStart()
kvStatus kvScriptStart |
( |
const int |
hnd, |
|
|
int |
slotNo |
|
) |
| |
◆ kvScriptStatus()
kvStatus kvScriptStatus |
( |
const int |
hnd, |
|
|
int |
slot, |
|
|
unsigned int * |
status |
|
) |
| |
- C#
- static Canlib.kvStatus kvScriptStatus(CanHandle hnd, Int32 slotNo, out Int32 status);
- Delphi
- function kvScriptStatus(hnd: canHandle; slot: integer; var status: Cardinal): kvStatus;
The kvScriptStatus() function reads the current status of a script slot.
- Parameters
-
[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 |
- Returns
- canOK (zero) if success
-
canERR_xxx (negative) if failure
◆ kvScriptStop()
kvStatus kvScriptStop |
( |
const int |
hnd, |
|
|
int |
slotNo, |
|
|
int |
mode |
|
) |
| |
◆ kvScriptTxeGetData()
kvStatus kvScriptTxeGetData |
( |
const char * |
filePathOnPC, |
|
|
int |
item, |
|
|
void * |
buffer, |
|
|
unsigned int * |
bufsize |
|
) |
| |
- C#
- static Canlib.kvStatus kvScriptTxeGetData(String filePathOnPC, Int32 item, out object buffer);
- Delphi
- function kvScriptTxeGetData(filePathOnPC: PAnsiChar; item: Integer; var buffer; var bufsize: Cardinal): canStatus;
This function can be used to retrieve information from a compiled script file (.txe).
- Parameters
-
[in] | filePathOnPC | The compiled script file name; a pointer to a NULL terminated array of chars. |
[in] | item | This parameter specifies what data to obtain. Valid values are one of the constants canTXEDATA_xxx. |
[out] | buffer | The address of a buffer which is to receive the data. |
[in,out] | bufsize | The size of the buffer to which the buffer parameter points. When the function returns, bufsize contains the number of bytes copied into the buffer. |
- Returns
- canOK (zero) if success
-
canERR_xxx (negative) if failure
If the buffer specified by buffer and bufsize is not large enough to hold the data requested, the function returns canERR_BUFFER_TOO_SMALL and stores the required buffer size in the integer pointed to by bufsize. The content of buffer is undefined.
If parameter buffer is NULL, and bufsize is non-NULL, the function returns canOK and stores the required buffer size in the integer pointed to by bufsize.
◆ kvScriptUnload()
kvStatus kvScriptUnload |
( |
const int |
hnd, |
|
|
int |
slotNo |
|
) |
| |