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

Provide ability to request connection priority #36

Closed
twyatt opened this issue Dec 15, 2020 · 5 comments · Fixed by #125
Closed

Provide ability to request connection priority #36

twyatt opened this issue Dec 15, 2020 · 5 comments · Fixed by #125
Milestone

Comments

@twyatt
Copy link
Member

twyatt commented Dec 15, 2020

Android BLE API supports requesting various connection priorities. Kable should expose this functionality for platforms that support it.

Implemented in Able via JuulLabs/able#95.

@mtrewartha
Copy link
Contributor

Hey, just checking on status for this... Any updates? We're experimenting with kable in our app and so far, liking it quite a bit! I think this is the one feature it's missing that we'd find really helpful, as we transfer large amounts of data over BLE and this would speed things up quite a bit. Thanks for the great library!

@twyatt
Copy link
Member Author

twyatt commented Jun 23, 2021

We try to prioritize issues based on number of 👍  . After each release we try to shuffle issues into appropriate target milestones based on their upvote count (as much as feasible at least).

That being said, internally we'll be wanting this feature as well, so we'll be getting to it sooner rather than later regardless of number of upvotes.

Thanks for the great library!

Thanks for the kind words. 😄

@mtrewartha
Copy link
Contributor

Great, thanks for the update!

@twyatt
Copy link
Member Author

twyatt commented Jun 24, 2021

@mtrewartha looked into it really quick and found the implementation to be super simple. As mentioned in #125, requestConnectionPriority is a bit bizarre: AFAIK there isn't a way to know if the connection priority request was successful. The requestConnectionPriority itself returns a Boolean, but that only indicates if the request went to the OS, not if it was completed successfully (i.e. whether or not connection parameters were successfully negotiated with the remote peripheral). 🤷

When you have a chance, you can give it a try:

repositories {
    maven("https://oss.sonatype.org/content/repositories/snapshots")
}

dependencies {
    implementation("com.juul.kable:core:0.5.1-issue-125-1-SNAPSHOT")
}
peripheral.connect()
peripheral.requestConnectionPriority(Priority.High) // or Priority.Low or Priority.Balanced

@twyatt twyatt added this to the 0.6.0 milestone Jun 24, 2021
@mtrewartha
Copy link
Contributor

Works great 👍🏼

Thanks again for the great library! The API is quite intuitive and so far, it's been reliable for me. I was able to replace all BLE code in our app and move it from our Android app module to a shared module in a matter of a day, all thanks to this library.

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 a pull request may close this issue.

2 participants