From 23420922845c9e77019a55c3b3e3271eb1ec261e Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 13 七月 2020 11:42:18 +0800
Subject: [PATCH] 新版本
---
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs | 40 ++++++++++++++++++++++++++++++----------
1 files changed, 30 insertions(+), 10 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs
index 7bf85cc..ce24a39 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs
@@ -151,8 +151,8 @@
}
get
{
- //10绉掑悗鍏佽鍐嶆璁块棶
- if (m_CanAccessHttp == true || (DateTime.Now - oldAccessHttpTime).TotalMilliseconds > 10 * 1000)
+ //8绉掑悗鍏佽鍐嶆璁块棶
+ if (m_CanAccessHttp == true || (DateTime.Now - oldAccessHttpTime).TotalMilliseconds > 8 * 1000)
{
oldAccessHttpTime = DateTime.Now;
return true;
@@ -368,23 +368,43 @@
/// <summary>
/// 鐩戝惉瀹夊崜缃戠粶鍙樺寲
/// </summary>
- /// <param name="value"></param>
+ /// <param name="value">0:娌℃湁缃戠粶 1:4G 2:wifi</param>
private void NetworkStateChanged(int value)
{
//娌℃湁缃戠粶
if (value == 0)
{
this.CanAccessHttp = false;
+ //鍏抽棴Socket
+ ZigBee.Common.Application.FindGateWaySocket.Stop();
}
- //鍙互鍙�4G
- else if (value == 1)
+ //WIFI鎴栬��4G鏃�
+ if (value == 1 || value == 2)
{
+ //鍏佽鑱旂綉
this.CanAccessHttp = true;
- }
- //WIFI
- else if (value == 2)
- {
- this.CanAccessHttp = true;
+
+ //妫�娴嬫槸鍚﹀凡缁忓畬鎴愯处鍙蜂俊鎭垵濮嬪寲
+ if (UserCenterResourse.UserInfo.InitUserInfoSuccess == false
+ && Common.Config.Instance.HomeId != string.Empty)
+ {
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ ProgressBar.Show();
+ //閲嶆柊鍒濆鍖栬处鍙蜂俊鎭�
+ UserCenterLogic.ReInitUserAccoutInfo();
+ ProgressBar.Close();
+
+ }, ShowErrorMode.NO);
+ }
+ //閲嶆柊鍒濆鍖朣ocket
+ ZigBee.Common.Application.FindGateWaySocket.Stop();
+ if (value == 2)
+ {
+ ZigBee.Common.Application.FindGateWaySocket.Start();
+ }
+ //鏂帀鏈湴杩炴帴
+ HdlGatewayLogic.Current.ClearAllRealGateway();
}
}
--
Gitblit v1.8.0