embassy-rs / nrf-softdevice

Apache License 2.0
254 stars 74 forks source link

Refactor advertisement_builder with a fully const API #217

Closed alexmoon closed 6 months ago

alexmoon commented 6 months ago

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.