-1

When i am trying to read characteristic using readCharacteristic() it giving me true but when i am getting response in onCharacteristicRead() it giving me

status = 128

instead of

status=0 (BluetoothGatt.GATT_SUCCESS)

Can any one help me or guide me ?? Thank you in advance.

android_sh
  • 171
  • 2
  • 12

1 Answers1

0

According to the Android Bluetooth source code status 128 refers to: GATT_NO RESOURCES

I'd encourage you to share more code as this error code should only appear if you haven't defined your BluetoothGattCharacteristic / BluetoothGattDescriptor.

Mark O'Sullivan
  • 10,138
  • 6
  • 39
  • 60
  • Thanks for response. I have added my descriptor and it giving me success in writedescriptor(). and FYI , i am using descriptor for different characteristic. – android_sh Oct 30 '17 at 14:22
  • final UUID CHARACTERISTIC_UPDATE_NOTIFICATION_DESCRIPTOR_UUID = UUID .fromString("00002902-0000-1000-8000-00805f9b34fb"); mBluetoothGatt.setCharacteristicNotification(rx_characteristic, true); readDescriptor = rx_characteristic .getDescriptor(CHARACTERISTIC_UPDATE_NOTIFICATION_DESCRIPTOR_UUID); if (readDescriptor == null) { return false; } readDescriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE); and writing descriptor when my all characteristic read completd – android_sh Oct 30 '17 at 14:26
  • No i am not writing and reading same characteristic. I am writing in another characteristic which causing status change and it giving me 128 while reading that status changed characteristic. one major noticeable thing is that without requestmtu() its working properly – android_sh Oct 30 '17 at 14:29