1078-添加云台雨刷控制

This commit is contained in:
648540858
2024-04-07 07:15:43 +08:00
parent b649464753
commit a8a4aecc15
3 changed files with 70 additions and 1 deletions

View File

@@ -27,6 +27,8 @@ public class JT1078Template {
private static final String H9301 = "9301";
private static final String H9302 = "9302";
private static final String H9303 = "9303";
private static final String H9304 = "9304";
private static final String H9305 = "9305";
private static final String H0001 = "0001";
private static final String H1205 = "1205";
@@ -201,6 +203,23 @@ public class JT1078Template {
return SessionManager.INSTANCE.request(cmd, timeOut);
}
/**
* 云台控制指令-云台雨刷控制
*
* @param devId 设备号
* @param j9304 云台雨刷控制参数
*/
public String ptzWiper(String devId, J9304 j9304, Integer timeOut) {
Cmd cmd = new Cmd.Builder()
.setDevId(devId)
.setPackageNo(randomInt())
.setMsgId(H9304)
.setRespId(H0001)
.setRs(j9304)
.build();
return SessionManager.INSTANCE.request(cmd, timeOut);
}
private Long randomInt() {
return (long) random.nextInt(1000) + 1;
}

View File

@@ -8,7 +8,7 @@ import io.netty.buffer.Unpooled;
* 云台控制指令-光圈控制
*
*/
@MsgId(id = "9302")
@MsgId(id = "9303")
public class J9303 extends Rs {
// 逻辑通道号
private int channel;

View File

@@ -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 = "9304")
public class J9304 extends Rs {
// 逻辑通道号
private int channel;
// 启停标识: 0停止 1启动
private int on;
@Override
public ByteBuf encode() {
ByteBuf buffer = Unpooled.buffer();
buffer.writeByte(channel);
buffer.writeByte(on);
return buffer;
}
public int getChannel() {
return channel;
}
public void setChannel(int channel) {
this.channel = channel;
}
public int getOn() {
return on;
}
public void setOn(int on) {
this.on = on;
}
@Override
public String toString() {
return "J9304{" +
"channel=" + channel +
", on=" + on +
'}';
}
}