mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-26 06:57:50 +08:00
1078-云台变倍控制
This commit is contained in:
parent
8ba30e83ef
commit
6757f4b719
@ -29,6 +29,7 @@ public class JT1078Template {
|
|||||||
private static final String H9303 = "9303";
|
private static final String H9303 = "9303";
|
||||||
private static final String H9304 = "9304";
|
private static final String H9304 = "9304";
|
||||||
private static final String H9305 = "9305";
|
private static final String H9305 = "9305";
|
||||||
|
private static final String H9306 = "9306";
|
||||||
|
|
||||||
private static final String H0001 = "0001";
|
private static final String H0001 = "0001";
|
||||||
private static final String H1205 = "1205";
|
private static final String H1205 = "1205";
|
||||||
@ -237,6 +238,23 @@ public class JT1078Template {
|
|||||||
return SessionManager.INSTANCE.request(cmd, timeOut);
|
return SessionManager.INSTANCE.request(cmd, timeOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 云台控制指令-变倍控制
|
||||||
|
*
|
||||||
|
* @param devId 设备号
|
||||||
|
* @param j9306 云台变倍控制参数
|
||||||
|
*/
|
||||||
|
public String ptzZoom(String devId, J9306 j9306, Integer timeOut) {
|
||||||
|
Cmd cmd = new Cmd.Builder()
|
||||||
|
.setDevId(devId)
|
||||||
|
.setPackageNo(randomInt())
|
||||||
|
.setMsgId(H9306)
|
||||||
|
.setRespId(H0001)
|
||||||
|
.setRs(j9306)
|
||||||
|
.build();
|
||||||
|
return SessionManager.INSTANCE.request(cmd, timeOut);
|
||||||
|
}
|
||||||
|
|
||||||
private Long randomInt() {
|
private Long randomInt() {
|
||||||
return (long) random.nextInt(1000) + 1;
|
return (long) random.nextInt(1000) + 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,50 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 云台控制指令-云台变倍控制
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@MsgId(id = "9306")
|
||||||
|
public class J9306 extends Rs {
|
||||||
|
// 逻辑通道号
|
||||||
|
private int channel;
|
||||||
|
|
||||||
|
// 0:调大; 1:调小
|
||||||
|
private int zoom;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ByteBuf encode() {
|
||||||
|
ByteBuf buffer = Unpooled.buffer();
|
||||||
|
buffer.writeByte(channel);
|
||||||
|
buffer.writeByte(zoom);
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getChannel() {
|
||||||
|
return channel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChannel(int channel) {
|
||||||
|
this.channel = channel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getZoom() {
|
||||||
|
return zoom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setZoom(int zoom) {
|
||||||
|
this.zoom = zoom;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "J9306{" +
|
||||||
|
"channel=" + channel +
|
||||||
|
", zoom=" + zoom +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user