nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches

◆ sd_card_list_files_match()

int sd_card_list_files_match ( uint16_t result_file_num_max,
uint16_t result_file_len_max,
char result[][result_file_len_max],
char * path,
char const *const pattern )

Finds all files on SD card that match the given pattern.

Note
The function uses a recursive approach with internal buffers. Memory intensive.
Parameters
[in]result_file_num_maxMaximum number of files to be found.
[in]result_file_len_maxMaximum length of each file name including total path length
[out]resultPointer to the result array of dimension result_file_num_max
  • result_file_len_max.
[in]pathNULL, search from root, otherwise search from the given path. Note not to add an ending "/"
[in]patternNull terminated pattern to find, e.g. *.lc3 or *.wav
Return values
Numberof files found.
-EINVALinvalid parameters.
-ENOMEMout of memory.
-ENODEVSD init failed. SD likely not inserted.
-EPERMSD card operation is ongoing somewhere else.
-Other,errorfrom underlying drivers.