liusuyi
2024-10-25 91f6e60919b92b7f99a41f2ddeb42df17cd0c487
ard-work/src/main/java/com/ard/tianyu/netty/handler/MessageProtocolDecoder.java
@@ -44,10 +44,6 @@
                break;
            case 0x03:
            case 0x04:
                byte[] boxSn = new byte[dataLength - 1];
                in.readBytes(boxSn);
                SubscribeReplyCommand subscribeReply = new SubscribeReplyCommand(new String(boxSn));
                log.debug("订阅回复: {}", subscribeReply.getBoxSn());
                break;
            case (byte) 0xA8:
                byte[] uavStatus = new byte[dataLength - 1];
@@ -83,9 +79,10 @@
                        in.readBytes(uavData1);
                        byte[] uavData2 = new byte[15];
                        in.readBytes(uavData2);
                        String boxSn = new String(uavData2);
                        TelemetryDataPB.UavInitInfo uavInitInfo = TelemetryDataPB.UavInitInfo.parseFrom(uavData1);
                        baseCommand = new DroneReadyNotificationCommand(uavInitInfo, actionCode);
                        log.info("无人机初始化数据: {}", uavInitInfo.getUavModel());
                        baseCommand = new UavReadyNotificationCommand(boxSn, uavInitInfo, actionCode);
                        log.debug("无人机初始化数据: {}", boxSn);
                        break;
                    default:
                        log.warn("无法识别的命令码动作编号:{}", String.format("0x%02X", actionCode & 0xFF));