//设置工作模式
public void handleBP33(Connection connection, Runtime runtime, String cmd) {
-// IWBP33,867155030001063,560555,1
-// IW:标识符
-// BP33 : 命令字符
-// 353456789012345:IMEI号,设备唯一ID
-// 080835:指令流水号
-// 1:设备工作模式,1:正常模式,2:省电模式,3:紧急模式
-
- String[] cmdlist = cmd.split(",");
- if (cmdlist.length == 4) {
- log("com.ic.work mode " + cmdlist[3]);
+ //IWBP33,867155030001063,560555,1
+ //IW:标识符
+ //BP33 : 命令字符
+ //353456789012345:IMEI号,设备唯一ID
+ //080835:指令流水号
+ //1:设备工作模式,1:正常模式,2:省电模式,3:紧急模式
+
+ String[] cmdList = cmd.split(",");
+ if (cmdList.length == 4) {
+ log("com.ic.work mode " + cmdList[3]);
try {
- int mod = Integer.parseInt(cmdlist[3]);
+ int mod = Integer.parseInt(cmdList[3]);
int Cycle = 900;
switch (mod) {
case ICLocation.NORMAL_MOD:
case ICLocation.REALTIME_MOD:
Cycle = 60;
break;
-
}
-
- StringMessage msg = AP33(cmdlist[2], mod);
+ StringMessage msg = AP33(cmdList[2], mod);
//设定当前工作模式及循环频率
connection.send(msg);
log("reply msg " + msg);
Config.setLocationCycle(runtime.getContextProxy().context, Cycle);
runtime.getLocationInstance().setLocation_cycle(Cycle);
runtime.getLocationInstance().setWorkingMod(mod);
-// CoreService.getInstance().setLocationAlarm(runtime.getLocationInstance().getWorkingMod());
+ //CoreService.getInstance().setLocationAlarm(runtime.getLocationInstance().getWorkingMod());
//此处设置好配置后,会在LocationClient通过消息开始执行及时定位操作。
} catch (Exception e) {
ICLogger.e(e.getMessage(), e);
public static StringMessage AP34(String cmdindex, int workMode) {
-//IWAP34,588854,1#
-//080835:指令流水号
-//8:模式
+ //IWAP34,588854,1#
+ //080835:指令流水号
+ //8:模式
return genStringMessage(cmdMap.get(CMD_TYPE.AP34), new StringBuffer(CMDHEADER).append(cmdMap.get(CMD_TYPE.AP34))
.append(CMDSPLIT).append(cmdindex)
.append(CMDSPLIT).append(workMode)
//设置自定义工作模式
public void handleBP34(Connection connection, Runtime runtime, String cmd) {
-// IWBP34,867155030001063,588854,8,900,1#
-// IW:标识符
-// BP33 : 命令字符
-// 353456789012345:IMEI号,设备唯一ID
-// 080835:指令流水号
-// 1:设备工作模式,1:正常模式,2:省电模式,3:紧急模式
-
- String[] cmdlist = cmd.split(",");
- if (cmdlist.length == 6) {
-
+ //IWBP34,867155030001063,588854,8,900,1#
+ //IW:标识符
+ //BP33 : 命令字符
+ //353456789012345:IMEI号,设备唯一ID
+ //080835:指令流水号
+ //1:设备工作模式,1:正常模式,2:省电模式,3:紧急模式
- log("com.ic.work mode " + cmdlist[3]);
+ String[] cmdList = cmd.split(",");
+ if (cmdList.length == 6) {
+ log("com.ic.work mode " + cmdList[3]);
try {
- int mod = Integer.parseInt(cmdlist[3]);
- int Cycle = Integer.parseInt(cmdlist[4]);
- int gpson = Integer.parseInt(cmdlist[5]);
+ int mod = Integer.parseInt(cmdList[3]);
+ int Cycle = Integer.parseInt(cmdList[4]);
+ int gpson = Integer.parseInt(cmdList[5]);
- StringMessage msg = AP34(cmdlist[2], mod);
+ StringMessage msg = AP34(cmdList[2], mod);
//设定当前工作模式及循环频率
connection.send(msg);
Config.setLocationCycle(runtime.getContextProxy().context, Cycle);
runtime.getLocationInstance().setLocation_cycle(Cycle);
runtime.getLocationInstance().setWorkingMod(mod);
-// CoreService.getInstance().setLocationAlarm(runtime.getLocationInstance().getWorkingMod());
+ //CoreService.getInstance().setLocationAlarm(runtime.getLocationInstance().getWorkingMod());
//此处设置好配置后,会在LocationClient通过消息开始执行及时定位操作。
} catch (Exception e) {
ICLogger.e(e.getMessage(), e);
public void handleBP40(Connection connection, Runtime runtime, String cmd) {
-// IWBP40,353456789012345,080835,XXXXXXXXXXXXXX#
-// IW:标识符
-// BP40 : 命令字符
-// 353456789012345:IMEI号,设备唯一ID
-// 080835 :指令流水号
-// XXXXXXXXXXXX : 表示文字内容GB2312编码
-
+ //IWBP40,353456789012345,080835,XXXXXXXXXXXXXX#
+ //IW:标识符
+ //BP40 : 命令字符
+ //353456789012345:IMEI号,设备唯一ID
+ //080835 :指令流水号
+ //XXXXXXXXXXXX : 表示文字内容GB2312编码
String[] cmdlist = cmd.split(",");
if (cmdlist.length == 4) {