From 574279644419e354de2217c98f350b018571d84f Mon Sep 17 00:00:00 2001 From: oliexdev Date: Mon, 3 Mar 2025 13:11:00 +0100 Subject: [PATCH] set notification on step 1 --- .../openscale/core/bluetooth/BluetoothQNScale.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothQNScale.java b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothQNScale.java index 02f47d53..70a25b7a 100644 --- a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothQNScale.java +++ b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothQNScale.java @@ -105,18 +105,14 @@ public class BluetoothQNScale extends BluetoothCommunication { } catch (NullPointerException e) { useFirstType = false; } - - // set notification on for custom characteristic 1 (weight, time, and others) - if (useFirstType) { - setNotificationOn(WEIGHT_MEASUREMENT_SERVICE, CUSTOM1_MEASUREMENT_CHARACTERISTIC); - } else { - setNotificationOn(WEIGHT_MEASUREMENT_SERVICE_ALTERNATIVE, CUSTOM1_MEASUREMENT_CHARACTERISTIC_ALTERNATIVE); - } break; case 1: - // set indication on for weight measurement + // set indication on for weight measurement and for custom characteristic 1 (weight, time, and others) if (useFirstType) { + setNotificationOn(WEIGHT_MEASUREMENT_SERVICE, CUSTOM1_MEASUREMENT_CHARACTERISTIC); setIndicationOn(WEIGHT_MEASUREMENT_SERVICE, CUSTOM2_MEASUREMENT_CHARACTERISTIC); + } else { + setNotificationOn(WEIGHT_MEASUREMENT_SERVICE_ALTERNATIVE, CUSTOM1_MEASUREMENT_CHARACTERISTIC_ALTERNATIVE); } break; case 2: