| | |
| | | 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; |
| | |
| | | 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; |