fixed position upload duration bugs.
authorTrillGates <williamtrillgates@gmail.com>
Mon, 26 Apr 2021 09:47:17 +0000 (17:47 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Mon, 26 Apr 2021 09:47:17 +0000 (17:47 +0800)
app/src/main/java/com/ic/protocols/protocol_anan.java

index 49c1e67..c3c6886 100644 (file)
@@ -240,7 +240,8 @@ public class protocol_anan {
         cmdMap.put(CMD_TYPE.AP28, "AP28");
         cmdMap.put(CMD_TYPE.AP17, "AP17");
         cmdMap.put(CMD_TYPE.AP18, "AP18");
-        cmdMap.put(AP32, "AP32");
+        cmdMap.put(CMD_TYPE.AP32, "AP32");
+        cmdMap.put(CMD_TYPE.AP15, "AP15");
 
     }
 
@@ -585,6 +586,7 @@ public class protocol_anan {
                     HeartRateManager.getInstance().triggerPPGTest(FROM_SERVER);
                 break;
             case BP88:
+                ICLogger.d("收到查找设备的指令...");
                 //收到查找设备消息
                 handleBP88(cmd, mConnection);
                 mConnection.DeliverCMDMessageToSystem("findDev", cmd);//通知下面线程状态变化
@@ -680,21 +682,17 @@ public class protocol_anan {
         //080835 :指令流水号
         //1: 表示白名单开,0 表示白名单关
         String[] list = cmd.split(CMDSPLIT);
-
         if (list.length == 4) {
             String index = list[2];
             String whitelist_switch = list[3];
             connection.send(AP84(index, 1));
-
             if (whitelist_switch.equals("1")) {
                 Util.setSystemProperties("persist.sys.whitelist.enable", "true");
             } else {
                 Util.setSystemProperties("persist.sys.whitelist.enable", "false");
             }
             ICLogger.i("收到服务器指令:白名单" + (whitelist_switch.equals("1") ? "开" : "关"));
-
         } else {
-
             ICLogger.i("BP84 format error!");
         }
 
@@ -728,7 +726,6 @@ public class protocol_anan {
             String time = list[3];
             connection.send(AP15(index));
             ICLogger.i("BP15 , 定位周期=" + time + "秒");
-
             try {
                 Config.setLocationMode(runtime.getContextProxy().context, ICLocation.CUSTOM_MOD8_GPS);
                 Config.setLocationCycle(runtime.getContextProxy().context, Integer.parseInt(time));
@@ -746,11 +743,12 @@ public class protocol_anan {
     }
 
     public static StringMessage AP15(String index) {
-//IWAP15, 080835#
-//080835:指令流水号
-        return genStringMessage("AP15", new StringBuffer(CMDHEADER).append(cmdMap.get(CMD_TYPE.AP15))
-                .append(CMDSPLIT).append(index)
-                .append(CMDEND).toString());
+        //IWAP15, 080835#
+        //080835:指令流水号
+        return genStringMessage(cmdMap.get(CMD_TYPE.AP15),
+                new StringBuffer(CMDHEADER).append(cmdMap.get(CMD_TYPE.AP15))
+                        .append(CMDSPLIT).append(index)
+                        .append(CMDEND).toString());
     }