Skip to content

Add read_file calls with prepared mem buffer. #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

abel-msk
Copy link

@abel-msk abel-msk commented Apr 13, 2025

Hello.

I fix compile problems for Arduino, but unfortunately steel cannot test in real application.
And of course add new methods in README.

Copy descriptions here

sd_mmc_card

Newly added methods

Type file_ptr_t universal (IDF/Arduino) pointer to File object. FILE for IDF framework and fs::File for Arduino framework

file_ptr_t open_file(const char path, const char mode);
file_ptr_t open_file(std::string const &path, const char *mode);
path - file path to open
mode - mode to open file ("r" - for read "w" - for write)

Return:  file handler  or NULL if fail

size_t block_read_file(file_ptr_t fl, uint8_t *buf, size_t promise_len);
fl - file handler
buf - pointer to memory area where to read data;
promise_len - max num bytes to read.

return: num of read bytes.  

note: subsequent reads start read form next byte it stop read before

void close_file(file_ptr_t fl);
close file

@n-serrette
Copy link
Owner

Thanks for your contribution, I will look at it once I have a little time

@n-serrette
Copy link
Owner

Thanks for your work,
I started looking at your PR, here are my first remarks:

  • split your work into two PR :
    • one for the addition of the new reading methods on sd_mmc_card
    • the other for the correction on of the file download on sd_file_server
  • remove the .sd_file_server.cpp.swp file which seams to be a remnant of your merge conflict issue
  • document the methods you added in sd_mmc_card/README.md
  • sd_file_server does not compile with the arduino framework

I will test and review your work further, if you do not consider your PRs ready for review could you mark them as draft

Once again thanks for your work, your contribution is greatly apprecied.

@abel-msk
Copy link
Author

abel-msk commented Apr 30, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants