File Handling

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

Functions

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)
 
kvStatus kvFileDiskFormat (const CanHandle hnd)
 

Detailed Description

Handling files and the files system on devices.

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

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

◆ kvFileDiskFormat()

kvStatus kvFileDiskFormat ( const CanHandle  hnd)

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