Characteristics with duplicating UUIDs are not supported
See original GitHub issueI have a device which has two different characteristics with the same UUID (8b6b2dbe-cffa-4f90-b004-b411af90d4c4):
One of them should be used for writing data and another for notifications.
Seems kable uses standard android method for getting characteristic and it returns the first one by UUID:
service.getCharacteristic(BLE_DATA_STREAM_CHARACTERISTIC_DATA_AVAILABILITY)
For my device I wrote a pure app without libraries and I loop the service characteristic and choose proper one by checking its properties:
private fun BluetoothGattService.getCharaWithProperty(uuid: UUID, property: Int) = characteristics.first { it.uuid == uuid && it.properties and property != 0 }
This pure app works fine but if I use kable my device is not working properly.
Is there any way to choose service/characteristic from discovered but not just by UUIDs? Is there a workaround to my problem?
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (6 by maintainers)
@solvek I’ll put together a write up for users re: how characteristic and descriptor lookups have changed to have in the 0.13.0 release notes. I expect to cut the release in the coming days. Sorry it took so long to get this in, thanks for your patience!
@solvek thanks so much for all your help! I’ll try to get a version with this update released soon (expect it in the ~0.12.0 release~ 0.13.0 release).