1、命令行增加第二DTU配置
This commit is contained in:
parent
c5d9add1bf
commit
3b5b48833c
@ -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;
|
||||||
|
|||||||
@ -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>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user