From: snickersun Date: Fri, 14 Aug 2020 14:04:40 +0000 (+0800) Subject: release V500 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=633bad91af887cc36baf3050c794be515c7287c2;p=protocol_srv.git release V500 1、添加体温预警的开关 2、修改protocol_ic , 适配A9提出的协议 BP68 ,BP86,BPDE,BPDG --- diff --git a/app/release/ICSer_V499_2008141706_release.apk b/app/release/ICSer_V500_2008142200_release.apk similarity index 77% rename from app/release/ICSer_V499_2008141706_release.apk rename to app/release/ICSer_V500_2008142200_release.apk index 03382bf1..4fc8ceeb 100644 Binary files a/app/release/ICSer_V499_2008141706_release.apk and b/app/release/ICSer_V500_2008142200_release.apk differ diff --git a/app/release/output.json b/app/release/output.json index 301e5136..d6c48aca 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -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 diff --git a/app/src/main/java/com/enqualcomm/support/Config.java b/app/src/main/java/com/enqualcomm/support/Config.java index e28ebc2f..a8dc5dd5 100644 --- a/app/src/main/java/com/enqualcomm/support/Config.java +++ b/app/src/main/java/com/enqualcomm/support/Config.java @@ -347,6 +347,7 @@ public class Config { public static boolean needAllwaysAlarmFenceOut=false; public static boolean needAllwaysAlarmAntiOff=false; + public static boolean needTemperature_abnormal_alarm=false; public static void LoadMessageConfigs(){ String tmp=Util.getSystemProperties("persist.sys.doBroadcastMSG"); @@ -400,6 +401,7 @@ public class Config { needBroadcastAntiAlarm=true; needAllwaysAlarmAntiOff=true; needAllwaysAlarmFenceOut=true; + needTemperature_abnormal_alarm=true; noPPGSensor=false; noTempSensor=false; } diff --git a/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java b/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java index 07eae293..d0bf7885 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java +++ b/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java @@ -3,6 +3,7 @@ package com.enqualcomm.support.utils; import android.content.Context; import android.content.Intent; +import com.enqualcomm.support.Config; import com.enqualcomm.support.Constants; import com.enqualcomm.support.CoreService; import com.enqualcomm.support.bean.Runtime; @@ -75,20 +76,21 @@ public class TemperatureUtil { Runtime runtime=CoreService.getInstance().getRuntime(); runtime.tempInfo.setTemp(body_temp,wrist_temp); - - switch( runtime.tempInfo.isBodyTempAbnormal()){ - case 0: - break; - case 1: - runtime.setAlarmType(Runtime.AlarmType.ALARM_HEART_RATE_HIGH); - //trigger AP10 报警定位 - CoreService.getInstance().getConnection().send(protocolAPIHelper.genStringMessage("AP10", protocolAPIHelper.getWarningMSG(runtime))); - break; - case 2: - runtime.setAlarmType(Runtime.AlarmType.ALARM_HEART_RATE_LOW); - //trigger AP10 报警定位 - CoreService.getInstance().getConnection().send(protocolAPIHelper.genStringMessage("AP10", protocolAPIHelper.getWarningMSG(runtime))); - break; + if (Config.needTemperature_abnormal_alarm) { + switch (runtime.tempInfo.isBodyTempAbnormal()) { + case 0: + break; + case 1: + runtime.setAlarmType(Runtime.AlarmType.ALARM_HEART_RATE_HIGH); + //trigger AP10 报警定位 + CoreService.getInstance().getConnection().send(protocolAPIHelper.genStringMessage("AP10", protocolAPIHelper.getWarningMSG(runtime))); + break; + case 2: + runtime.setAlarmType(Runtime.AlarmType.ALARM_HEART_RATE_LOW); + //trigger AP10 报警定位 + CoreService.getInstance().getConnection().send(protocolAPIHelper.genStringMessage("AP10", protocolAPIHelper.getWarningMSG(runtime))); + break; + } } }else{ @@ -103,19 +105,21 @@ public class TemperatureUtil { Runtime runtime=CoreService.getInstance().getRuntime(); runtime.tempInfo.setTemp(body_temp,wrist_temp); - switch( runtime.tempInfo.isBodyTempAbnormal()){ - case 0: - break; - case 1: - runtime.setAlarmType(Runtime.AlarmType.ALARM_TEMP_HIGH); - //trigger AP10 报警定位 - CoreService.getInstance().getConnection().send(protocolAPIHelper.genStringMessage("AP10", protocolAPIHelper.getWarningMSG(runtime))); - break; - case 2: - runtime.setAlarmType(Runtime.AlarmType.ALARM_TEMP_LOW); - //trigger AP10 报警定位 - CoreService.getInstance().getConnection().send(protocolAPIHelper.genStringMessage("AP10", protocolAPIHelper.getWarningMSG(runtime))); - break; + if (Config.needTemperature_abnormal_alarm) { + switch (runtime.tempInfo.isBodyTempAbnormal()) { + case 0: + break; + case 1: + runtime.setAlarmType(Runtime.AlarmType.ALARM_TEMP_HIGH); + //trigger AP10 报警定位 + CoreService.getInstance().getConnection().send(protocolAPIHelper.genStringMessage("AP10", protocolAPIHelper.getWarningMSG(runtime))); + break; + case 2: + runtime.setAlarmType(Runtime.AlarmType.ALARM_TEMP_LOW); + //trigger AP10 报警定位 + CoreService.getInstance().getConnection().send(protocolAPIHelper.genStringMessage("AP10", protocolAPIHelper.getWarningMSG(runtime))); + break; + } } } diff --git a/app/src/main/java/com/ic/protocols/protocol_ic.java b/app/src/main/java/com/ic/protocols/protocol_ic.java index 0f208574..cc15426c 100644 --- a/app/src/main/java/com/ic/protocols/protocol_ic.java +++ b/app/src/main/java/com/ic/protocols/protocol_ic.java @@ -1499,12 +1499,13 @@ public class protocol_ic { } //17.绑定解绑(下行协议号:BP68,响应:AP68) - public static String AP68(String index){ + public static String AP68(String index,String cmd){ - //设备响应: IWAP86, 080835# + //设备响应: IWAP86, 080835,1# //080835:指令流水号 return new StringBuffer(CMDHEADER).append(cmdMap.get(CMD_TYPE.AP68)) .append(CMDSPLIT).append(index) + .append(CMDSPLIT).append(cmd) .append(CMDEND).toString(); } @@ -1524,7 +1525,7 @@ public class protocol_ic { if (list.length==4){ String index=list[2]; String type=list[3]; - connection.send(genStringMessage("AP86",AP68(index))); + connection.send(genStringMessage("AP86",AP68(index,type))); ICLogger.i("收到服务器消息:"+(type.equals("1")?"绑定成功 ":"未激活或者解绑")); if (Config.custom_branch_name.equals("YQ")||Config.custom_branch_name.equals("YQ_EN")) {//AK-YQ if (type.equals("1")) { @@ -1563,7 +1564,7 @@ public class protocol_ic { //示例: //IWBP86, 353456789012345, 080835,1,720# - //说明: + //说明:IWBP86,867400020316612,858663,1,30 //IW:标识符 //BP86 : 命令字符 //353456789012345:IMEI号,设备唯一ID @@ -1917,25 +1918,25 @@ public class protocol_ic { public void handleBPDE(NettyConnection connection,String cmd,Runtime runtime){ /*** * 示例: - * IWBPDE,353456789012345,1 # + * IWBPDE,867400020316612,853676,0 * 说明: * IW:标识符 * BPDE: 命令字符 * 353456789012345:设备IMEI或者ID * 080835 :指令流水号 - * 1:进入禁止区域 2离开禁止区域 + * 0:进入禁止区域 1离开禁止区域 * #:结尾标识符 * 设备响应: IWAPDE,080835# * 080835:指令流水号 * 说明: 本消息适用所有终端 */ String[] list=cmd.split(CMDSPLIT); - if (list.length==3){ + if (list.length==4){ - String index=list[1]; - String msg=list[2]; + String index=list[2]; + String msg=list[3]; connection.send(genStringMessage("APDE",APDE(index))); - if ( Integer.parseInt(msg) == 1) { + if ( Integer.parseInt(msg) == 0) { ICLogger.i("Handle BPDE index " + index + ", 进入禁止区域 "); runtime.Fence_Warning_flag=1; WakeLockUtil.ScreenOnWakeLockTemperary(runtime.getContextProxy().context); @@ -1943,7 +1944,8 @@ public class protocol_ic { }else { ICLogger.i("Handle BPDE index " + index + ", 离开禁止区域 "); runtime.Fence_Warning_flag=0; -// runtime.getContextProxy().sendMsgBroadcast(runtime.getContextProxy().context.getResources().getString(R.string.alarm_out_wall),0); +// Util.ShowToast(runtime,""); + runtime.getContextProxy().sendMsgBroadcast(runtime.getContextProxy().context.getResources().getString(R.string.alarm_cross_boundary),0); } }else{ ICLogger.i("BPDE format error!"); @@ -1961,7 +1963,7 @@ public class protocol_ic { /** * 示例: * IWBPDG,353456789012345,1,30.0,37.3 # - * 说明: + * 说明:IWBPDG,867400020316612,502102,1,33,44 * IW:标识符 * BPDG: 命令字符 * 353456789012345:设备IMEI或者ID @@ -1972,18 +1974,23 @@ public class protocol_ic { * #:结尾标识符 * */ String[] list=cmd.split(CMDSPLIT); - if (list.length==5){ + if (list.length==6){ - String index=list[1]; - String switch_on=list[2]; - String min_temp=list[3]; - String max_temp=list[4]; + String index=list[2]; + String switch_on=list[3]; + String min_temp=list[4]; + String max_temp=list[5]; connection.send(genStringMessage("APDG",APDG(index))); if ( Integer.parseInt(switch_on) == 1) { ICLogger.i("Handle BPDG index " + index + ", 体温报警阈值开 min="+min_temp+",max="+max_temp); + runtime.tempInfo.setBodyTempThreshold(Double.valueOf(max_temp),Double.valueOf(min_temp)); + Config.needTemperature_abnormal_alarm=true; }else { ICLogger.i("Handle BPDG index " + index + ", 体温报警阈值关 "); + Config.needTemperature_abnormal_alarm=false; } + + }else{ ICLogger.i("BPDG format error!"); } @@ -2137,12 +2144,14 @@ public class protocol_ic { * # 结尾标识符 */ String[] cmdlist=cmd.split(CMDSPLIT); - if (cmdlist.length==5){ + + if (cmdlist.length>=4 ){ String imei=cmdlist[1]; String id=cmdlist[2]; String cdd=cmdlist[3]; - String tmp=cmdlist[4]; - + if (cmdlist.length==5) { + String tmp = cmdlist[4]; + } connection.send(genStringMessage("AP46",AP46(id,cdd))); if (cdd.equals("1")) { @@ -2356,7 +2365,9 @@ public class protocol_ic { mConnection.DeliverCMDMessageToSystem("AP86",cmd);//通知下面线程状态变化 break; - + case BP68: + handleBP68(cmd,mConnection,mRuntime); + break; case BP88: //收到查找设备消息 handleBP88(cmd,mConnection); diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index b70cc736..288978d6 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -122,6 +122,7 @@ 恭喜您解矫成功 非法解锁 您已越界,请尽快返回 + 您已越界! 腕带已脱落 腕带已佩戴 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 71cce27a..6f4c45f2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -122,6 +122,7 @@ Congratulations on your successful unbind! Illegal to unlock! You have crossed the line, please return as soon as possible! + You have crossed the boundary! Wristband has fallen off Wristband has been wear diff --git a/app/version_code.properties b/app/version_code.properties index b3d63c8e..bd894b86 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Fri Aug 14 17:06:25 CST 2020 -VERSION_CODE=499 +#Fri Aug 14 22:00:59 CST 2020 +VERSION_CODE=500