Bugfix: running sensor data total is distance is UINT_32.

This commit is contained in:
Dennis Guse
2021-11-11 20:20:43 +01:00
parent b1032f898a
commit c3d55127fe
2 changed files with 5 additions and 5 deletions
@@ -175,8 +175,8 @@ public class BluetoothUtils {
index += 2;
}
if (hasTotalDistance && valueLength - index >= 2) {
totalDistance = Distance.ofDM(characteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_UINT16, index));
if (hasTotalDistance && valueLength - index >= 4) {
totalDistance = Distance.ofDM(characteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_UINT32, index));
}
return new SensorDataRunning(address, sensorName, speed, cadence, totalDistance);