Read data from file into the buffer.
- Parameters
-
[in] | filename | Name 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] | buf | Pointer to the buffer to write the read data into. |
[in,out] | size | Pointer 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
-
0 | on success. |
-EPERM | SD card operation is ongoing somewhere else. |
-ENODEV | SD init failed. SD card likely not inserted. |
Otherwise,error | from underlying drivers. |