mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-23 21:47:49 +08:00
1078-添加查询终端参数
This commit is contained in:
parent
570307669e
commit
fce96def9f
@ -263,7 +263,24 @@ public class JT1078Template {
|
|||||||
*
|
*
|
||||||
* @param devId 设备号
|
* @param devId 设备号
|
||||||
*/
|
*/
|
||||||
public String getDeviceConfig(String devId, J8106 j8106, Integer timeOut) {
|
public String getDeviceConfig(String devId, J8104 j8104, Integer timeOut) {
|
||||||
|
|
||||||
|
Cmd cmd = new Cmd.Builder()
|
||||||
|
.setDevId(devId)
|
||||||
|
.setPackageNo(randomInt())
|
||||||
|
.setMsgId(H8104)
|
||||||
|
.setRespId(H0104)
|
||||||
|
.setRs(j8104)
|
||||||
|
.build();
|
||||||
|
return SessionManager.INSTANCE.request(cmd, timeOut);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指定终端参数
|
||||||
|
*
|
||||||
|
* @param devId 设备号
|
||||||
|
*/
|
||||||
|
public String getDeviceSpecifyConfig(String devId, J8106 j8106, Integer timeOut) {
|
||||||
|
|
||||||
Cmd cmd = new Cmd.Builder()
|
Cmd cmd = new Cmd.Builder()
|
||||||
.setDevId(devId)
|
.setDevId(devId)
|
||||||
|
|||||||
@ -0,0 +1,21 @@
|
|||||||
|
package com.genersoft.iot.vmp.jt1078.proc.response;
|
||||||
|
|
||||||
|
import com.genersoft.iot.vmp.jt1078.annotation.MsgId;
|
||||||
|
import io.netty.buffer.ByteBuf;
|
||||||
|
import io.netty.buffer.Unpooled;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询终端参数
|
||||||
|
*/
|
||||||
|
@MsgId(id = "8104")
|
||||||
|
public class J8104 extends Rs {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ByteBuf encode() {
|
||||||
|
ByteBuf buffer = Unpooled.buffer();
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -501,25 +501,27 @@ public class jt1078ServiceImpl implements Ijt1078Service {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (params == null || params.length == 0) {
|
if (params == null || params.length == 0) {
|
||||||
return;
|
J8104 j8104 = new J8104();
|
||||||
}
|
jt1078Template.getDeviceConfig(deviceId, j8104, 6);
|
||||||
byte[] paramBytes = new byte[params.length];
|
}else {
|
||||||
for (int i = 0; i < params.length; i++) {
|
byte[] paramBytes = new byte[params.length];
|
||||||
try {
|
for (int i = 0; i < params.length; i++) {
|
||||||
Field field = JTDeviceConfig.class.getDeclaredField(params[i]);
|
try {
|
||||||
if (field.isAnnotationPresent(ConfigAttribute.class) ) {
|
Field field = JTDeviceConfig.class.getDeclaredField(params[i]);
|
||||||
ConfigAttribute configAttribute = field.getAnnotation(ConfigAttribute.class);
|
if (field.isAnnotationPresent(ConfigAttribute.class) ) {
|
||||||
byte id = configAttribute.id();
|
ConfigAttribute configAttribute = field.getAnnotation(ConfigAttribute.class);
|
||||||
String description = configAttribute.description();
|
byte id = configAttribute.id();
|
||||||
System.out.println(description + ": " + id);
|
String description = configAttribute.description();
|
||||||
paramBytes[i] = configAttribute.id();
|
System.out.println(description + ": " + id);
|
||||||
|
paramBytes[i] = configAttribute.id();
|
||||||
|
}
|
||||||
|
} catch (NoSuchFieldException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
} catch (NoSuchFieldException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
}
|
||||||
|
J8106 j8106 = new J8106();
|
||||||
|
j8106.setParams(paramBytes);
|
||||||
|
jt1078Template.getDeviceSpecifyConfig(deviceId, j8106, 6);
|
||||||
}
|
}
|
||||||
J8106 j8106 = new J8106();
|
|
||||||
j8106.setParams(paramBytes);
|
|
||||||
jt1078Template.getDeviceConfig(deviceId, j8106, 6);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user