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

Allow values different from [u8] in AttributeTable #153

Closed
Erik1000 opened this issue Oct 30, 2024 · 1 comment
Closed

Allow values different from [u8] in AttributeTable #153

Erik1000 opened this issue Oct 30, 2024 · 1 comment

Comments

@Erik1000
Copy link

I find it quite counter-intuitive that one defines a characteristic with the characteristic macro and some type but this type is never actually used as a value since it is only used in the macro to initialize the storage capacity of the array in the StaticCell using [0; size_of::<T>()].

I would find it much more intuitive if one could use an array that has the same type as in the characteristic macro and enforce some kind of (de)serialization trait to convert it to its bytes representation as it would be used by the bluetooth stack.
It would also allow for more type safety, because one would not work with raw bytes.

@petekubiak
Copy link
Collaborator

We're in the process of implementing this as part of #151. The idea is that get, set and notify will require the expected type for that characteristic rather than &[u8]

@lulf lulf closed this as completed Dec 17, 2024
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