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

💾 Internal change: Use OptionSet paradigm for flags of WeightScaleService #8

Closed
1 task done
nriedman opened this issue May 20, 2024 · 0 comments · Fixed by #13
Closed
1 task done

💾 Internal change: Use OptionSet paradigm for flags of WeightScaleService #8

nriedman opened this issue May 20, 2024 · 0 comments · Fixed by #13
Assignees
Labels
enhancement New feature or request

Comments

@nriedman
Copy link
Contributor

Problem

Right now, the WeightScaleService's characteristics decode the flag bits by manually bit shifting and masking. In other parts of SpeziBluetooth, we utilize and OptionSet to recover the flags. This technique makes for cleaner code.

Solution

Instead of bit shifting and bit masking, we use an OptionSet to decode all the flags from a UInt8 rawValue at once.

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct and Contributing Guidelines
@nriedman nriedman added the enhancement New feature or request label May 20, 2024
@Supereg Supereg self-assigned this May 22, 2024
@Supereg Supereg linked a pull request May 31, 2024 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants