From f23ad1b3f9f6193f35f72104d690b21dc67d5c1f Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期一, 06 七月 2020 12:35:25 +0800 Subject: [PATCH] 去掉了访问外网的异步 --- ZigbeeApp/Shared/Phone/ZigBee/Device/IASZone.cs | 33 +++++++++++++++++++++++++++++++-- 1 files changed, 31 insertions(+), 2 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/IASZone.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/IASZone.cs index 38aaeca..2db5d41 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/IASZone.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/IASZone.cs @@ -13,12 +13,41 @@ } #region IAS瀹夐槻淇℃伅涓婃姤. + /// <summary> + /// 涓婁竴娆¤闂甶ASInfo鐨勬椂闂� + /// </summary> + [Newtonsoft.Json.JsonIgnore] + private DateTime oldiASInfoTime = DateTime.Now; + /// <summary> + /// IAS瀹夐槻淇℃伅涓婃姤 + /// </summary> + [Newtonsoft.Json.JsonIgnore] + private IASInfoData m_iASInfo = null; /// <summary> - /// IAS瀹夐槻淇℃伅涓婃姤 + /// IAS瀹夐槻淇℃伅涓婃姤(杩欎釜涓滆タ30绉掍箣鍚庡氨娓呮帀) /// <para>褰撳畨闃茶澶囧睘鎬х姸鎬佹敼鍙樻椂鍊欙紙渚嬪涓�姘у寲纰充紶鎰熷櫒妫�娴嬪埌涓�姘у寲纰虫皵浣擄級锛岃澶囧皢涓婃姤灞炴�х姸鎬佸彉鍖栨暟鎹��</para> /// </summary> [Newtonsoft.Json.JsonIgnore] - public IASInfoData iASInfo; + public IASInfoData iASInfo + { + get + { + if (m_iASInfo != null && (DateTime.Now - oldiASInfoTime).TotalMilliseconds > 30 * 1000) + { + //杩欎釜涓滆タ30绉掍箣鍚庡氨娓呮帀 + m_iASInfo = null; + return null; + } + return m_iASInfo; + } + set + { + //璁板綍璧锋洿鏂版椂闂� + this.oldiASInfoTime = DateTime.Now; + m_iASInfo = value; + } + } + /// <summary> /// IAS瀹夐槻淇℃伅涓婃姤 /// <para>褰撳畨闃茶澶囧睘鎬х姸鎬佹敼鍙樻椂鍊欙紙渚嬪涓�姘у寲纰充紶鎰熷櫒妫�娴嬪埌涓�姘у寲纰虫皵浣擄級锛岃澶囧皢涓婃姤灞炴�х姸鎬佸彉鍖栨暟鎹��</para> -- Gitblit v1.8.0