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");
}
HeartRateManager.getInstance().triggerPPGTest(FROM_SERVER);
break;
case BP88:
+ ICLogger.d("收到查找设备的指令...");
//收到查找设备消息
handleBP88(cmd, mConnection);
mConnection.DeliverCMDMessageToSystem("findDev", cmd);//通知下面线程状态变化
//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!");
}
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));
}
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());
}