JLChen
2020-03-16 7a951ecdc084ea8643e29e1ade59c1877fd7fbe5
hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Core/HDLCommand.java
@@ -402,6 +402,44 @@
    }
    /**
     * 控制地热模块温度
     *
     * @param info
     * @param state 2020-03-15
     */
    public static void geothermalCtrlTemp(final AppliancesInfo info, int state) {
//        HDLDeviceManager.isGeothermalCtrlSuccess = false;
        HDLDeviceManager.setDeviceCtrlSuccessStateWithInfo(info, false);
        if (geothermalCtrlFailTimer != null) {
            geothermalCtrlFailTimer.cancel();
            geothermalCtrlFailTimer = null;
        }
        if (info.getBigType() == Configuration.GEOTHERMAL_BIG_TYPE) {
            byte[] sendbytes = GeothermalParser.getGeothermalAddByteTemp(info, state);
            addSendData(info, sendbytes, Configuration.CONTROL);
            geothermalCtrlFailTimer = new Timer();
            geothermalCtrlFailTimer.schedule(new TimerTask() {
                @Override
                public void run() {
                    if (!HDLDeviceManager.getDeviceCtrlSuccessStateWithInfo(info)) {
                        GeothermalBackInfo mGeothermalBackInfo = new GeothermalBackInfo();
                        mGeothermalBackInfo.setAppliancesInfo(info);
                        EventBus.getDefault().post(new GeothermalFeedBackEvent(mGeothermalBackInfo, EventCode.FAILURE));
                    }
                }
            }, 5000);
        } else {
            HDLLog.info("地热模块控制不在范围内"
                    + " LittleType = " + info.getLittleType()
                    + " BigType = " + info.getBigType()
            );
        }
    }
    /**
     * 控制地热模块
     *
     * @param info