package com.ard.tianyu.component.netty.command.real;
|
|
import com.ard.tianyu.domain.dto.state.UavState;
|
import com.ard.tianyu.component.netty.command.BaseCmd;
|
import io.netty.buffer.ByteBuf;
|
import lombok.Data;
|
|
@Data
|
public class UavStateCmd extends BaseCmd {
|
private UavState uavState; // ProtoBuf 数据类
|
|
// 构造函数
|
public UavStateCmd(UavState uavState) {
|
setDataHeader((short) 0x6A77); // 设置帧头
|
setBoxSn(uavState.getBoxSn().getBytes()); // 设置云盒编号
|
// setDataLength((short) (1 + uavState.toByteArray().length)); // 数据长度
|
setCmdCode((byte) 0xA8); // 设置命令编号
|
this.uavState = uavState;
|
}
|
// 实现 encode 方法,如果需要
|
@Override
|
public void encode(ByteBuf out) {
|
// 根据需要实现编码
|
}
|
}
|