| | |
| | | package com.ard.tianyu.netty.command.real; |
| | | |
| | | import com.ard.tianyu.model.dto.telemetry.TelemetryData; |
| | | import com.ard.tianyu.netty.command.BaseCmd; |
| | | import com.ard.tianyu.netty.protobuf.TelemetryDataPB; |
| | | import io.netty.buffer.ByteBuf; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * UavDataCommand |
| | |
| | | * @author liusuyi |
| | | * @date 2024年10月23日9:33 |
| | | **/ |
| | | @Data |
| | | public class UavTelemetryDataCmd extends BaseCmd { |
| | | private TelemetryDataPB.TelemetryData telemetryData; |
| | | private TelemetryData telemetryData; |
| | | // 构造函数 |
| | | public UavTelemetryDataCmd(TelemetryDataPB.TelemetryData telemetryData) { |
| | | public UavTelemetryDataCmd(TelemetryData telemetryData) { |
| | | setDataHeader((short) 0x6A77); // 设置帧头 |
| | | // setDataLength((short) (1 + uavState.toByteArray().length)); // 数据长度 |
| | | setBoxSn(telemetryData.getBoxSn().getBytes()); |
| | | setCmdCode((byte) 0xA9); // 设置命令编号 |
| | | this.telemetryData = telemetryData; |
| | | } |
| | | |
| | | // 获取无人机状态数据 |
| | | public TelemetryDataPB.TelemetryData getTelemetryData() { |
| | | return telemetryData; |
| | | } |
| | | |
| | | // 实现 encode 方法,如果需要 |