liusuyi
2025-12-12 7a164e24123df74c3228324e4a398b79cb9c12b6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.ard.work.component.netty.command.real;
 
import com.ard.work.domain.dto.telemetry.TelemetryData;
import com.ard.work.component.netty.command.BaseCmd;
import io.netty.buffer.ByteBuf;
import lombok.Data;
import lombok.EqualsAndHashCode;
 
/**
 * UavDataCommand
 *
 * @author liusuyi
 * @date 2024年10月23日9:33
 **/
@Data
@EqualsAndHashCode(callSuper = false)
public class UavTelemetryDataCmd extends BaseCmd {
    private 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;
    }
 
    // 实现 encode 方法,如果需要
    @Override
    public void encode(ByteBuf out) {
        // 根据需要实现编码
    }
}