mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-02-03 05:27:44 +01:00
Huawei: Generalize HR and SpO2 support
This commit is contained in:
parent
b43d87f6bc
commit
a90e1be0ee
@ -93,7 +93,7 @@ public class ActivityChartsActivity extends AbstractChartsActivity {
|
|||||||
if (!coordinator.supportsPai()) {
|
if (!coordinator.supportsPai()) {
|
||||||
tabList.remove("pai");
|
tabList.remove("pai");
|
||||||
}
|
}
|
||||||
if (!coordinator.supportsSpo2()) {
|
if (!coordinator.supportsSpo2(device)) {
|
||||||
tabList.remove("spo2");
|
tabList.remove("spo2");
|
||||||
}
|
}
|
||||||
if (!coordinator.supportsStepCounter()) {
|
if (!coordinator.supportsStepCounter()) {
|
||||||
|
@ -466,7 +466,7 @@ public abstract class AbstractDeviceCoordinator implements DeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsSpo2() {
|
public boolean supportsSpo2(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,7 +229,7 @@ public interface DeviceCoordinator {
|
|||||||
* Returns true if SpO2 measurement and fetching is supported by the device
|
* Returns true if SpO2 measurement and fetching is supported by the device
|
||||||
* (with this coordinator).
|
* (with this coordinator).
|
||||||
*/
|
*/
|
||||||
boolean supportsSpo2();
|
boolean supportsSpo2(GBDevice device);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if heart rate stats (max, resting, manual) measurement and fetching is supported
|
* Returns true if heart rate stats (max, resting, manual) measurement and fetching is supported
|
||||||
|
@ -266,7 +266,7 @@ public class CmfWatchProCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsSpo2() {
|
public boolean supportsSpo2(GBDevice device) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ public abstract class GarminCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsSpo2() {
|
public boolean supportsSpo2(GBDevice device) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ public class AmazfitBip3Coordinator extends HuamiCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsSpo2() {
|
public boolean supportsSpo2(GBDevice device) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ public class AmazfitBip3ProCoordinator extends HuamiCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsSpo2() {
|
public boolean supportsSpo2(GBDevice device) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ public abstract class ZeppOsCoordinator extends HuamiCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsSpo2() {
|
public boolean supportsSpo2(GBDevice device) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,7 +220,12 @@ public abstract class HuaweiBRCoordinator extends AbstractBLClassicDeviceCoordin
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return huaweiCoordinator.supportsHeartRate(device);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean supportsSpo2(GBDevice device) {
|
||||||
|
return huaweiCoordinator.supportsSPo2(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -59,7 +59,6 @@ public class HuaweiCoordinator {
|
|||||||
|
|
||||||
private final HuaweiCoordinatorSupplier parent;
|
private final HuaweiCoordinatorSupplier parent;
|
||||||
|
|
||||||
|
|
||||||
private boolean transactionCrypted=true;
|
private boolean transactionCrypted=true;
|
||||||
|
|
||||||
public HuaweiCoordinator(HuaweiCoordinatorSupplier parent) {
|
public HuaweiCoordinator(HuaweiCoordinatorSupplier parent) {
|
||||||
@ -340,7 +339,6 @@ public class HuaweiCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean supportsHeartRate() {
|
public boolean supportsHeartRate() {
|
||||||
// TODO: this is not correct
|
|
||||||
return supportsCommandForService(0x07, 0x17);
|
return supportsCommandForService(0x07, 0x17);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,7 +222,12 @@ public abstract class HuaweiLECoordinator extends AbstractBLEDeviceCoordinator i
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
||||||
return false;
|
return huaweiCoordinator.supportsHeartRate(device);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean supportsSpo2(GBDevice device) {
|
||||||
|
return huaweiCoordinator.supportsSPo2(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -50,16 +50,6 @@ public class HonorBand5Coordinator extends HuaweiLECoordinator {
|
|||||||
return Pattern.compile(HuaweiConstants.HO_BAND5_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
return Pattern.compile(HuaweiConstants.HO_BAND5_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSpo2() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
|
@ -45,16 +45,6 @@ public class HonorBand6Coordinator extends HuaweiLECoordinator {
|
|||||||
return Pattern.compile(HuaweiConstants.HO_BAND6_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
return Pattern.compile(HuaweiConstants.HO_BAND6_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSpo2() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
|
@ -45,16 +45,6 @@ public class HonorBand7Coordinator extends HuaweiLECoordinator {
|
|||||||
return Pattern.compile(HuaweiConstants.HO_BAND7_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
return Pattern.compile(HuaweiConstants.HO_BAND7_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSpo2() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
|
@ -54,11 +54,6 @@ public class HonorMagicWatch2Coordinator extends HuaweiBRCoordinator {
|
|||||||
return Pattern.compile(HuaweiConstants.HO_MAGICWATCH2_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
return Pattern.compile(HuaweiConstants.HO_MAGICWATCH2_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSpo2() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
|
@ -45,16 +45,6 @@ public class HuaweiBand4ProCoordinator extends HuaweiLECoordinator {
|
|||||||
return Pattern.compile("(" + HuaweiConstants.HU_BAND4_NAME + "|" + HuaweiConstants.HU_BAND4PRO_NAME + ").*", Pattern.CASE_INSENSITIVE);
|
return Pattern.compile("(" + HuaweiConstants.HU_BAND4_NAME + "|" + HuaweiConstants.HU_BAND4PRO_NAME + ").*", Pattern.CASE_INSENSITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSpo2() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
|
@ -45,16 +45,6 @@ public class HuaweiBand6Coordinator extends HuaweiLECoordinator {
|
|||||||
return Pattern.compile(HuaweiConstants.HU_BAND6_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
return Pattern.compile(HuaweiConstants.HU_BAND6_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSpo2() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
|
@ -45,16 +45,6 @@ public class HuaweiBand7Coordinator extends HuaweiLECoordinator {
|
|||||||
return Pattern.compile(HuaweiConstants.HU_BAND7_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
return Pattern.compile(HuaweiConstants.HU_BAND7_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSpo2() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
|
@ -45,16 +45,6 @@ public class HuaweiBand8Coordinator extends HuaweiLECoordinator {
|
|||||||
return Pattern.compile(HuaweiConstants.HU_BAND8_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
return Pattern.compile(HuaweiConstants.HU_BAND8_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSpo2() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
|
@ -49,16 +49,6 @@ public class HuaweiBand9Coordinator extends HuaweiLECoordinator {
|
|||||||
return Pattern.compile(HuaweiConstants.HU_BAND9_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
return Pattern.compile(HuaweiConstants.HU_BAND9_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSpo2() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
|
@ -44,16 +44,6 @@ public class HuaweiWatchFitCoordinator extends HuaweiLECoordinator {
|
|||||||
return Pattern.compile(HuaweiConstants.HU_WATCHFIT_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
return Pattern.compile(HuaweiConstants.HU_WATCHFIT_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSpo2() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
|
@ -45,16 +45,6 @@ public class HuaweiWatchGTCoordinator extends HuaweiLECoordinator {
|
|||||||
return Pattern.compile(HuaweiConstants.HU_WATCHGT_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
return Pattern.compile(HuaweiConstants.HU_WATCHGT_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSpo2() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
|
@ -49,11 +49,6 @@ public class HuaweiWatchGT2Coordinator extends HuaweiBRCoordinator {
|
|||||||
return Pattern.compile("(" + HuaweiConstants.HU_WATCHGT2_NAME + "|" + HuaweiConstants.HU_WATCHGT2PRO_NAME + ").*", Pattern.CASE_INSENSITIVE);
|
return Pattern.compile("(" + HuaweiConstants.HU_WATCHGT2_NAME + "|" + HuaweiConstants.HU_WATCHGT2PRO_NAME + ").*", Pattern.CASE_INSENSITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSpo2() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
|
@ -49,16 +49,6 @@ public class HuaweiWatchGT2eCoordinator extends HuaweiLECoordinator {
|
|||||||
return Pattern.compile(HuaweiConstants.HU_WATCHGT2E_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
return Pattern.compile(HuaweiConstants.HU_WATCHGT2E_NAME + ".*", Pattern.CASE_INSENSITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSpo2() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
|
@ -50,16 +50,6 @@ public class HuaweiWatchGT4Coordinator extends HuaweiBRCoordinator {
|
|||||||
return Pattern.compile("(" + HuaweiConstants.HU_WATCHGT4_NAME + ").*", Pattern.CASE_INSENSITIVE);
|
return Pattern.compile("(" + HuaweiConstants.HU_WATCHGT4_NAME + ").*", Pattern.CASE_INSENSITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSpo2() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
|
@ -49,16 +49,6 @@ public class HuaweiWatchUltimateCoordinator extends HuaweiBRCoordinator {
|
|||||||
return Pattern.compile("(" + HuaweiConstants.HU_WATCHULTIMATE_NAME + ").*", Pattern.CASE_INSENSITIVE);
|
return Pattern.compile("(" + HuaweiConstants.HU_WATCHULTIMATE_NAME + ").*", Pattern.CASE_INSENSITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsHeartRateMeasurement(GBDevice device) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsSpo2() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(GBDevice device, DaoSession session) {
|
||||||
return new HuaweiSpo2SampleProvider(device, session);
|
return new HuaweiSpo2SampleProvider(device, session);
|
||||||
|
@ -172,7 +172,7 @@ public class SonyWena3Coordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsSpo2() {
|
public boolean supportsSpo2(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ public class TestDeviceCoordinator extends AbstractDeviceCoordinator {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(final GBDevice device, final DaoSession session) {
|
public TimeSampleProvider<? extends Spo2Sample> getSpo2SampleProvider(final GBDevice device, final DaoSession session) {
|
||||||
return supportsSpo2() ? new TestSpo2SampleProvider() : super.getSpo2SampleProvider(device, session);
|
return supportsSpo2(device) ? new TestSpo2SampleProvider() : super.getSpo2SampleProvider(device, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -317,7 +317,7 @@ public class TestDeviceCoordinator extends AbstractDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsSpo2() {
|
public boolean supportsSpo2(GBDevice device) {
|
||||||
return supports(getTestDevice(), TestFeature.SPO2);
|
return supports(getTestDevice(), TestFeature.SPO2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -251,7 +251,7 @@ public abstract class XiaomiCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsSpo2() {
|
public boolean supportsSpo2(GBDevice device) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -413,7 +413,7 @@ public abstract class XiaomiCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
//
|
//
|
||||||
// Health
|
// Health
|
||||||
//
|
//
|
||||||
if (supportsStressMeasurement() && supports(device, FEAT_STRESS) && supportsSpo2() && supports(device, FEAT_SPO2)) {
|
if (supportsStressMeasurement() && supports(device, FEAT_STRESS) && supportsSpo2(device) && supports(device, FEAT_SPO2)) {
|
||||||
deviceSpecificSettings.addRootScreen(R.xml.devicesettings_heartrate_sleep_alert_activity_stress_spo2);
|
deviceSpecificSettings.addRootScreen(R.xml.devicesettings_heartrate_sleep_alert_activity_stress_spo2);
|
||||||
} else if (supportsStressMeasurement() && supports(device, FEAT_STRESS)) {
|
} else if (supportsStressMeasurement() && supports(device, FEAT_STRESS)) {
|
||||||
deviceSpecificSettings.addRootScreen(R.xml.devicesettings_heartrate_sleep_alert_activity_stress);
|
deviceSpecificSettings.addRootScreen(R.xml.devicesettings_heartrate_sleep_alert_activity_stress);
|
||||||
|
@ -27,6 +27,7 @@ import nodomain.freeyourgadget.gadgetbridge.R;
|
|||||||
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.XiaomiCoordinator;
|
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.XiaomiCoordinator;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.XiaomiInstallHandler;
|
import nodomain.freeyourgadget.gadgetbridge.devices.xiaomi.XiaomiInstallHandler;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||||
|
|
||||||
public class MiWatchLiteCoordinator extends XiaomiCoordinator {
|
public class MiWatchLiteCoordinator extends XiaomiCoordinator {
|
||||||
@Override
|
@Override
|
||||||
@ -72,7 +73,7 @@ public class MiWatchLiteCoordinator extends XiaomiCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsSpo2() {
|
public boolean supportsSpo2(GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1674,7 +1674,7 @@ public abstract class HuamiSupport extends AbstractBTLEDeviceSupport implements
|
|||||||
this.fetchOperationQueue.add(new FetchPaiOperation(this));
|
this.fetchOperationQueue.add(new FetchPaiOperation(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((dataTypes & RecordedDataTypes.TYPE_SPO2) != 0 && coordinator.supportsSpo2()) {
|
if ((dataTypes & RecordedDataTypes.TYPE_SPO2) != 0 && coordinator.supportsSpo2(gbDevice)) {
|
||||||
this.fetchOperationQueue.add(new FetchSpo2NormalOperation(this));
|
this.fetchOperationQueue.add(new FetchSpo2NormalOperation(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user