JLChen
2019-09-30 4f841eac608f6f22a573b4f7ed713679e89c2e5b
hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Core/HDLDeviceManager.java
@@ -47,6 +47,7 @@
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.ConcurrentHashMap;
import static com.hdl.sdk.hdl_core.Util.TransformUtil.StringUtil.byte2String;
@@ -67,27 +68,23 @@
    public static List<RcuLight> rcuLightList = new ArrayList<>();
    public static List<RcuCurtain> rcuCurtainList = new ArrayList<>();
    public static boolean isLogicCtrl = false;
    public static ConcurrentHashMap<String, Boolean> ctrlSuccessStateHashMap = new ConcurrentHashMap<>();//2019-8-2
    public static byte[] air1Info = null;
    public static byte[] air2Info = null;
    public static byte[] air3Info = null;
    public static byte[] air4Info = null;
//    public static byte[] air1Info = null;
//    public static byte[] air2Info = null;
//    public static byte[] air3Info = null;
//    public static byte[] air4Info = null;
    //        air4Info[开关状态,模式,设置温度,风速,当前温度,是否摆风 ];
    public static boolean isGetRcuIpSuccess = false;
    public static boolean isLightCtrlSuccess = false; //判断灯光是否控制成功
    public static boolean isCurtainCtrlSuccess = false; //判断窗帘是否控制成功
    public static boolean isACCtrlSuccess = false; //判断空调是否控制成功
    public static boolean isSceneCtrlSuccess = false; //判断场景是否控制成功
    public static boolean isGetDeviceStateSuccess = false; //判断获取设备状态是否控制成功
    public static boolean isFreshAirCtrlSuccess = false; //判断新风系统是否控制成功
    public static boolean isGeothermalCtrlSuccess = false; //判断地热模块是否控制成功
//    public static boolean isLightCtrlSuccess = false; //判断灯光是否控制成功
//    public static boolean isCurtainCtrlSuccess = false; //判断窗帘是否控制成功
//    public static boolean isACCtrlSuccess = false; //判断空调是否控制成功
//    public static boolean isSceneCtrlSuccess = false; //判断场景是否控制成功
//    public static boolean isFreshAirCtrlSuccess = false; //判断新风系统是否控制成功
//    public static boolean isGeothermalCtrlSuccess = false; //判断地热模块是否控制成功
    /**
@@ -506,7 +503,8 @@
                                    info.setBrightness(getDatas.addBytes[2] & 0xFF);
//                                  info.setChannelCount(getDatas.AddBytes[3] & 0xFF);
//                                  info.setDeviceChannelCount(getDatas.AddBytes[4] & 0xFF);
                                    isLightCtrlSuccess = true;
//                                    isLightCtrlSuccess = true;
                                    setDeviceCtrlSuccessStateWithInfo(infos.get(j), true);
                                    EventBus.getDefault().post(new LightFeedBackEvent(info, true));
                                    break outter;
                                }
@@ -547,7 +545,8 @@
                                        info1.setBrightness(getDatas.addBytes[2] & 0xFF);
                                        info1.setChannelCount(getDatas.addBytes[3] & 0xFF);
                                        info1.setDeviceChannelCount(getDatas.addBytes[4] & 0xFF);
                                        isLightCtrlSuccess = true;
//                                        isLightCtrlSuccess = true;
                                        setDeviceCtrlSuccessStateWithInfo(infos.get(j), true);
                                        EventBus.getDefault().post(new LightFeedBackEvent(info1, true));
                                        break outter;
                                    }
@@ -642,7 +641,8 @@
                            curtainCtrlBackInfo.setRemarks(curtainInfo.getRemarks());
                            curtainCtrlBackInfo.setParentRemarks(curtainInfo.getParentRemarks());
                            curtainCtrlBackInfo.setAppliancesInfo(curtainInfo);
                            isCurtainCtrlSuccess = true;
//                            isCurtainCtrlSuccess = true;
                            setDeviceCtrlSuccessStateWithInfo(infos.get(j), true);
                            if (curtainInfo.getDeviceType() == HDLApConfig.TYPE_CURTAIN_GLYSTRO
                                    || curtainInfo.getDeviceType() == HDLApConfig.TYPE_CURTAIN_ROLLER) {
@@ -694,7 +694,8 @@
                                //                如果有多个空调面板,这将会出错
                                AirCtrlBackInfo airCtrlBackInfo = new AirCtrlBackInfo();
                                airCtrlBackInfo.setAppliancesInfo(infos.get(j));
                                isACCtrlSuccess = true;
//                                isACCtrlSuccess = true;
                                setDeviceCtrlSuccessStateWithInfo(infos.get(j), true);
                                if ((getDatas.addBytes[0] & 0xFF) == AirCtrlParser.airMode) {
                                    airCtrlBackInfo.setCurState(new byte[]{getDatas.addBytes[0], getDatas.addBytes[1]});
                                    byte[] airCurState = devicesDataList.get(i).getAppliancesInfoList().get(j).getArrCurState();
@@ -810,33 +811,35 @@
                                int indexI = devIndex;
                                int indexJ = appIndex;
                                final byte[] oldAirInfo;
                                switch (getDatas.addBytes[0] & 0xFF) {
                                    case 1:
                                        oldAirInfo = air1Info;
                                        break;
                                    case 2:
                                        oldAirInfo = air2Info;
                                        break;
                                    case 3:
                                        oldAirInfo = air3Info;
                                        break;
                                    case 4:
                                        oldAirInfo = air4Info;
                                        break;
                                    default:
                                        oldAirInfo = new byte[1];
                                        break;
                                }
                                byte[] oldAirInfo = airInfo.getArrCurState();
//                                switch (getDatas.addBytes[0] & 0xFF) {
//                                    case 1:
//                                        oldAirInfo = air1Info;
//                                        break;
//                                    case 2:
//                                        oldAirInfo = air2Info;
//                                        break;
//                                    case 3:
//                                        oldAirInfo = air3Info;
//                                        break;
//                                    case 4:
//                                        oldAirInfo = air4Info;
//                                        break;
//                                    default:
//                                        oldAirInfo = new byte[1];
//                                        break;
//                                }
                                byte[] newAirInfo = getDatas.addBytes;
                                byte[] curAirInfo = new byte[]{0};
                                boolean isModeChange = false;
                                if (oldAirInfo == null || oldAirInfo.length == 0) {
                                    return;
                                    oldAirInfo = AirCtrlParser.getNewAcByte();
                                }
                                setDeviceCtrlSuccessStateWithInfo(infos.get(appIndex), true);
                                for (int oldAirInedx = 0; oldAirInedx < oldAirInfo.length; oldAirInedx++) {
                                    if (oldAirInedx == 0) {
                                        if (oldAirInfo[0] != newAirInfo[8]) {
//                                        if (oldAirInfo[0] != newAirInfo[8]) {//2019 去掉相同开关状态判断,解决开状态下,调用开命令状态下,不停重发问题
                                            oldAirInfo[0] = newAirInfo[8];
                                            curAirInfo = new byte[]{AirCtrlParser.airSwich, newAirInfo[8]};
                                            if (curAirInfo.length > 1) {
@@ -845,11 +848,12 @@
                                                AirCtrlBackInfo airCtrlBackInfo = new AirCtrlBackInfo();
                                                airCtrlBackInfo.setAppliancesInfo(airInfo);
                                                airCtrlBackInfo.setCurState(curAirInfo);
                                                isACCtrlSuccess = true;
//                                                isACCtrlSuccess = true;
//                                                setDeviceCtrlSuccessStateWithInfo(infos.get(appIndex), true);
                                                EventBus.getDefault().post(new AirFeedBackEvent(airCtrlBackInfo, true));
                                            }
                                        }
//                                        }
                                    } else if (oldAirInedx == 1) {
//                        int mode = ((newAirInfo[4] & 0xf0) >> 4);
                                        int mode = newAirInfo[9] & 0xff;
@@ -863,7 +867,8 @@
                                                AirCtrlBackInfo airCtrlBackInfo = new AirCtrlBackInfo();
                                                airCtrlBackInfo.setAppliancesInfo(airInfo);
                                                airCtrlBackInfo.setCurState(curAirInfo);
                                                isACCtrlSuccess = true;
//                                                isACCtrlSuccess = true;
//                                                setDeviceCtrlSuccessStateWithInfo(infos.get(appIndex), true);
                                                EventBus.getDefault().post(new AirFeedBackEvent(airCtrlBackInfo, true));
                                            }
@@ -895,7 +900,8 @@
                                                AirCtrlBackInfo airCtrlBackInfo = new AirCtrlBackInfo();
                                                airCtrlBackInfo.setAppliancesInfo(airInfo);
                                                airCtrlBackInfo.setCurState(curAirInfo);
                                                isACCtrlSuccess = true;
//                                                isACCtrlSuccess = true;
//                                                setDeviceCtrlSuccessStateWithInfo(infos.get(appIndex), true);
                                                EventBus.getDefault().post(new AirFeedBackEvent(airCtrlBackInfo, true));
                                            }
@@ -912,7 +918,8 @@
                                                AirCtrlBackInfo airCtrlBackInfo = new AirCtrlBackInfo();
                                                airCtrlBackInfo.setAppliancesInfo(airInfo);
                                                airCtrlBackInfo.setCurState(curAirInfo);
                                                isACCtrlSuccess = true;
//                                                isACCtrlSuccess = true;
//                                                setDeviceCtrlSuccessStateWithInfo(infos.get(appIndex), true);
                                                EventBus.getDefault().post(new AirFeedBackEvent(airCtrlBackInfo, true));
                                            }
@@ -920,44 +927,18 @@
                                    }
                                }
                                switch (getDatas.addBytes[0] & 0xFF) {
                                    case 1:
                                        air1Info = oldAirInfo;
                                        break;
                                    case 2:
                                        air2Info = oldAirInfo;
                                        break;
                                    case 3:
                                        air3Info = oldAirInfo;
                                        break;
                                    case 4:
                                        air4Info = oldAirInfo;
                                        break;
                                }
                                if (curAirInfo.length > 1) {
//                    if (isModeChange) {
//                        isACCtrlSuccess = true;
//                        getAirInfo(hvacInfo);
//                    } else {
//                        airInfo.setArrCurState(oldAirInfo);
//                        AirCtrlBackInfo airCtrlBackInfo = new AirCtrlBackInfo();
//                        airCtrlBackInfo.setAppliancesInfo(airInfo);
//                        airCtrlBackInfo.setCurState(curAirInfo);
//                        isACCtrlSuccess = true;
//                        EventBus.getDefault().post(new AirFeedBackEvent(airCtrlBackInfo, true));
//                    }
                                    devicesDataList.get(indexI).getAppliancesInfoList().get(indexJ).setArrCurState(oldAirInfo);
                                    airInfo.setArrCurState(oldAirInfo);
                                    AirCtrlBackInfo airCtrlBackInfo = new AirCtrlBackInfo();
                                    airCtrlBackInfo.setAppliancesInfo(airInfo);
                                    airCtrlBackInfo.setCurState(curAirInfo);
                                    isACCtrlSuccess = true;
                                    EventBus.getDefault().post(new AirFeedBackEvent(airCtrlBackInfo, true));
                                }
//                                if (curAirInfo.length > 1) {
//                                    devicesDataList.get(indexI).getAppliancesInfoList().get(indexJ).setArrCurState(oldAirInfo);
//                                    airInfo.setArrCurState(oldAirInfo);
//                                    AirCtrlBackInfo airCtrlBackInfo = new AirCtrlBackInfo();
//                                    airCtrlBackInfo.setAppliancesInfo(airInfo);
//                                    airCtrlBackInfo.setCurState(curAirInfo);
////                                    isACCtrlSuccess = true;
//                                    setDeviceCtrlSuccessStateWithInfo(infos.get(appIndex), true);
//                                    EventBus.getDefault().post(new AirFeedBackEvent(airCtrlBackInfo, true));
//
//                                }
                                break outter;
@@ -991,7 +972,8 @@
                                logicCtrlBackInfo.setAppliancesInfo(sceneInfo);
                                logicCtrlBackInfo.setAreaNum(getDatas.addBytes[0] & 0xFF);
                                logicCtrlBackInfo.setSceneNum(getDatas.addBytes[1] & 0xFF);
                                isSceneCtrlSuccess = true;
//                                isSceneCtrlSuccess = true;
                                setDeviceCtrlSuccessStateWithInfo(infos.get(j), true);
                                EventBus.getDefault().post(new LogicFeedBackEvent(logicCtrlBackInfo, true));
                                break outter;
                            }
@@ -1015,7 +997,8 @@
                                devicesDataList.get(i).getAppliancesInfoList().get(j).setFeedbackState(getDatas.addBytes);
                                AppliancesInfo mFreshAirInfo = devicesDataList.get(i).getAppliancesInfoList().get(j);
                                FreshAirBackInfo info = new FreshAirBackInfo(mFreshAirInfo);
                                isFreshAirCtrlSuccess = true;
//                                isFreshAirCtrlSuccess = true;
                                setDeviceCtrlSuccessStateWithInfo(infos.get(j), true);
                                EventBus.getDefault().post(new FreshAirFeedBackEvent(info, true));
                                break outter;
                            }
@@ -1060,7 +1043,8 @@
                                        AppliancesInfo mInfo = devicesDataList.get(i).getAppliancesInfoList().get(j);
                                        GeothermalBackInfo info = new GeothermalBackInfo(mInfo, true);
                                        isGeothermalCtrlSuccess = true;
//                                        isGeothermalCtrlSuccess = true;
                                        setDeviceCtrlSuccessStateWithInfo(infos.get(j), true);
                                        EventBus.getDefault().post(new GeothermalFeedBackEvent(info, EventCode.SUCCESS));
                                    } else {
@@ -1224,120 +1208,150 @@
                                && infos.get(indexJ).getChannelNum() == (getDatas.addBytes[airIndex * 11] & 0xFF)) {
                            AppliancesInfo appliancesInfo = devicesDataList.get(indexI).getAppliancesInfoList().get(indexJ);
                            if (appliancesInfo.getPort() != 0) {
//                                byte[] airbytes = getDatas.addBytes;
//                                String airString = "209a 附加数据:";
//                                for (int i = 0; i < airbytes.length; i++) {
//                                    airString += (airbytes[i] & 0xff) + ",";
//                                }
//                                HDLLog.info( airString);
                                switch (getDatas.addBytes[airIndex * 11] & 0xff) {
                                    case 1:
                                        handleAirCastData(getDatas, air1Info, airIndex, appliancesInfo);
                                        air1Info[0] = getDatas.addBytes[1 + 0 * 11];
                                byte[] oldAirInfo = appliancesInfo.getArrCurState();
                                if (oldAirInfo == null || oldAirInfo.length == 0) {
                                    oldAirInfo = AirCtrlParser.getNewAcByte();
                                }
                                        air1Info[1] = (byte) ((getDatas.addBytes[3 + 0 * 11] & 0xf0) >> 4);
                                handleAirCastData(getDatas, oldAirInfo, airIndex, appliancesInfo);
                                oldAirInfo[0] = getDatas.addBytes[1 + 0 * 11];
                                oldAirInfo[1] = (byte) ((getDatas.addBytes[3 + 0 * 11] & 0xf0) >> 4);
                                        switch (air1Info[0] & 0xff) {
                                            case 0:
                                                air1Info[2] = getDatas.addBytes[2 + 0 * 11];
                                                break;
                                            case 1:
                                                air1Info[2] = getDatas.addBytes[6 + 0 * 11];
                                                break;
                                            case 3:
                                                air1Info[2] = getDatas.addBytes[8 + 0 * 11];
                                                break;
                                            case 4:
                                                air1Info[2] = getDatas.addBytes[9 + 0 * 11];
                                                break;
                                        }
                                        air1Info[3] = (byte) (getDatas.addBytes[3 + 0 * 11] & 0x0f);
                                        air1Info[4] = getDatas.addBytes[5 + 0 * 11];
                                        air1Info[5] = getDatas.addBytes[10 + 0 * 11];
//                                        HDLLog.info( "209a air1Info = " + air1Info[0] + " " + air1Info[1] + " " + air1Info[2] + " " + air1Info[3] + " " + air1Info[4] + " " + air1Info[5]);
//                                        String arrString = "209a 附加数据:";
//                                        for (int i = 0; i < getDatas.addBytes.length; i++) {
//                                            arrString += (getDatas.addBytes[i] & 0xff) + ",";
//                                        }
//                                        HDLLog.info( arrString);
                                        devicesDataList.get(indexI).getAppliancesInfoList().get(indexJ).setArrCurState(air1Info);
                                switch (oldAirInfo[0] & 0xff) {
                                    case 0:
                                        oldAirInfo[2] = getDatas.addBytes[2 + 0 * 11];
                                        break;
                                    case 2:
                                        handleAirCastData(getDatas, air2Info, airIndex, appliancesInfo);
                                        air2Info[0] = getDatas.addBytes[1 + 1 * 11];
                                        air2Info[1] = (byte) ((getDatas.addBytes[3 + 1 * 11] & 0xf0) >> 4);
                                        switch (air2Info[0] & 0xff) {
                                            case 0:
                                                air2Info[2] = getDatas.addBytes[2 + 1 * 11];
                                                break;
                                            case 1:
                                                air2Info[2] = getDatas.addBytes[6 + 1 * 11];
                                                break;
                                            case 3:
                                                air2Info[2] = getDatas.addBytes[8 + 1 * 11];
                                                break;
                                            case 4:
                                                air2Info[2] = getDatas.addBytes[9 + 1 * 11];
                                                break;
                                        }
                                        air2Info[3] = (byte) (getDatas.addBytes[3 + 1 * 11] & 0x0f);
                                        air2Info[4] = getDatas.addBytes[5 + 1 * 11];
                                        air2Info[5] = getDatas.addBytes[10 + 1 * 11];
                                        devicesDataList.get(indexI).getAppliancesInfoList().get(indexJ).setArrCurState(air2Info);
                                    case 1:
                                        oldAirInfo[2] = getDatas.addBytes[6 + 0 * 11];
                                        break;
                                    case 3:
                                        handleAirCastData(getDatas, air3Info, airIndex, appliancesInfo);
                                        air3Info[0] = getDatas.addBytes[1 + 2 * 11];
                                        air3Info[1] = (byte) ((getDatas.addBytes[3 + 2 * 11] & 0xf0) >> 4);
                                        switch (air3Info[0] & 0xff) {
                                            case 0:
                                                air3Info[2] = getDatas.addBytes[2 + 2 * 11];
                                                break;
                                            case 1:
                                                air3Info[2] = getDatas.addBytes[6 + 2 * 11];
                                                break;
                                            case 3:
                                                air3Info[2] = getDatas.addBytes[8 + 2 * 11];
                                                break;
                                            case 4:
                                                air3Info[2] = getDatas.addBytes[9 + 2 * 11];
                                                break;
                                        }
                                        air3Info[3] = (byte) (getDatas.addBytes[3 + 2 * 11] & 0x0f);
                                        air3Info[4] = getDatas.addBytes[5 + 2 * 11];
                                        air3Info[5] = getDatas.addBytes[10 + 2 * 11];
                                        devicesDataList.get(indexI).getAppliancesInfoList().get(indexJ).setArrCurState(air3Info);
                                        oldAirInfo[2] = getDatas.addBytes[8 + 0 * 11];
                                        break;
                                    case 4:
                                        handleAirCastData(getDatas, air4Info, airIndex, appliancesInfo);
                                        air4Info[0] = getDatas.addBytes[1 + 3 * 11];
                                        air4Info[1] = (byte) ((getDatas.addBytes[3 + 3 * 11] & 0xf0) >> 4);
                                        switch (air4Info[0] & 0xff) {
                                            case 0:
                                                air4Info[2] = getDatas.addBytes[2 + 3 * 11];
                                                break;
                                            case 1:
                                                air4Info[2] = getDatas.addBytes[6 + 3 * 11];
                                                break;
                                            case 3:
                                                air4Info[2] = getDatas.addBytes[8 + 3 * 11];
                                                break;
                                            case 4:
                                                air4Info[2] = getDatas.addBytes[9 + 3 * 11];
                                                break;
                                        }
                                        air4Info[3] = (byte) (getDatas.addBytes[3 + 3 * 11] & 0x0f);
                                        air4Info[4] = getDatas.addBytes[5 + 3 * 11];
                                        air4Info[5] = getDatas.addBytes[10 + 3 * 11];
                                        devicesDataList.get(indexI).getAppliancesInfoList().get(indexJ).setArrCurState(air4Info);
                                        oldAirInfo[2] = getDatas.addBytes[9 + 0 * 11];
                                        break;
                                }
                                oldAirInfo[3] = (byte) (getDatas.addBytes[3 + 0 * 11] & 0x0f);
                                oldAirInfo[4] = getDatas.addBytes[5 + 0 * 11];
                                oldAirInfo[5] = getDatas.addBytes[10 + 0 * 11];
                                devicesDataList.get(indexI).getAppliancesInfoList().get(indexJ).setArrCurState(oldAirInfo);
//                                switch (getDatas.addBytes[airIndex * 11] & 0xff) {
//                                    case 1:
//                                        handleAirCastData(getDatas, air1Info, airIndex, appliancesInfo);
//                                        air1Info[0] = getDatas.addBytes[1 + 0 * 11];
//
//
//                                        air1Info[1] = (byte) ((getDatas.addBytes[3 + 0 * 11] & 0xf0) >> 4);
//
//
//                                        switch (air1Info[0] & 0xff) {
//                                            case 0:
//                                                air1Info[2] = getDatas.addBytes[2 + 0 * 11];
//                                                break;
//                                            case 1:
//                                                air1Info[2] = getDatas.addBytes[6 + 0 * 11];
//                                                break;
//                                            case 3:
//                                                air1Info[2] = getDatas.addBytes[8 + 0 * 11];
//                                                break;
//                                            case 4:
//                                                air1Info[2] = getDatas.addBytes[9 + 0 * 11];
//                                                break;
//
//                                        }
//
//                                        air1Info[3] = (byte) (getDatas.addBytes[3 + 0 * 11] & 0x0f);
//                                        air1Info[4] = getDatas.addBytes[5 + 0 * 11];
//                                        air1Info[5] = getDatas.addBytes[10 + 0 * 11];
////                                        HDLLog.info( "209a air1Info = " + air1Info[0] + " " + air1Info[1] + " " + air1Info[2] + " " + air1Info[3] + " " + air1Info[4] + " " + air1Info[5]);
////                                        String arrString = "209a 附加数据:";
////                                        for (int i = 0; i < getDatas.addBytes.length; i++) {
////                                            arrString += (getDatas.addBytes[i] & 0xff) + ",";
////                                        }
////                                        HDLLog.info( arrString);
//                                        devicesDataList.get(indexI).getAppliancesInfoList().get(indexJ).setArrCurState(air1Info);
//                                        break;
//                                    case 2:
//                                        handleAirCastData(getDatas, air2Info, airIndex, appliancesInfo);
//                                        air2Info[0] = getDatas.addBytes[1 + 1 * 11];
//                                        air2Info[1] = (byte) ((getDatas.addBytes[3 + 1 * 11] & 0xf0) >> 4);
//                                        switch (air2Info[0] & 0xff) {
//                                            case 0:
//                                                air2Info[2] = getDatas.addBytes[2 + 1 * 11];
//                                                break;
//                                            case 1:
//                                                air2Info[2] = getDatas.addBytes[6 + 1 * 11];
//                                                break;
//                                            case 3:
//                                                air2Info[2] = getDatas.addBytes[8 + 1 * 11];
//                                                break;
//                                            case 4:
//                                                air2Info[2] = getDatas.addBytes[9 + 1 * 11];
//                                                break;
//
//                                        }
//                                        air2Info[3] = (byte) (getDatas.addBytes[3 + 1 * 11] & 0x0f);
//                                        air2Info[4] = getDatas.addBytes[5 + 1 * 11];
//                                        air2Info[5] = getDatas.addBytes[10 + 1 * 11];
//                                        devicesDataList.get(indexI).getAppliancesInfoList().get(indexJ).setArrCurState(air2Info);
//                                        break;
//                                    case 3:
//                                        handleAirCastData(getDatas, air3Info, airIndex, appliancesInfo);
//                                        air3Info[0] = getDatas.addBytes[1 + 2 * 11];
//                                        air3Info[1] = (byte) ((getDatas.addBytes[3 + 2 * 11] & 0xf0) >> 4);
//                                        switch (air3Info[0] & 0xff) {
//                                            case 0:
//                                                air3Info[2] = getDatas.addBytes[2 + 2 * 11];
//                                                break;
//                                            case 1:
//                                                air3Info[2] = getDatas.addBytes[6 + 2 * 11];
//                                                break;
//                                            case 3:
//                                                air3Info[2] = getDatas.addBytes[8 + 2 * 11];
//                                                break;
//                                            case 4:
//                                                air3Info[2] = getDatas.addBytes[9 + 2 * 11];
//                                                break;
//                                        }
//                                        air3Info[3] = (byte) (getDatas.addBytes[3 + 2 * 11] & 0x0f);
//                                        air3Info[4] = getDatas.addBytes[5 + 2 * 11];
//                                        air3Info[5] = getDatas.addBytes[10 + 2 * 11];
//                                        devicesDataList.get(indexI).getAppliancesInfoList().get(indexJ).setArrCurState(air3Info);
//                                        break;
//                                    case 4:
//                                        handleAirCastData(getDatas, air4Info, airIndex, appliancesInfo);
//                                        air4Info[0] = getDatas.addBytes[1 + 3 * 11];
//                                        air4Info[1] = (byte) ((getDatas.addBytes[3 + 3 * 11] & 0xf0) >> 4);
//                                        switch (air4Info[0] & 0xff) {
//                                            case 0:
//                                                air4Info[2] = getDatas.addBytes[2 + 3 * 11];
//                                                break;
//                                            case 1:
//                                                air4Info[2] = getDatas.addBytes[6 + 3 * 11];
//                                                break;
//                                            case 3:
//                                                air4Info[2] = getDatas.addBytes[8 + 3 * 11];
//                                                break;
//                                            case 4:
//                                                air4Info[2] = getDatas.addBytes[9 + 3 * 11];
//                                                break;
//                                        }
//                                        air4Info[3] = (byte) (getDatas.addBytes[3 + 3 * 11] & 0x0f);
//                                        air4Info[4] = getDatas.addBytes[5 + 3 * 11];
//                                        air4Info[5] = getDatas.addBytes[10 + 3 * 11];
//                                        devicesDataList.get(indexI).getAppliancesInfoList().get(indexJ).setArrCurState(air4Info);
//                                        break;
//
//                                }
                            }
                        }
                    }
@@ -1530,21 +1544,21 @@
                                case 0:
                                    byte[] airInfo = new byte[6];
                                    System.arraycopy(getDatas.addBytes, 23, airInfo, 0, airInfo.length);
                                    switch (getDatas.addBytes[2] & 0xFF) {
                                        case 1:
                                            air1Info = airInfo;
                                            break;
                                        case 2:
                                            air2Info = airInfo;
                                            break;
                                        case 3:
                                            air3Info = airInfo;
                                            break;
                                        case 4:
                                            air4Info = airInfo;
                                            break;
                                    }
//                                    switch (getDatas.addBytes[2] & 0xFF) {
//                                        case 1:
//                                            air1Info = airInfo;
//                                            break;
//                                        case 2:
//                                            air2Info = airInfo;
//                                            break;
//                                        case 3:
//                                            air3Info = airInfo;
//                                            break;
//                                        case 4:
//                                            air4Info = airInfo;
//                                            break;
//
//                                    }
                                    devicesDataList.get(devPos).getAppliancesInfoList().get(appPos).setArrCurState(airInfo);
                                    newInfo1 = devicesDataList.get(devPos).getAppliancesInfoList().get(appPos);
                                    break;
@@ -1557,27 +1571,27 @@
//        getAppInfo(newInfo);
        final AppliancesInfo newInfo = newInfo1;
        final byte[] airCurInfo;
        if (newInfo == null) {
            return;
        }
        switch (newInfo.getChannelNum()) {
            case 1:
                airCurInfo = air1Info;
                break;
            case 2:
                airCurInfo = air2Info;
                break;
            case 3:
                airCurInfo = air3Info;
                break;
            case 4:
                airCurInfo = air4Info;
                break;
            default:
                airCurInfo = new byte[]{0, 0};
                break;
        }
        final byte[] airCurInfo = newInfo1.getArrCurState();
//        switch (newInfo.getChannelNum()) {
//            case 1:
//                airCurInfo = air1Info;
//                break;
//            case 2:
//                airCurInfo = air2Info;
//                break;
//            case 3:
//                airCurInfo = air3Info;
//                break;
//            case 4:
//                airCurInfo = air4Info;
//                break;
//            default:
//                airCurInfo = new byte[]{0, 0};
//                break;
//        }
        new Timer().schedule(new TimerTask() {
            @Override
@@ -1808,30 +1822,33 @@
                                        for (int i = 23; i < getDatas.addBytes.length; i++) {
                                            hvacBytes[i - 23] = getDatas.addBytes[i];
                                        }
                                        devicesDataList.get(devPos).getAppliancesInfoList().get(appPos).setArrCurState(hvacBytes);
                                        switch (devicesDataList.get(devPos).getAppliancesInfoList().get(appPos).getChannelNum()) {
                                            case 1:
                                                if (air1Info == null) {
                                                    air1Info = hvacBytes;
                                                }
                                                break;
                                            case 2:
                                                if (air2Info == null) {
                                                    air2Info = hvacBytes;
                                                }
                                                break;
                                            case 3:
                                                if (air3Info == null) {
                                                    air3Info = hvacBytes;
                                                }
                                                break;
                                            case 4:
                                                if (air4Info == null) {
                                                    air4Info = hvacBytes;
                                                }
                                                break;
                                        }
                                        HDLLog.info("获取备注Configuration.AIR_BIG_TYPE:  "+ StringUtil.ByteArrToHex(hvacBytes,0, hvacBytes.length));
                                        devicesDataList.get(devPos).getAppliancesInfoList().get(appPos).setArrCurState(hvacBytes);
//                                        switch (devicesDataList.get(devPos).getAppliancesInfoList().get(appPos).getChannelNum()) {
//                                            case 1:
//                                                if (air1Info == null) {
//                                                    air1Info = hvacBytes;
//                                                }
//                                                break;
//                                            case 2:
//                                                if (air2Info == null) {
//                                                    air2Info = hvacBytes;
//                                                }
//                                                break;
//                                            case 3:
//                                                if (air3Info == null) {
//                                                    air3Info = hvacBytes;
//                                                }
//                                                break;
//                                            case 4:
//                                                if (air4Info == null) {
//                                                    air4Info = hvacBytes;
//                                                }
//                                                break;
//
//                                        }
                                        break;
                                    case 3:
                                        byte[] newBytes = new byte[getDatas.addBytes.length - 24 + 1];
@@ -1886,6 +1903,7 @@
                        }
                        listRemarksOutter:
                        for (int lRPos = 0, len3 = listRemarks.size(); lRPos < len3; lRPos++) {
                            //找到E44B对应的设备回路,判断是否已经拿到了数据。
                            if (listRemarks.get(lRPos).getAppliancesInfo().getDeviceSubnetID() == getDatas.sourceSubnetID
                                    && listRemarks.get(lRPos).getAppliancesInfo().getDeviceDeviceID() == getDatas.sourceDeviceID
@@ -1946,7 +1964,7 @@
            ) {
                List<AppliancesInfo> infos = devicesDataList.get(i).getAppliancesInfoList();
                for (int j = 0, len2 = infos.size(); j < len2; j++) {
                    HDLLog.info("HDL big::" + devicesDataList.get(i).getAppliancesInfoList().get(j).getBigType());
//                    HDLLog.info("HDL big::" + devicesDataList.get(i).getAppliancesInfoList().get(j).getBigType());
                    switch (devicesDataList.get(i).getAppliancesInfoList().get(j).getBigType()) {
                        case Configuration.LIGTH_BIG_TYPE:
                            isGetDeviceStateSuccess = true;
@@ -2370,5 +2388,23 @@
        }
    }
    /**
     * 设置控制是否成功状态
     * @param info
     * @param success
     */
    public static void setDeviceCtrlSuccessStateWithInfo(AppliancesInfo info, Boolean success){
        ctrlSuccessStateHashMap.put(info.getDeviceKey(), success);
    }
    /**
     * 获取是否控制成功
     * @param info
     * @return 结果
     */
    public static Boolean getDeviceCtrlSuccessStateWithInfo(AppliancesInfo info){
        Boolean success =  ctrlSuccessStateHashMap.get(info.getDeviceKey());
        if(success == null) success = false;
        return success;
    }
}