From 9cc8fd11b13813adbdd3c6c31554e5c0bebf4026 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期五, 21 八月 2020 19:53:49 +0800 Subject: [PATCH] 发布到商店的版本 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceBindLogic.cs | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceBindLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceBindLogic.cs index f5ac6ec..d799cb9 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceBindLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceBindLogic.cs @@ -192,6 +192,32 @@ //淇敼缂撳瓨 TemplateData.TemplateDeviceDataLogic.Current.AddDeviceBindList(addBindData, result.JsonData[0]); + var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<BindObj.AddedDeviceBindResponseData>(result.ReceiptData); + return new BindObj.AddedDeviceBindResponseAllData() { addedDeviceBindResponseData = tempData }; + } + + /// <summary> + ///璁惧缁戝畾銆愪竴瀵逛竴 缁戝畾锛屼竴涓寜閿洖璺彧鑳界粦瀹氫竴涓澶囥�� + /// </summary> + public BindObj.AddedDeviceBindResponseAllData AddDeviceSingleBindAsync(BindObj.AddBindData addBindData) + { + //濡傛灉褰撳墠浣忓畢鏄櫄鎷熶綇瀹� + if (Common.Config.Instance.Home.IsVirtually == true) + { + return ModelData.DeviceModelDataLogic.Current.AddDeviceBindList(addBindData, "Bind/GetDeviceBind"); + } + + var device = Common.LocalDevice.Current.GetDevice(addBindData.DeviceAddr, addBindData.Epoint); + //鑾峰彇鍙戦�佺殑鍛戒护瀛楃 + var sendData = this.GetAddDeviceListBindCommandText(addBindData); + //鍙戦�� + var result = HdlDeviceCommonLogic.Current.SendJobjectDataToGateway(device, "Bind/SetSingleBind", sendData, "Bind/SetSingleBind_Respon", 20); + if (result.ErrorMsg != null || result.ErrorMsgDiv == 0) + { + return null; + } + //淇敼缂撳瓨 + TemplateData.TemplateDeviceDataLogic.Current.AddDeviceBindList(addBindData, result.JsonData[0]); var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<BindObj.AddedDeviceBindResponseData>(result.ReceiptData); return new BindObj.AddedDeviceBindResponseAllData() { addedDeviceBindResponseData = tempData }; -- Gitblit v1.8.0