From 914bf2649899eb813a9039507b684c85b56bad32 Mon Sep 17 00:00:00 2001 From: oliexdev Date: Sun, 10 Oct 2021 11:19:12 +0200 Subject: [PATCH] fixed conversion error for checksum calculation. --- .../java/com/health/openscale/core/bluetooth/BluetoothOKOK.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothOKOK.java b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothOKOK.java index 300695fa..109ab0f4 100644 --- a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothOKOK.java +++ b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothOKOK.java @@ -68,7 +68,7 @@ public class BluetoothOKOK extends BluetoothCommunication { byte[] data = manufacturerSpecificData.get(MANUFACTURER_DATA_ID_V11); float divider = 10.0f; float extraWeight = 0; - byte checksum = 0xca ^ 0x11; // Version and magic fields are part of the checksum, but not in array + byte checksum = (byte)0xca ^ (byte)0x11; // Version and magic fields are part of the checksum, but not in array if (data == null || data.length != IDX_V11_CHECKSUM + 6 + 1) return; for (int i = 0; i < IDX_V11_CHECKSUM; i++)