From 6125ba856f3e093fbb700650fa9c2cf38422df31 Mon Sep 17 00:00:00 2001 From: Grega Podlesek Date: Tue, 13 Feb 2024 16:45:28 +0100 Subject: [PATCH] Bug fix: Write correct descriptor value when attempting to disable notifications --- .../main/java/no/nordicsemi/android/ble/BleManagerHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ble/src/main/java/no/nordicsemi/android/ble/BleManagerHandler.java b/ble/src/main/java/no/nordicsemi/android/ble/BleManagerHandler.java index 404f95ae..f3a5b68b 100644 --- a/ble/src/main/java/no/nordicsemi/android/ble/BleManagerHandler.java +++ b/ble/src/main/java/no/nordicsemi/android/ble/BleManagerHandler.java @@ -969,7 +969,7 @@ private boolean internalDisableNotifications(@Nullable final BluetoothGattCharac if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { log(Log.DEBUG, () -> "gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x00-00)"); - return gatt.writeDescriptor(descriptor, BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE) == BluetoothStatusCodes.SUCCESS; + return gatt.writeDescriptor(descriptor, BluetoothGattDescriptor.DISABLE_NOTIFICATION_VALUE) == BluetoothStatusCodes.SUCCESS; } else { log(Log.DEBUG, () -> "descriptor.setValue(0x00-00)"); descriptor.setValue(BluetoothGattDescriptor.DISABLE_NOTIFICATION_VALUE);