JS connection fails when characteristic has no descriptors
See original GitHub issueKable version: 0.10.2
Kotlin version: 1.5.31 (using IR)
Chrome version: 95.0.4638.54 (64 bit)
Upon trying to connect to my BLE device, I get the following error message:
SystemLogEngine.kt?d539:37 [Kable] z6FTIjgMta7LYVye0Uu2zQ== Unable to retrieve descriptor.
service: 00001000-0000-1000-8000-00805f9b34fb
characteristic: 00001001-0000-1000-8000-00805f9b34fb
DOMException: No Descriptors found in Characteristic.
By using a different, third-party BLE tool (“nRF Connect for Mobile” Android app) I have been able to establish that the characteristic mentioned in the error message indeed has no descriptors.

In terms of the source code, I have been able to figure out that…
- Upon
connecting to aPeripheral, all Services are being queried and converted toPlatformServices: https://github.com/JuulLabs/kable/blob/0.10.2/core/src/jsMain/kotlin/Peripheral.kt#L178 - For each individual Service, the Characteristics are in turn queried and converted to
PlatformCharacteristics: https://github.com/JuulLabs/kable/blob/0.10.2/core/src/jsMain/kotlin/PlatformService.kt#L24 - Each individual Characteristic queries a list of descriptors: https://github.com/JuulLabs/kable/blob/0.10.2/core/src/jsMain/kotlin/PlatformCharacteristic.kt#L27
- The Characteristic uses the external
getDescriptorsmethod in the Web Bluetooth API: https://github.com/JuulLabs/kable/blob/0.10.2/core/src/jsMain/kotlin/external/BluetoothRemoteGATTCharacteristic.kt#L19 - That method seems to throw an error when there are no Descriptors (cf. the original error report “No Descriptors found in Characteristic”, which triggers the catch handler in https://github.com/JuulLabs/kable/blob/0.10.2/core/src/jsMain/kotlin/PlatformCharacteristic.kt#L28
Please note that I am not knowledgeable enough in Bluetooth or BLE technology to understand what a Characteristic not having Descriptors even means, or whether it is allowed per the Bluetooth specifications. The device I am using is a Rubik’s Cube that can track movements and rotations, cf. https://www.thecubicle.com/products/moyu-weilong-ai-3x3
Thank you for your awesome Kotlin library 😄
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (6 by maintainers)

Top Related StackOverflow Question
With your snapshot, the exception changes from
GATT operation failed for unknown reason.toGATT operation not permitted.The cube is publicly available, it’s called “MoYu WeiLong AI”. You can purchase one at
But I really won’t expect the maintainers of a free, open-source project to spend 70USD for debugging a random Bluetooth issue! 😅 I’d be more than happy to get in touch via the kotlinlang Slack, I think my username is either
gregorbgorGregor Billingover there.An update on this. I received the “MoYu WeiLong AI”, but have not yet had time to revisit this issue. I’ll try to find some time soon though.