-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add support for transferring badge config via Bluetooth Low Energy #16
Conversation
Adds a new crate feature `ble` that allows for transfering badge configurations over Bluetooth Low Energy instead of USB. Expands the CLI to allow for specification of the transport protocol, either USB or BLE. The BLE library uses async rust requiring to add tokio as a async runtime to the CLI.
Reviewer's Guide by SourceryThis pull request adds support for transferring badge configurations via Bluetooth Low Energy (BLE) in addition to the existing USB option. It introduces a new crate feature File-Level Changes
Tips
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @hlxid - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR ❤️. BLE support was on my wishlist.
I have written a few improvement suggestions. In general please have look at all ?
operators. Every time you return an error from a library like btleplug
try to add a custom context to the error. This helps to narrow down where an error originated from (kind of like a stack trace). I have given one example suggestion, but this can be applied to all ?
operators.
Note: All suggestions are just written in GitHub, they still need cargo fmt
and maybe some use
statements are missing.
I can't test the BLE functionality myself. Did you test this feature on real hardware with an actual badge? And on which OS?
The CI pipeline failed on linux. The |
Thank you very much for your extensive review! I have tested this PR with a real badge on two different Arch Linux machines. I can also test it on Windows and macOS if you want. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome. I've just added some last suggestions.
And it would be great if you could test it on Windows and MacOS too.
Note: I haven't tested the code on Windows or MacOS at all. There could be unrelated bugs. If you have the time, you could also test the USB transport on those systems.
Thanks again. I've also removed the service UUID check as it is done through the I've tested this now on macOS where writing to the badge works but afterwards the CLI just decides to hang indefinitely and not exit as expected. USB works flawlessly :) |
LGTM I've moved the MacOS and Windows testing to a separate issue: #20 |
Adds a new crate feature
ble
that allows for transfering badge configurations over Bluetooth Low Energy instead of USB. Expands the CLI to allow for specification of the transport protocol, either USB or BLE.The BLE library uses async rust requiring to add tokio as a async runtime to the CLI.
Summary by Sourcery
This pull request introduces support for transferring badge configurations via Bluetooth Low Energy (BLE) by adding a new crate feature
ble
. The CLI has been expanded to allow users to specify the transport protocol (USB or BLE). Additionally, thetokio
async runtime has been integrated to support the asynchronous operations required by the BLE library. Documentation has been updated to reflect these changes.ble
.tokio
async runtime to support asynchronous operations required by the BLE library.