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

GATT Server CPFD #225

Merged
merged 7 commits into from
Feb 1, 2024
Merged

GATT Server CPFD #225

merged 7 commits into from
Feb 1, 2024

Conversation

AliMoal
Copy link
Contributor

@AliMoal AliMoal commented Jan 31, 2024

According to the issue (#222), which tells Softdevice reserved CPFD's UUID, this PR is providing Characteristic Presentation Format Descriptor (CPFD) based on SoftDevice API and BLE documentation.
Examples also are updated according to new APIs.
Please merge this PR.
Thanks.

@alexmoon
Copy link
Contributor

Thanks! Looks pretty good. I would like to see a minor change to the API: instead of adding the presentation format as an optional parameter to the Metadata struct, let's use a builder-style API (like we use for Properties).

So new would just take properties and set the presentation format to None.

Then there would be a method called presentation(self, presentation: Presentation) -> Self. You should also change the with_security constructor to a similar builder method security(self, security: Security) -> Self.

That way users only have to deal with the optional pieces that they care about and you would create the metadata with a call like Metadata::new(my_properites).presentation(my_presentation).security(my_security);

@AliMoal
Copy link
Contributor Author

AliMoal commented Feb 1, 2024

Thanks! Looks pretty good. I would like to see a minor change to the API: instead of adding the presentation format as an optional parameter to the Metadata struct, let's use a builder-style API (like we use for Properties).

So new would just take properties and set the presentation format to None.

Then there would be a method called presentation(self, presentation: Presentation) -> Self. You should also change the with_security constructor to a similar builder method security(self, security: Security) -> Self.

That way users only have to deal with the optional pieces that they care about and you would create the metadata with a call like Metadata::new(my_properites).presentation(my_presentation).security(my_security);

I guess I understood what you mean. Yes, that's the better method. I will change the code to this way and let you know.

@AliMoal
Copy link
Contributor Author

AliMoal commented Feb 1, 2024

@alexmoon Please check the new changes. Thanks

@alexmoon alexmoon added this pull request to the merge queue Feb 1, 2024
Merged via the queue into embassy-rs:master with commit 8ba471d Feb 1, 2024
1 check passed
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