1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-22 08:13:43 +02:00

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)
This commit is contained in:
Erik Johansson
2018-10-08 21:12:34 +02:00
parent c03d8c7601
commit 2f1b7663b7

View File

@@ -78,10 +78,8 @@ public class BluetoothBeurerSanitas extends BluetoothCommunication {
private static final UUID SERVICE_CHANGED = private static final UUID SERVICE_CHANGED =
UUID.fromString("00002A05-0000-1000-8000-00805F9B34FB"); 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"); 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 = private static final UUID CUSTOM_SERVICE_1 =
UUID.fromString("0000FFE0-0000-1000-8000-00805F9B34FB"); UUID.fromString("0000FFE0-0000-1000-8000-00805F9B34FB");
@@ -156,10 +154,7 @@ public class BluetoothBeurerSanitas extends BluetoothCommunication {
seenUsers = new TreeSet<>(); seenUsers = new TreeSet<>();
// Setup notification // Setup notification
UUID clientCharacteristicsConfiguration = deviceType == DeviceType.SANITAS_SBF70_70 setNotificationOn(CUSTOM_SERVICE_1, CUSTOM_CHARACTERISTIC_WEIGHT, CLIENT_CHARACTERISTICS_CONFIGURATION);
? CLIENT_CHARACTERISTICS_CONFIGURATION_SANITAS
: CLIENT_CHARACTERISTICS_CONFIGURATION_BEURER;
setNotificationOn(CUSTOM_SERVICE_1, CUSTOM_CHARACTERISTIC_WEIGHT, clientCharacteristicsConfiguration);
break; break;
case 1: case 1:
// Say "Hello" to the scale // Say "Hello" to the scale