forked from upstream-mirrors/OpenTracks
+1
-2
@@ -1,7 +1,6 @@
|
||||
package de.dennisguse.opentracks.sensors;
|
||||
|
||||
import android.bluetooth.BluetoothGattCharacteristic;
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
@@ -33,7 +32,7 @@ public class BluetoothHandlerBarometricPressure implements SensorHandlerInterfac
|
||||
public void handlePayload(SensorManager.SensorDataChangedObserver observer, ServiceMeasurementUUID serviceMeasurementUUID, String sensorName, String address, BluetoothGattCharacteristic characteristic) {
|
||||
AtmosphericPressure value = parseEnvironmentalSensing(characteristic);
|
||||
if (value == null) return;
|
||||
Log.i("ZXCV", "VALUE: " + value);
|
||||
|
||||
observer.onChange(new Raw<>(value));
|
||||
}
|
||||
|
||||
|
||||
+4
-3
@@ -3,16 +3,17 @@ package de.dennisguse.opentracks.sensors.sensorData;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import de.dennisguse.opentracks.data.models.Power;
|
||||
import de.dennisguse.opentracks.sensors.BluetoothHandlerManagerCyclingPower;
|
||||
|
||||
public class AggregatorCyclingPower extends Aggregator<Power, Power> {
|
||||
public class AggregatorCyclingPower extends Aggregator<BluetoothHandlerManagerCyclingPower.Data, Power> {
|
||||
|
||||
public AggregatorCyclingPower(String name, String address) {
|
||||
super(name, address);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void computeValue(Raw<Power> current) {
|
||||
this.value = current.value();
|
||||
public void computeValue(Raw<BluetoothHandlerManagerCyclingPower.Data> current) {
|
||||
this.value = current.value().power();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
||||
@@ -10,7 +10,6 @@ import androidx.annotation.VisibleForTesting;
|
||||
import de.dennisguse.opentracks.data.models.AtmosphericPressure;
|
||||
import de.dennisguse.opentracks.data.models.Cadence;
|
||||
import de.dennisguse.opentracks.data.models.HeartRate;
|
||||
import de.dennisguse.opentracks.data.models.Power;
|
||||
import de.dennisguse.opentracks.data.models.Speed;
|
||||
import de.dennisguse.opentracks.data.models.TrackPoint;
|
||||
import de.dennisguse.opentracks.sensors.BluetoothHandlerCyclingCadence;
|
||||
@@ -116,7 +115,7 @@ public final class SensorDataSet {
|
||||
return;
|
||||
}
|
||||
if (value instanceof BluetoothHandlerManagerCyclingPower.Data) {
|
||||
this.cyclingPower.add((Raw<Power>) data);
|
||||
this.cyclingPower.add((Raw<BluetoothHandlerManagerCyclingPower.Data>) data);
|
||||
return;
|
||||
}
|
||||
if (value instanceof AtmosphericPressure) {
|
||||
|
||||
Reference in New Issue
Block a user