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

◆ sd_card_open_read_close()

int sd_card_open_read_close ( char const *const  filename,
char *const  buf,
size_t *  size 
)

Read data from file into the buffer.

Parameters
[in]filenameName of the target file for reading, the default location is the root directoy of SD card, accept absolute path under root of SD card.
[out]bufPointer to the buffer to write the read data into.
[in,out]sizePointer to the number of bytes which wait to be read from the file. The actual read size will be returned. If the actual read size is 0, there will be a warning message which indicates that the file is empty.
Return values
0on success.
-EPERMSD card operation is ongoing somewhere else.
-ENODEVSD init failed. SD card likely not inserted.
Otherwise,errorfrom underlying drivers.