From 2f1b7663b768af4174fa128ffaba2e56a8380092 Mon Sep 17 00:00:00 2001 From: Erik Johansson Date: Mon, 8 Oct 2018 21:12:34 +0200 Subject: [PATCH] Descriptor 0x2902 is the one that should be used to enable notifications Both according to https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml and the bt snoop log in #319 (from @Alejandro131) --- .../openscale/core/bluetooth/BluetoothBeurerSanitas.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothBeurerSanitas.java b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothBeurerSanitas.java index 2b646a6d..de8e691d 100644 --- a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothBeurerSanitas.java +++ b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothBeurerSanitas.java @@ -78,10 +78,8 @@ public class BluetoothBeurerSanitas extends BluetoothCommunication { private static final UUID SERVICE_CHANGED = UUID.fromString("00002A05-0000-1000-8000-00805F9B34FB"); - private static final UUID CLIENT_CHARACTERISTICS_CONFIGURATION_BEURER = + private static final UUID CLIENT_CHARACTERISTICS_CONFIGURATION = UUID.fromString("00002902-0000-1000-8000-00805F9B34FB"); - private static final UUID CLIENT_CHARACTERISTICS_CONFIGURATION_SANITAS = - UUID.fromString("00002901-0000-1000-8000-00805F9B34FB"); private static final UUID CUSTOM_SERVICE_1 = UUID.fromString("0000FFE0-0000-1000-8000-00805F9B34FB"); @@ -156,10 +154,7 @@ public class BluetoothBeurerSanitas extends BluetoothCommunication { seenUsers = new TreeSet<>(); // Setup notification - UUID clientCharacteristicsConfiguration = deviceType == DeviceType.SANITAS_SBF70_70 - ? CLIENT_CHARACTERISTICS_CONFIGURATION_SANITAS - : CLIENT_CHARACTERISTICS_CONFIGURATION_BEURER; - setNotificationOn(CUSTOM_SERVICE_1, CUSTOM_CHARACTERISTIC_WEIGHT, clientCharacteristicsConfiguration); + setNotificationOn(CUSTOM_SERVICE_1, CUSTOM_CHARACTERISTIC_WEIGHT, CLIENT_CHARACTERISTICS_CONFIGURATION); break; case 1: // Say "Hello" to the scale