From: SnickerSun Date: Sat, 25 Sep 2021 15:24:26 +0000 (+0800) Subject: release protocolV2 V902 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=15a27b11c29d045675af91f9c73772c3343e0f1c;p=icsupport.git release protocolV2 V902 L004PT 增加BPSQ 设置心率,体温检测频率 --- diff --git a/app/release/ICSer_V901_2109020927_release.apk b/app/release/ICSer_V902_2109252319_release.apk similarity index 77% rename from app/release/ICSer_V901_2109020927_release.apk rename to app/release/ICSer_V902_2109252319_release.apk index b57d79ef..57bc709d 100644 Binary files a/app/release/ICSer_V901_2109020927_release.apk and b/app/release/ICSer_V902_2109252319_release.apk differ diff --git a/app/release/output.json b/app/release/output.json index c9c56b17..16286fd2 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":901,"versionName":"2109020927","enabled":true,"outputFile":"ICSer_V901_2109020927_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V901_2109020927_release.apk","properties":{}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":902,"versionName":"2109252319","enabled":true,"outputFile":"ICSer_V902_2109252319_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V902_2109252319_release.apk","properties":{}}] \ No newline at end of file diff --git a/app/src/main/java/com/ic/protocols/protocol_beehome.java b/app/src/main/java/com/ic/protocols/protocol_beehome.java index c69f96ce..ab17943d 100644 --- a/app/src/main/java/com/ic/protocols/protocol_beehome.java +++ b/app/src/main/java/com/ic/protocols/protocol_beehome.java @@ -125,6 +125,8 @@ public class protocol_beehome { UNKNOWN_CMD, BPTF,//时间设置 APTF,//时间设置 + BPSQ,//设置体征信息监测间隔 + APSQ, } private static HashMap cmdMap = null; @@ -209,6 +211,8 @@ public class protocol_beehome { cmdMap.put(CMD_TYPE.BPHP, "BPHP"); cmdMap.put(CMD_TYPE.BPTF, "BPTF"); cmdMap.put(CMD_TYPE.APTF, "APTF"); + cmdMap.put(CMD_TYPE.BPSQ, "BPSQ"); + cmdMap.put(CMD_TYPE.APSQ, "APSQ"); } @@ -1885,11 +1889,74 @@ public class protocol_beehome { ICLogger.i("BPX1 format error!"); } } + public static StringMessage APSQ(String id,int type , int cycle) { + //设备响应: IWAPSQ,080835,1,60# + //080835:指令流水号 + return genStringMessage(cmdMap.get(CMD_TYPE.APSQ), new StringBuffer(CMDHEADER).append(cmdMap.get(CMD_TYPE.APSQ)) + .append(CMDSPLIT).append(id) + .append(CMDSPLIT).append(type) + .append(CMDSPLIT).append(cycle) + .append(CMDEND).toString()); + } + + public void handleBPSQ(String cmd, Connection connection, Runtime runtime) { + //IWBPSQ,353456789012345,080835,1,60# + //说明: + // 080835为序列号,1,是传感器类型(1是心率,2是血压,3是体温,4是血氧),60为间隔时间,单位为秒 + String[] list = cmd.split(CMDSPLIT); + if (list.length >= 5) { + + String imei = list[1]; + String index = list[2]; + String typestr = list[3].trim(); + String cyclestr = list[4].trim(); + int type=0; + int cycle_seconds=0; + int cycle_minutes=0; + try{ + type=Integer.parseInt(typestr); + cycle_seconds = Integer.parseInt(cyclestr); + connection.send(APSQ(index,type,cycle_seconds)); + cycle_minutes = cycle_seconds/60; + String type_name="未知"; + switch(type){ + case 1: + type_name="心率"; + //发送重置PPGCycle的广播,会在CoreServer里面执行 + CoreService.getInstance().setHeartRateDetectAlarm(cycle_minutes); + break; + case 2: + type_name="血压"; + //发送重置PPGCycle的广播,会在CoreServer里面执行 + CoreService.getInstance().setHeartRateDetectAlarm(cycle_minutes); + break; + case 3: + type_name="体温"; + Config.setTemperatureTestCycle(runtime, cycle_seconds); + CoreService.getInstance().setTempAlarm(true); + break; + case 4: + type_name="血氧"; + //发送重置PPGCycle的广播,会在CoreServer里面执行 + CoreService.getInstance().setHeartRateDetectAlarm(cycle_minutes); + break; + default: + type_name="未知"; + break; + } + ICLogger.i("收到 BPSQ 指令,设置体征传感器测试周期, IMEI " + imei + ", index " + index + ", 传感器类型 " + type + " "+type_name + " 间隔"+cycle_seconds+"秒,相当于"+cycle_minutes+"分钟"); + }catch (Exception e){ + ICLogger.e(e.getMessage(), e); + } + } else { + ICLogger.i("BPSQ format error!"); + } + } public static StringMessage APHP(Runtime ds) { //IWAPHP,60,130,85,95,90, , , , , , , , # //IW:标识符 - //APHT : 命令字符 + //APHP : 命令字符 //60 : 表示心率 //130: 血压高压 [收缩压] //85 : 血压低压 [舒张压] @@ -2127,6 +2194,10 @@ public class protocol_beehome { handleBPTF(cmd, mConnection, mRuntime); ICLogger.d("收到修改时间格式的指令..."); break; + case BPSQ: + handleBPSQ(cmd,mConnection,mRuntime); + ICLogger.d("收到设置体征信息检测间隔的指令..."); + break; } return ret; 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 0508618c..a3e6838e 100644 --- a/app/src/main/java/com/ic/protocols/protocol_ic.java +++ b/app/src/main/java/com/ic/protocols/protocol_ic.java @@ -1885,8 +1885,7 @@ public class protocol_ic { ICLogger.i("收到服务器指令:测量体温 " + freq + "分钟一次。"); Config.setTemperatureTestCycle(runtime, freq * 60); CoreService.getInstance().setTempAlarm(true); - if (runtime.check_stat_do_temp_test()) - TemperatureUtil.getInstance().doTempTestInThread(FROM_SERVER); + } catch (Exception e) { ICLogger.e(e.getMessage(), e); } diff --git a/app/version_code.properties b/app/version_code.properties index 168700e8..ef39e4e2 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Thu Sep 02 09:27:35 CST 2021 -VERSION_CODE=901 +#Sat Sep 25 23:19:04 CST 2021 +VERSION_CODE=902