flutter_blue set_notification_error, could not locate CCCD descriptor for characteristic
NickName:jason.juntong Ask DateTime:2021-06-18T15:45:28

flutter_blue set_notification_error, could not locate CCCD descriptor for characteristic

I created a flutter demo app for BLE connection and communication.

I'm try listen the data from characteristic value. But doing the await characteristic.setNotifyValue(true); will cause an error.

The code bellow is the whole operation from discovering services and read characteristic.

discoverServices() async {
List<BluetoothService> services = await discoveredDevice.discoverServices();
services.forEach((service) {
    service.characteristics.forEach((characteristic) async {

        // Read characteristic
        var value = await characteristic.read();
        debugPrint("Read value: $value");

        // Read descriptor
        var descriptors = characteristic.descriptors;
        for(BluetoothDescriptor d in descriptors) {
          List<int> descriptorValue = await d.read();
          debugPrint("Descriptor value: $descriptorValue");
        }

        await characteristic.setNotifyValue(true);
        debugPrint('Is characteristic notifying: ${characteristic.isNotifying}');
        characteristic.value.listen((characteristicValue) {
          debugPrint('Characteristic value: $characteristicValue');
          setState(() {
            listStream = characteristic.value;
          });
        });
    });
});

And I encounter this error:

E/flutter (28172): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: PlatformException(set_notification_error, could not locate CCCD descriptor for characteristic: 00002a00-0000-1000-8000-00805f9b34fb, null, null)

All characteristic uuid from my BLE device have the error above.

Your answer/s will be much appreciated, thank you!

Copyright Notice:Content Author:「jason.juntong」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/68031279/flutter-blue-set-notification-error-could-not-locate-cccd-descriptor-for-charac

More about “flutter_blue set_notification_error, could not locate CCCD descriptor for characteristic” related questions

flutter_blue set_notification_error, could not locate CCCD descriptor for characteristic

I created a flutter demo app for BLE connection and communication. I'm try listen the data from characteristic value. But doing the await characteristic.setNotifyValue(true); will cause an error. The

Show Detail

Flutter_blue and Adafruit Bluefruit BLE characteristic error: could not locate CCCD descriptor for characteristic

I am currently running into an issue with my ble project for flutter. I am using the flutter blue package by Paul DeMarco and the additional page for the app is based on &quot;ThatProject&quot; dust

Show Detail

How to write a client characteristic configuration descriptor in bluez

I am working with the example-gatt-server.py script that comes with bluez on my linux board. I want to add notification to one of my custom characteristics. For that I need to define the Client

Show Detail

flutter_blue: set_notification and read_characteristic errors on Android, BLE device disconnects on first connection attempt

I've been working with flutter for a few weeks now and am attempting to build an app to communicate with a power bank over BLE. In its current state, it works correctly on iOS. On android, partly d...

Show Detail

flutter_blue some characteristic properties are not working correctly

i am using any app that include flutter_blue package . I want to read , write and notify to some characteristics. I'm having trouble writing to a characteristic. When i use another package or anoth...

Show Detail

Windows 10 BLE C#: Subscribing to notifications from the peripheral using cccd fails first time for non-bonded devices

I am trying to develop a WPF app on windows 10 to communicate to a BLE device. I am using advertisement watcher class to scan for new devices. I am expected to authenticate (proprietary) to the dev...

Show Detail

If notify and indicate properties exist in one characteristic in Python bleak

i'm using bleak to control BLE(bluetooth low energy) devices in Python. and i was trying to control a BLE device that included notify and indicate properties in one characteristic, so there was a p...

Show Detail

Android as BLE peripheral does not show the CCCD descriptor when central discovers services, characteristic and descriptors being advertised

When my central device tries to discover the services, characteristics and its descriptor everything is discovered fine but when the central device tries to search for the Client Configuration

Show Detail

.writeValue will not let me write hex string to characteristic to enable notifications

My ble peripheral requires me to write the hex value 0x0001 to my CCCD descriptor to enable notifications. When I try to write the value to the characteristic with the .notify property, I get the

Show Detail

Confused about Characteristic/Descriptor addressing and UUIDs

I've always assumed that for every characteristic/service/descriptor on a BLE peripheral, there was a unique UUID. I figured the UUID not only described what it provided, but also provided a unique

Show Detail