-
Notifications
You must be signed in to change notification settings - Fork 88
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
Services with the same UUIDs #93
Comments
Android provides I'll have to investigate if Core Bluetooth (e.g. iOS) and JavaScript offer a similar property (to keep behavior parity between the platforms). — this might be a good approach for Core Bluetooth. |
@Shakenbeer it looks like BluetoothGattService and BluetoothGattCharacteristic both have an Just to confirm: You don't have multiple descriptors (with the same UUID) on the same characteristic, do you? |
@twyatt There is
I did a quick fix for myself. Now I can read/write/observe characteristics and read/write descriptors for services with the same UUID.
and that
|
@twyatt Answering your question - no, I do not. I think, it's only possible for services. But I'm not sure, need to read some specs. |
Aw, thanks for the tip.
Do you know if Android always has the same instance ID for the characteristics (with the same UUID)? In other words, can you rely on the Perhaps it is just based on the ordering that they are sent over during discover services? In which case it would be in the control of the Peripheral/server as to what the ordering would be. 🤔 |
I checked instanceIds only for services so far. And those ids are the same after every connection. But I believe you would want some written confirmation in specs. So far I simply write those two services instanceIds to properties after services are discovered and use them. Also, I'm not sure at all, how those ids are assigned. For example, I have 9 services and ids are 1, 9, 16, 35, 44, 75, 106, 137, 150. |
Just when I thought BLE couldn't get any stranger. 😄 Thanks for the info! I'll do some research when I have some time, but good to hear that at least you're observing that they are consistent across connects. |
For the Core Bluetooth side, found this helpful recommendation:
— Differentiate between two CBCharacteristics with identical UUIDs? It seems likely that in situations where multiple characteristics share a UUID, that Kable libraries consumers will need to iterate the |
Apologies, I haven't had the time I had hoped to work on this. I do want to tackle this sooner than later, but it will have to be pushed back to a later version. |
There is nothing to apologize for. I was able to adjust your great code to my needs. Unfortunately I have no time to make this properly and create a pull request. I should apologize here. |
This comment has been minimized.
This comment has been minimized.
@Shakenbeer when you have a chance, can you try the following version and see if it addresses this issue?:
See #238 for more details. |
@twyatt thanks for your work. At this moment I can't verify it, as we closed the project and I have neither devices nor software infrastructure to simulate the state of interest. I'll try to find time on the weekend and verify it with some simulated devices. Sorry that I can't help more at this moment. If I still worked on that project, I would do it right away. |
No worries at all. Other users had similar issues, so I'll be able to get feedback as needed. Thanks for following up! |
Thanks a lot for you work. The library is awesome.
I have BLE device with this strange firmware. There are two services with the same UUIDs and with identical sets of characteristics. The only difference is in one of descriptors. So, there are two services S1 and S2, they both have characteristic C, and value of a descriptor D differs. All uuids are the same.
S1.uuid == S2.uuid
S1.C.uuid == S2.C.uuid
S1.C.D.uuid == S2.C.D.uuid
S1.C.D.value != S1.C.D.value.
This way I should distinct those 2 services.
So after services are discovered I do a loop over them and for every service S1 and S2 I read that descriptor.
Unfortunately I always get the same value, as in both cases I read only descriptor of the service S1.
readDescriptor
function searches for descriptor through all services and always return the first one found.Is there a way to read identical descriptors (and characteristics) of two different services?
The text was updated successfully, but these errors were encountered: