This commit is contained in:
Dennis Guse
2021-12-22 22:29:09 +01:00
committed by GitHub
2 changed files with 13 additions and 21 deletions
+6 -8
View File
@@ -18,23 +18,21 @@
Please note that the according to the specification these sensors _may_ provide speed as well as cadence.
However, often only one value is provided.
### Speed
### Speed & Cadence
* Wahoo Blue SC
### Speed only
* Garmin Speed Sensor 2
* Has updatable firmware that requires an account for garmin.com
* This sensor reports speed data as cadence.
A workaround is in place.
* Wahoo Speed (Model: WFRPMSPD)
* CooSpo cadence and speed sensor (model: BK467)
### Cadence
### Cadence only
* Garmin Cadence Sensor 2
* Wahoo Cadence (Model: WFPODCAD2)
This sensor reports cadence data as speed.
A workaround is in place.
## 0x1818: Power Measurement
@@ -203,11 +203,6 @@ public abstract class BluetoothConnectionManager<DataType> {
return cadenceAndSpeed.getCadence();
}
//Workaround for Wahoo CADENCE: this sensor reports speed (instead of cadence)
if (cadenceAndSpeed.getDistanceSpeed() != null) {
return new SensorDataCycling.Cadence(cadenceAndSpeed.getDistanceSpeed());
}
return null;
}
}
@@ -226,15 +221,14 @@ public abstract class BluetoothConnectionManager<DataType> {
@Override
protected SensorDataCycling.DistanceSpeed parsePayload(String sensorName, String address, BluetoothGattCharacteristic characteristic) {
SensorDataCycling.CadenceAndSpeed cadenceAndSpeed = BluetoothUtils.parseCyclingCrankAndWheel(address, sensorName, characteristic);
if (cadenceAndSpeed != null) {
// Workaround for Garmin Speed Sensor 2: provides cadence instead of speed
SensorDataCycling.DistanceSpeed result = cadenceAndSpeed.getDistanceSpeed();
if (result == null && cadenceAndSpeed.getCadence() != null) {
result = new SensorDataCycling.DistanceSpeed(cadenceAndSpeed.getSensorAddress(), cadenceAndSpeed.getSensorName(), (int) cadenceAndSpeed.getCadence().getCrankRevolutionsCount(), cadenceAndSpeed.getCadence().getCrankRevolutionsTime());
}
return result;
if (cadenceAndSpeed == null) {
return null;
}
if (cadenceAndSpeed.getDistanceSpeed() != null) {
return cadenceAndSpeed.getDistanceSpeed();
}
return null;
}
}