Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

characteristic.getDescriptor() returns null

Tags:

java

android

I am interfacing a ble pedometer to android. when i execute the following line in my setCharacteristicNotification function i get descriptor as Null

BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(SampleGattAttributes.CLIENT_CHARACTERISTIC_CONFIG));



public static String CLIENT_CHARACTERISTIC_CONFIG = "00002902-0000-1000-8000-00805f9b34fb";

Why is it returning a null value ??

characteristic.getUuid() is returning me correct value.

like image 296
Sarao Avatar asked Mar 14 '15 20:03

Sarao


1 Answers

seems your device doesn't support this 0x2902 BluetoothGattDescriptor try to see all of your Descriptors:

  for (BluetoothGattDescriptor descriptor:characteristic.getDescriptors()){
                    Log.e(TAG, "BluetoothGattDescriptor: "+descriptor.getUuid().toString());
                }
like image 123
NickUnuchek Avatar answered Oct 30 '22 06:10

NickUnuchek