release V500
authorsnickersun <scy@incartech.cn>
Fri, 14 Aug 2020 14:04:40 +0000 (22:04 +0800)
committersnickersun <scy@incartech.cn>
Fri, 14 Aug 2020 14:04:40 +0000 (22:04 +0800)
1、添加体温预警的开关
2、修改protocol_ic , 适配A9提出的协议 BP68 ,BP86,BPDE,BPDG

app/release/ICSer_V500_2008142200_release.apk [moved from app/release/ICSer_V499_2008141706_release.apk with 77% similarity]
app/release/output.json
app/src/main/java/com/enqualcomm/support/Config.java
app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java
app/src/main/java/com/ic/protocols/protocol_ic.java
app/src/main/res/values-zh-rCN/strings.xml
app/src/main/res/values/strings.xml
app/version_code.properties

similarity index 77%
rename from app/release/ICSer_V499_2008141706_release.apk
rename to app/release/ICSer_V500_2008142200_release.apk
index 03382bf..4fc8cee 100644 (file)
Binary files a/app/release/ICSer_V499_2008141706_release.apk and b/app/release/ICSer_V500_2008142200_release.apk differ
index 301e513..d6c48ac 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":499,"versionName":"2008141706","enabled":true,"outputFile":"ICSer_V499_2008141706_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V499_2008141706_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":500,"versionName":"2008142200","enabled":true,"outputFile":"ICSer_V500_2008142200_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V500_2008142200_release.apk","properties":{}}]
\ No newline at end of file
index e28ebc2..a8dc5dd 100644 (file)
@@ -347,6 +347,7 @@ public class Config {
 \r
   public static boolean needAllwaysAlarmFenceOut=false;\r
   public static boolean needAllwaysAlarmAntiOff=false;\r
+  public static boolean needTemperature_abnormal_alarm=false;\r
 \r
   public static void LoadMessageConfigs(){\r
     String tmp=Util.getSystemProperties("persist.sys.doBroadcastMSG");\r
@@ -400,6 +401,7 @@ public class Config {
       needBroadcastAntiAlarm=true;\r
       needAllwaysAlarmAntiOff=true;\r
       needAllwaysAlarmFenceOut=true;\r
+      needTemperature_abnormal_alarm=true;\r
       noPPGSensor=false;\r
       noTempSensor=false;\r
     }\r
index 07eae29..d0bf788 100644 (file)
@@ -3,6 +3,7 @@ package com.enqualcomm.support.utils;
 import android.content.Context;\r
 import android.content.Intent;\r
 \r
+import com.enqualcomm.support.Config;\r
 import com.enqualcomm.support.Constants;\r
 import com.enqualcomm.support.CoreService;\r
 import com.enqualcomm.support.bean.Runtime;\r
@@ -75,20 +76,21 @@ public class TemperatureUtil {
 \r
                     Runtime runtime=CoreService.getInstance().getRuntime();\r
                     runtime.tempInfo.setTemp(body_temp,wrist_temp);\r
-\r
-                    switch( runtime.tempInfo.isBodyTempAbnormal()){\r
-                        case 0:\r
-                            break;\r
-                        case 1:\r
-                            runtime.setAlarmType(Runtime.AlarmType.ALARM_HEART_RATE_HIGH);\r
-                            //trigger AP10 报警定位\r
-                            CoreService.getInstance().getConnection().send(protocolAPIHelper.genStringMessage("AP10", protocolAPIHelper.getWarningMSG(runtime)));\r
-                            break;\r
-                        case 2:\r
-                            runtime.setAlarmType(Runtime.AlarmType.ALARM_HEART_RATE_LOW);\r
-                            //trigger AP10 报警定位\r
-                            CoreService.getInstance().getConnection().send(protocolAPIHelper.genStringMessage("AP10", protocolAPIHelper.getWarningMSG(runtime)));\r
-                            break;\r
+                    if (Config.needTemperature_abnormal_alarm) {\r
+                        switch (runtime.tempInfo.isBodyTempAbnormal()) {\r
+                            case 0:\r
+                                break;\r
+                            case 1:\r
+                                runtime.setAlarmType(Runtime.AlarmType.ALARM_HEART_RATE_HIGH);\r
+                                //trigger AP10 报警定位\r
+                                CoreService.getInstance().getConnection().send(protocolAPIHelper.genStringMessage("AP10", protocolAPIHelper.getWarningMSG(runtime)));\r
+                                break;\r
+                            case 2:\r
+                                runtime.setAlarmType(Runtime.AlarmType.ALARM_HEART_RATE_LOW);\r
+                                //trigger AP10 报警定位\r
+                                CoreService.getInstance().getConnection().send(protocolAPIHelper.genStringMessage("AP10", protocolAPIHelper.getWarningMSG(runtime)));\r
+                                break;\r
+                        }\r
                     }\r
 \r
                 }else{\r
@@ -103,19 +105,21 @@ public class TemperatureUtil {
                     Runtime runtime=CoreService.getInstance().getRuntime();\r
                     runtime.tempInfo.setTemp(body_temp,wrist_temp);\r
 \r
-                    switch( runtime.tempInfo.isBodyTempAbnormal()){\r
-                        case 0:\r
-                            break;\r
-                        case 1:\r
-                            runtime.setAlarmType(Runtime.AlarmType.ALARM_TEMP_HIGH);\r
-                            //trigger AP10 报警定位\r
-                            CoreService.getInstance().getConnection().send(protocolAPIHelper.genStringMessage("AP10", protocolAPIHelper.getWarningMSG(runtime)));\r
-                            break;\r
-                        case 2:\r
-                            runtime.setAlarmType(Runtime.AlarmType.ALARM_TEMP_LOW);\r
-                            //trigger AP10 报警定位\r
-                            CoreService.getInstance().getConnection().send(protocolAPIHelper.genStringMessage("AP10", protocolAPIHelper.getWarningMSG(runtime)));\r
-                            break;\r
+                    if (Config.needTemperature_abnormal_alarm) {\r
+                        switch (runtime.tempInfo.isBodyTempAbnormal()) {\r
+                            case 0:\r
+                                break;\r
+                            case 1:\r
+                                runtime.setAlarmType(Runtime.AlarmType.ALARM_TEMP_HIGH);\r
+                                //trigger AP10 报警定位\r
+                                CoreService.getInstance().getConnection().send(protocolAPIHelper.genStringMessage("AP10", protocolAPIHelper.getWarningMSG(runtime)));\r
+                                break;\r
+                            case 2:\r
+                                runtime.setAlarmType(Runtime.AlarmType.ALARM_TEMP_LOW);\r
+                                //trigger AP10 报警定位\r
+                                CoreService.getInstance().getConnection().send(protocolAPIHelper.genStringMessage("AP10", protocolAPIHelper.getWarningMSG(runtime)));\r
+                                break;\r
+                        }\r
                     }\r
                 }\r
 \r
index 0f20857..cc15426 100644 (file)
@@ -1499,12 +1499,13 @@ public class protocol_ic {
     }\r
 \r
     //17.绑定解绑(下行协议号:BP68,响应:AP68)\r
-    public static String AP68(String index){\r
+    public static String AP68(String index,String cmd){\r
 \r
-        //设备响应:      IWAP86, 080835#\r
+        //设备响应:      IWAP86, 080835,1#\r
         //080835:指令流水号\r
         return new StringBuffer(CMDHEADER).append(cmdMap.get(CMD_TYPE.AP68))\r
                 .append(CMDSPLIT).append(index)\r
+                .append(CMDSPLIT).append(cmd)\r
                 .append(CMDEND).toString();\r
     }\r
 \r
@@ -1524,7 +1525,7 @@ public class protocol_ic {
         if (list.length==4){\r
             String index=list[2];\r
             String type=list[3];\r
-            connection.send(genStringMessage("AP86",AP68(index)));\r
+            connection.send(genStringMessage("AP86",AP68(index,type)));\r
             ICLogger.i("收到服务器消息:"+(type.equals("1")?"绑定成功 ":"未激活或者解绑"));\r
             if (Config.custom_branch_name.equals("YQ")||Config.custom_branch_name.equals("YQ_EN")) {//AK-YQ\r
                 if (type.equals("1")) {\r
@@ -1563,7 +1564,7 @@ public class protocol_ic {
 \r
         //示例:\r
         //IWBP86, 353456789012345, 080835,1,720#\r
-        //说明:\r
+        //说明:IWBP86,867400020316612,858663,1,30\r
         //IW:标识符\r
         //BP86 : 命令字符\r
         //353456789012345:IMEI号,设备唯一ID\r
@@ -1917,25 +1918,25 @@ public class protocol_ic {
     public void handleBPDE(NettyConnection connection,String cmd,Runtime runtime){\r
 /***\r
  * 示例:\r
- * IWBPDE,353456789012345,1 #\r
+ * IWBPDE,867400020316612,853676,0\r
  * 说明:\r
  * IW:标识符\r
  * BPDE: 命令字符\r
  * 353456789012345:设备IMEI或者ID\r
  * 080835 :指令流水号\r
- * 1:进入禁止区域 2离开禁止区域\r
+ * 0:进入禁止区域 1离开禁止区域\r
  * #:结尾标识符\r
  * 设备响应:     IWAPDE,080835#\r
  * 080835:指令流水号\r
  * 说明:   本消息适用所有终端\r
  */\r
         String[] list=cmd.split(CMDSPLIT);\r
-        if (list.length==3){\r
+        if (list.length==4){\r
 \r
-            String index=list[1];\r
-            String msg=list[2];\r
+            String index=list[2];\r
+            String msg=list[3];\r
             connection.send(genStringMessage("APDE",APDE(index)));\r
-            if ( Integer.parseInt(msg) == 1) {\r
+            if ( Integer.parseInt(msg) == 0) {\r
                 ICLogger.i("Handle BPDE index " + index + ", 进入禁止区域 ");\r
                 runtime.Fence_Warning_flag=1;\r
                 WakeLockUtil.ScreenOnWakeLockTemperary(runtime.getContextProxy().context);\r
@@ -1943,7 +1944,8 @@ public class protocol_ic {
             }else {\r
                 ICLogger.i("Handle BPDE index " + index + ", 离开禁止区域 ");\r
                 runtime.Fence_Warning_flag=0;\r
-//                runtime.getContextProxy().sendMsgBroadcast(runtime.getContextProxy().context.getResources().getString(R.string.alarm_out_wall),0);\r
+//                Util.ShowToast(runtime,"");\r
+                runtime.getContextProxy().sendMsgBroadcast(runtime.getContextProxy().context.getResources().getString(R.string.alarm_cross_boundary),0);\r
             }\r
         }else{\r
             ICLogger.i("BPDE format error!");\r
@@ -1961,7 +1963,7 @@ public class protocol_ic {
 /**\r
  * 示例:\r
  * IWBPDG,353456789012345,1,30.0,37.3 #\r
- * 说明:\r
+ * 说明:IWBPDG,867400020316612,502102,1,33,44\r
  * IW:标识符\r
  * BPDG: 命令字符\r
  * 353456789012345:设备IMEI或者ID\r
@@ -1972,18 +1974,23 @@ public class protocol_ic {
  * #:结尾标识符\r
  * */\r
         String[] list=cmd.split(CMDSPLIT);\r
-        if (list.length==5){\r
+        if (list.length==6){\r
 \r
-            String index=list[1];\r
-            String switch_on=list[2];\r
-            String min_temp=list[3];\r
-            String max_temp=list[4];\r
+            String index=list[2];\r
+            String switch_on=list[3];\r
+            String min_temp=list[4];\r
+            String max_temp=list[5];\r
             connection.send(genStringMessage("APDG",APDG(index)));\r
             if ( Integer.parseInt(switch_on) == 1) {\r
                 ICLogger.i("Handle BPDG index " + index + ", 体温报警阈值开 min="+min_temp+",max="+max_temp);\r
+                runtime.tempInfo.setBodyTempThreshold(Double.valueOf(max_temp),Double.valueOf(min_temp));\r
+                Config.needTemperature_abnormal_alarm=true;\r
             }else {\r
                 ICLogger.i("Handle BPDG index " + index + ", 体温报警阈值关 ");\r
+                Config.needTemperature_abnormal_alarm=false;\r
             }\r
+\r
+\r
         }else{\r
             ICLogger.i("BPDG format error!");\r
         }\r
@@ -2137,12 +2144,14 @@ public class protocol_ic {
  * # 结尾标识符\r
  */\r
         String[] cmdlist=cmd.split(CMDSPLIT);\r
-        if (cmdlist.length==5){\r
+\r
+        if (cmdlist.length>=4 ){\r
             String imei=cmdlist[1];\r
             String id=cmdlist[2];\r
             String cdd=cmdlist[3];\r
-            String tmp=cmdlist[4];\r
-\r
+            if (cmdlist.length==5) {\r
+                String tmp = cmdlist[4];\r
+            }\r
             connection.send(genStringMessage("AP46",AP46(id,cdd)));\r
 \r
             if (cdd.equals("1")) {\r
@@ -2356,7 +2365,9 @@ public class protocol_ic {
                 mConnection.DeliverCMDMessageToSystem("AP86",cmd);//通知下面线程状态变化\r
 \r
                 break;\r
-\r
+            case BP68:\r
+                handleBP68(cmd,mConnection,mRuntime);\r
+                break;\r
             case BP88:\r
                 //收到查找设备消息\r
                 handleBP88(cmd,mConnection);\r
index b70cc73..288978d 100644 (file)
     <string name="alarm_unbind_success">恭喜您解矫成功</string>
     <string name="alarm_Illegal_unlock">非法解锁</string>
     <string name="alarm_out_wall">您已越界,请尽快返回</string>
+    <string name="alarm_cross_boundary">您已越界!</string>
     <string name="alarm_wristband_off">腕带已脱落</string>
     <string name="alarm_wristband_on">腕带已佩戴</string>
 
index 71cce27..6f4c45f 100644 (file)
     <string name="alarm_unbind_success">Congratulations on your successful unbind!</string>
     <string name="alarm_Illegal_unlock">Illegal to unlock!</string>
     <string name="alarm_out_wall">You have crossed the line, please return as soon as possible!</string>
+    <string name="alarm_cross_boundary">You have crossed the boundary!</string>
     <string name="alarm_wristband_off">Wristband has fallen off</string>
     <string name="alarm_wristband_on">Wristband has been wear</string>
 
index b3d63c8..bd894b8 100644 (file)
@@ -1,2 +1,2 @@
-#Fri Aug 14 17:06:25 CST 2020\r
-VERSION_CODE=499\r
+#Fri Aug 14 22:00:59 CST 2020\r
+VERSION_CODE=500\r