From: snickersun Date: Thu, 25 Mar 2021 07:01:14 +0000 (+0800) Subject: release 768 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=c25fc3072906f14660e1e911f8a738697a18983e;p=protocol_srv.git release 768 1、修复FZD 解析PING错误问题,确认FZD LGZONE 服务器返回的时间是带了时区之后的时间,设置时间不用加时区。 2、修复BEEHOME 时间设置问题,确认BP00 回复时间为time-zone 0,设置时间需要加时区。 --- diff --git a/app/release/ICSer_V767_2103201024_release.apk b/app/release/ICSer_V768_2103251412_release.apk similarity index 78% rename from app/release/ICSer_V767_2103201024_release.apk rename to app/release/ICSer_V768_2103251412_release.apk index 46b40a7c..17f4e399 100644 Binary files a/app/release/ICSer_V767_2103201024_release.apk and b/app/release/ICSer_V768_2103251412_release.apk differ diff --git a/app/release/output.json b/app/release/output.json index a559e1af..6e16ee5e 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":767,"versionName":"2103201024","enabled":true,"outputFile":"ICSer_V767_2103201024_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V767_2103201024_release.apk","properties":{}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":768,"versionName":"2103251412","enabled":true,"outputFile":"ICSer_V768_2103251412_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V768_2103251412_release.apk","properties":{}}] \ No newline at end of file diff --git a/app/src/main/java/com/enqualcomm/support/adapter/BTHelper.java b/app/src/main/java/com/enqualcomm/support/adapter/BTHelper.java index bc079fd1..c063b8db 100644 --- a/app/src/main/java/com/enqualcomm/support/adapter/BTHelper.java +++ b/app/src/main/java/com/enqualcomm/support/adapter/BTHelper.java @@ -291,6 +291,10 @@ public class BTHelper { public void run() { ICLogger.i("BT stopLeScan " + Thread.currentThread().getName()); mBtAdapter.stopLeScan(lecallback); + if(mBtAdapter.isDiscovering()) { + ICLogger.i("BT Stop Discovery"); + mBtAdapter.cancelDiscovery(); + } //开始扫描前是关闭的,就关闭它 // if(!enabledBeforScan) disableBT(); diff --git a/app/src/main/java/com/ic/jni/ICJniUtils.java b/app/src/main/java/com/ic/jni/ICJniUtils.java index 5d61ef71..ede27b74 100644 --- a/app/src/main/java/com/ic/jni/ICJniUtils.java +++ b/app/src/main/java/com/ic/jni/ICJniUtils.java @@ -1,235 +1,236 @@ -package com.ic.jni; - -public class ICJniUtils { - - public enum GSensorType - { - GSENSOR_TYPE_NONE, - GSENSOR_TYPE_QMA7981, - GSENSOR_TYPE_SC7A21, - GSENSOR_TYPE_MAX - }; - - public enum TempSensorType - { - TEMPSENSOR_TYPE_NONE, - TEMPSENSOR_TYPE_NST175, - TEMPSENSOR_TYPE_IC68, - TEMPSENSOR_TYPE_EM7068, - TEMPSENSOR_TYPE_MAX - }; - - public enum PPG_EGC_SensorType - { - PPG_EGC_TYPE_NONE, - PPG_EGC_TYPE_EM7028, - PPG_EGC_TYPE_EM7068, - PPG_EGC_TYPE_HRS3313, - PPG_EGC_TYPE_HRS3301, - PPG_EGC_TYPE_IC66, - PPG_EGC_TYPE_PAH8002, - PPG_EGC_TYPE_MAX - }; - - public ICJniUtils(){ - - } - static { - // build.gradle里面 android\defaultConfig\ndk\moduleName 的名称 - // Android.mk, LOCAL_MODULE 的名称 - System.loadLibrary("ICJniUtils"); - } - - /***************计步控制************************************/ - /*** - * 运行此函数清除 系统计步为0,一版在午夜执行 - * @return - */ - public static native int resetStepCount(); - - /*** - * 获取当前步数 - * @return - */ - public static native int getStepCount(); - - /*** - * 开启计步 不必判断返回值 - * @return - */ - public static native int enablePedometer(); - - /*** - * 停止计步 不必判断返回值 - * @return - */ - public static native int disablePedometer(); - - /*** - * 检测计步当前是否开启 - * @return - * 1开启,0 关闭 - */ - public static native int isPedometerEnabled(); - - /*** - * 获取当前计步器(GSensor)类型 GSensorType - * @return - * 不存在返回 GSENSOR_TYPE_NONE,否则返回Gsensor类型 - * 理论上此设备必选,一定存在。 - */ - public static native int getGsensorType(); - - /*保存当前步数(getStepCount取得的值)到磁盘 不必判断返回值 - * 为了兼容,已经不再使用 - * */ - public static native int saveStepCount(); - - /*恢复保存时的步数数据,下次getStepCount会在恢复的值上增加 不必判断返回值 - * * 为了兼容,已经不再使用 - * */ - public static native int recoverStepCount(); - - /******心率,血压****************************************/ - /*** - * 检查 PPG硬件是否存在,返回PPG_EGC_SensorType - * @return - * 返回PPG_EGC_TYPE_NONE代表不存在,否则返回 传感器类型 - */ - public static native int isPPGavailable(); - - /** - * 开启心率血压检测 - * @return - */ - public static native int enablePPG(); - - /*** - * 停止心率血压检测 - * @return - */ - public static native int disablePPG(); - - - /*** - * 返回PPG 运行状态, 0 停止, 1,运行中 - * @return - */ - public static native int isPPGStarted(); - - /*** - * 返回 心率值 每分钟跳动次数, 通过这个心率>0 判断是否已经有检测结果, - * 有就可以直接通过getHighBloodPressure 和 getLowBloodPressure 获取血压高压低压值 - * @return - */ - public static native int getPPG(); - - /*** - * 返回是否佩戴 0 未佩戴,1 佩戴 。 - * 请注意,此数据必须在执行 getPPG() 后才有效,否则一直为上一次的值。 - * @return - */ - public static native int isWeared(); - - /*** - * 获取血压高压值 - * 请注意,此数据必须在执行 getPPG() 后才有效,否则一直为上一次的值。 - * @return - */ - public static native int getHighBloodPressure(); - - /*** - * 获取血压低压值 - * 请注意,此数据必须在执行 getPPG() 后才有效,否则一直为上一次的值。 - * @return - */ - public static native int getLowBloodPressure(); - - /*** - * 获取血氧值 - * 请注意,此数据必须在执行 getPPG() 后才有效,否则一直为上一次的值。 - * @return - */ - public static native int getSPO2(); - - - /*** - * 开始温度检测,有些sensor不需要,为了兼容,请开始前执行一次,并且sleep 1秒钟 - * @return - */ - public static native int enableTemperature(); - - /*** - * 停止温度检测,有些sensor不需要,为了兼容请结束后还是要执行一次。 - * @return 返回值<0 表示失败 =>0表示成功 - */ - public static native int disableTemperature(); - - /*** - * 执行温度校准操作,一版在整机生产时的恒温箱中执行 - * @param refTemp 恒温箱的温度 - * @return 返回值<0 表示失败 =>0表示成功 - */ - public static native int doTempCalibration(double refTemp); - - /*** - * 获取温度 校准后数据 单位摄氏度 - * @return 返回值<=0 表示失败 >0表示成功 - */ - public static native double getTemperature(); - - /*** - * 设置当前温度标志位, - * @param flag - * 实际上就是按照二进制位来定义的。 - * 0、可以测温 - * 第一位为1,0x1、充电超过2分钟或者充电超过2分钟后拔除5分钟内 0001 - * 第二位为1,0x2、亮屏超过5分钟或者亮屏超过5分钟后灭屏5分钟内 0010 - * 第三位为1,0x4、通话超过2分钟或者通话超过2分钟后挂断5分钟内 0100 - * 所有大于0的都不能测温 - * 注:暂时未启用,预留 - * @return - */ - public static native int setTemperatureValidFlag(int flag); - - /*** - * 此操作仅仅为了检查标志状态设置成功与否,标志已经在内部被使用 - * 注:暂时未启用,预留 - * @return - */ - public static native int getTemperatureValidFlag(); - - /*** - * 根据环境参考温度和腕温换算 体温 - * ic66可以直接输出体温,不需要这个公式。 - * @param wrist_temp - * 腕温 - * @param ref_temp - * 室外参考温度 - * @return 返回值<=0 表示失败 >0表示成功 - */ - public static native double getBodyTempFromWristTemp(double wrist_temp,double ref_temp); - - /*** - * 有体温检测功能则返回 TempSensorType - * TempSensor_NONE 就表示没有体温检测功能,否则返回温度传感器类型 - * @return - */ - public static native int isTemperatureDevAvailable(); - - - /*获取温度校准前 - * 为了兼容已经不用 - * */ - public static native double getTemperatureOrigin(); - - /*设置校准参数 - * * 为了兼容已经不用 - * */ - public static native int setTemperatureAdjustValue(double value); - - /*设置校准参数 - * * 为了兼容已经不用 - * */ - public static native double getTemperatureAdjustValue(); -} +package com.ic.jni; + +public class ICJniUtils { + + public enum GSensorType + { + GSENSOR_TYPE_NONE, + GSENSOR_TYPE_QMA7981, + GSENSOR_TYPE_SC7A21, + GSENSOR_TYPE_MAX + }; + + public enum TempSensorType + { + TEMPSENSOR_TYPE_NONE, + TEMPSENSOR_TYPE_NST175, + TEMPSENSOR_TYPE_IC68, + TEMPSENSOR_TYPE_EM7068, + TEMPSENSOR_TYPE_MAX + }; + + public enum PPG_EGC_SensorType + { + PPG_EGC_TYPE_NONE, + PPG_EGC_TYPE_EM7028, + PPG_EGC_TYPE_EM7068, + PPG_EGC_TYPE_HRS3313, + PPG_EGC_TYPE_HRS3301, + PPG_EGC_TYPE_IC66, + PPG_EGC_TYPE_PAH8002, + PPG_EGC_TYPE_GH30X, + PPG_EGC_TYPE_MAX + }; + + public ICJniUtils(){ + + } + static { + // build.gradle里面 android\defaultConfig\ndk\moduleName 的名称 + // Android.mk, LOCAL_MODULE 的名称 + System.loadLibrary("ICJniUtils"); + } + + /***************计步控制************************************/ + /*** + * 运行此函数清除 系统计步为0,一版在午夜执行 + * @return + */ + public static native int resetStepCount(); + + /*** + * 获取当前步数 + * @return + */ + public static native int getStepCount(); + + /*** + * 开启计步 不必判断返回值 + * @return + */ + public static native int enablePedometer(); + + /*** + * 停止计步 不必判断返回值 + * @return + */ + public static native int disablePedometer(); + + /*** + * 检测计步当前是否开启 + * @return + * 1开启,0 关闭 + */ + public static native int isPedometerEnabled(); + + /*** + * 获取当前计步器(GSensor)类型 GSensorType + * @return + * 不存在返回 GSENSOR_TYPE_NONE,否则返回Gsensor类型 + * 理论上此设备必选,一定存在。 + */ + public static native int getGsensorType(); + + /*保存当前步数(getStepCount取得的值)到磁盘 不必判断返回值 + * 为了兼容,已经不再使用 + * */ + public static native int saveStepCount(); + + /*恢复保存时的步数数据,下次getStepCount会在恢复的值上增加 不必判断返回值 + * * 为了兼容,已经不再使用 + * */ + public static native int recoverStepCount(); + + /******心率,血压****************************************/ + /*** + * 检查 PPG硬件是否存在,返回PPG_EGC_SensorType + * @return + * 返回PPG_EGC_TYPE_NONE代表不存在,否则返回 传感器类型 + */ + public static native int isPPGavailable(); + + /** + * 开启心率血压检测 + * @return + */ + public static native int enablePPG(); + + /*** + * 停止心率血压检测 + * @return + */ + public static native int disablePPG(); + + + /*** + * 返回PPG 运行状态, 0 停止, 1,运行中 + * @return + */ + public static native int isPPGStarted(); + + /*** + * 返回 心率值 每分钟跳动次数, 通过这个心率>0 判断是否已经有检测结果, + * 有就可以直接通过getHighBloodPressure 和 getLowBloodPressure 获取血压高压低压值 + * @return + */ + public static native int getPPG(); + + /*** + * 返回是否佩戴 0 未佩戴,1 佩戴 。 + * 请注意,此数据必须在执行 getPPG() 后才有效,否则一直为上一次的值。 + * @return + */ + public static native int isWeared(); + + /*** + * 获取血压高压值 + * 请注意,此数据必须在执行 getPPG() 后才有效,否则一直为上一次的值。 + * @return + */ + public static native int getHighBloodPressure(); + + /*** + * 获取血压低压值 + * 请注意,此数据必须在执行 getPPG() 后才有效,否则一直为上一次的值。 + * @return + */ + public static native int getLowBloodPressure(); + + /*** + * 获取血氧值 + * 请注意,此数据必须在执行 getPPG() 后才有效,否则一直为上一次的值。 + * @return + */ + public static native int getSPO2(); + + + /*** + * 开始温度检测,有些sensor不需要,为了兼容,请开始前执行一次,并且sleep 1秒钟 + * @return + */ + public static native int enableTemperature(); + + /*** + * 停止温度检测,有些sensor不需要,为了兼容请结束后还是要执行一次。 + * @return 返回值<0 表示失败 =>0表示成功 + */ + public static native int disableTemperature(); + + /*** + * 执行温度校准操作,一版在整机生产时的恒温箱中执行 + * @param refTemp 恒温箱的温度 + * @return 返回值<0 表示失败 =>0表示成功 + */ + public static native int doTempCalibration(double refTemp); + + /*** + * 获取温度 校准后数据 单位摄氏度 + * @return 返回值<=0 表示失败 >0表示成功 + */ + public static native double getTemperature(); + + /*** + * 设置当前温度标志位, + * @param flag + * 实际上就是按照二进制位来定义的。 + * 0、可以测温 + * 第一位为1,0x1、充电超过2分钟或者充电超过2分钟后拔除5分钟内 0001 + * 第二位为1,0x2、亮屏超过5分钟或者亮屏超过5分钟后灭屏5分钟内 0010 + * 第三位为1,0x4、通话超过2分钟或者通话超过2分钟后挂断5分钟内 0100 + * 所有大于0的都不能测温 + * 注:暂时未启用,预留 + * @return + */ + public static native int setTemperatureValidFlag(int flag); + + /*** + * 此操作仅仅为了检查标志状态设置成功与否,标志已经在内部被使用 + * 注:暂时未启用,预留 + * @return + */ + public static native int getTemperatureValidFlag(); + + /*** + * 根据环境参考温度和腕温换算 体温 + * ic66可以直接输出体温,不需要这个公式。 + * @param wrist_temp + * 腕温 + * @param ref_temp + * 室外参考温度 + * @return 返回值<=0 表示失败 >0表示成功 + */ + public static native double getBodyTempFromWristTemp(double wrist_temp,double ref_temp); + + /*** + * 有体温检测功能则返回 TempSensorType + * TempSensor_NONE 就表示没有体温检测功能,否则返回温度传感器类型 + * @return + */ + public static native int isTemperatureDevAvailable(); + + + /*获取温度校准前 + * 为了兼容已经不用 + * */ + public static native double getTemperatureOrigin(); + + /*设置校准参数 + * * 为了兼容已经不用 + * */ + public static native int setTemperatureAdjustValue(double value); + + /*设置校准参数 + * * 为了兼容已经不用 + * */ + public static native double getTemperatureAdjustValue(); +} 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 66e555fd..83fcdf14 100644 --- a/app/src/main/java/com/ic/protocols/protocol_beehome.java +++ b/app/src/main/java/com/ic/protocols/protocol_beehome.java @@ -376,7 +376,7 @@ public class protocol_beehome { TimeUtil.setTimeZone(runtime.getContextProxy().context,timezone); ICLogger.i("===" + TimeUtil.getDefaultTimeZone()); - TimeUtil.setSysDateTime(runtime.getContextProxy().context, datetime, timezone,false); + TimeUtil.setSysDateTime(runtime.getContextProxy().context, datetime, timezone,true); ICLogger.i("===" + TimeUtil.getDefaultTimeZone()); } diff --git a/app/src/main/java/com/ic/protocols/protocol_fzd.java b/app/src/main/java/com/ic/protocols/protocol_fzd.java index a8e7fea3..cfc50d47 100644 --- a/app/src/main/java/com/ic/protocols/protocol_fzd.java +++ b/app/src/main/java/com/ic/protocols/protocol_fzd.java @@ -273,7 +273,7 @@ public class protocol_fzd { for (CMD_TYPE key : cmdMap.keySet()) { // ICLogger.i("key "+cmdMap.get(key)+" cmdbuf "+cmd_msgbuf); if (regexUtil.isFZDCMD(cmdMap.get(key), cmd_msgbuf)) { //如果是FZD命令,则进行处理,否则保留数据动 - String data = cmdbuf.toString().replace(CMDHEADER, "").replace(cmd_msgbuf, "").replace(CMDEND, ""); + String data = cmdbuf.substring(cmdbuf.indexOf(cmd_msgbuf)).replace(cmd_msgbuf, "").replace(CMDEND, ""); if (data.startsWith(CMDSPLIT)) data = data.substring(1); handleCmd(key, cmd_msgbuf, data); cmdbuf.delete(0, cmdbuf.length());//处理后清空 @@ -359,6 +359,8 @@ public class protocol_fzd { public static void handlePing(Runtime runtime, String data) { // [IC*YYYYYYYYYYYYYYY*LEN*PING,是否绑定(0 表示未绑定,1 表示绑定)] + // [d283d49aaf7d919f05ce6f5784cda1c5IC*860314001000466*0006*PING,0] + // recv IC*860314001000466*0006*PING d283d49aaf7d919f05ce6f5784cda1c5,0 // 实例:[IC*334588000000156*0006*PING,0]或[IC*334588000000156*0006*PING,1] try { int bind = Integer.parseInt(data); diff --git a/app/version_code.properties b/app/version_code.properties index c0933e14..02831dbc 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Sat Mar 20 10:24:20 CST 2021 -VERSION_CODE=767 +#Thu Mar 25 14:12:28 CST 2021 +VERSION_CODE=768