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

Support multiple services or characteristics with the same id #776

Merged
merged 8 commits into from
Aug 28, 2023

Conversation

spkersten
Copy link
Collaborator

@spkersten spkersten commented Jul 26, 2023

Fixes #478
Fixes #509

The change is mostly backwards compatible. The exception to that is that if you try to use the existing read/write/subscribe methods for a characteristic ids for which there is no single unique instance, an exception is thrown. Before, it would read/write/subscribe the first matching characteristic.

@spkersten spkersten force-pushed the multi-service branch 2 times, most recently from 6a79dc0 to 75801ca Compare July 26, 2023 14:31
@spkersten spkersten force-pushed the multi-service branch 3 times, most recently from faa61d4 to 5797c5f Compare August 17, 2023 13:14
@spkersten spkersten changed the title Draft: Support multiple services or characteristics with the same id Support multiple services or characteristics with the same id Aug 17, 2023
@spkersten spkersten force-pushed the multi-service branch 2 times, most recently from ea79440 to 7b5fe98 Compare August 17, 2023 13:24
@@ -152,24 +154,31 @@ open class ReactiveBleClient(private val context: Context) : BleClient {
}.firstOrError()
}

@SuppressLint("MissingPermission")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I recommend against adding @SuppressLint("MissingPermission") to the library in order to suppress lint warnings. Instead, we have provided clear instructions in the README about the required permissions for the library's proper functioning. It's important to maintain a transparent approach to permissions and ensure that developers integrating the library are aware of and handle the necessary permissions appropriately.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How does adding a SuppressLint conflict with "maintain[ing] a transparent approach to permissions and ensur[ing] that developers integrating the library are aware of and handle the necessary permissions appropriately"?

@spkersten spkersten force-pushed the multi-service branch 2 times, most recently from 213380d to df35339 Compare August 28, 2023 09:35
@Taym95 Taym95 merged commit 49aa9d9 into PhilipsHue:master Aug 28, 2023
1 check passed
@castehlin
Copy link

Hi,

Sorry if this is the wrong place since it's closed, but I haven't found a place that covers this latest change and if it addresses characteristics with identical service and char uuids, but different properties (write/read/notify etc). The documentation for this package doesn't seem to cover this on pub.dev.

Provided I've found the unique characteristic using the isWritable/isNotifyable fields or the instance_id, how can I get something like writeCharacteristic() or subscribeCharacteristic() to take in these unique identifiers, rather than just what the QualifiedCharacteristic object allows (only charUuid, serviceUuid, deviceId?)

Is this supported in this package yet?

SO post that covers this in a bit more detail:
https://stackoverflow.com/questions/77052224/how-to-write-notify-to-characteristic-with-identical-service-and-char-uuids-in-f

@spkersten
Copy link
Collaborator Author

spkersten commented Sep 22, 2023

@castehlin The entry point for dealing with services or characteristics that don't have a unique id is getDiscoveredServices. Or alternatively the resolve method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants