修正 GH301的测试方式,要与IC66一致。
authorsnickersun <scy@incartech.cn>
Mon, 29 Mar 2021 04:05:37 +0000 (12:05 +0800)
committersnickersun <scy@incartech.cn>
Mon, 29 Mar 2021 04:05:37 +0000 (12:05 +0800)
已知问题 数据解析后未作逻辑处理。

app/src/main/java/com/ic/work/WorkService.java
app/src/main/java/com/ic/work/hardware/BloodInfoHelper.java
app/src/main/java/com/ic/work/hardware/BloodRunnable.java
app/src/main/java/com/ic/work/utils/HardwareUtils.java

index 25ade05..b3f1e90 100644 (file)
@@ -296,6 +296,7 @@ public class WorkService extends Service {
                 switch (acyion) {
                     case GET_PED_ACTION:
                         //ThreadPoolManager.getInstance().execute(new PedRunnable(mApp.getApplicationContext(), mApp.getRepository()));
+                        IcLog.d(TAG,"GET_PED_ACTION ");
                         new Thread(new PedRunnable(mApp.getApplicationContext(), mApp.getRepository())).start();
                         break;
                     case Intent.ACTION_TIMEZONE_CHANGED:
index 65ced8d..112b2ba 100644 (file)
@@ -53,7 +53,7 @@ public class BloodInfoHelper implements SensorEventListener {
 
     public void getBloodInfo() {
         ICLogger.d("getBloodInfo...");
-        boolean[] deviceState = HardwareUtils.isPPGavailableGH301();
+        boolean[] deviceState = HardwareUtils.isPPGavailableIc66();
 
         if (!deviceState[0]) {
             IcLog.d(TAG, "deviceState[0] == > false");
index 19cda8d..4961c22 100644 (file)
@@ -30,17 +30,17 @@ public class BloodRunnable implements Runnable {
 
         boolean[] deviceState = HardwareUtils.isPPGavailableIc66();
 
-        if (!deviceState[0]) {
+        if (!deviceState[0]) {//没有 ECG sensor
             sendTipsEventBus(BLOOD_NULL_TIPS, BLOOD_NOT_DEVICE);
             //add by TrillGates notify task finished.
             EventBus.getDefault().post(new TaskFinishedEvent());
             return;
         }
 
-        if (deviceState[1]) {
+        if (deviceState[1]) {//有 IC66或者GH301
             sendTipsEventBus(BLOOD_PLEASE_QUIET, BLOOD_START_CHECK);
             EventBus.getDefault().post(new BloodSensorEvent(1));
-        } else {
+        } else {// 其他ECG Sensor
             checkBloodOther();
         }
         //add by TrillGates notify task finished.
index cf5dbae..b629522 100644 (file)
@@ -11,20 +11,7 @@ public class HardwareUtils {
             int value = ICJniUtils.isPPGavailable();
             return new boolean[]{
                     value > ICJniUtils.PPG_EGC_SensorType.PPG_EGC_TYPE_NONE.ordinal(),
-                    value == ICJniUtils.PPG_EGC_SensorType.PPG_EGC_TYPE_IC66.ordinal()
-            };
-        } catch (Exception e) {
-            IcLog.e(TAG, "", e);
-            return new boolean[]{false, false};
-        }
-    }
-
-    public static boolean[] isPPGavailableGH301() {
-        try {
-            int value = ICJniUtils.isPPGavailable();
-            return new boolean[]{
-                    value > ICJniUtils.PPG_EGC_SensorType.PPG_EGC_TYPE_NONE.ordinal(),
-                    value == ICJniUtils.PPG_EGC_SensorType.PPG_EGC_TYPE_GH301.ordinal()
+                    value == ICJniUtils.PPG_EGC_SensorType.PPG_EGC_TYPE_IC66.ordinal()||value == ICJniUtils.PPG_EGC_SensorType.PPG_EGC_TYPE_GH301.ordinal()
             };
         } catch (Exception e) {
             IcLog.e(TAG, "", e);