I have connected to a bluetooth device. I am able to read charectristic using
mGatt.readCharacteristic(getMiliService().getCharacteristic(uuid));
But I am not able to register indicate for a characteristic.
What I tried
boolean flag1 = m_Gatt.setCharacteristicNotification(bluetoothgattcharacteristic, flag);
BluetoothGattDescriptor descriptor= bluetoothgattcharacteristic.getDescriptor(Helper.UUID_DESCRIPTOR_CLIENT_CHARACTERISTIC_CONFIGURATION);
descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
mGatt.writeDescriptor(descriptor);
descriptor.setValue(BluetoothGattDescriptor.ENABLE_INDICATION_VALUE);
mGatt.writeDescriptor(descriptor);
and waiting for
onCharacteristicChanged(BluetoothGatt bluetoothgatt, final BluetoothGattCharacteristic characteristic)
method getting called. which never happend.
I am not sure what I am missing here.
Can anyone give a working example for indicate?