Same characteristic, different service

Ask, and ye shall receive.
mikepsmith
Posts: 6
Joined: 15:42, 28 May 2015

Same characteristic, different service

Postby mikepsmith » 16:12, 28 May 2015

I am developing an Android app to work with a BLE device which has the same characteristic UUID in two different services.

From looking at the easyble.js code, it seems to store all characteristic UUIDs discovered from the device in a single table indexed by the UUID value itself. This means that the first occurrence of the characteristic will be overwritten by the second and that the readCharacteristic() call will never return the value of the first instance.

Having read "Bluetooth Low Energy, The Developers Handbook", it appears that having the same characteristic UUID in different services is allowed (see section 14.6 for an example). This would mean that to handle this case the readCharacteristic() call would also need the service UUID as well as the characteristic UUID so that the correct characteristic can be found.

Am I right? :-)

At the moment it looks like I will have to implement a routine called readServiceCharacteristic() which will take both a service and a characteristic UUID.

Mike

Fredrik
Site Admin
Posts: 196
Joined: 15:00, 18 Nov 2013

Re: Same characteristic, different service

Postby Fredrik » 16:38, 28 May 2015

Your analysis appears to be correct and useful. Thanks!

The underlying BLE plugin tracks characteristics by integer handle rather than UUID, so a function readServiceCharacteristic() is definitely possible.

We'll want to have such a function ourselves, so I've opened an issue for it.


Return to “Questions and answers”

Who is online

Users browsing this forum: No registered users and 9 guests