Workaround: Wahoo Tickr X repords cadence in SPM instead of RPM.

Fixes #1164.
This commit is contained in:
Dennis Guse
2022-04-05 22:01:47 +02:00
parent 8ae268fab2
commit 92f9f94423
2 changed files with 5 additions and 1 deletions
@@ -107,7 +107,6 @@ public abstract class BluetoothConnectionManager<DataType> {
@Override
public void onCharacteristicChanged(BluetoothGatt gatt, @NonNull BluetoothGattCharacteristic characteristic) {
Log.d(TAG, "Received data from " + gatt.getDevice().getAddress());
SensorData<DataType> sensorData = parsePayload(gatt.getDevice().getName(), gatt.getDevice().getAddress(), characteristic);
if (sensorData != null) {
Log.d(TAG, "Decoded data from " + gatt.getDevice().getAddress() + ": " + sensorData);
@@ -165,6 +165,11 @@ public class BluetoothUtils {
index = 3;
if (valueLength - index >= 1) {
cadence = Cadence.of(characteristic.getIntValue(BluetoothGattCharacteristic.FORMAT_UINT8, index));
// Hacky workaround as the Wahoo Tickr X provides cadence in SPM (steps per minute) in violation to the standard.
if (sensorName != null && sensorName.startsWith("TICKR X")) {
cadence = Cadence.of(cadence.getRPM() / 2);
}
}
index = 4;