liusuyi
2024-10-25 fddccbf217223e7287d6861c3020d9ba5cc15e55
ard-work/src/main/java/com/ard/tianyu/netty/command/control/AngleControlCommand.java
File was renamed from ard-work/src/main/java/com/ard/tianyu/netty/command/ControlAngleCommand.java
@@ -1,5 +1,7 @@
package com.ard.tianyu.netty.command;
package com.ard.tianyu.netty.command.control;
import com.ard.tianyu.model.dto.control.AngleControlDto;
import com.ard.tianyu.netty.command.BaseCommand;
import io.netty.buffer.ByteBuf;
import lombok.Data;
@@ -11,20 +13,18 @@
 */
@Data
public class ControlAngleCommand extends BaseCommand {
    private final byte encryptFlag; // 加密标志
public class AngleControlCommand extends BaseCommand {
    private final byte encryptFlag = 0x00; // 加密标志
    private final byte actionCode; // 动作编号
    private final byte rotationAngle; // 转动角度
    public ControlAngleCommand(String boxSn, byte actionCode, byte rotationAngle) {
    public AngleControlCommand(AngleControlDto angleControlDto) {
        setDataHeader((short) 0x7479);
        setDataLength((short)19);
        setBoxSn(boxSn.getBytes());
        setDataLength((short) 19);
        setBoxSn(angleControlDto.getBoxSn().getBytes());
        setCmdCode((byte) 0xD1);
        this.encryptFlag = 0x00;
        this.actionCode = actionCode;
        this.rotationAngle = rotationAngle;
        this.actionCode = angleControlDto.getActionCode();
        this.rotationAngle = angleControlDto.getRotationAngle();
    }
    public void encode(ByteBuf out) {