Skip to content
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

No-std support #68

Open
thunderstorm010 opened this issue Nov 25, 2024 · 5 comments
Open

No-std support #68

thunderstorm010 opened this issue Nov 25, 2024 · 5 comments

Comments

@thunderstorm010
Copy link

I'd like to use this library on some STM32 chips.

@patrickelectric
Copy link
Member

Hi @thunderstorm010, that would be nice to have in the message generation, to generate messages that can be used in embedded applications.

@thunderstorm010
Copy link
Author

thunderstorm010 commented Nov 25, 2024

I've created a very, very small subset of this library at https://github.com/thunderstorm010/ping-protocol-core.git. It only includes decoding and serializing functions. Open for everything.

@RaulTrombin
Copy link
Member

RaulTrombin commented Nov 26, 2024

Hey @thunderstorm010, to make it broadly available as no-std, we need to think about how to replace the tokio ecosystem features.
I did a quick attempt by splitting out decoder.rs and message.rs into an inner core project (https://github.com/RaulTromber/ping-rs/tree/split_no_std_method).
Then in /ping-protocol-core:
cross build --target thumbv7em-none-eabihf --example stm32 --features stm32
With this approach, the examples still run on the main crate, but we need to put more effort into checking everything. It would be nice to forward the message generation from builder to this inner crate.

@thunderstorm010
Copy link
Author

Your code looks quite cool tbh, but as with upstream the code in decoder.rs involves a lot of unnecessary cloning (which I mostly removed in my version). I think I can contribute some of this code (without smallvec stuff) to upstream.

And, we should probably feature gate alloc.

@patrickelectric
Copy link
Member

Hi @thunderstorm010, that would be cool, be free to send a PR

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

No branches or pull requests

3 participants