From 451e5a16f428c35c986e9b93b489c0fd525a1107 Mon Sep 17 00:00:00 2001 From: Erik Johansson Date: Tue, 20 Nov 2018 12:59:54 +0100 Subject: [PATCH] Send user set up message --- .../openscale/core/bluetooth/BluetoothInlife.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothInlife.java b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothInlife.java index 505492d8..e8680d04 100644 --- a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothInlife.java +++ b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothInlife.java @@ -50,6 +50,18 @@ public class BluetoothInlife extends BluetoothCommunication { setNotificationOn(WEIGHT_SERVICE, WEIGHT_MEASUREMENT_CHARACTERISTIC, BluetoothGattUuid.DESCRIPTOR_CLIENT_CHARACTERISTIC_CONFIGURATION); break; + case 1: + byte level = 1; + byte sex = 0; // Male, 1 = female + byte userId = 0; + byte age = 30; + byte height = (byte)156; + byte[] data = {(byte)0x02, (byte)0xd2, level, sex, userId, age, height, + 0, 0, 0, 0, 0, 0, (byte)0xaa}; + data[data.length - 2] = xorChecksum(data, 1, 6); + + writeBytes(WEIGHT_SERVICE, WEIGHT_CMD_CHARACTERISTIC, data); + break; default: return false; }