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

Refactor advertisement_builder with a fully const API #217

Merged
merged 5 commits into from
Jan 7, 2024

Conversation

alexmoon
Copy link
Contributor

@alexmoon alexmoon commented Jan 6, 2024

I got nerd sniped into seeing if the advertisement builder API by @AdinAck in #214 could be made fully const. It turns out the answer is yes, though it required removing the traits (traits are generally not compatible with const fns) and making a few other refactorings as a result. I also changed the ADType enum to an AdvertisementDataType newtype with associated constants, to allow users to use values that may be standardized later.

Copy link
Contributor

@AdinAck AdinAck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome, so happy you nerd-sniped me. I'm glad we finally have a kick ass advertisement builder! 🎉🥳

nrf-softdevice/src/ble/advertisement_builder.rs Outdated Show resolved Hide resolved
nrf-softdevice/src/ble/advertisement_builder.rs Outdated Show resolved Hide resolved
@alexmoon alexmoon added this pull request to the merge queue Jan 7, 2024
Merged via the queue into embassy-rs:master with commit b193eaa Jan 7, 2024
1 check passed
@alexmoon alexmoon deleted the const-ad-builder branch January 7, 2024 16:33
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