liusuyi
2024-10-25 1157c58dc74805cbb7db57ab121bbb521f4c216b
ard-work/src/main/java/com/ard/tianyu/netty/handler/MessageProtocolDecoder.java
@@ -1,6 +1,7 @@
package com.ard.tianyu.netty.handler;// MessageProtocolDecoder.java
import com.ard.tianyu.netty.command.*;
import com.ard.tianyu.netty.command.camera.CameraModeReplyCommand;
import com.ard.tianyu.netty.command.camera.CapturePicReplyCommand;
import com.ard.tianyu.netty.command.camera.RecordStartReplyCommand;
import com.ard.tianyu.netty.command.camera.RecordStopReplyCommand;
@@ -83,21 +84,30 @@
                byte encryptionFlag = in.readByte();
                byte actionCode = in.readByte();
                switch (actionCode) {
                    case 0x23:
                    case 0x22:
                        byte result = in.readByte();
                        int errorCode = in.readInt();
                        uavData = new byte[15];
                        in.readBytes(uavData);
                        String boxSn = new String(uavData);
                        baseCommand = new CameraModeReplyCommand(boxSn, result, errorCode);
                        log.debug("设置相机模式回复: {}", boxSn);
                        break;
                    case 0x23:
                        result = in.readByte();
                        errorCode = in.readInt();
                        uavData = new byte[15];
                        in.readBytes(uavData);
                        boxSn = new String(uavData);
                        baseCommand = new CapturePicReplyCommand(boxSn, result, errorCode);
                        log.debug("拍照回复: {}", boxSn);
                        break;
                    case 0x24:
                         result = in.readByte();
                         errorCode = in.readInt();
                        result = in.readByte();
                        errorCode = in.readInt();
                        uavData = new byte[15];
                        in.readBytes(uavData);
                         boxSn = new String(uavData);
                        boxSn = new String(uavData);
                        baseCommand = new RecordStartReplyCommand(boxSn, result, errorCode);
                        log.debug("开始录像回复: {}", boxSn);
                        break;