| | |
| | | } |
| | | |
| | | } else if (A5LightReportEnum.Time_Synchronized.getCode().equals(functionCode)) { |
| | | // log.info("请求时间同步"); |
| | | log.info("请求时间同步"); |
| | | A5LightTimeSyncReportInnerFrame syncRespInnerFrame = new A5LightTimeSyncReportInnerFrame().transformFrame(frame.getPayload()); |
| | | // log.info(syncRespInnerFrame.toString()); |
| | | log.info(syncRespInnerFrame.toString()); |
| | | if (syncRespInnerFrame.isValidate()) { |
| | | SpringContextHolder.getBean(LightService.class).timeSynchronizationInitiative(deviceName, syncRespInnerFrame.getDestinationAddress()); |
| | | } |
| | | |
| | | } else if (A5LightReportEnum.Error_Code.getCode().equals(functionCode)) { |
| | | log.info("故障码上报"); |
| | | A5LightErrorCodeReportInnerFrame codeRespInnerFrame = new A5LightErrorCodeReportInnerFrame().transformFrame(frame.getPayload()); |
| | | System.out.println(JSON.toJSONString(codeRespInnerFrame) + "++++++++++++++++++++++++++++"); |
| | | log.info(codeRespInnerFrame.isValidate() + "是否通过校验"); |
| | | log.info(codeRespInnerFrame.getErrorCode() + "故障码"); |
| | | if (codeRespInnerFrame.isValidate() && (codeRespInnerFrame.getErrorCode() != 0)) { |
| | | if (codeRespInnerFrame.isValidate()) { |
| | | SpringContextHolder.getBean(LightReportErrorService.class).saveReportError(deviceName, codeRespInnerFrame); |
| | | } |
| | | //0000 表示没有故障,发送清除故障指令 |
| | | if (codeRespInnerFrame.getErrorCode() == 0) { |
| | | System.out.println("清除故障操作!"); |
| | | SpringContextHolder.getBean(LightReportErrorService.class).cleanErrorCode(deviceName, codeRespInnerFrame.getDestinationAddress()); |
| | | } |
| | | } |
| | | } |
| | | } |