File Handling

Handling files and the files system on devices. More...

Functions

kvStatus kvFileCopyToDevice (const int hnd, char *hostFileName, char *deviceFileName)
 
kvStatus kvFileCopyFromDevice (const int hnd, char *deviceFileName, char *hostFileName)
 
kvStatus kvFileDelete (const int hnd, char *deviceFileName)
 
kvStatus kvFileGetName (const int hnd, int fileNo, char *name, int namelen)
 
kvStatus kvFileGetCount (const int hnd, int *count)
 
kvStatus kvFileGetSystemData (const int hnd, int itemCode, int *result)
 
kvStatus kvFileDiskFormat (const int hnd)
 

Detailed Description

Handling files and the files system on devices.

Function Documentation

◆ kvFileCopyFromDevice()

kvStatus kvFileCopyFromDevice ( const int  hnd,
char *  deviceFileName,
char *  hostFileName 
)
C#
static Canlib.kvStatus kvFileCopyFromDevice(CanHandle hnd, String deviceFileName, String hostFileName);
Delphi
function kvFileCopyFromDevice(hnd: canHandle; deviceFileName: PAnsiChar; hostFileName: PAnsiChar): kvStatus;

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 int  hnd,
char *  hostFileName,
char *  deviceFileName 
)
C#
static Canlib.kvStatus kvFileCopyToDevice(CanHandle hnd, String hostFileName, String deviceFileName);
Delphi
function kvFileCopyToDevice(hnd: canHandle; hostFileName: PAnsiChar; deviceFileName: PAnsiChar): kvStatus;

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()
Copying files from / to device

◆ kvFileDelete()

kvStatus kvFileDelete ( const int  hnd,
char *  deviceFileName 
)
C#
static Canlib.kvStatus kvFileDelete(CanHandle hnd, String deviceFileName);
Delphi
function kvFileDelete(hnd: canHandle; deviceFileName: PAnsiChar): kvStatus;

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()

◆ kvFileDiskFormat()

kvStatus kvFileDiskFormat ( const int  hnd)
C#
static Canlib.canStatus kvFileDiskFormat(CanHandle hnd);
Delphi
function kvFileDiskFormat(hnd: canHandle): kvStatus;

The kvFileDiskFormat() function is used for formating the disk, back to FAT32.

Parameters
[in]hndAn open handle to a CAN channel.
Returns
canOK (zero) if success
canERR_xxx (negative) if failure

◆ kvFileGetCount()

kvStatus kvFileGetCount ( const int  hnd,
int *  count 
)
C#
static Canlib.kvStatus kvFileGetCount(CanHandle hnd, out Int32 count);
Delphi
function kvFileGetCount(hnd: canHandle; var count: Integer): kvStatus;

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 int  hnd,
int  fileNo,
char *  name,
int  namelen 
)
C#
static Canlib.kvStatus kvFileGetName(CanHandle hnd, Int32 fileNo, out String name);
Delphi
function kvFileGetName(hnd: canHandle; fileNo: Integer; name: PAnsiChar; namelen: Integer): kvStatus;

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 int  hnd,
int  itemCode,
int *  result 
)
C#
static Canlib.kvStatus kvFileGetSystemData(CanHandle hnd, Int32 itemCode, out Int32 result);
Delphi
function kvFileGetSystemData(hnd: canHandle; itemCode: Integer; var result: Integer): kvStatus;

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