| | |
| | | else if (topic == gatewayID + "/" + "Bind/SetBind_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID }; |
| | | var tempBindList = Newtonsoft.Json.Linq.JArray.Parse(jobject["Data"]["BindList"].ToString()); |
| | | if (tempBindList == null) |
| | | //var tempBindList = Newtonsoft.Json.Linq.JArray.Parse(jobject["Data"]["BindList"].ToString()); |
| | | var tempResult = Newtonsoft.Json.JsonConvert.DeserializeObject<AddedDeviceBindResponseData>(jobject["Data"].ToString()); |
| | | if (tempResult == null) |
| | | { |
| | | result = new AddedDeviceBindResponseAllData { errorMessageBase = "网关返回的数据为空" }; |
| | | } |
| | | else |
| | | { |
| | | var dataBindRes = new AddedDeviceBindResponseData(); |
| | | for (int m = 0; tempBindList != null && m < tempBindList.Count; m++) |
| | | { |
| | | var tempBind = tempBindList[m]; |
| | | dataBindRes.BindList.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<AddBindListResponseObj>(tempBind.ToString())); |
| | | } |
| | | if (dataBindRes != null) |
| | | { |
| | | result = new AddedDeviceBindResponseAllData { addedDeviceBindResponseData = dataBindRes }; |
| | | DebugPrintLog($"UI收到通知后的主题_{topic}"); |
| | | } |
| | | //var dataBindRes = new AddedDeviceBindResponseData(); |
| | | //for (int m = 0; tempBindList != null && m < tempBindList.Count; m++) |
| | | //{ |
| | | // var tempBind = tempBindList[m]; |
| | | // dataBindRes.BindList.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<AddBindListResponseObj>(tempBind.ToString())); |
| | | //} |
| | | //if (dataBindRes != null) |
| | | //{ |
| | | result = new AddedDeviceBindResponseAllData { addedDeviceBindResponseData = tempResult }; |
| | | DebugPrintLog($"UI收到通知后的主题_{topic}"); |
| | | //} |
| | | } |
| | | } |
| | | //else if (topic == gatewayID + "/" + "Bind/BindResult") |
| | |
| | | /// 0:绑定所有目标成功 |
| | | ///<para>1:绑定目标失败,绑定设备目标有漏掉</para> |
| | | /// </summary> |
| | | public int Result; |
| | | public int Result = -1; |
| | | } |
| | | |
| | | /// <summary> |