| | |
| | | * @param getDatas |
| | | */ |
| | | private static void handleHVACCtrlData(UdpDataBean getDatas) { |
| | | switch (getDatas.command) { |
| | | case Configuration.AIR_HVAC_CTRL_BACK_COMMAND: |
| | | outter: |
| | | for (int i = 0, len = devicesDataList.size(); i < len; i++) { |
| | | if (devicesDataList.get(i).getSourceSubnetID() == getDatas.sourceSubnetID |
| | | && devicesDataList.get(i).getSourceDeviceID() == getDatas.sourceDeviceID |
| | | ) { |
| | | List<AppliancesInfo> infos = devicesDataList.get(i).getAppliancesInfoList(); |
| | | for (int j = 0, len2 = infos.size(); j < len2; j++) { |
| | | if (getDatas.addBytes.length > 0) { |
| | | if (infos.get(j).getBigType() == Configuration.AIR_BIG_TYPE |
| | | && infos.get(j).getDeviceType() == HDLApConfig.TYPE_AC_HVAC |
| | | && infos.get(j).getChannelNum() == (getDatas.addBytes[0] & 0xFF)) { |
| | | outter: |
| | | for (int i = 0, len = devicesDataList.size(); i < len; i++) { |
| | | if (devicesDataList.get(i).getSourceSubnetID() == getDatas.sourceSubnetID |
| | | && devicesDataList.get(i).getSourceDeviceID() == getDatas.sourceDeviceID |
| | | ) { |
| | | List<AppliancesInfo> infos = devicesDataList.get(i).getAppliancesInfoList(); |
| | | for (int j = 0, len2 = infos.size(); j < len2; j++) { |
| | | if (getDatas.addBytes.length > 0) { |
| | | if (infos.get(j).getBigType() == Configuration.AIR_BIG_TYPE |
| | | && infos.get(j).getDeviceType() == HDLApConfig.TYPE_AC_HVAC |
| | | && infos.get(j).getChannelNum() == (getDatas.addBytes[0] & 0xFF)) { |
| | | |
| | | devicesDataList.get(i).getAppliancesInfoList().get(j).setArrCurState(getDatas.addBytes); |
| | | AppliancesInfo mHvacAirInfo = devicesDataList.get(i).getAppliancesInfoList().get(j); |
| | | AirHVACBackInfo info = new AirHVACBackInfo(mHvacAirInfo); |
| | | setDeviceCtrlSuccessStateWithInfo(infos.get(j), true); |
| | | EventBus.getDefault().post(new AirHVACFeedBackEvent(info, true)); |
| | | break outter; |
| | | } |
| | | devicesDataList.get(i).getAppliancesInfoList().get(j).setArrCurState(getDatas.addBytes); |
| | | AppliancesInfo mHvacAirInfo = devicesDataList.get(i).getAppliancesInfoList().get(j); |
| | | AirHVACBackInfo info = new AirHVACBackInfo(mHvacAirInfo); |
| | | setDeviceCtrlSuccessStateWithInfo(infos.get(j), true); |
| | | EventBus.getDefault().post(new AirHVACFeedBackEvent(info, true)); |
| | | break outter; |
| | | } |
| | | // else { |
| | | // HDLLog.E("控制HVAC状态反馈数据异常"); |
| | | // } |
| | | } |
| | | } |
| | | |
| | | break outter; |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | |
| | | break outter; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |