From 3b5b48833cf92bb700b32d8f592264b77d6b39b9 Mon Sep 17 00:00:00 2001 From: weidong Date: Sun, 1 Sep 2024 15:12:46 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=91=BD=E4=BB=A4=E8=A1=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=AC=AC=E4=BA=8CDTU=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/imdroid/beidou/controller/CmdLineController.java | 8 +++----- .../src/main/resources/templates/page/cmd_line.html | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) 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 @@