From c6ff92e84b6cb2815cb98065ecb0ecf95d0689c3 Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期三, 15 一月 2020 09:42:29 +0800
Subject: [PATCH] 2020-01-15-1
---
ZigbeeApp/Shared/Phone/ZigBee/Device/BindObj.cs | 54 +++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 39 insertions(+), 15 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/BindObj.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/BindObj.cs
old mode 100755
new mode 100644
index 51ae471..6faa212
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/BindObj.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/BindObj.cs
@@ -13,7 +13,6 @@
/// </summary>
public async System.Threading.Tasks.Task<AddedDeviceBindResponseAllData> AddDeviceBindAsync(AddBindData addBindData)
{
-
return await System.Threading.Tasks.Task.Run(async () =>
{
var result = new AddedDeviceBindResponseAllData();
@@ -91,9 +90,9 @@
{
var dInfo = new JObject{
{ "BindMacAddr",bindInfo.BindMacAddr},
- { "BindEpoint", bindInfo.BindEpoint} ,
- { "BindCluster", bindInfo.BindCluster} ,
- { "BindType",bindInfo.BindType}
+ { "BindEpoint", bindInfo.BindEpoint} ,
+ { "BindCluster", bindInfo.BindCluster} ,
+ { "BindType",bindInfo.BindType}
};
bindList.Add(dInfo);
}
@@ -101,15 +100,15 @@
{
var dInfo = new JObject{
{ "BindCluster", bindInfo.BindCluster} ,
- { "BindType",bindInfo.BindType},
- { "BindScenesId", bindInfo.BindScenesId}
+ { "BindType",bindInfo.BindType},
+ { "BindScenesId", bindInfo.BindScenesId}
};
bindList.Add(dInfo);
}
}
var data = new JObject{
- {"BindName",addBindData.BindName},
- { "BindList", bindList }
+ {"BindName",addBindData.BindName},
+ { "BindList", bindList }
};
jObject.Add("Data", data);
//ZbGateway.MainGateWay.CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo?.gwID;
@@ -128,7 +127,21 @@
{
continue;
}
- if (0 < result.addedDeviceBindResponseData.BindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 2).Count)
+ if (0 < result.addedDeviceBindResponseData.BindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 1).Count)
+ {
+ if (result.addBindResultResponseData != null)
+ {
+ break;
+ }
+ }
+ else if (0 < result.addedDeviceBindResponseData.BindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 2).Count)
+ {
+ if (result.addBindResultResponseData != null)
+ {
+ break;
+ }
+ }
+ else if (0 < result.addedDeviceBindResponseData.BindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 3).Count)
{
if (result.addBindResultResponseData != null)
{
@@ -406,7 +419,6 @@
}
catch { }
-
var dateTime = DateTime.Now;
while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime)
{
@@ -415,7 +427,21 @@
{
continue;
}
- if (0 < responseData.delDeviceBindResponseData.RemoveBindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 3).Count)
+ if (0 < responseData.delDeviceBindResponseData.RemoveBindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 1).Count)
+ {
+ if (responseData.removeBindResultResponseData != null)
+ {
+ break;
+ }
+ }
+ else if (0 < responseData.delDeviceBindResponseData.RemoveBindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 3).Count)
+ {
+ if (responseData.removeBindResultResponseData != null)
+ {
+ break;
+ }
+ }
+ else if (0 < responseData.delDeviceBindResponseData.RemoveBindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 4).Count)
{
if (responseData.removeBindResultResponseData != null)
{
@@ -427,14 +453,12 @@
break;
}
}
-
if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime)
{
responseData.errorMessageBase = "鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔";
}
mainGateway.Actions -= action;
System.Console.WriteLine("DeviceBind/DelBind_Actions 閫�鍑�" + System.DateTime.Now.ToString());
-
return responseData;
});
}
@@ -645,7 +669,7 @@
try
{
- System.Console.WriteLine("Bind/GetDeviceBind_Actions 鍚姩" + "_" + System.DateTime.Now.ToString());
+ // System.Console.WriteLine("Bind/GetDeviceBind_Actions 鍚姩" + "_" + System.DateTime.Now.ToString());
var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", DeviceEpoint }, { "Cluster_ID", 0 }, { "Command", 5007 } };
mainGateway.Send("Bind/GetDeviceBind", jObject.ToString());
}
@@ -665,7 +689,7 @@
d = new GetDeviceBindResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
}
mainGateway.Actions -= action;
- System.Console.WriteLine("Bind/GetDeviceBind_Actions 閫�鍑�" + System.DateTime.Now.ToString());
+ //System.Console.WriteLine("Bind/GetDeviceBind_Actions 閫�鍑�" + System.DateTime.Now.ToString());
return d;
});
--
Gitblit v1.8.0