| | |
| | | DeviceDTO deviceDTO = (DeviceDTO) RedisOpsUtils.get(RedisConst.DEVICE_ONLINE_PREFIX + dockSn); |
| | | boolean deviceOnline = this.checkDeviceOnline(deviceDTO.getChildDeviceSn()); |
| | | if (!deviceOnline) { |
| | | return ResponseResult.error(CommonErrorEnum.DEVICE_OFFLINE.getErrorCode(),"无人机" + CommonErrorEnum.DEVICE_OFFLINE.getErrorMsg()); |
| | | return ResponseResult.error(2222,"无人机" + CommonErrorEnum.DEVICE_OFFLINE.getErrorMsg()); |
| | | //throw new RuntimeException("Device is offline."); |
| | | // CommonErrorEnum.DEVICE_OFFLINE.getErrorCode() |
| | | } |
| | | |
| | | // Make sure the data is valid. |
| | |
| | | CommonTopicReceiver<Map<String,Integer>> stateReceiver = new CommonTopicReceiver<>(); |
| | | stateReceiver.setTid(UUID.randomUUID().toString()); |
| | | stateReceiver.setBid(UUID.randomUUID().toString()); |
| | | stateReceiver.setType(MessageType.LIVESTREAM.getType()); |
| | | stateReceiver.setType(MessageType.LIVESTATUS.getType()); |
| | | stateReceiver.setGateway(sn); |
| | | stateReceiver.setTimestamp(System.currentTimeMillis()); |
| | | Map<String,Integer> live_status = new HashMap<>(); |