From 273c34742683b4d65772a4e287b35c26330385ac Mon Sep 17 00:00:00 2001 From: Erik Johansson Date: Fri, 6 Jul 2018 07:01:21 +0200 Subject: [PATCH] Fix typo (data is in little endian format) --- .../com/health/openscale/core/bluetooth/BluetoothOneByone.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothOneByone.java b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothOneByone.java index 329395b4..c7e87327 100644 --- a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothOneByone.java +++ b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothOneByone.java @@ -137,7 +137,7 @@ public class BluetoothOneByone extends BluetoothCommunication { } private void parseBytesOld(byte[] weightBytes) { - float weight = Converters.fromUnsignedInt16Be(weightBytes, 3) / 100.0f; + float weight = Converters.fromUnsignedInt16Le(weightBytes, 3) / 100.0f; boolean done = (weightBytes[9] & 0xff) == 0; Timber.d("weight: %.2f%s", weight, done ? " (done)" : "");