1078-添加云台旋转

This commit is contained in:
648540858
2024-04-07 07:07:27 +08:00
parent 4ec4d618d6
commit a1ab834875
2 changed files with 82 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
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.ByteBufUtil;
import io.netty.buffer.Unpooled;
/**
* 云台控制指令-云台旋转
*
*/
@MsgId(id = "9301")
public class J9301 extends Rs {
// 逻辑通道号
private int channel;
// 方向: 0停止 1 2 3 4
private int direction;
// 速度0 255
private int speed;
@Override
public ByteBuf encode() {
ByteBuf buffer = Unpooled.buffer();
buffer.writeByte(channel);
buffer.writeByte(direction);
buffer.writeByte(speed);
return buffer;
}
public int getChannel() {
return channel;
}
public void setChannel(int channel) {
this.channel = channel;
}
public int getDirection() {
return direction;
}
public void setDirection(int direction) {
this.direction = direction;
}
public int getSpeed() {
return speed;
}
public void setSpeed(int speed) {
this.speed = speed;
}
@Override
public String toString() {
return "J9301{" +
"channel=" + channel +
", direction=" + direction +
", speed=" + speed +
'}';
}
}