AA协议上传心率体温后得到返回值并通过广播发出去
authork.liang <liangkang648253071@126.com>
Mon, 18 Oct 2021 02:02:28 +0000 (10:02 +0800)
committerk.liang <liangkang648253071@126.com>
Mon, 18 Oct 2021 02:02:28 +0000 (10:02 +0800)
app/release/output.json
app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java
app/src/main/java/com/ic/protocols/protocol_anan.java
app/version_code.properties

index 67d4a06..7602ec3 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":973,"versionName":"2110151050","enabled":true,"outputFile":"ICSer_V973_2110151050_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V973_2110151050_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":977,"versionName":"2110151940","enabled":true,"outputFile":"ICSer_V977_2110151940_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V977_2110151940_release.apk","properties":{}}]
\ No newline at end of file
index 00af445..4e10cd9 100644 (file)
@@ -118,7 +118,7 @@ public class TemperatureUtil {
         }
     };
 
-    private void handleTemperature(Temperature temperature) {
+    private void  handleTemperature(Temperature temperature) {
         ICLogger.i("Temperature done!" + temperature);
         if (temperature == null) {
             return;
index 495cf2c..0f19e9d 100644 (file)
@@ -14,6 +14,7 @@ import android.media.AudioManager;
 import android.net.Uri;
 import android.os.Environment;
 import android.os.SystemProperties;
+import android.os.UserHandle;
 import android.provider.Settings;
 import android.support.v4.app.ActivityCompat;
 import android.telephony.TelephonyManager;
@@ -394,6 +395,7 @@ public class protocol_anan {
         cmdMap.put(CMD_TYPE.BPDW, "BPDW");
         cmdMap.put(CMD_TYPE.BPBJ, "BPBJ");
         cmdMap.put(CMD_TYPE.BPTP, "BPTP");
+        cmdMap.put(CMD_TYPE.BPHT, "BPHT");
     }
 
 
@@ -929,6 +931,7 @@ public class protocol_anan {
                 mConnection.DeliverCMDMessageToSystem("AP01", cmd);//通知下面线程服务器收到指令
                 break;
             case BPHT:
+                handleBPHT(mConnection,cmd);
                 ICLogger.i("服务器收到上传的心率血压APHT");
                 mConnection.DeliverCMDMessageToSystem("APHT", cmd);//通知下面线程服务器收到指令
                 break;
@@ -1785,6 +1788,24 @@ public class protocol_anan {
         }
     }
 
+    public void handleBPHT(Connection connection, String cmd) {
+        //IWBPHT,870314001009713,98,35.6,63,118,78,-8
+        String[] cmdlist = cmd.split(CMDSPLIT);
+        if(cmdlist.length == 8){
+            sendTempBroadcast(Double.parseDouble(cmdlist[3]));
+        }
+    }
+
+    public static final String ACTION_TEMP_RESULT = "com.ic.action.watch_face_value";
+    public static final String KEY_TEMP_BODY = "body";  // double 体温
+
+    private void sendTempBroadcast(double bodyTemp) {
+        Intent pedIntent = new Intent();
+        ICLogger.i("bodyTemp == > " + bodyTemp);
+        pedIntent.setAction(ACTION_TEMP_RESULT);
+        pedIntent.putExtra(KEY_TEMP_BODY, bodyTemp);
+        mRuntime.getContextProxy().context.sendBroadcast(pedIntent);
+    }
 
     public static StringMessage AP18(String index) {
         return genStringMessage("AP18", new StringBuffer(CMDHEADER).append(cmdMap.get(CMD_TYPE.AP18))
index fc67c9e..d158af4 100644 (file)
@@ -1,2 +1,2 @@
-#Tue Oct 12 11:54:18 CST 2021\r
-VERSION_CODE=973\r
+#Fri Oct 15 19:40:40 CST 2021\r
+VERSION_CODE=977\r