| File was renamed from ard-work/src/main/java/com/ard/tianyu/netty/command/ControlAngleCommand.java |
| | |
| | | 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; |
| | | |
| | |
| | | */ |
| | | |
| | | @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) { |