1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-12 03:34:09 +02:00

set notification on step 1

This commit is contained in:
oliexdev
2025-03-03 13:11:00 +01:00
parent de9eb18718
commit 5742796444

View File

@@ -105,18 +105,14 @@ public class BluetoothQNScale extends BluetoothCommunication {
} catch (NullPointerException e) { } catch (NullPointerException e) {
useFirstType = false; 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; break;
case 1: 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) { if (useFirstType) {
setNotificationOn(WEIGHT_MEASUREMENT_SERVICE, CUSTOM1_MEASUREMENT_CHARACTERISTIC);
setIndicationOn(WEIGHT_MEASUREMENT_SERVICE, CUSTOM2_MEASUREMENT_CHARACTERISTIC); setIndicationOn(WEIGHT_MEASUREMENT_SERVICE, CUSTOM2_MEASUREMENT_CHARACTERISTIC);
} else {
setNotificationOn(WEIGHT_MEASUREMENT_SERVICE_ALTERNATIVE, CUSTOM1_MEASUREMENT_CHARACTERISTIC_ALTERNATIVE);
} }
break; break;
case 2: case 2: