修改了签到信息传输的便民服务不
authorTrillGates <williamtrillgates@gmail.com>
Mon, 6 Dec 2021 07:27:41 +0000 (15:27 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Mon, 6 Dec 2021 07:27:41 +0000 (15:27 +0800)
app/src/main/java/com/enqualcomm/support/Config.java
app/src/main/java/com/enqualcomm/support/utils/CellInfoUtil.java
app/src/main/java/com/enqualcomm/support/utils/TimeUtil.java
app/src/main/java/com/enqualcomm/support/utils/Util.java
app/src/main/java/com/ic/protocols/protocol_s123.java

index aff46e2..44d2bcc 100644 (file)
@@ -479,7 +479,7 @@ public class Config {
         }
     }
 
-    private static String getLastBootupDate(Context context) {
+    private static String getLastBootUpDate(Context context) {
         return SharePreferenceUtil.getPrefString(context, KeyBootUpDate, "");
     }
 
@@ -488,8 +488,8 @@ public class Config {
         //如果手表一直没有重启过,则每次resetStepCount的时候把启动时间更新到当天,
         //从而解决第二天重启就会被重置的问题!
         String currentDate = TimeUtil.getSystemTime4();
-        String lastDate = getLastBootupDate(context);
-        boolean ret = false;
+        String lastDate = getLastBootUpDate(context);
+        boolean ret;
         if (currentDate.equals(lastDate)) {
             ret = false;
         } else {
index a71c83e..b1b59a6 100644 (file)
@@ -162,7 +162,6 @@ public class CellInfoUtil {
                 ICLogger.i("LBS operator == null");
                 return null;
             }
-
             mccmnc = mccmnc.substring(0, 5);
         } else {
             mccmnc = telephonyManager.getNetworkOperator();
index b050b7d..d7223c9 100644 (file)
@@ -31,7 +31,7 @@ public class TimeUtil {
         return (new SimpleDateFormat("MMddHHmmss")).format(new Date(paramLong));
     }
 
-    public static String getLocalTimeYMD(String paramLong) {
+    public static String getLocalTimeYMD(long paramLong) {
         return (new SimpleDateFormat("yyyy-MM-dd")).format(paramLong);
     }
 
index 96be0e2..c1ebf7a 100644 (file)
@@ -234,6 +234,7 @@ public class Util {
     }
 
     public static String utf8ToUnicode(String inStr) {
+        ICLogger.d("inStr ==> " + inStr);
         char[] myBuffer = inStr.toCharArray();
 
         StringBuffer sb = new StringBuffer();
@@ -258,7 +259,9 @@ public class Util {
                 sb.append(hexS.toLowerCase());
             }
         }
-        return sb.toString();
+        String s = sb.toString();
+        ICLogger.d("utf8ToUnicode result ==> " + s);
+        return s;
     }
 
     /**
index 615b79c..38ac2c9 100644 (file)
@@ -116,19 +116,6 @@ public class protocol_s123 {
         //如果是其他数字,通过id去查询即可
         if (!"none".equals(value) && !"success".equals(value)) {
             //先查询出内容,再组装数据
-            ContentResolver resolver = mRuntime.getContextProxy().getResolver();
-            Cursor query = resolver.query(Uri.parse(ShootTextProvider.SHOOT_TEXT),
-                    new String[]{ICDatabaseHelper.shoot_value},
-                    ICDatabaseHelper.shoot_id + "=?",
-                    new String[]{value}, null);
-            String contentValue = "";
-            if (query != null) {
-                if (query.moveToNext()) {
-                    //要判断数据是否为空
-                    contentValue = query.getString(0);
-                }
-                query.close();
-            }
             //组装数据
             //IWAPRP,080524, 102533,128,36.6,88,120,90,90,XXXXXXXX,
             // A,22.567898,113.1234567, 50,5,61, 120, wgs84, 99, 20, 460, 0,
@@ -146,8 +133,8 @@ public class protocol_s123 {
             //88: 心率
             //120:  收缩压
             //90: 舒张压
-            //90: 电池电量 0~100
-            mConnection.send(APRP(contentValue));
+            //95: 血氧
+            mConnection.send(APRP(value));
         }
     }
 
@@ -157,6 +144,7 @@ public class protocol_s123 {
         int heartRate = mRuntime.getHRS().getPPG();
         int lowPressure = mRuntime.getHRS().getBPL();
         int highPressure = mRuntime.getHRS().getBPH();
+        int spo2 = mRuntime.getHRS().getSpo2();
         int batteryLev = mRuntime.getBatteryLevel();
         //定位数据
         // String s123GpsData = mRuntime.getS123GpsData();
@@ -169,7 +157,7 @@ public class protocol_s123 {
                         .append(CMDSPLIT).append(heartRate)
                         .append(CMDSPLIT).append(lowPressure)
                         .append(CMDSPLIT).append(highPressure)
-                        .append(CMDSPLIT).append(batteryLev)
+                        .append(CMDSPLIT).append(spo2)
                         .append(CMDSPLIT).append(Util.utf8ToUnicode(msg))//utf8转unicode
                         .append(CMDSPLIT).append(mRuntime.getS123GpsData())
                         .append(CMDSPLIT).append("wgs84")//原始经纬度
@@ -773,7 +761,8 @@ public class protocol_s123 {
             //返回发布版本的时间戳
             String releaseTimeUtcStr = Util.getSystemProperties("ro.build.date.utc");
             ICLogger.d("releaseTimeUtcStr ==> " + releaseTimeUtcStr);
-            String localTimeYMD = TimeUtil.getLocalTimeYMD(releaseTimeUtcStr);
+            long timeLong = Long.parseLong(releaseTimeUtcStr);
+            String localTimeYMD = TimeUtil.getLocalTimeYMD(timeLong);
             ICLogger.d("localTimeYMD ==> " + localTimeYMD);
             protocolReleaseDate = localTimeYMD;
         } catch (Exception e) {
@@ -832,7 +821,7 @@ public class protocol_s123 {
     }
 
     public static StringMessage AP03(Runtime ds) {
-        ICLogger.d("创建心跳内容 ==> " + Log.getStackTraceString(new Throwable()));
+        // ICLogger.d("创建心跳内容 ==> " + Log.getStackTraceString(new Throwable()));
         //IWAP03,06000908000102,5555,30,1200#
         //IWAP03,06000908000102,5555,30#
         //IW: 标识符