package com.zy.acs.common.domain.protocol;
|
|
import com.zy.acs.common.utils.Utils;
|
import lombok.Data;
|
import lombok.extern.slf4j.Slf4j;
|
|
import java.io.Serializable;
|
|
/**
|
* 动作命令包
|
* Created by vincent on 2023/3/21
|
*/
|
@Data
|
public class AGV_02_DOWN implements IMessageBody, Serializable {
|
|
private static final long serialVersionUID = 1664188062202647371L;
|
|
@Override
|
public byte[] writeToBytes() {
|
String serialNo = Utils.zeroFill(this.serialNo, 16);
|
byte[] serialNoBytes = Utils.reverse(serialNo.getBytes());
|
byte cmdCodeByte = (byte) this.getCmdCode();
|
byte valByte = (byte) this.getVal();
|
|
byte[] cmdBodyBytes = commandBody.writeToBytes();
|
|
return Utils.merge(serialNoBytes, cmdCodeByte, valByte, cmdBodyBytes);
|
}
|
|
@Override
|
public void readFromBytes(byte[] messageBodyBytes) {
|
|
}
|
|
// 流水号 - 16
|
private String serialNo;
|
|
// 命令码
|
private int cmdCode;
|
|
// 属性值
|
private int val;
|
|
// 动作参数
|
private ICommandBody commandBody;
|
|
}
|