| | |
| | | * 解析仓库温湿度信息,将信息放在缓存中,以便粮情使用 |
| | | * |
| | | * @param msg |
| | | * @param ser |
| | | * @param device |
| | | */ |
| | | public void analysis8828(ReMessage msg, GatewayDevice ser) { |
| | | public void analysis8828(ReMessage msg, GatewayDevice device) { |
| | | |
| | | log.debug("-----------analysis8828------------{}.{}", ser.getIp(), ser.getPort()); |
| | | log.debug("-----------analysis8828------------{}.{}", device.getIp(), device.getPort()); |
| | | |
| | | String content = msg.getBody().getContent(); |
| | | |
| | |
| | | t = BytesUtil.hexToInt("FF" + temp); |
| | | } |
| | | if (t == ERROR_TH_TAG) { |
| | | log.error("{}温湿度解析异常,原因:没有检测到传感器", ser.getDeviceName()); |
| | | th.setRemark(ser.getDeviceName() + "温湿度解析异常,原因:没有检测到传感器"); |
| | | log.error("{}温湿度解析异常,原因:没有检测到传感器", device.getDeviceName()); |
| | | th.setRemark(device.getDeviceName() + "温湿度解析异常,原因:没有检测到传感器"); |
| | | } else { |
| | | th.setTempIn(Double.valueOf(t)); |
| | | } |
| | |
| | | h = BytesUtil.hexToInt("FF" + temp); |
| | | } |
| | | if (h == ERROR_TH_TAG) { |
| | | log.error("{}温湿度解析异常,原因:没有检测到传感器", ser.getDeviceName()); |
| | | th.setRemark(ser.getDeviceName() + "温湿度解析异常,原因:没有检测到传感器"); |
| | | log.error("{}温湿度解析异常,原因:没有检测到传感器", device.getDeviceName()); |
| | | th.setRemark(device.getDeviceName() + "温湿度解析异常,原因:没有检测到传感器"); |
| | | } else { |
| | | th.setHumidityIn(Double.valueOf(h)); |
| | | } |
| | | |
| | | th.setSerId(ser.getId()); |
| | | th.setSerId(device.getDeviceId()); |
| | | th.setThAddr(thAddr + ""); |
| | | |
| | | //存放缓存 |
| | | ProtocolUtils.addTh2Map(ser.getDeviceId(), th); |
| | | ProtocolUtils.addTh2Map(device.getDeviceId(), th); |
| | | |
| | | log.info("仓温仓湿解析完成={}", th); |
| | | } |