| | |
| | | using System.Collections.Generic; |
| | | using HDL_ON.Common; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.DriverLayer; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.Entity |
| | |
| | | { |
| | | try |
| | | { |
| | | var controlValues = new Dictionary<string, object>(); |
| | | foreach(var p in pairs) |
| | | |
| | | if (DriverLayer.Control.Ins.GatewayOnline_Local) |
| | | { |
| | | controlValues.Add("key", p.Key); |
| | | controlValues.Add("value", p.Value); |
| | | } |
| | | var pack = ApiUtlis.Ins.HttpRequest.ControlGroupControl(userDeviceGroupControlId, controlValues); |
| | | if (pack != null) |
| | | { |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | var controlValues = new Dictionary<string, string>(); |
| | | foreach (var p in pairs) |
| | | { |
| | | //DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl. |
| | | controlValues.Add("key", p.Key); |
| | | controlValues.Add("value", p.Value.ToString()); |
| | | } |
| | | else |
| | | var functionControlDataObj = GetGatewayAlinkControlData(controlValues); |
| | | var functionControlDataJson = Newtonsoft.Json.JsonConvert.SerializeObject(functionControlDataObj); |
| | | var sendBytes = DriverLayer.Control.Ins.ConvertSendBodyData(CommunicationTopic.ct.ControlFunctionTopic, functionControlDataJson); |
| | | new Control_Udp().SendLocalHdlLinkData(sendBytes, functionControlDataObj.id, 3); |
| | | MainPage.Log($"本地通讯 发送HDL-Link数据:{functionControlDataJson}"); |
| | | } |
| | | else |
| | | { |
| | | |
| | | var controlValues = new Dictionary<string, object>(); |
| | | foreach (var p in pairs) |
| | | { |
| | | MainPage.Log($"群控控制失败,Code: {pack.Code}"); |
| | | controlValues.Add("key", p.Key); |
| | | controlValues.Add("value", p.Value); |
| | | } |
| | | var pack = ApiUtlis.Ins.HttpRequest.ControlGroupControl(userDeviceGroupControlId, controlValues); |
| | | if (pack != null) |
| | | { |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | //DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl. |
| | | } |
| | | else |
| | | { |
| | | MainPage.Log($"群控控制失败,Code: {pack.Code}"); |
| | | } |
| | | } |
| | | } |
| | | } |