From a7adf98ff4ac801342853b1f9231cc1ab5acebf3 Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期四, 14 十一月 2019 17:25:42 +0800 Subject: [PATCH] Merge branch 'dev-tzy' into DEV_GXC --- ZigbeeApp/Shared/Phone/ZigBee/Device/Safeguard.cs | 63 +++++++++++++++++++++++++++++++ 1 files changed, 62 insertions(+), 1 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/Safeguard.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/Safeguard.cs index 2e92268..2c0df35 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/Safeguard.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/Safeguard.cs @@ -6613,7 +6613,65 @@ System.Console.WriteLine($"Security/AddZoneAction(璁剧疆鑳佽揩鐘舵�佷笅鐨勭數璇濆彿鐮侊級_Actions 閫�鍑篲{System.DateTime.Now.ToString()}"); return d; }); + } + + /// <summary> + /// *璁剧疆鑳佽揩鐘舵�佷笅琚�氱煡鐨勮仈绯诲彿鐮佺殑澶囨敞锛堥渶瑕佺鐞嗗憳鏉冮檺锛�. -2:涓荤綉鍏充涪澶� + /// </summary> + /// <param name="strPhone">鍦板尯鐮�-鑱旂郴鏂瑰紡</param> + /// <param name="strNote">澶囨敞,鏈�澶�63byte</param> + /// <returns></returns> + public static async System.Threading.Tasks.Task<SetCoercePhoneNumberResponseData> SetCoercePhoneNumberNoteAsync(string strPhone,string strNote) + { + SetCoercePhoneNumberResponseData d = null; + var mainGateway = ZbGateway.MainGateWay; + if (mainGateway == null) + { + d = new SetCoercePhoneNumberResponseData(); + d.Result = -2; + return d; + } + Action<string, string> action = (topic, message) => + { + var gatewayID = topic.Split('/')[0]; + if (topic == gatewayID + "/" + "Security/AddPushNumberNote_Respon") + { + var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); + d = Newtonsoft.Json.JsonConvert.DeserializeObject<SetCoercePhoneNumberResponseData>(jobject["Data"].ToString()); + } + }; + + mainGateway.Actions += action; + try + { + var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4038 } }; + var data = new JObject + { + { "ActionType", 253}, + { "LoginToken", Shared.Phone.UserCenter.HdlSafeguardLogic.Current.GetLoginToken()}, + { "PushNumber", strPhone}, + { "PushNumberNote", strNote} + }; + jObject.Add("Data", data); + mainGateway.Send("Security/AddPushNumberNote", jObject.ToString()); + } + catch { } + + int timeOut = 0; + while (timeOut <= 60) + { + await System.Threading.Tasks.Task.Delay(50); + if (d != null) + { + break; + } + timeOut++; + } + + mainGateway.Actions -= action; + return d; } + /// <summary> /// 璁剧疆鑳佽揩鐘舵�佷笅琚�氱煡鐨勮仈绯诲彿鐮佺殑杩斿洖鏁版嵁 ,缃戝叧鍙嶉淇℃伅 @@ -6695,7 +6753,10 @@ /// 鎺ㄩ�佷俊鎭殑鐩爣鎵嬫満鍙风爜 ///</summary> public string PushNumber; - + /// <summary> + /// 澶囨敞淇℃伅 + /// </summary> + public string PushNumberNote; } /// <summary> -- Gitblit v1.8.0