// APK 名称
static def getApkBaseName() {
- return "ICProtocol8.1"
+ return "ICProtocol81"
}
android {
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":928,"versionName":"2109081956","enabled":true,"outputFile":"ICProtocol8.1_V928_2109081956_release.apk","fullName":"release","baseName":"release"},"path":"ICProtocol8.1_V928_2109081956_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":931,"versionName":"2109232020","enabled":true,"outputFile":"ICProtocol81_V931_2109232020_release.apk","fullName":"release","baseName":"release"},"path":"ICProtocol81_V931_2109232020_release.apk","properties":{}}]
\ No newline at end of file
public static final int PROTOCOL_ANAN = 5;
public static final int PROTOCOL_S123 = 6;
public static final int PROTOCOL_GATOR = 7;
- public static final int PROTOCOL_W100 = 8;
public static final int PROTOCOL_UNKNOWN = 255;
public static int protocol_no = getProtocolNumber();
//如果为0,那么就不上传了
if (heartRate.getHeartRate() == 0) {
ICLogger.d("result invalidate...");
- return;
+ runtime.getHRS().setHeartrateStat(heartRateStatus.HEARTRATE_WORKINGSTAT.HEARTRATE_TEST_FAILED);
+ uploadResult();
+ }else {
+ //BY TrillGates
+ //判断是否有超出阀值
+ //如果超出的话,插入一条警告通知
+ //如果数据为0,不处理
+ checkHeartRateValue(heartRate);
+ runtime.getHRS().setHeartrateStat(heartRateStatus.HEARTRATE_WORKINGSTAT.HEARTRATE_TEST_SUCCESS);
+ runtime.getHRS().setLastHeartrate(heartRate.getHeartRate(), heartRate.getBloodHeight(), heartRate.getBloodLow(), heartRate.getOxygen());
+ uploadResult();
}
- //BY TrillGates
- //判断是否有超出阀值
- //如果超出的话,插入一条警告通知
- //如果数据为0,不处理
- checkHeartRateValue(heartRate);
- runtime.getHRS().setHeartrateStat(heartRateStatus.HEARTRATE_WORKINGSTAT.HEARTRATE_TEST_SUCCESS);
- runtime.getHRS().setLastHeartrate(heartRate.getHeartRate(), heartRate.getBloodHeight(), heartRate.getBloodLow(), heartRate.getOxygen());
- uploadResult();
}
private void checkHeartRateValue(HeartRate heartRate) {
}
} else {
- ICLogger.i("PPG Failed for Timeout!");
+ ICLogger.i("PPG Failed for Timeout! send 0 message to server");
+ if (!Runtime.practising) {
+ StringMessage PPGDATA = protocolAPIHelper.getPPG_ECG_MSG(runtime,0,0,0,0);
+ //因为协议中没有时间变量,所以只能实时传输,如果恰巧没有网络也只能丢弃,有时间变量的话,可以考虑通过deliver的buffer来进行缓存发送
+ if (PPGDATA == null) {
+ StringMessage ppgd = protocolAPIHelper.getPPG_MSG(0, this.runtime);
+ StringMessage bloodd = protocolAPIHelper.getBlood_MSG(0,0, this.runtime);
+ StringMessage oxd = protocolAPIHelper.getOxygen_MSG(0, this.runtime);
+ Deliver.sendLocationMSG(ppgd);
+ Deliver.sendLocationMSG(bloodd);
+ Deliver.sendLocationMSG(oxd);
+ } else {
+ Deliver.sendLocationMSG(PPGDATA);
+ }
+ }
}
}
return ret;
}
- public static StringMessage getPPG_ECG_MSG(int ppg, int bph, int bpl, int spo2, Runtime runtime) {
+ public static StringMessage getPPG_ECG_MSG(Runtime runtime,int ppg, int bph, int bpl, int spo2 ) {
if (is_protocol_not_Initialled()) return null;
StringMessage ret = null;
SOSON,//w100SOS 报警开关
IP,//配置服务器地址
SOSREC,//服务器响应S0S消息
+ LOCATIONMODE,//设置工作模式
}
public static HashMap<CMD_TYPE, String> cmdMap = null;
cmdMap.put(CMD_TYPE.SOSON, "SOSON");
cmdMap.put(CMD_TYPE.IP, "IP");
cmdMap.put(CMD_TYPE.SOSREC, "SOSREC");
+ cmdMap.put(CMD_TYPE.LOCATIONMODE, "LOCATIONMODE");
}
private Connection mConnection = null;
}
}
+
+ public static StringMessage LOCATIONMODE() {
+
+ return genFZDCMD(cmdMap.get(CMD_TYPE.LOCATIONMODE));
+ }
+
+ public void handleLOCATIONMODE(Connection connection, Runtime runtime, String cmd, String data) {
+ /**
+ * 平台发送:
+ * [XT*YYYYYYYYYYYYYYY*LEN*LOCATIONMODE,mode,cycle_seconds]
+ * 实例:[XT*334588000000156*0012*LOCATIONMODE,8,900]
+ * 终端回复:
+ * [XT*YYYYYYYYYYYYYYY*LEN*LOCATIONMODE]
+ * 实例:[XT*334588000000156*000C*LOCATIONMODE]
+ * @return
+ */
+ connection.send(LOCATIONMODE());
+ try {
+ String list[]=data.split(CMD_SPLIT);
+ if(list.length==2) {
+ int timesecond = Integer.parseInt(list[1]);
+ int mod = Integer.parseInt(list[0]);
+ log("LOCATION_MODE " + LOCATION_MODE + " mod " + mod);
+ Config.setLocationMode(runtime.getContextProxy().context, mod);
+ Config.setLocationCycle(runtime.getContextProxy().context, timesecond);
+ runtime.getLocationInstance().setLocation_cycle(timesecond);
+ runtime.getLocationInstance().setWorkingMod(mod);
+ }
+// CoreService.getInstance().setLocationAlarm(runtime.getLocationInstance().getWorkingMod());
+ //此处设置好配置后,会在LocationClient通过消息开始执行及时定位操作。
+ } catch (Exception e) {
+ ICLogger.e(e.getMessage(), e);
+ }
+ }
+
public static StringMessage heart(int hrt) {
return genFZDCMD(cmdMap.get(CMD_TYPE.heart), String.valueOf(hrt));
}
//通知下面线程状态变化
mConnection.DeliverCMDMessageToSystem("setWorkMod", cmd);
break;
+ case LOCATIONMODE:
+ //设置工作模式
+ handleLOCATIONMODE(mConnection,mRuntime,cmd,data);
+ //通知下面线程状态变化
+ mConnection.DeliverCMDMessageToSystem("setWorkMod", cmd);
+ break;
case SOS:
//收到设置SOS号码
handleSOS(mConnection, mRuntime, cmd, data);
-#Wed Sep 08 19:56:03 CST 2021\r
-VERSION_CODE=928\r
+#Thu Sep 23 20:20:45 CST 2021\r
+VERSION_CODE=931\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<module external.linked.project.id="icsupport" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">\r
- <component name="FacetManager">\r
- <facet type="java-gradle" name="Java-Gradle">\r
- <configuration>\r
- <option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />\r
- <option name="BUILDABLE" value="false" />\r
- </configuration>\r
- </facet>\r
- </component>\r
- <component name="NewModuleRootManager" inherit-compiler-output="true">\r
- <exclude-output />\r
- <content url="file://$MODULE_DIR$">\r
- <excludeFolder url="file://$MODULE_DIR$/.gradle" />\r
- <excludeFolder url="file://$MODULE_DIR$/build" />\r
- </content>\r
- <orderEntry type="inheritedJdk" />\r
- <orderEntry type="sourceFolder" forTests="false" />\r
- </component>\r
-</module>
\ No newline at end of file