| | |
| | | */ |
| | | @Override |
| | | public Boolean capturePic(CapturePicDTO capturePicDto) { |
| | | //设置相机模式为拍照模式 |
| | | updateCameraMode(CameraModeDTO.builder().boxSn(capturePicDto.getBoxSn()).actionParam((byte) 0x01).build()); |
| | | //设置拍照回传 |
| | | photoReturnToggle(PhotoReturnToggleDTO.builder().boxSn(capturePicDto.getBoxSn()).actionParam((byte) 0x01).build()); |
| | | |
| | | CapturePicCmd capturePicCommand = new CapturePicCmd(capturePicDto); |
| | | this.sendMessage(tyConfiguration.getIpPort(), capturePicCommand); |
| | | return true; |
| | |
| | | case 0x02: |
| | | // 处理注册消息 |
| | | HeartbeatReplyCmd heartbeatReplyCmd = (HeartbeatReplyCmd) tyCommand; |
| | | logPrint("心跳消息", heartbeatReplyCmd.getTimestamp()); |
| | | //logPrint("心跳消息", heartbeatReplyCmd.getTimestamp()); |
| | | break; |
| | | case 0x03: |
| | | // 处理订阅消息 |
| | | break; |
| | | case 0x04: |
| | | // 处理取消订阅消息 |
| | | break; |
| | | case 0x09: |
| | | // 处理图片上传完成通知 |
| | | PicUploadCompletedReplyCmd picUploadCompletedReplyCmd = (PicUploadCompletedReplyCmd) tyCommand; |
| | | logPrint("图片上传完成", picUploadCompletedReplyCmd.getPicUrl()); |
| | | break; |
| | | case 0x0A: |
| | | // 处理云盒开关机通知消息 |
| | |
| | | // 处理无人机状态消息 |
| | | UavStateCmd uavStateCmd = (UavStateCmd) tyCommand; |
| | | UavStateCache.putUavState(uavStateCmd.getUavState()); |
| | | logPrint("无人机状态", uavStateCmd.getUavState().getBoxSn()); |
| | | // WebSocketUtil.sendMessageAll(uavStateCmd.getUavState()); |
| | | //logPrint("无人机状态", uavStateCmd.getUavState().getBoxSn()); |
| | | // WebSocketUtil.sendMessageAll(uavStateCmd.getUavState()); |
| | | break; |
| | | case (byte) 0xA9: |
| | | // 处理无人机遥测消息 |
| | | UavTelemetryDataCmd uavTelemetryDataCmd = (UavTelemetryDataCmd) tyCommand; |
| | | UavTelemetryDataCache.putUavTelemetryData(uavTelemetryDataCmd.getTelemetryData()); |
| | | logPrint("无人机遥测", uavTelemetryDataCmd.getTelemetryData().getBoxSn()); |
| | | //logPrint("无人机遥测", uavTelemetryDataCmd.getTelemetryData().getBoxSn()); |
| | | //WebSocketUtil.sendMessageAll(uavTelemetryDataCmd.getTelemetryData()); |
| | | break; |
| | | |
| | |
| | | // 处理无人机信道质量数据 |
| | | SignalInfoCmd signalInfoCmd = (SignalInfoCmd) tyCommand; |
| | | UavSignalInfoCache.putUavSignalInfoCache(signalInfoCmd.getSignalInfo()); |
| | | logPrint("无人机信道质量", signalInfoCmd.getSignalInfo().getBoxSn()); |
| | | //logPrint("无人机信道质量", signalInfoCmd.getSignalInfo().getBoxSn()); |
| | | break; |
| | | case (byte) 0xD1: |
| | | // 处理无人机 |
| | |
| | | //到达指点飞行位置回复 |
| | | if (tyCommand instanceof PointControlReachedReplyCmd) { |
| | | PointControlReachedReplyCmd pointControlReachedReplyCmd = (PointControlReachedReplyCmd) tyCommand; |
| | | logPrint("到达指点飞行位置", pointControlReachedReplyCmd.getResult(), pointControlReachedReplyCmd.getErrorCode()); |
| | | logPrint("到达指点飞行位置", pointControlReachedReplyCmd.getResult(), |
| | | pointControlReachedReplyCmd.getErrorCode()); |
| | | } |
| | | //紧急制动回复 |
| | | if (tyCommand instanceof EmergencyBrakeReplyCmd) { |
| | |
| | | //设置返航高度回复 |
| | | if (tyCommand instanceof ReturnHeightSettingReplyCmd) { |
| | | ReturnHeightSettingReplyCmd returnHeightSettingReplyCmd = (ReturnHeightSettingReplyCmd) tyCommand; |
| | | logPrint("设置返航高度", returnHeightSettingReplyCmd.getResult(), returnHeightSettingReplyCmd.getErrorCode()); |
| | | logPrint("设置返航高度", returnHeightSettingReplyCmd.getResult(), |
| | | returnHeightSettingReplyCmd.getErrorCode()); |
| | | } |
| | | //设置返航点回复 |
| | | if (tyCommand instanceof ReturnPointSettingReplyCmd) { |
| | | ReturnPointSettingReplyCmd returnPointSettingReplyCmd = (ReturnPointSettingReplyCmd) tyCommand; |
| | | logPrint("设置返航点", returnPointSettingReplyCmd.getResult(), returnPointSettingReplyCmd.getErrorCode()); |
| | | logPrint("设置返航点", returnPointSettingReplyCmd.getResult(), |
| | | returnPointSettingReplyCmd.getErrorCode()); |
| | | } |
| | | break; |
| | | case (byte) 0xD2: |
| | | //设置视频码流回复 |
| | | if (tyCommand instanceof VideoStreamSettingReplyCmd) { |
| | | VideoStreamSettingReplyCmd videoStreamSettingReplyCmd = (VideoStreamSettingReplyCmd) tyCommand; |
| | | logPrint("设置视频码流", videoStreamSettingReplyCmd.getResult(), videoStreamSettingReplyCmd.getErrorCode()); |
| | | logPrint("设置视频码流", videoStreamSettingReplyCmd.getResult(), |
| | | videoStreamSettingReplyCmd.getErrorCode()); |
| | | } |
| | | break; |
| | | default: |
| | |
| | | |
| | | //公共日志打印 |
| | | private void logPrint(String message, Object obj) { |
| | | log.debug("收到{}回复{}", message, obj); |
| | | log.warn("收到{}回复{}", message, obj); |
| | | } |
| | | |
| | | //公共日志打印 |