|
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.
|
|
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
-
list | Pointer to the allocated array of bytes of the size acquired by the previous call to JCStorageGetFilesListSize() function. |
list_bytes_allocated | Size 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
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_index | It should contain an index of the file we want to create and write data to it. |
data | Pointer to the data i.e. array of bytes to be written into the new file on the card. |
data_size | Size, in bytes, of the data to be written into the file on the card. |
- Returns
- Operation status
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_index | It 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_name | Pointer 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