| | |
| | | |
| | | @Override |
| | | public CommandResponse reset() { |
| | | CommandResponse response = new CommandResponse(false); |
| | | try { |
| | | LiftCommand resetCommand = getResetCommand(9999); |
| | | |
| | | //发出请求 |
| | | String resultKey = requestCommand(resetCommand); |
| | | //查询请求结果 |
| | | JSONObject result = queryCommandStatus(resultKey); |
| | | if (result == null) { |
| | | return response;//请求失败 |
| | | } |
| | | if(!result.getString("result").equals("success")) { |
| | | return response;//请求失败 |
| | | } |
| | | |
| | | this.liftProtocol.setSendTime(System.currentTimeMillis());//指令下发时间 |
| | | CommandResponse response = new CommandResponse(true); |
| | | this.setSyncTaskNo(0); |
| | | this.setProtocolStatus(LiftProtocolStatusType.IDLE); |
| | | response.setMessage(JSON.toJSONString(result)); |
| | | response.setResult(true); |
| | | return response; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | response.setMessage(e.getMessage()); |
| | | return response; |
| | | } |
| | | } |
| | | |
| | | @Override |