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 getting and setting all attributes #261

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

petekubiak
Copy link
Collaborator

Implements generic get and set methods, allowing getting and setting of descriptors and characteristic properties.

This is a draft to get feedback on what you think of the implementation, I think some documentation and examples are needed before merging.

Resolves #155.

Copy link
Member

@lulf lulf left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@jamessizeland
Copy link
Collaborator

Do we need to assert that a writeable descriptor must also be named?

@petekubiak
Copy link
Collaborator Author

Do we need to assert that a writeable descriptor must also be named?

I don't think so, because setting the descriptor as writeable only affects whether it can be written by a connected device.
The user might not need to access the descriptor locally, so we don't want to have to force them to name it.

@@ -69,6 +69,7 @@ impl Primitive for f32 {}
impl Primitive for f64 {}
impl Primitive for BluetoothUuid16 {} // ok as this is just a NewType(u16)
impl Primitive for &'_ str {}
impl Primitive for &'_ [u8] {}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This impl follows the same flawed logic highlighted in #272 and will require the same fix (assuming I can find one 😅)

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.

Expand get and set methods to allow getting and setting all attributes
3 participants