| | |
| | | import com.hdl.sdk.ttl.Config.MCUConstants; |
| | | import com.hdl.sdk.ttl.HDLAppliances.Config.HDLApConfig; |
| | | import com.hdl.sdk.ttl.HDLAppliances.HDLAirCondition.AirCtrlBackInfo; |
| | | import com.hdl.sdk.ttl.HDLAppliances.HDLAirCondition.AirTechSysBackInfo; |
| | | import com.hdl.sdk.ttl.HDLAppliances.HDLAirCondition.Parser.AirCtrlParser; |
| | | import com.hdl.sdk.ttl.HDLAppliances.HDLAudio.HDLAudio; |
| | | import com.hdl.sdk.ttl.HDLAppliances.HDLCommonSwitch.CommonSwitchBackInfo; |
| | |
| | | import com.hdl.sdk.ttl.HDLDeviceManger.Bean.ScenesData; |
| | | import com.hdl.sdk.ttl.HDLDeviceManger.Bean.SendDatas; |
| | | import com.hdl.sdk.ttl.HDLDeviceManger.EventBusEvent.AirFeedBackEvent; |
| | | import com.hdl.sdk.ttl.HDLDeviceManger.EventBusEvent.AirTechSysFeedBackEvent; |
| | | import com.hdl.sdk.ttl.HDLDeviceManger.EventBusEvent.ColourLightFeedBackEvent; |
| | | import com.hdl.sdk.ttl.HDLDeviceManger.EventBusEvent.CommonSwitchCtrlBackEvent; |
| | | import com.hdl.sdk.ttl.HDLDeviceManger.EventBusEvent.CurtainFeedBackEvent; |
| | |
| | | AirCtrlBackInfo airCtrlBackInfo = new AirCtrlBackInfo(); |
| | | airCtrlBackInfo.setAppliancesInfo(info); |
| | | EventBus.getDefault().post(new AirFeedBackEvent(airCtrlBackInfo, false)); |
| | | } |
| | | } |
| | | }, mRequestTimeout); |
| | | |
| | | |
| | | } else { |
| | | HDLLog.I("空调设备控制不在范围内" |
| | | + " LittleType = " + info.getLittleType() |
| | | + " BigType = " + info.getBigType() |
| | | ); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 控制空调温度(温度为浮点型) |
| | | * |
| | | * @param info |
| | | * @param type |
| | | * @param temp 温度 |
| | | */ |
| | | public static void airCtrlTemp(final AppliancesInfo info, int type, float temp) { |
| | | HDLDeviceManager.setDeviceCtrlSuccessStateWithInfo(info, false); |
| | | if (acCtrlFailTimer != null) { |
| | | acCtrlFailTimer.cancel(); |
| | | acCtrlFailTimer = null; |
| | | } |
| | | if (info.getBigType() == Configuration.AIR_BIG_TYPE) { |
| | | if (info.getDeviceType() == HDLApConfig.TYPE_AC_KNXTECHSYS) { |
| | | byte[] airbytes = AirCtrlParser.getAirKNXTechAddByte(info, type, temp); |
| | | if (airbytes != null) { |
| | | addSendData(info, airbytes, Configuration.CONTROL); |
| | | } |
| | | } |
| | | |
| | | acCtrlFailTimer = new Timer(); |
| | | acCtrlFailTimer.schedule(new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | if (!HDLDeviceManager.getDeviceCtrlSuccessStateWithInfo(info)) { |
| | | AirTechSysBackInfo AirTechSysBackInfo = new AirTechSysBackInfo(info); |
| | | EventBus.getDefault().post(new AirTechSysFeedBackEvent(AirTechSysBackInfo, false)); |
| | | } |
| | | } |
| | | }, mRequestTimeout); |
| | |
| | | Crc sendDatas = new Crc(command, subnetID, deviceID, addBytes); |
| | | HDLSerialPortCore.sendData(sendDatas); |
| | | } else { |
| | | |
| | | SendDatas.AddSendData(command, subnetID, deviceID, addBytes); |
| | | } |
| | | } |