esp-rs / esp-idf-svc

Type-Safe Rust Wrappers for various ESP-IDF services (WiFi, Network, Httpd, Logging, etc.)
https://docs.esp-rs.org/esp-idf-svc/
Apache License 2.0
330 stars 183 forks source link

Document OTA API #500

Closed armandas closed 1 month ago

armandas commented 1 month ago

I've been recently implementing OTA for my project and noticed the documentation was lacking. I decided to add documentation to improve my own understanding and hopefully make it more accessible to others.

I used ESP-IDF OTA documentation for reference.

As I'm not an expert here, I would appreciate if someone could check the correctness, especially the module doc.

Additionally, I'm not sure about the contents of EspOtaUpdate::flush(). On one hand, this function does nothing and the user may want to know about it, on the other hand, I just exposed implementation details. Should the documentation be written with the assumption that this function does something? This would encourage users to use it and ensure compatibility with future updates.

DaneSlattery commented 1 month ago

This is for your perusal as well in case you wanted a more in depth example https://github.com/DaneSlattery/esp-ota . Hopefully the changes here will invalidate that other crate, but it also has useful docs from the before-times.

Also very useful are the write_all methods on an EspOtaUpdate thanks to embedded_io::Write

ivmarkov commented 1 month ago

Thanks!