| | |
| | | foreach (var data in result.addedDeviceBindResponseData.BindList)
|
| | | {
|
| | | string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(data.BindMacAddr, data.BindEpoint);
|
| | | //0:添加成功 3:已经存在,也可以代表成功
|
| | | if (data.Result == 0 || data.Result == 3)
|
| | | if (dicDevice.ContainsKey(mainkeys) == true)
|
| | | {
|
| | | if (dicDevice.ContainsKey(mainkeys) == true)
|
| | | {
|
| | | listSuccess.Add(dicDevice[mainkeys]);
|
| | | }
|
| | | }
|
| | | //1:失败,节点设备或场景不存在
|
| | | else if (data.Result == 1)
|
| | | {
|
| | | if (dicDevice.ContainsKey(mainkeys) == true)
|
| | | {
|
| | | //设备名称 绑定失败
|
| | | string msg = Common.LocalDevice.Current.GetDeviceEpointName(dicDevice[mainkeys]) + "\r\n";
|
| | | msg += Language.StringByID(R.MyInternationalizationString.BindFailed);
|
| | | this.ShowTipMsg(msg);
|
| | | }
|
| | | }
|
| | | //2:未知,由节点设备反馈发送“Bind/BindResult”主题消息确定是否成功
|
| | | else if (data.Result == 2)
|
| | | {
|
| | | if (result.addBindResultResponseData == null)
|
| | | {
|
| | | //设备名称 绑定失败
|
| | | string msg = Common.LocalDevice.Current.GetDeviceEpointName(dicDevice[mainkeys]) + "\r\n";
|
| | | msg += Language.StringByID(R.MyInternationalizationString.BindFailed);
|
| | | this.ShowTipMsg(msg);
|
| | | }
|
| | | else
|
| | | {
|
| | | //添加成功
|
| | | if (result.addBindResultResponseData.Result == 0)
|
| | | {
|
| | | if (dicDevice.ContainsKey(mainkeys) == true)
|
| | | {
|
| | | listSuccess.Add(dicDevice[mainkeys]);
|
| | | }
|
| | | }
|
| | | //设备名称 绑定列表已满
|
| | | else if (result.addBindResultResponseData.Result == 140)
|
| | | {
|
| | | string msg = Common.LocalDevice.Current.GetDeviceEpointName(dicDevice[mainkeys]) + "\r\n";
|
| | | msg += Language.StringByID(R.MyInternationalizationString.uBindListIsFull);
|
| | | this.ShowTipMsg(msg);
|
| | | }
|
| | | else
|
| | | {
|
| | | //设备名称 绑定失败
|
| | | string msg = Common.LocalDevice.Current.GetDeviceEpointName(dicDevice[mainkeys]) + "\r\n";
|
| | | msg += Language.StringByID(R.MyInternationalizationString.BindFailed);
|
| | | this.ShowTipMsg(msg);
|
| | | }
|
| | | }
|
| | | listSuccess.Add(dicDevice[mainkeys]);
|
| | | }
|
| | | }
|
| | |
|
| | | if (listSuccess.Count == 0)
|
| | | {
|
| | | //绑定目标设置失败
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uSetBindTargetsFail);
|
| | | this.ShowTipMsg(msg);
|
| | | }
|
| | | return listSuccess;
|
| | | }
|
| | |
|