From d6aec3027ebec50e1096af7da19d03b1e5f5bea4 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期六, 19 十二月 2020 21:33:00 +0800
Subject: [PATCH] 20201219-99

---
 HDL_ON/Common/HDLCommon.cs |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs
index 02943ea..ee56f54 100644
--- a/HDL_ON/Common/HDLCommon.cs
+++ b/HDL_ON/Common/HDLCommon.cs
@@ -6,6 +6,7 @@
 using HDL_ON.UI;
 using HDL_ON.Entity;
 using System.Threading;
+using HDL_ON.DriverLayer;
 
 namespace HDL_ON
 {
@@ -381,6 +382,38 @@
         {
             return string.IsNullOrEmpty(userName) ? Language.StringByID(StringId.UsersWhoNameIsEmpty) : userName;
         }
+
+
+        /// <summary>
+        /// 鐩戝惉缃戠粶鍙樺寲鍚庡鐞嗕簨浠�
+        /// 鍒锋柊缃戠粶鐘舵��
+        /// </summary>
+        /// <param name="internetStatus">缃戠粶鍙樺寲</param>
+        /// <param name="IsEnterBackground">鏄惁杩涘叆浜嗗悗鍙�</param>
+        public void UpdateInternetStatus(int internetStatus, bool IsEnterBackground = false)
+        {
+            MainPage.Log($"缃戠粶鐘舵�佸彉鍖栵紝褰撳墠缃戠粶:{internetStatus} 鏄惁鍚庡彴:{IsEnterBackground.ToString()}");
+            //缃戠粶鐘舵�佸彉鍖� 閲嶇疆缃戝叧鐘舵�侀噸鏂版悳绱�
+            Control.Ins.GatewayOnline = false;
+
+            if (internetStatus == 0)//娌℃湁缃戠粶杩炴帴 0
+            {
+                //Control.Ins.GatewayOnline = false;
+                Control.Ins.IsRemote = false;
+                MainPage.InternetStatus = 0;
+            }
+            else if (internetStatus == 1)//3,4G鐨勭綉缁滆繛鎺� 1
+            {
+                MainPage.InternetStatus = 1;
+                Control.Ins.SearchLoaclGateway();
+                
+            }
+            else if (internetStatus == 2)//WiFi缃戠粶
+            {
+                MainPage.InternetStatus = 2;
+                Control.Ins.SearchLoaclGateway();
+            }
+        }
         #endregion
     }
 }

--
Gitblit v1.8.0