uFCoder 2.62
Loading...
Searching...
No Matches

Functions

UFR_STATUS DL_API JCStorageDeleteFile (uint8_t file_index)
 After successful call to this function, the file on the DLStorage card will be deleted.
 
UFR_STATUS DL_API JCStorageGetFileSize (uint8_t card_file_index, VAR uint32_t *file_size)
 This function returns file size indexed by the parameter card_file_index, on successful execution.
 
UFR_STATUS DL_API JCStorageGetFilesListSize (VAR uint32_t *list_size)
 This function has to be called before JCStorageListFiles() to acquire the size of the array of bytes needed to be allocated for the list of currently existing files on the DLStorage card.
 
UFR_STATUS DL_API JCStorageListFiles (OUT uint8_t *list, uint32_t list_bytes_allocated)
 After calling the JCStorageGetFilesListSize() function and getting the size of the list of the currently existing files on the DLStorage card, and if the list size is greater than 0, you can allocate a convenient array of bytes and then call this function.
 
UFR_STATUS DL_API JCStorageReadFile (uint8_t card_file_index, OUT uint8_t *data, uint32_t data_bytes_allocated)
 After calling the JCStorageGetFileSize() function and getting the size of the file on the DLStorage card you can allocate a convenient array of bytes and then call this function.
 
UFR_STATUS DL_API JCStorageReadFileToFileSystem (uint8_t card_file_index, IN const char *file_system_path_name)
 This function reads a file from the DLStorage card directly to the new file on the host file-system.
 
UFR_STATUS DL_API JCStorageWriteFile (uint8_t card_file_index, IN const uint8_t *data, uint32_t data_size)
 This function creates a file on the DLStorage card and writes an array of bytes pointed by the data parameter to it.
 
UFR_STATUS DL_API JCStorageWriteFileFromFileSystem (uint8_t card_file_index, IN const char *file_system_path_name)
 This function writes file content from the host file-system to the new file on the DLStorage card.
 

Detailed Description

Function Documentation

◆ JCStorageDeleteFile()

UFR_STATUS DL_API JCStorageDeleteFile ( uint8_t file_index)

After successful call to this function, the file on the DLStorage card will be deleted.

Maximum files on the card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If a file with index defined by the file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code.

Parameters
file_indexIt should contain an index of the file we want to delete.
Returns
Operation status

◆ JCStorageGetFileSize()

UFR_STATUS DL_API JCStorageGetFileSize ( uint8_t card_file_index,
VAR uint32_t * file_size )

This function returns file size indexed by the parameter card_file_index, on successful execution.

Returned file size is in bytes. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. You have to know file size to allocate an appropriate amount of data prior to calling the JCStorageReadFile() function.

Parameters
card_file_indexIt should contain an index of the file which size we want to get.
file_sizePointer to the 32-bit unsigned integer which will contain size in bytes of the file having card_file_index.
Returns
Operation status

◆ JCStorageGetFilesListSize()

UFR_STATUS DL_API JCStorageGetFilesListSize ( VAR uint32_t * list_size)

This function has to be called before JCStorageListFiles() to acquire the size of the array of bytes needed to be allocated for the list of currently existing files on the DLStorage card.

Maximum files on the DLStorage card is 16.

Parameters
list_sizeointer to the 32-bit unsigned integer which will contain the size of the array of bytes needed to be allocated prior to calling the JCStorageListFiles() function.
Returns
Operation status

◆ JCStorageListFiles()

UFR_STATUS DL_API JCStorageListFiles ( OUT uint8_t * list,
uint32_t list_bytes_allocated )

After calling the JCStorageGetFilesListSize() function and getting the size of the list of the currently existing files on the DLStorage card, and if the list size is greater than 0, you can allocate a convenient array of bytes and then call this function.

On successful function execution, the array pointed by the list parameter will contain indexes of the existing files on the card. Maximum files on the DLStorage card is 16. Each byte of the array pointed by the list parameter contains a single index of the existing file on the DLStorage card.

Parameters
listPointer to the allocated array of bytes of the size acquired by the previous call to JCStorageGetFilesListSize() function.
list_bytes_allocatedSize of the array of bytes pointed by the list parameter. Have to be equal to the value of the *list_size acquired by the previous call to JCStorageGetFilesListSize() function.
Returns
Operation status

◆ JCStorageReadFile()

UFR_STATUS DL_API JCStorageReadFile ( uint8_t card_file_index,
OUT uint8_t * data,
uint32_t data_bytes_allocated )

After calling the JCStorageGetFileSize() function and getting the size of the file on the DLStorage card you can allocate a convenient array of bytes and then call this function.

On successful function execution, the array pointed by the data parameter will contain file content. If the file with the index defined by the card_file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15.

Parameters
card_file_indexIt should contain an index of the file we want to read.
dataPointer to the allocated array of bytes of the size acquired by the previous call to JCStorageGetFileSize() function.
data_bytes_allocatedSize of the array of bytes pointed by the data parameter. Have to be equal to the value of the *file_size acquired by the prior calling JCStorageGetFileSize() function.
Returns
Operation status

◆ JCStorageReadFileToFileSystem()

UFR_STATUS DL_API JCStorageReadFileToFileSystem ( uint8_t card_file_index,
IN const char * file_system_path_name )

This function reads a file from the DLStorage card directly to the new file on the host file-system.

If the file on the host file system already exists, it will be overwritten. If the file with the index defined by the card_file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15.

Parameters
card_file_indexIt should contain an index of the file we want to read.
file_system_path_namePointer to the null-terminated string that should contain path and the name of the new file on the host file-system which will contain the data read from the file on the card in case of successful function execution.
Returns
Operation status

◆ JCStorageWriteFile()

UFR_STATUS DL_API JCStorageWriteFile ( uint8_t card_file_index,
IN const uint8_t * data,
uint32_t data_size )

This function creates a file on the DLStorage card and writes an array of bytes pointed by the data parameter to it.

Parameter data_size defines the amount of data to be written in the file on the DLStorage card. If the file with the index defined by the card_file_index parameter already exists on the card, the function will return UFR_APDU_SW_ENTITY_ALREADY_EXISTS (0x000A6A89) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If there is an error during the writing procedure, for example because of the loss of the NFC field and the file is only partially written (tearing event), a corrupted file on the DLStorage card should be deleted and then written again. Therefore we suggest you to always do verification of the data written to the card.

Parameters
card_file_indexIt should contain an index of the file we want to create and write data to it.
dataPointer to the data i.e. array of bytes to be written into the new file on the card.
data_sizeSize, in bytes, of the data to be written into the file on the card.
Returns
Operation status

◆ JCStorageWriteFileFromFileSystem()

UFR_STATUS DL_API JCStorageWriteFileFromFileSystem ( uint8_t card_file_index,
IN const char * file_system_path_name )

This function writes file content from the host file-system to the new file on the DLStorage card.

If the file with the index defined by the card_file_index parameter already exists on the card, the function will return UFR_APDU_SW_ENTITY_ALREADY_EXISTS (0x000A6A89) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If there is an error during the writing procedure, for example because of the loss of the NFC field and the file is only partially written (tearing event), a corrupted file on the DLStorage card should be deleted and then written again. Therefore we suggest you to always do verification of the data written to the card.

Parameters
card_file_indexIt should contain an index of the file on the card we want to create and write content of the file from the host file-sistem to it.
file_system_path_namePointer to the null-terminated string that should contain path and the name of the file from the host file-sistem whose content we want to transfer to the new file on the card.
Returns
Operation status