From db21de901bb1bbc6ec66b59e7b0766d0d2c5c6cc Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期二, 16 七月 2019 13:54:44 +0800
Subject: [PATCH] 20190716 1.提供声必可SDK,部分数据处理调整; 2.演示DemoAPP,地热和新风页面调整;

---
 hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLAppliances/HDLGeothermal/Parser/GeothermalParser.java |  103 ++++++++++++++++++++++++++-------------------------
 1 files changed, 53 insertions(+), 50 deletions(-)

diff --git a/hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLAppliances/HDLGeothermal/Parser/GeothermalParser.java b/hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLAppliances/HDLGeothermal/Parser/GeothermalParser.java
index 870ec37..f099917 100644
--- a/hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLAppliances/HDLGeothermal/Parser/GeothermalParser.java
+++ b/hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLAppliances/HDLGeothermal/Parser/GeothermalParser.java
@@ -18,56 +18,66 @@
 
 
     public static final int gMode = 4;      //妯″紡
-    public static final int gModeNormal = 0;//鏅�氭ā寮�
-    public static final int gModeDay = 1;//鐧藉ぉ妯″紡
-    public static final int gModeNight = 2;//澶滈棿妯″紡
-    public static final int gModeLeave = 3;//绂诲紑妯″紡
-    public static final int gModeAuto = 4;//鑷姩妯″紡
+    public static final int gModeNormal = 1;//鏅�氭ā寮�
+    public static final int gModeDay = 2;//鐧藉ぉ妯″紡
+    public static final int gModeNight = 3;//澶滈棿妯″紡
+    public static final int gModeLeave = 4;//绂诲紑妯″紡
+    public static final int gModeAuto = 5;//鑷姩妯″紡
 
     public static final int gNormalTemp = 5;//鏅�氭ā寮忔俯搴�
     public static final int gDayTemp = 6;//鐧藉ぉ妯″紡娓╁害
     public static final int gNightTemp = 7;//澶滈棿妯″紡娓╁害
     public static final int gLeaveTemp = 8;//绂诲紑妯″紡娓╁害
 
-//    [鍥炶矾锛屽紑鍏崇姸鎬侊紝娓╁害绫诲瀷锛屾ā寮忥紝鏅�氭俯搴︼紝鐧藉ぉ娓╁害锛屽闂存俯搴︼紝绂诲紑娓╁害锛岃嚜鍔ㄦ俯搴︼紝褰撳墠娓╁害]
+    //    feedbackState [鍥炶矾锛屽紑鍏崇姸鎬侊紝娓╁害绫诲瀷锛屾ā寮忥紝鏅�氭俯搴︼紝鐧藉ぉ娓╁害锛屽闂存俯搴︼紝绂诲紑娓╁害锛岃嚜鍔ㄦ俯搴︼紝褰撳墠娓╁害]
     public static byte[] getGeothermalAddByte(AppliancesInfo appliancesInfo, int type, int state) {
-        AppliancesInfo newInfo = null;
-        byte[] airBytes = null;
-        outter:
-        for (int i = 0; i < HDLDeviceManager.devicesDataList.size(); i++) {
-            if (appliancesInfo.getDeviceSubnetID() == HDLDeviceManager.devicesDataList.get(i).getSourceSubnetID()
-                    && appliancesInfo.getDeviceDeviceID() == HDLDeviceManager.devicesDataList.get(i).getSourceDeviceID()) {
-                for (int j = 0; j < HDLDeviceManager.devicesDataList.get(i).getAppliancesInfoList().size(); j++) {
-                    if (HDLDeviceManager.devicesDataList.get(i).getAppliancesInfoList().get(j).getBigType() == Configuration.AIR_BIG_TYPE
-                            && HDLDeviceManager.devicesDataList.get(i).getAppliancesInfoList().get(j).getDeviceType() != HDLApConfig.TYPE_AC_PANEL
-                            && appliancesInfo.getChannelNum() == HDLDeviceManager.devicesDataList.get(i).getAppliancesInfoList().get(j).getChannelNum()) {
-                        newInfo = HDLDeviceManager.devicesDataList.get(i).getAppliancesInfoList().get(j);
-                        if (newInfo.getFeedbackState() == null) {
-                            newInfo.setFeedbackState(new byte[10]);
+        try {
+            AppliancesInfo newInfo = null;
+            byte[] airBytes = null;
+            outter:
+            for (int i = 0; i < HDLDeviceManager.devicesDataList.size(); i++) {
+                if (appliancesInfo.getDeviceSubnetID() == HDLDeviceManager.devicesDataList.get(i).getSourceSubnetID()
+                        && appliancesInfo.getDeviceDeviceID() == HDLDeviceManager.devicesDataList.get(i).getSourceDeviceID()) {
+                    for (int j = 0; j < HDLDeviceManager.devicesDataList.get(i).getAppliancesInfoList().size(); j++) {
+                        if (HDLDeviceManager.devicesDataList.get(i).getAppliancesInfoList().get(j).getBigType() == Configuration.GEOTHERMAL_BIG_TYPE
+                                && HDLDeviceManager.devicesDataList.get(i).getAppliancesInfoList().get(j).getDeviceType() == HDLApConfig.TYPE_GEOTHERMAL_MODULE
+                                && appliancesInfo.getChannelNum() == HDLDeviceManager.devicesDataList.get(i).getAppliancesInfoList().get(j).getChannelNum()) {
+                            newInfo = HDLDeviceManager.devicesDataList.get(i).getAppliancesInfoList().get(j);
+                            if (newInfo.getFeedbackState() == null) {
+                                newInfo.setFeedbackState(new byte[10]);
+                            }
+                            airBytes = newInfo.getFeedbackState();
+                            break outter;
                         }
-                        break outter;
-                    }
 
+                    }
                 }
             }
-        }
 
-        airBytes =  newInfo.getFeedbackState();
-
-        if (airBytes != null && airBytes.length >= 10) {
             byte[] addBytes = new byte[10];
-            addBytes[0] = (byte) newInfo.getChannelNum();
-            addBytes[1] = airBytes[1];
-            addBytes[2] = 0;
-            addBytes[3] = airBytes[3];
-            addBytes[4] = airBytes[4];
-            addBytes[5] = airBytes[5];
-            addBytes[6] = airBytes[6];
-            addBytes[7] = airBytes[7];
-            addBytes[8] = airBytes[8];
-            addBytes[9] = 0;
-            addBytes[10] = 0;
-
+            if (airBytes != null && airBytes.length >= 10) {
+                addBytes[0] = (byte) newInfo.getChannelNum();
+                addBytes[1] = airBytes[1];
+                addBytes[2] = 0;
+                addBytes[3] = airBytes[3];
+                addBytes[4] = airBytes[4];
+                addBytes[5] = airBytes[5];
+                addBytes[6] = airBytes[6];
+                addBytes[7] = airBytes[7];
+                addBytes[8] = 0;
+                addBytes[9] = 0;
+            } else {
+                addBytes[0] = (byte) newInfo.getChannelNum();
+                addBytes[1] = 0;
+                addBytes[2] = 0;
+                addBytes[3] = 1;
+                addBytes[4] = 30;
+                addBytes[5] = 30;
+                addBytes[6] = 30;
+                addBytes[7] = 30;
+                addBytes[8] = 0;
+                addBytes[9] = 0;
+            }
 
             switch (type) {
                 case gSwich:
@@ -79,7 +89,7 @@
                     break;
                 case gMode:
                     addBytes[1] = 1;
-                    addBytes[3] =  (byte) state;
+                    addBytes[3] = (byte) state;
                     break;
                 case gNormalTemp:
                     addBytes[1] = 1;//鎵撳紑
@@ -99,21 +109,14 @@
                     break;
             }
             return addBytes;
-        } else {
-            return null;
+
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            return new byte[]{fail};
         }
 
     }
-
-
-
-
-
-
-
-
-
-
 
 
 }

--
Gitblit v1.8.0