diff --git a/sec-beidou/src/main/java/com/imdroid/beidou/controller/CmdLineController.java b/sec-beidou/src/main/java/com/imdroid/beidou/controller/CmdLineController.java index a7b3b213..58cb3fde 100644 --- a/sec-beidou/src/main/java/com/imdroid/beidou/controller/CmdLineController.java +++ b/sec-beidou/src/main/java/com/imdroid/beidou/controller/CmdLineController.java @@ -64,16 +64,14 @@ public class CmdLineController extends BasicController{ @RequestParam("cmd_type") int cmdType) { String sendCmd = cmd.replaceAll(" +",""); short len = 0; - int msgType; - if(cmdType == 1){ // DTU,string format - msgType = 0xD31A; + int msgType = 0xD310 + cmdType; + if(cmdType == 1 || cmdType==11){ // DTU,string format len = (short) (sendCmd.length() + 5); - sendCmd = "D31A"+ HexUtil.Short2HexString(len)+ + sendCmd = Integer.toHexString(msgType) + HexUtil.Short2HexString(len)+ HexUtil.Int2HexString(Integer.parseInt(deviceId))+ "01"+HexUtil.String2HexString(sendCmd); } else{ //hex format - msgType = 0xD310+cmdType; len = (short) (sendCmd.length()/2+4); sendCmd = Integer.toHexString(msgType) + HexUtil.Short2HexString(len)+ HexUtil.Int2HexString(Integer.parseInt(deviceId))+sendCmd; diff --git a/sec-beidou/src/main/resources/templates/page/cmd_line.html b/sec-beidou/src/main/resources/templates/page/cmd_line.html index 1676af41..2e1eef13 100644 --- a/sec-beidou/src/main/resources/templates/page/cmd_line.html +++ b/sec-beidou/src/main/resources/templates/page/cmd_line.html @@ -45,9 +45,9 @@