1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-26 09:44:31 +02:00

Send user set up message

This commit is contained in:
Erik Johansson
2018-11-20 12:59:54 +01:00
parent 44773dee1f
commit 451e5a16f4

View File

@@ -50,6 +50,18 @@ public class BluetoothInlife extends BluetoothCommunication {
setNotificationOn(WEIGHT_SERVICE, WEIGHT_MEASUREMENT_CHARACTERISTIC, setNotificationOn(WEIGHT_SERVICE, WEIGHT_MEASUREMENT_CHARACTERISTIC,
BluetoothGattUuid.DESCRIPTOR_CLIENT_CHARACTERISTIC_CONFIGURATION); BluetoothGattUuid.DESCRIPTOR_CLIENT_CHARACTERISTIC_CONFIGURATION);
break; 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: default:
return false; return false;
} }