If we call setCharacteristicNotification on a character, not giving Remote Notification on value Change? How to enable the remote Notification on a Central
To enable notification you should do as following.
mBluetoothLeService.setCharacteristicNotification(mSampleCharacteristic, true);
of which definition is as following.
if (enabled) {
BluetoothGattDescriptor bluetoothGattDescriptor = characteristic.getDescriptor(UUID.fromString(SampleGattAttributes.CLIENT_CHARACTERISTIC_CONFIG));
bluetoothGattDescriptor.setValue(BluetoothGattDescriptor.ENABLE_INDICATION_VALUE);
mBluetoothGatt.writeDescriptor(bluetoothGattDescriptor);
} else {
BluetoothGattDescriptor bluetoothGattDescriptor = characteristic.getDescriptor(UUID.fromString(SampleGattAttributes.CLIENT_CHARACTERISTIC_CONFIG));
bluetoothGattDescriptor.setValue(BluetoothGattDescriptor.DISABLE_NOTIFICATION_VALUE);
mBluetoothGatt.writeDescriptor(bluetoothGattDescriptor);
}
Still if remote notification does not work, try to read characteristics only after enabling notifications for the same.
Reading characteristics is as
mBluetoothLeService.readCharacteristic(eachChara);