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
333 stars 183 forks source link

Fix EspWebSocketClient issues and add websocket_client example #336

Closed mykmelez closed 10 months ago

mykmelez commented 11 months ago

While developing an application that uses the EspWebSocketClient API, I ran into several bugs in the implementation. This branch includes fixes for them along with one minor enhancement and a websocket_client example that demonstrates how to use the API.

I've separated the changes into individual commits, except for the last one, which contains several fixes to enable and document building the websocket_client example with ESP-IDF 5.*. See the individual commit messages for detailed descriptions of each fix/enhancement. (If it'd be easier to review, I can also separate these changes into individual PRs.)

ivmarkov commented 11 months ago

@mykmelez Thanks for the PR and sorry for the delay! I think overall it looks good - the one thing I need to look at tmr, is the EspWebSocketX509Encoding thing. I vaguely remember we already had something similar in the crate, need to look if we can unite the two.

ivmarkov commented 10 months ago

@mykmelez I would like to branch a new release of the esp-idf-* crates by end of this week, however I would really like to also pull your WS-related fixes and the WS client example too. If you won't have time to work on that in the next couple of days, I can address the remaining X509-related concerns? Just give me a sign.

ivmarkov commented 10 months ago

@mykmelez See this. I've applied here all fixes from this PR plus my suggestions for changes. Let me run the example to double check it works fine, and if all is OK, I'll push.

BTW this new PR is based on your branch, so you would still be listed as a contributor.

ivmarkov commented 10 months ago

@mykmelez Good news! X509 works as-is for the WS client as well. I therefore merged the other PR.

ivmarkov commented 10 months ago

I think we can close this, thanks again.