| | |
| | |
|
| | | //修改缓存
|
| | | 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 };
|