1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-18 14:31:23 +02:00

fixed conversion error for checksum calculation.

This commit is contained in:
oliexdev
2021-10-10 11:19:12 +02:00
parent 36eb1a8b40
commit 914bf26498

View File

@@ -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++)