| | |
| | | import com.hdl.sdk.hdl_core.HDLDeviceManger.EventBusEvent.CommonSwitchStateBackEvent; |
| | | import com.hdl.sdk.hdl_core.HDLDeviceManger.EventBusEvent.CurtainFeedBackEvent; |
| | | import com.hdl.sdk.hdl_core.HDLDeviceManger.EventBusEvent.DeviceStateEvent; |
| | | import com.hdl.sdk.hdl_core.HDLDeviceManger.EventBusEvent.DryContactSensorBackEvent; |
| | | import com.hdl.sdk.hdl_core.HDLDeviceManger.EventBusEvent.EventCode; |
| | | import com.hdl.sdk.hdl_core.HDLDeviceManger.EventBusEvent.FreshAirFeedBackEvent; |
| | | import com.hdl.sdk.hdl_core.HDLDeviceManger.EventBusEvent.GeothermalFeedBackEvent; |
| | |
| | | break; |
| | | case Configuration.COMMON_SWITCH_STATE_BACK_COMMAND: |
| | | handleCommonSwitchStateData(getDatas); |
| | | break; |
| | | /***2020-06-23 新增干节点指令**/ |
| | | case Configuration.DRY_CONTACT_STATE_BACK_COMMAND: |
| | | case Configuration.DRY_CONTACT_BROADCAST_STATE_COMMAND: |
| | | handleDryContactBroadcastStateData(getDatas); |
| | | break; |
| | | case Configuration.SECURITY_ARMING_CTRL_BACK_COMMAND://20190729新增 |
| | | case Configuration.SECURITY_ALARM_CTRL_BACK_COMMAND://报警设置反馈 |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 干接点广播状态反馈反馈 |
| | | * 2020-06-24 新增 |
| | | * |
| | | * @param getDatas |
| | | */ |
| | | private static void handleDryContactBroadcastStateData(UdpDataBean getDatas) { |
| | | 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 (infos.get(j).getBigType() == Configuration.SENSOR_BIG_TYPE |
| | | && infos.get(j).getChannelNum() == (getDatas.addBytes[1] & 0xFF)) {//2019-07-29 |
| | | if (getDatas.addBytes.length >= 3) { |
| | | isGetDeviceStateSuccess = true; |
| | | int state = getDatas.addBytes[2] & 0xFF; |
| | | devicesDataList.get(i).getAppliancesInfoList().get(j).setIntCurState(state); |
| | | // devicesDataList.get(i).getAppliancesInfoList().get(j).setArrCurState(getDatas.addBytes); |
| | | EventBus.getDefault().post(new DryContactSensorBackEvent(devicesDataList.get(i).getAppliancesInfoList().get(j), true, state)); |
| | | } else { |
| | | isGetDeviceStateSuccess = true; |
| | | EventBus.getDefault().post(new DryContactSensorBackEvent(devicesDataList.get(i).getAppliancesInfoList().get(j), false)); |
| | | HDLLog.info("DryContac 返回addBytes数据异常"); |
| | | } |
| | | break outter; |
| | | } else { |
| | | // HDLLog.I("DryContac 没有找到匹配类型"); |
| | | } |
| | | } |
| | | break outter; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |