| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import lombok.Data; |
| | | |
| | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | private Date createTime; |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | public ResponseVO<Object> getAirEquipment(@PathVariable String mac) { |
| | | return ResponseUtil.success(airEquipmentNongGengService.getAirEquipment(mac)); |
| | | } |
| | | |
| | | /** |
| | | * 设置å¿è·³å
é´éæ¶é´ |
| | | * |
| | | * @param mac |
| | | * @param time |
| | | * @return |
| | | */ |
| | | @GetMapping("/setHeartBeatTime") |
| | | public ResponseVO<Object> setHeartBeatTime(@RequestParam(value = "mac", required = false) String mac, |
| | | @RequestParam(value = "time", required = false) Integer time) { |
| | | if (!permissionConfig.check(MenuEnum.AIR_HEARTBEATTIME.getCode())) { |
| | | return ResponseUtil.fail("缺å°å¯¹åºç¨æ·æé"); |
| | | } |
| | | return ResponseUtil.success(airEquipmentNongGengService.setHeartBeatTime(mac, time)); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å¤§æ°è®¾å¤å¿è·³å
æ¶é´ |
| | | * |
| | | * @return |
| | | */ |
| | | @GetMapping("/QueryHeartBeatTime") |
| | | public ResponseVO<Object> QueryHeartBeatTime(@RequestParam(value = "mac", required = false) String mac) { |
| | | if (!permissionConfig.check(MenuEnum.AIR_HEARTBEATTIME.getCode())) { |
| | | return ResponseUtil.fail("缺å°å¯¹åºç¨æ·æé"); |
| | | } |
| | | return ResponseUtil.success(airEquipmentNongGengService.QueryHeartBeatTime(mac)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢è½¯ç¡¬ä»¶çæ¬ |
| | | * |
| | | * @param mac |
| | | * @return |
| | | */ |
| | | @GetMapping("/QueryVersion") |
| | | public ResponseVO<Object> QueryVersion(@RequestParam(value = "mac", required = false) String mac) { |
| | | if (!permissionConfig.check(MenuEnum.AIR_QUERYVERSION.getCode())) { |
| | | return ResponseUtil.fail("缺å°å¯¹åºç¨æ·æé"); |
| | | } |
| | | return ResponseUtil.success(airEquipmentNongGengService.QueryVersion(mac)); |
| | | } |
| | | |
| | | /** |
| | | * 软éå¯ |
| | | * |
| | | * @param mac |
| | | * @return |
| | | */ |
| | | @GetMapping("/Reboot") |
| | | public ResponseVO<Object> Reboot(@RequestParam(value = "mac", required = false) String mac) { |
| | | if (!permissionConfig.check(MenuEnum.AIR_REBOOT.getCode())) { |
| | | return ResponseUtil.fail("缺å°å¯¹åºç¨æ·æé"); |
| | | } |
| | | return ResponseUtil.success(airEquipmentNongGengService.Reboot(mac)); |
| | | } |
| | | } |
| | |
| | | |
| | | @Override |
| | | public void process(String productKey, String deviceName, CommonFrame frame) { |
| | | /** |
| | | * connectTypeç¨äºå¤æä¸»å¨ä¸æ¥çæ°æ®æ¯å±äºæ§å¤§æ°è®¾å¤è¿æ¯åè大æ°è®¾å¤ |
| | | * åèå¿è·³å
主å¨ä¸æ¥ç³»ç»å°åï¼MQTTè¯·æ±æ¹å¼ï¼ï¼01 åè½ç ï¼03 |
| | | */ |
| | | String connectType = frame.getPayload().substring(0, 2); |
| | | String functionCode = frame.getPayload().substring(2, 4); |
| | | if (A5AtmosphereReportEnum.HeartBeat_Data.getCode().equals(functionCode)) { |
| | | log.info("å¿è·³ç¸åºââå¤§æ°æ°æ®"); |
| | | A5AtmosphereHeartbeatReportInnerFrame heartbeatReportInnerFrame = new A5AtmosphereHeartbeatReportInnerFrame().transformFrame(frame.getPayload()); |
| | | if(heartbeatReportInnerFrame != null){ |
| | | if (heartbeatReportInnerFrame != null) { |
| | | log.info(heartbeatReportInnerFrame.toString()); |
| | | SpringContextHolder.getBean(AirDataService.class).saveReportData(deviceName, heartbeatReportInnerFrame.getHeartBeatDataPackage()); |
| | | } |
| | | } else if (A5AtmosphereReportEnum.HeartBeat_Data_Nong_Geng.getCode().equals(functionCode)) { |
| | | } else if (A5AtmosphereReportEnum.HeartBeat_Data_Nong_Geng.getCode().equals(functionCode) && "01".equals(connectType)) { |
| | | log.info("å¿è·³ç¸åºââå¤§æ°æ°æ®(åè)"); |
| | | A5AtmosphereNewHeartbeatReportInnerFrame heartbeatReportInnerFrame = new A5AtmosphereNewHeartbeatReportInnerFrame().transformFrame(frame.getPayload()); |
| | | if (heartbeatReportInnerFrame != null && heartbeatReportInnerFrame.isValidate()) { |
| | | log.info(heartbeatReportInnerFrame.toString()); |
| | | SpringContextHolder.getBean(AirDataNongGengService.class).saveReportData(deviceName, heartbeatReportInnerFrame.getHeartBeatDataPackage()); |
| | | }else{ |
| | | } else { |
| | | System.out.println("æ°æ®æ ¡éªå¼å¸¸ï¼"); |
| | | } |
| | | |
| | |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.IResponseInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.util.CRC16Utils; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.util.CRC32Utils; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.util.CRCUtils; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | */ |
| | | @Data |
| | | public class A5AtmosphereNewHeartbeatReportInnerFrame extends BaseResponseInnerFrame<A5AtmosphereNewHeartbeatReportInnerFrame> { |
| | | //ff03200241000000000000000000000009000a198a186327b8000c000000000000000b8c35c1cad6bf |
| | | //010326FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1B341022277F000D05B5000000015DDD0000FFFF000070C9 主å¨ä¸æ¥å¿è·³å
|
| | | private HeartBeatDataPackage heartBeatDataPackage; |
| | | |
| | | @Override |
| | |
| | | } |
| | | //æ ¡éª |
| | | hex = hex.replaceAll(" ", ""); |
| | | if (hex.length() < 74) { |
| | | if (hex.length() != 86) { |
| | | return null; |
| | | } |
| | | |
| | |
| | | setHeartBeatDataPackage(heartBeatDataPackage); |
| | | |
| | | setCrc16(hex.substring(hex.length() - 4)); |
| | | // æ ¡éªCRC32 |
| | | // æ ¡éªCRC16 |
| | | String frame = hex.substring(0, hex.length() - 4); |
| | | this.setValidate(getCrc16().equals(CRC16Utils.getCRC16(frame))); |
| | | this.setValidate(getCrc16().equals(CRCUtils.getCRC16(frame))); |
| | | return this; |
| | | } |
| | | |
| | |
| | | private BigDecimal radiation; |
| | | //("å
ç
§") |
| | | private BigDecimal illumination; |
| | | //ç´«å¤ææ° |
| | | private BigDecimal ultraviolet; |
| | | //CO2 |
| | | private BigDecimal co2; |
| | | //è´æ°§ç¦»å |
| | | private BigDecimal o2; |
| | | |
| | | @Override |
| | | public HeartBeatDataPackage transformFrame(String hex) { |
| | | //ff 03 20 0241000000000000000000000009000a198a186327b8000c000000000000000b8c35c1ca(åèå¼) |
| | | // 0241 0000 0000 0000 0000 0000 0009 000a 198a 1863 27b8 000c 0000 0000 0000 000b 8c35 c1ca |
| | | // 010326FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1B341022277F000D05B5000000015DDD0000FFFF000070C9 主å¨ä¸æ¥å¿è·³å
|
| | | // 01ï¼ç³»ç»å°å |
| | | // 03ï¼åè½ç |
| | | // 26ï¼æ°æ®æ®µå èæ°é |
| | | // FFFFï¼åªå£°-------ã |
| | | // FFFFï¼ç¡«åæ°¢-------ã |
| | | // FFFFï¼SO2 æµåº¦-------ã |
| | | // FFFFï¼NO2 æµåº¦-------ã |
| | | // FFFFï¼CO æµåº¦-------ã |
| | | // FFFFï¼O3 æµåº¦-------ã |
| | | // FFFFï¼PM2.5 æµåº¦-------ã |
| | | // FFFFï¼PM10 æµåº¦-------ã |
| | | // 1B34ï¼ç©ºæ°æ¸©åº¦-------ã29.64â |
| | | // 1022ï¼ç©ºæ°æ¹¿åº¦-------ã41.30% |
| | | // 277Fï¼å¤§æ°å强-------ã101.11hPa |
| | | // 000Dï¼é£é-------ã0.13m/s |
| | | // 05B5ï¼é£å-------ã146.1° |
| | | // 0000ï¼è¿ç»é¨é-------ã0mm |
| | | // 0001ï¼è¾å°-------ã1W/ã¡ |
| | | // 5DDDï¼å
ç
§-------ã240.29Klux |
| | | // 0000ï¼ç´«å¤ææ°-------ã |
| | | // FFFFï¼CO2-------ã |
| | | // 0000ï¼è´æ°§ç¦»å-------ã |
| | | // 70C9ï¼CRC16 æ ¡éªä½ |
| | | |
| | | //åªå£° |
| | | this.noise = BigDecimal.valueOf(parseVal(hex, 6, 10) / 10.0); |
| | | if (isValidData(hex, 6, 10)) { |
| | | this.noise = new BigDecimal(parseVal(hex, 6, 10)).divide(new BigDecimal(10), 1, BigDecimal.ROUND_HALF_UP); |
| | | } |
| | | //ç¡«åæ°¢ |
| | | this.hydrogenSulfide = BigDecimal.valueOf(parseVal(hex, 10, 14) / 1.0); |
| | | if (isValidData(hex, 10, 14)) { |
| | | this.hydrogenSulfide = new BigDecimal(parseVal(hex, 10, 14)); |
| | | } |
| | | //SO2 æµåº¦ |
| | | this.so2 = BigDecimal.valueOf(parseVal(hex, 14, 18) / 1.0); |
| | | if (isValidData(hex, 14, 18)) { |
| | | this.so2 = new BigDecimal(parseVal(hex, 14, 18)); |
| | | } |
| | | //NO2 æµåº¦ |
| | | this.no2 = BigDecimal.valueOf(parseVal(hex, 18, 22) / 1.0); |
| | | if (isValidData(hex, 18, 22)) { |
| | | this.no2 = new BigDecimal(parseVal(hex, 18, 22)); |
| | | } |
| | | //CO æµåº¦ |
| | | this.co = BigDecimal.valueOf(parseVal(hex, 22, 26) / 1.0); |
| | | if (isValidData(hex, 22, 26)) { |
| | | this.co = new BigDecimal(parseVal(hex, 22, 26)); |
| | | } |
| | | //O3 æµåº¦ |
| | | this.o3 = BigDecimal.valueOf(parseVal(hex, 26, 30) / 1.0); |
| | | if (isValidData(hex, 26, 30)) { |
| | | this.o3 = new BigDecimal(parseVal(hex, 26, 30)); |
| | | } |
| | | //PM2.5 æµåº¦ |
| | | this.pm2point5 = BigDecimal.valueOf(parseVal(hex, 30, 34) / 1.0); |
| | | if (isValidData(hex, 30, 34)) { |
| | | this.pm2point5 = new BigDecimal(parseVal(hex, 30, 34)); |
| | | } |
| | | //PM10 æµåº¦ |
| | | this.pm10 = BigDecimal.valueOf(parseVal(hex, 34, 38) / 1.0); |
| | | if (isValidData(hex, 34, 38)) { |
| | | this.pm10 = new BigDecimal(parseVal(hex, 34, 38)); |
| | | } |
| | | //ç©ºæ°æ¸©åº¦ |
| | | this.airTemperature = BigDecimal.valueOf(parseVal(hex, 38, 42) / 100.0 - 40); |
| | | if (isValidData(hex, 38, 42)) { |
| | | this.airTemperature = new BigDecimal(parseVal(hex, 38, 42)).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP).subtract(new BigDecimal(40)); |
| | | } |
| | | //ç©ºæ°æ¹¿åº¦ |
| | | this.airHumidity = BigDecimal.valueOf(parseVal(hex, 42, 46) / 100.0); |
| | | if (isValidData(hex, 42, 46)) { |
| | | this.airHumidity = new BigDecimal(parseVal(hex, 42, 46)).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP); |
| | | } |
| | | //大æ°å强 |
| | | this.airPressure = BigDecimal.valueOf(parseVal(hex, 46, 50) / 10.0); |
| | | if (isValidData(hex, 46, 50)) { |
| | | this.airPressure = new BigDecimal(parseVal(hex, 46, 50)).divide(new BigDecimal(10), 1, BigDecimal.ROUND_HALF_UP); |
| | | } |
| | | //é£é |
| | | this.windSpeed = BigDecimal.valueOf(parseVal(hex, 50, 54) / 100.0); |
| | | if (isValidData(hex, 50, 54)) { |
| | | this.windSpeed = new BigDecimal(parseVal(hex, 50, 54)).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP); |
| | | } |
| | | //é£å |
| | | this.windDirection = BigDecimal.valueOf(parseVal(hex, 54, 58) / 10.0); |
| | | if (isValidData(hex, 54, 58)) { |
| | | this.windDirection = new BigDecimal(parseVal(hex, 54, 58)).divide(new BigDecimal(10), 1, BigDecimal.ROUND_HALF_UP); |
| | | } |
| | | //10 åéé¨é |
| | | this.tenRainfallMin = BigDecimal.valueOf(parseVal(hex, 58, 62) / 10.0); |
| | | if (isValidData(hex, 58, 62)) { |
| | | this.tenRainfallMin = new BigDecimal(parseVal(hex, 58, 62)).divide(new BigDecimal(10), 1, BigDecimal.ROUND_HALF_UP); |
| | | } |
| | | //è¾å° |
| | | this.radiation = BigDecimal.valueOf(parseVal(hex, 62, 66) / 1.0); |
| | | if (isValidData(hex, 62, 66)) { |
| | | this.radiation = new BigDecimal(parseVal(hex, 62, 66)); |
| | | } |
| | | //å
ç
§ |
| | | this.illumination = BigDecimal.valueOf(parseVal(hex, 66, 70) / 100.0); |
| | | if (isValidData(hex, 66, 70)) { |
| | | this.illumination = new BigDecimal(parseVal(hex, 66, 70)).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP); |
| | | } |
| | | //ç´«å¤ææ° |
| | | if (isValidData(hex, 70, 74)) { |
| | | this.ultraviolet = new BigDecimal(parseVal(hex, 70, 74)).divide(new BigDecimal(1), 2, BigDecimal.ROUND_HALF_UP); |
| | | } |
| | | //CO2 |
| | | if (isValidData(hex, 74, 78)) { |
| | | this.co2 = new BigDecimal(parseVal(hex, 74, 78)); |
| | | } |
| | | //è´æ°§ç¦»å |
| | | if (isValidData(hex, 78, 82)) { |
| | | this.o2 = BigDecimal.valueOf(parseVal(hex, 78, 82) * 10.0); |
| | | this.o2 = new BigDecimal(parseVal(hex, 78, 82)).multiply(new BigDecimal(1)); |
| | | } |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * å¤æè¯¥å¤§æ°è®¾å¤æ¯å¦æå¯¹åºçæåºå¨ |
| | | * |
| | | * @param value |
| | | * @param startIndex |
| | | * @param endIndex |
| | | * @return |
| | | */ |
| | | private boolean isValidData(String value, int startIndex, int endIndex) { |
| | | //FFFFæ¯ä»£è¡¨è¿ä¸ªè®¾å¤ä¸æ¯æè¿ä¸ªæ°æ®é¡¹ã0000æ¯è¡¨ç¤ºæ¯æä½æ¯æ°æ®ä¸ºé¶ |
| | | if ("FFFF".equals(value.substring(startIndex, endIndex))) { |
| | | return false; |
| | | } else { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | private Integer parseVal(String frame, int start, int end) { |
| | | return Integer.parseInt(frame.substring(start, end), 16); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.manager.iot.rrpc.util; |
| | | |
| | | public class CRCUtils { |
| | | /** |
| | | * 计ç®CRC16/Modbusæ ¡éªç é«ä½å¨å,ä½ä½å¨å |
| | | * |
| | | * @param hex åå
è¿å¶å符串 |
| | | * @return CRC16æ ¡éªç |
| | | */ |
| | | public static String getCRC16 (String hex) { |
| | | byte[] tx_buff = SupplementUtils.hexStringToBytes(hex); |
| | | int[] result = CRCValidate.calculateCRC(tx_buff, 0, tx_buff.length); |
| | | String hex1 = Integer.toHexString(result[1]); |
| | | String hex2 = Integer.toHexString(result[0]); |
| | | |
| | | if (hex1.length()<2) { |
| | | hex1 = "0" + hex1; |
| | | } |
| | | if (hex2.length()<2) { |
| | | hex2 = "0" + hex2; |
| | | } |
| | | return ( hex2 + hex1 ).toUpperCase(); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.manager.iot.rrpc.util; |
| | | |
| | | /** |
| | | * Created by 11833 on 2018/1/5. |
| | | */ |
| | | public class CRCValidate { |
| | | |
| | | private static final String TAG="CRCValidate"; |
| | | /** |
| | | * 计ç®CRC |
| | | * */ |
| | | public static final int[] calculateCRC(byte[] data, int offset, int len) { |
| | | |
| | | int[] crc = { 0xFF, 0xFF }; |
| | | |
| | | int nextByte = 0; |
| | | |
| | | int uIndex; |
| | | |
| | | for (int i = offset; i < len && i < data.length; i++) { |
| | | |
| | | nextByte = 0xFF & ((int) data[i]); |
| | | |
| | | uIndex = crc[0] ^ nextByte; |
| | | |
| | | crc[0] = crc[1] ^ auchCRCHi[uIndex]; |
| | | |
| | | crc[1] = auchCRCLo[uIndex]; |
| | | |
| | | } |
| | | |
| | | return crc; |
| | | |
| | | }// calculateCRC |
| | | |
| | | /** |
| | | * 鿤æ·éæ¤æ·ä¸ä½CRC??鿤æ·éæ¤æ·ä½éæ¤æ·é? |
| | | * 鿤æ·ä¸éæ¤æ·éæ¤æ·éæ¤æ·éæ¤æ·è¦éæ¤æ·éæ¤æ·éçµuff |
| | | * 鿤æ·ä¸éæ¤æ·éæ¤æ·éæ¤æ·éæ¤æ·éæ¤æ·å§ä½éæ¤æ· |
| | | * 鿤æ·éæ¤æ·éæ¤æ·éæ¤æ·éæ¤æ·éæ¤æ·éæ¤æ·éå§é¿éæ¤æ· |
| | | * |
| | | * */ |
| | | public static final int calculateSingleCRC(byte[] data, int offset, int len) { |
| | | |
| | | int crc = data[offset]; |
| | | |
| | | /* pass through message buffer */ |
| | | |
| | | for (int i = offset+1; i < (offset+len) && i < data.length; i++) { |
| | | |
| | | crc = crc ^ ((int) data[i]); // *puchMsg++; /* calculate the CRC */ |
| | | |
| | | } |
| | | |
| | | return crc; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * /鿤æ·éæ¤æ·CRC?? 鿤æ·ä¸éæ¤æ·éæ¤æ·éæ¤æ·éæ¤æ·è¦éæ¤æ·éæ¤æ·éçµalcStr |
| | | * // "01 10 00 5e 00 02 04 11 12 13 14"éç«ç¢æ·crc="df 19" |
| | | */ |
| | | public static final String calculateStringCRC(String calcStr) { |
| | | |
| | | String crcStr = null; |
| | | if (SupplementUtils.isHex(calcStr)) { |
| | | byte[] data = SupplementUtils.hexStringToBytes(calcStr); |
| | | int[] crcIntArr = CRCValidate.calculateCRC(data, 0, data.length); |
| | | byte[] crcByteArr1 = { 0, (byte) crcIntArr[0] }; |
| | | byte[] crcByteArr2 = { 0, (byte) crcIntArr[1] }; |
| | | // String crcStr1 = HexStrConvertUtil.bytesToHexString(crcByteArr1).substring(2); |
| | | // String crcStr2 = HexStrConvertUtil.bytesToHexString(crcByteArr2).substring(2); |
| | | // crcStr = crcStr1 + " " + crcStr2; |
| | | } |
| | | |
| | | return crcStr.toLowerCase(); |
| | | |
| | | } |
| | | |
| | | /* Table of CRC values for high-order byte */ |
| | | |
| | | private final static short[] auchCRCHi = { |
| | | |
| | | 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, |
| | | |
| | | 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, |
| | | |
| | | 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, |
| | | |
| | | 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, |
| | | |
| | | 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, |
| | | |
| | | 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, |
| | | |
| | | 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, |
| | | |
| | | 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, |
| | | |
| | | 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, |
| | | |
| | | 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, |
| | | |
| | | 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, |
| | | |
| | | 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, |
| | | |
| | | 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, |
| | | |
| | | 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, |
| | | |
| | | 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, |
| | | |
| | | 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, |
| | | |
| | | 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, |
| | | |
| | | 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, |
| | | |
| | | 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, |
| | | |
| | | 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, |
| | | |
| | | 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, |
| | | |
| | | 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, |
| | | |
| | | 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, |
| | | |
| | | 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, |
| | | |
| | | 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, |
| | | |
| | | 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40 |
| | | |
| | | }; |
| | | |
| | | /* Table of CRC values for low-order byte */ |
| | | |
| | | private final static short[] auchCRCLo = { |
| | | |
| | | 0x00, 0xC0, 0xC1, 0x01, 0xC3, 0x03, 0x02, 0xC2, 0xC6, 0x06, |
| | | |
| | | 0x07, 0xC7, 0x05, 0xC5, 0xC4, 0x04, 0xCC, 0x0C, 0x0D, 0xCD, |
| | | |
| | | 0x0F, 0xCF, 0xCE, 0x0E, 0x0A, 0xCA, 0xCB, 0x0B, 0xC9, 0x09, |
| | | |
| | | 0x08, 0xC8, 0xD8, 0x18, 0x19, 0xD9, 0x1B, 0xDB, 0xDA, 0x1A, |
| | | |
| | | 0x1E, 0xDE, 0xDF, 0x1F, 0xDD, 0x1D, 0x1C, 0xDC, 0x14, 0xD4, |
| | | |
| | | 0xD5, 0x15, 0xD7, 0x17, 0x16, 0xD6, 0xD2, 0x12, 0x13, 0xD3, |
| | | |
| | | 0x11, 0xD1, 0xD0, 0x10, 0xF0, 0x30, 0x31, 0xF1, 0x33, 0xF3, |
| | | |
| | | 0xF2, 0x32, 0x36, 0xF6, 0xF7, 0x37, 0xF5, 0x35, 0x34, 0xF4, |
| | | |
| | | 0x3C, 0xFC, 0xFD, 0x3D, 0xFF, 0x3F, 0x3E, 0xFE, 0xFA, 0x3A, |
| | | |
| | | 0x3B, 0xFB, 0x39, 0xF9, 0xF8, 0x38, 0x28, 0xE8, 0xE9, 0x29, |
| | | |
| | | 0xEB, 0x2B, 0x2A, 0xEA, 0xEE, 0x2E, 0x2F, 0xEF, 0x2D, 0xED, |
| | | |
| | | 0xEC, 0x2C, 0xE4, 0x24, 0x25, 0xE5, 0x27, 0xE7, 0xE6, 0x26, |
| | | |
| | | 0x22, 0xE2, 0xE3, 0x23, 0xE1, 0x21, 0x20, 0xE0, 0xA0, 0x60, |
| | | |
| | | 0x61, 0xA1, 0x63, 0xA3, 0xA2, 0x62, 0x66, 0xA6, 0xA7, 0x67, |
| | | |
| | | 0xA5, 0x65, 0x64, 0xA4, 0x6C, 0xAC, 0xAD, 0x6D, 0xAF, 0x6F, |
| | | |
| | | 0x6E, 0xAE, 0xAA, 0x6A, 0x6B, 0xAB, 0x69, 0xA9, 0xA8, 0x68, |
| | | |
| | | 0x78, 0xB8, 0xB9, 0x79, 0xBB, 0x7B, 0x7A, 0xBA, 0xBE, 0x7E, |
| | | |
| | | 0x7F, 0xBF, 0x7D, 0xBD, 0xBC, 0x7C, 0xB4, 0x74, 0x75, 0xB5, |
| | | |
| | | 0x77, 0xB7, 0xB6, 0x76, 0x72, 0xB2, 0xB3, 0x73, 0xB1, 0x71, |
| | | |
| | | 0x70, 0xB0, 0x50, 0x90, 0x91, 0x51, 0x93, 0x53, 0x52, 0x92, |
| | | |
| | | 0x96, 0x56, 0x57, 0x97, 0x55, 0x95, 0x94, 0x54, 0x9C, 0x5C, |
| | | |
| | | 0x5D, 0x9D, 0x5F, 0x9F, 0x9E, 0x5E, 0x5A, 0x9A, 0x9B, 0x5B, |
| | | |
| | | 0x99, 0x59, 0x58, 0x98, 0x88, 0x48, 0x49, 0x89, 0x4B, 0x8B, |
| | | |
| | | 0x8A, 0x4A, 0x4E, 0x8E, 0x8F, 0x4F, 0x8D, 0x4D, 0x4C, 0x8C, |
| | | |
| | | 0x44, 0x84, 0x85, 0x45, 0x87, 0x47, 0x46, 0x86, 0x82, 0x42, |
| | | |
| | | 0x43, 0x83, 0x41, 0x81, 0x80, 0x40 |
| | | |
| | | }; |
| | | |
| | | /* |
| | | * éå«è®¹æ·CRCå¼éè§å¤æ·éæ¤æ·ç¡®--CRCæ ¡éæ¤æ· |
| | | */ |
| | | public static Boolean isCRCConfig(byte[] buff) { |
| | | int offset = 0; |
| | | int len = buff.length - 2; |
| | | // 鿤æ·éæ¤æ·åéæ¤æ·æ¨¡éæ¤æ·éè¡å¤æ·éè¡é©æ·ç¢î®æ·éæ¤æ·è©éæ¤æ·éæ¤æ·éå«ï½æ·éæ¤æ·èâæ·é? |
| | | // 鿤æ·éæ¤æ·CRCå¼,(鿤æ·ä¸éæ¤æ·éæ¤æ·éæ¤æ·éæ¤æ·è¦éæ¤æ·éæ¤æ·éçµuff 鿤æ·ä¸éæ¤æ·éæ¤æ·éæ¤æ·éæ¤æ·éæ¤æ·å§ä½ 鿤æ·éæ¤æ·éæ¤æ·éæ¤æ·éæ¤æ·éæ¤æ·éæ¤æ·éå§é¿éæ¤æ·) |
| | | int[] crc = CRCValidate.calculateCRC(buff, offset, len); |
| | | // éé¥ºæ¤æ·buff鿤æ·éæ¤æ·éæ¤æ·é轿ç±RC鿤æ·éè§å¤æ·éæ¤æ·è¯©éæ¤æ·éæ¤æ·éæ¤æ·éæ¤æ·CRCéæ¤æ· |
| | | return (byte) crc[0] == buff[buff.length - 2] & (byte) crc[1] == buff[buff.length - 1]; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | public static boolean isHex(String str) { |
| | | boolean isHexFlg = true; |
| | | int i = 0; |
| | | char c; |
| | | for (i = 0; i < str.length(); i++) { |
| | | c = str.charAt(i); |
| | | if (!(((c >= '0') && (c <= '9')) || ((c >= 'A') && (c <= 'F')) || ((c >= 'a') && (c <= 'f')) || (c == ' '))) { |
| | | isHexFlg = false; |
| | | break; |
| | | } |
| | | } |
| | | return isHexFlg; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.sandu.ximon.admin.service; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5AtmosphereHeartbeatReportInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5AtmosphereNewHeartbeatReportInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.AtmoFunctionCode; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.utils.RedisUtils; |
| | | import com.sandu.ximon.dao.bo.AirDataBo; |
| | | import com.sandu.ximon.dao.bo.AirDataNongGengBo; |
| | | import com.sandu.ximon.dao.domain.AirData; |
| | | import com.sandu.ximon.dao.domain.AirDataNongGeng; |
| | | import com.sandu.ximon.dao.domain.AirEquipment; |
| | | import com.sandu.ximon.dao.domain.AirEquipmentNongGeng; |
| | | import com.sandu.ximon.dao.mapper.AirDataNongGengMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å¤§æ°æ°æ®ï¼åè硬件 |
| | |
| | | public boolean saveReportData(String deviceName, A5AtmosphereNewHeartbeatReportInnerFrame.HeartBeatDataPackage heartBeatDataPackage) { |
| | | |
| | | AirDataNongGeng airDataNongGeng = new AirDataNongGeng(); |
| | | BeanUtils.copyProperties(heartBeatDataPackage, airDataNongGeng); |
| | | //("åªå£°") |
| | | airDataNongGeng.setNoise(heartBeatDataPackage.getNoise() == null ? null : heartBeatDataPackage.getNoise() + "dB"); |
| | | //("ç¡«åæ°¢") |
| | | airDataNongGeng.setHydrogenSulfide(heartBeatDataPackage.getHydrogenSulfide() == null ? null : heartBeatDataPackage.getHydrogenSulfide() + ""); |
| | | //("SO2 æµåº¦") |
| | | airDataNongGeng.setSo2(heartBeatDataPackage.getSo2() == null ? null : heartBeatDataPackage.getSo2() + "ppb"); |
| | | //("NO2 æµåº¦") |
| | | airDataNongGeng.setNo2(heartBeatDataPackage.getNo2() == null ? null : heartBeatDataPackage.getNo2() + "ppb"); |
| | | //("CO æµåº¦") |
| | | airDataNongGeng.setCo(heartBeatDataPackage.getCo() == null ? null : heartBeatDataPackage.getCo() + "ppb"); |
| | | //("O3 æµåº¦") |
| | | airDataNongGeng.setO3(heartBeatDataPackage.getO3() == null ? null : heartBeatDataPackage.getO3() + "ppb"); |
| | | //("PM2.5 æµåº¦") |
| | | airDataNongGeng.setPm2point5(heartBeatDataPackage.getPm2point5() == null ? null : heartBeatDataPackage.getPm2point5() + "ug/m³"); |
| | | //("PM10 æµåº¦") |
| | | airDataNongGeng.setPm10(heartBeatDataPackage.getPm10() == null ? null : heartBeatDataPackage.getPm10() + "ug/m³"); |
| | | //("ç©ºæ°æ¸©åº¦") |
| | | airDataNongGeng.setAirTemperature(heartBeatDataPackage.getAirTemperature() == null ? null : heartBeatDataPackage.getAirTemperature() + "â"); |
| | | //("ç©ºæ°æ¹¿åº¦") |
| | | airDataNongGeng.setAirHumidity(heartBeatDataPackage.getAirHumidity() == null ? null : heartBeatDataPackage.getAirHumidity() + "%"); |
| | | //("大æ°å强") |
| | | airDataNongGeng.setAirPressure(heartBeatDataPackage.getAirPressure() == null ? null : heartBeatDataPackage.getAirPressure() + "hPa"); |
| | | //("é£é") |
| | | airDataNongGeng.setWindSpeed(heartBeatDataPackage.getWindSpeed() == null ? null : heartBeatDataPackage.getWindSpeed() + "m/s"); |
| | | //("é£å") |
| | | airDataNongGeng.setWindDirection(heartBeatDataPackage.getWindDirection() == null ? null : heartBeatDataPackage.getWindDirection() + "°"); |
| | | //("10 åéé¨é") |
| | | airDataNongGeng.setTenRainfallMin(heartBeatDataPackage.getTenRainfallMin() == null ? null : heartBeatDataPackage.getTenRainfallMin() + "mm"); |
| | | //("è¾å°") |
| | | airDataNongGeng.setRadiation(heartBeatDataPackage.getRadiation() == null ? null : heartBeatDataPackage.getRadiation() + "0W/ã¡"); |
| | | //("å
ç
§") |
| | | airDataNongGeng.setIllumination(heartBeatDataPackage.getIllumination() == null ? null : heartBeatDataPackage.getIllumination() + "Klux"); |
| | | //ç´«å¤ææ° |
| | | airDataNongGeng.setUltraviolet(heartBeatDataPackage.getUltraviolet() == null ? null : heartBeatDataPackage.getUltraviolet() + ""); |
| | | //CO2 |
| | | airDataNongGeng.setCo2(heartBeatDataPackage.getCo2() == null ? null : heartBeatDataPackage.getCo2() + "0ppm"); |
| | | //è´æ°§ç¦»å |
| | | airDataNongGeng.setO2(heartBeatDataPackage.getO2() == null ? null : heartBeatDataPackage.getO2() + "个"); |
| | | |
| | | airDataNongGeng.setMac(deviceName); |
| | | |
| | | //å°è®¾å¤ä¿¡æ¯æ·»å å°å¤§æ°è®¾å¤è¡¨ |
| | |
| | | |
| | | return save(airDataNongGeng); |
| | | } |
| | | |
| | | |
| | | // |
| | | // /** |
| | | // * æ¥è¯¢å¤§æ°æ°æ®(æ¨¡ç³æ¥è¯¢) |
| | |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.common.util.SpringContextHolder; |
| | | import com.sandu.ximon.admin.manager.iot.frame.A5Frame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5AtmosphereHeartBeatTimeReportInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5AtmosphereOperationReportInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5AtmosphereQueryVersionReportInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.request.AtmosphereQueryHeartBeatTimeReqInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.request.AtmosphereQueryVersionReqInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.request.AtmosphereRebootReqInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.request.AtmosphereSetHeartBeatTimeReqInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.dto.CommonFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.A5OrderEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.AtmoFunctionCode; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.mainboard.MainBoardInvokeSyncService; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.utils.RedisUtils; |
| | | import com.sandu.ximon.admin.utils.StoreOperationRecordsUtils; |
| | | import com.sandu.ximon.admin.utils.StringUtil; |
| | | import com.sandu.ximon.dao.bo.AirEquipmentNongGengBo; |
| | | import com.sandu.ximon.dao.domain.AirEquipment; |
| | | import com.sandu.ximon.dao.domain.AirEquipmentNongGeng; |
| | | import com.sandu.ximon.dao.mapper.AirEquipmentNongGengMapper; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | } |
| | | return one; |
| | | } |
| | | |
| | | /** |
| | | * 设置大æ°è®¾å¤å¿è·³å
é´éæ¶é´ |
| | | * |
| | | * @param mac |
| | | * @param time |
| | | */ |
| | | public String setHeartBeatTime(String mac, Integer time) { |
| | | if (StringUtil.strIsNullOrEmpty(mac)) { |
| | | throw new BusinessException("ç¯æmacåæ°é误ï¼"); |
| | | } |
| | | if (time == null) { |
| | | throw new BusinessException("å¿è·³å
é´éæ¶é´ä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | | |
| | | if (time < 30) { |
| | | throw new BusinessException("å¿è·³å
é´éæ¶é´ä¸è½å°äº30sï¼"); |
| | | } |
| | | AirEquipmentNongGeng airEquipmentNongGeng = SpringContextHolder.getBean(AirEquipmentNongGengService.class). |
| | | getOne(Wrappers.lambdaQuery(AirEquipmentNongGeng.class).eq(AirEquipmentNongGeng::getMac, mac).last("limit 1")); |
| | | if (airEquipmentNongGeng == null) { |
| | | throw new BusinessException("大æ°è®¾å¤ä¸åå¨ï¼"); |
| | | } |
| | | |
| | | AtmosphereSetHeartBeatTimeReqInnerFrame atmosphereSetHeartBeatTimeReqInnerFrame = new AtmosphereSetHeartBeatTimeReqInnerFrame(time); |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_ATMOSPHERE_DATA.getCode(), atmosphereSetHeartBeatTimeReqInnerFrame); |
| | | System.out.println(a5Frame + " --------a5Frame"); |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(mac, a5Frame); |
| | | System.out.println(commonFrame + " -----------commonFrame"); |
| | | |
| | | A5AtmosphereOperationReportInnerFrame a5AtmosphereOperationReportInnerFrame |
| | | = new A5AtmosphereOperationReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | if (a5AtmosphereOperationReportInnerFrame != null && a5AtmosphereOperationReportInnerFrame.isValidate()) { |
| | | return a5AtmosphereOperationReportInnerFrame.getState(); |
| | | } else { |
| | | throw new BusinessException("æ°æ®æ ¡éªå¼å¸¸ï¼"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å¤§æ°è®¾å¤å¿è·³å
æ¶é´ |
| | | */ |
| | | public String QueryHeartBeatTime(String mac) { |
| | | if (StringUtil.strIsNullOrEmpty(mac)) { |
| | | throw new BusinessException("ç¯æmacåæ°é误ï¼"); |
| | | } |
| | | AirEquipmentNongGeng airEquipmentNongGeng = SpringContextHolder.getBean(AirEquipmentNongGengService.class). |
| | | getOne(Wrappers.lambdaQuery(AirEquipmentNongGeng.class).eq(AirEquipmentNongGeng::getMac, mac).last("limit 1")); |
| | | if (airEquipmentNongGeng == null) { |
| | | throw new BusinessException("大æ°è®¾å¤ä¸åå¨ï¼"); |
| | | } |
| | | |
| | | AtmosphereQueryHeartBeatTimeReqInnerFrame atmosphereQueryHeartBeatTimeReqInnerFrame = new AtmosphereQueryHeartBeatTimeReqInnerFrame(); |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_ATMOSPHERE_DATA.getCode(), atmosphereQueryHeartBeatTimeReqInnerFrame); |
| | | System.out.println(a5Frame + " --------a5Frame"); |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(mac, a5Frame); |
| | | System.out.println(commonFrame + " -----------commonFrame"); |
| | | |
| | | A5AtmosphereHeartBeatTimeReportInnerFrame a5AtmosphereHeartBeatTimeReportInnerFrame |
| | | = new A5AtmosphereHeartBeatTimeReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | |
| | | if (a5AtmosphereHeartBeatTimeReportInnerFrame != null && a5AtmosphereHeartBeatTimeReportInnerFrame.isValidate()) { |
| | | return "该大æ°è®¾å¤å¿è·³å
é´éæ¶é´ä¸ºï¼" + a5AtmosphereHeartBeatTimeReportInnerFrame.getIntervalTime() + "s"; |
| | | } else { |
| | | throw new BusinessException("æ°æ®æ ¡éªå¼å¸¸ï¼"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢è½¯ç¡¬ä»¶çæ¬ |
| | | * |
| | | * @param mac |
| | | * @return |
| | | */ |
| | | public String QueryVersion(String mac) { |
| | | if (StringUtil.strIsNullOrEmpty(mac)) { |
| | | throw new BusinessException("ç¯æmacåæ°é误ï¼"); |
| | | } |
| | | AirEquipmentNongGeng airEquipmentNongGeng = SpringContextHolder.getBean(AirEquipmentNongGengService.class). |
| | | getOne(Wrappers.lambdaQuery(AirEquipmentNongGeng.class).eq(AirEquipmentNongGeng::getMac, mac).last("limit 1")); |
| | | if (airEquipmentNongGeng == null) { |
| | | throw new BusinessException("大æ°è®¾å¤ä¸åå¨ï¼"); |
| | | } |
| | | |
| | | AtmosphereQueryVersionReqInnerFrame atmosphereQueryVersionReqInnerFrame = new AtmosphereQueryVersionReqInnerFrame(); |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_ATMOSPHERE_DATA.getCode(), atmosphereQueryVersionReqInnerFrame); |
| | | System.out.println(a5Frame + " --------a5Frame"); |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(mac, a5Frame); |
| | | System.out.println(commonFrame + " -----------commonFrame"); |
| | | |
| | | A5AtmosphereQueryVersionReportInnerFrame a5AtmosphereQueryVersionReportInnerFrame = |
| | | new A5AtmosphereQueryVersionReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | if (a5AtmosphereQueryVersionReportInnerFrame != null && a5AtmosphereQueryVersionReportInnerFrame.isValidate()) { |
| | | return a5AtmosphereQueryVersionReportInnerFrame.getVersion(); |
| | | } else { |
| | | throw new BusinessException("æ°æ®æ ¡éªå¼å¸¸ï¼"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 软éå¯ |
| | | * |
| | | * @param mac |
| | | * @return |
| | | */ |
| | | public String Reboot(String mac) { |
| | | if (StringUtil.strIsNullOrEmpty(mac)) { |
| | | throw new BusinessException("ç¯æmacåæ°é误ï¼"); |
| | | } |
| | | |
| | | AirEquipmentNongGeng airEquipmentNongGeng = SpringContextHolder.getBean(AirEquipmentNongGengService.class). |
| | | getOne(Wrappers.lambdaQuery(AirEquipmentNongGeng.class).eq(AirEquipmentNongGeng::getMac, mac).last("limit 1")); |
| | | if (airEquipmentNongGeng == null) { |
| | | throw new BusinessException("大æ°è®¾å¤ä¸åå¨ï¼"); |
| | | } |
| | | |
| | | AtmosphereRebootReqInnerFrame atmosphereRebootReqInnerFrame = new AtmosphereRebootReqInnerFrame(); |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_ATMOSPHERE_DATA.getCode(), atmosphereRebootReqInnerFrame); |
| | | System.out.println(a5Frame + " --------a5Frame"); |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(mac, a5Frame); |
| | | System.out.println(commonFrame + " -----------commonFrame"); |
| | | |
| | | A5AtmosphereOperationReportInnerFrame a5AtmosphereOperationReportInnerFrame = |
| | | new A5AtmosphereOperationReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | |
| | | if (a5AtmosphereOperationReportInnerFrame != null && a5AtmosphereOperationReportInnerFrame.isValidate()) { |
| | | return a5AtmosphereOperationReportInnerFrame.getState(); |
| | | } else { |
| | | throw new BusinessException("æ°æ®æ ¡éªå¼å¸¸ï¼"); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | enable: true |
| | | |
| | | listenter: |
| | | isOpen: false |
| | | isOpen: true |
| | | |
| | | minio: |
| | | endpoint: 47.106.172.9 |