1、命令行增加第二DTU配置

This commit is contained in:
weidong 2024-09-01 15:12:46 +08:00
parent c5d9add1bf
commit 3b5b48833c
2 changed files with 5 additions and 7 deletions

View File

@ -64,16 +64,14 @@ public class CmdLineController extends BasicController{
@RequestParam("cmd_type") int cmdType) { @RequestParam("cmd_type") int cmdType) {
String sendCmd = cmd.replaceAll(" +",""); String sendCmd = cmd.replaceAll(" +","");
short len = 0; short len = 0;
int msgType; int msgType = 0xD310 + cmdType;
if(cmdType == 1){ // DTU,string format if(cmdType == 1 || cmdType==11){ // DTU,string format
msgType = 0xD31A;
len = (short) (sendCmd.length() + 5); len = (short) (sendCmd.length() + 5);
sendCmd = "D31A"+ HexUtil.Short2HexString(len)+ sendCmd = Integer.toHexString(msgType) + HexUtil.Short2HexString(len)+
HexUtil.Int2HexString(Integer.parseInt(deviceId))+ HexUtil.Int2HexString(Integer.parseInt(deviceId))+
"01"+HexUtil.String2HexString(sendCmd); "01"+HexUtil.String2HexString(sendCmd);
} }
else{ //hex format else{ //hex format
msgType = 0xD310+cmdType;
len = (short) (sendCmd.length()/2+4); len = (short) (sendCmd.length()/2+4);
sendCmd = Integer.toHexString(msgType) + HexUtil.Short2HexString(len)+ sendCmd = Integer.toHexString(msgType) + HexUtil.Short2HexString(len)+
HexUtil.Int2HexString(Integer.parseInt(deviceId))+sendCmd; HexUtil.Int2HexString(Integer.parseInt(deviceId))+sendCmd;

View File

@ -45,9 +45,9 @@
<div class="layui-input-inline"> <div class="layui-input-inline">
<select name="cmd_type" id="cmd_type" lay-filter="cmd_type"> <select name="cmd_type" id="cmd_type" lay-filter="cmd_type">
<option value="0">GNSS</option> <option value="0">GNSS</option>
<option value="1">DTU</option> <option value="10">DTU</option>
<option value="2">MPU</option> <option value="2">MPU</option>
<option value="11">LORA</option> <option value="11">DTU2</option>
<option value="3">DEBUG</option> <option value="3">DEBUG</option>
<option value="16">V3.2 DEBUG</option> <option value="16">V3.2 DEBUG</option>
</select> </select>