mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-24 05:57:49 +08:00
1078-添加设备控制
This commit is contained in:
parent
8aa97ba695
commit
5a392372cb
@ -19,6 +19,7 @@ public class JT1078Template {
|
|||||||
|
|
||||||
private static final String H8103 = "8103";
|
private static final String H8103 = "8103";
|
||||||
private static final String H8104 = "8104";
|
private static final String H8104 = "8104";
|
||||||
|
private static final String H8105 = "8105";
|
||||||
private static final String H8106 = "8106";
|
private static final String H8106 = "8106";
|
||||||
private static final String H9101 = "9101";
|
private static final String H9101 = "9101";
|
||||||
private static final String H9102 = "9102";
|
private static final String H9102 = "9102";
|
||||||
@ -313,4 +314,15 @@ public class JT1078Template {
|
|||||||
private Long randomInt() {
|
private Long randomInt() {
|
||||||
return (long) random.nextInt(1000) + 1;
|
return (long) random.nextInt(1000) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Object deviceControl(String devId, J8105 j8105, int timeOut) {
|
||||||
|
Cmd cmd = new Cmd.Builder()
|
||||||
|
.setDevId(devId)
|
||||||
|
.setPackageNo(randomInt())
|
||||||
|
.setMsgId(H8105)
|
||||||
|
.setRespId(H0001)
|
||||||
|
.setRs(j8105)
|
||||||
|
.build();
|
||||||
|
return SessionManager.INSTANCE.request(cmd, timeOut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -338,7 +338,7 @@ public class JT1078Controller {
|
|||||||
public void connectionControl(@RequestBody ConnectionControlParam control){
|
public void connectionControl(@RequestBody ConnectionControlParam control){
|
||||||
|
|
||||||
logger.info("[1078-终端控制] 参数: {}", control.toString());
|
logger.info("[1078-终端控制] 参数: {}", control.toString());
|
||||||
service.connectionControl(, config.getConfig());
|
service.connectionControl(control.getDeviceId(), control.getControl());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import com.genersoft.iot.vmp.common.GeneralCallback;
|
|||||||
import com.genersoft.iot.vmp.common.StreamInfo;
|
import com.genersoft.iot.vmp.common.StreamInfo;
|
||||||
import com.genersoft.iot.vmp.jt1078.bean.JTDevice;
|
import com.genersoft.iot.vmp.jt1078.bean.JTDevice;
|
||||||
import com.genersoft.iot.vmp.jt1078.bean.JTDeviceConfig;
|
import com.genersoft.iot.vmp.jt1078.bean.JTDeviceConfig;
|
||||||
|
import com.genersoft.iot.vmp.jt1078.bean.JTDeviceConnectionControl;
|
||||||
import com.genersoft.iot.vmp.jt1078.proc.request.J1205;
|
import com.genersoft.iot.vmp.jt1078.proc.request.J1205;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
|
|
||||||
@ -45,4 +46,6 @@ public interface Ijt1078Service {
|
|||||||
JTDeviceConfig queryConfig(String deviceId, String[] params, GeneralCallback<StreamInfo> callback);
|
JTDeviceConfig queryConfig(String deviceId, String[] params, GeneralCallback<StreamInfo> callback);
|
||||||
|
|
||||||
void setConfig(String deviceId, JTDeviceConfig config);
|
void setConfig(String deviceId, JTDeviceConfig config);
|
||||||
|
|
||||||
|
void connectionControl(String deviceId, JTDeviceConnectionControl control);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import com.genersoft.iot.vmp.conf.DynamicTask;
|
|||||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||||
import com.genersoft.iot.vmp.jt1078.bean.JTDevice;
|
import com.genersoft.iot.vmp.jt1078.bean.JTDevice;
|
||||||
import com.genersoft.iot.vmp.jt1078.bean.JTDeviceConfig;
|
import com.genersoft.iot.vmp.jt1078.bean.JTDeviceConfig;
|
||||||
|
import com.genersoft.iot.vmp.jt1078.bean.JTDeviceConnectionControl;
|
||||||
import com.genersoft.iot.vmp.jt1078.bean.common.ConfigAttribute;
|
import com.genersoft.iot.vmp.jt1078.bean.common.ConfigAttribute;
|
||||||
import com.genersoft.iot.vmp.jt1078.cmd.JT1078Template;
|
import com.genersoft.iot.vmp.jt1078.cmd.JT1078Template;
|
||||||
import com.genersoft.iot.vmp.jt1078.dao.JTDeviceMapper;
|
import com.genersoft.iot.vmp.jt1078.dao.JTDeviceMapper;
|
||||||
@ -526,4 +527,11 @@ public class jt1078ServiceImpl implements Ijt1078Service {
|
|||||||
j8103.setConfig(config);
|
j8103.setConfig(config);
|
||||||
jt1078Template.setDeviceSpecifyConfig(deviceId, j8103, 6);
|
jt1078Template.setDeviceSpecifyConfig(deviceId, j8103, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void connectionControl(String deviceId, JTDeviceConnectionControl control) {
|
||||||
|
J8105 j8105 = new J8105();
|
||||||
|
j8105.setConnectionControl(control);
|
||||||
|
jt1078Template.deviceControl(deviceId, j8105, 6);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user