1078-添加云台光圈控制
This commit is contained in:
@@ -184,6 +184,23 @@ public class JT1078Template {
|
|||||||
return SessionManager.INSTANCE.request(cmd, timeOut);
|
return SessionManager.INSTANCE.request(cmd, timeOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 云台控制指令-云台调整光圈控制
|
||||||
|
*
|
||||||
|
* @param devId 设备号
|
||||||
|
* @param j9303 云台光圈控制参数
|
||||||
|
*/
|
||||||
|
public String ptzIris(String devId, J9303 j9303, Integer timeOut) {
|
||||||
|
Cmd cmd = new Cmd.Builder()
|
||||||
|
.setDevId(devId)
|
||||||
|
.setPackageNo(randomInt())
|
||||||
|
.setMsgId(H9303)
|
||||||
|
.setRespId(H0001)
|
||||||
|
.setRs(j9303)
|
||||||
|
.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 = "9302")
|
||||||
|
public class J9303 extends Rs {
|
||||||
|
// 逻辑通道号
|
||||||
|
private int channel;
|
||||||
|
|
||||||
|
// 调整方式: 0:调大; 1:调小
|
||||||
|
private int iris;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ByteBuf encode() {
|
||||||
|
ByteBuf buffer = Unpooled.buffer();
|
||||||
|
buffer.writeByte(channel);
|
||||||
|
buffer.writeByte(iris);
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getChannel() {
|
||||||
|
return channel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChannel(int channel) {
|
||||||
|
this.channel = channel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getIris() {
|
||||||
|
return iris;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIris(int iris) {
|
||||||
|
this.iris = iris;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "J9303{" +
|
||||||
|
"channel=" + channel +
|
||||||
|
", iris=" + iris +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user