liusuyi
2024-10-26 f2236478e434b9d1b714b51d3586fb11a59e6f14
ard-work/src/main/java/com/ard/tianyu/netty/handler/MessageProtocolDecoder.java
@@ -5,6 +5,7 @@
import com.ard.tianyu.netty.command.camera.CapturePicReplyCmd;
import com.ard.tianyu.netty.command.camera.RecordStartReplyCmd;
import com.ard.tianyu.netty.command.camera.RecordStopReplyCmd;
import com.ard.tianyu.netty.command.manual.TakeOffReplyCmd;
import com.ard.tianyu.netty.command.notice.BoxPowerStatusReplyCmd;
import com.ard.tianyu.netty.command.notice.FlyWayEndReplyCmd;
import com.ard.tianyu.netty.command.notice.UavReadyReplyCmd;
@@ -92,12 +93,21 @@
                byte encryptionFlag = in.readByte();
                byte actionCode = in.readByte();
                switch (actionCode) {
                    case 0x22:
                    case 0x11:
                        byte result = in.readByte();
                        int errorCode = in.readInt();
                        uavData = new byte[15];
                        in.readBytes(uavData);
                        String boxSn = new String(uavData);
                        baseCmd = new TakeOffReplyCmd(boxSn, result, errorCode);
                        log.debug("起飞回复: {}", boxSn);
                        break;
                    case 0x22:
                        result = in.readByte();
                        errorCode = in.readInt();
                        uavData = new byte[15];
                        in.readBytes(uavData);
                        boxSn = new String(uavData);
                        baseCmd = new CameraModeReplyCmd(boxSn, result, errorCode);
                        log.debug("设置相机模式回复: {}", boxSn);
                        break;