From 3a26f6025130dcaae4aa82ea19b16ad902450eb8 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期四, 28 十一月 2019 11:43:47 +0800 Subject: [PATCH] 合并全部代码完成 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs | 48 ++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 44 insertions(+), 4 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs index b8058f2..d78f64a 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs @@ -31,25 +31,48 @@ } /// <summary> - /// 褰撳墠wifi鐨凷SID,涔熷彨Wifi鐨勫悕瀛� + /// 褰撳墠wifi鐨凷SID,涔熷彨Wifi鐨勫悕瀛�(鍙栦笉鍒版椂,浼氳繑鍥瀗ull) /// </summary> public string SSID { get { - string ssiD = Shared.WiimuUPnP.SSID; +#if iOS + return string.Empty; +#endif +#if Android + string ssiD = null; + HdlThreadLogic.Current.RunThread(() => + { + Shared.Net.NetWiFi.GetWIFISSID((strId) => + { + ssiD = strId; + }); + }); + int count = 0; + while (ssiD == null) + { + System.Threading.Thread.Sleep(50); + count++; + if (count == 60) + { + //3绉掕秴鏃� + return null; + } + } if (string.IsNullOrEmpty(ssiD) == false && ssiD.StartsWith("\"") && ssiD.EndsWith("\"")) { ssiD = ssiD.Substring(1, ssiD.Length - 2); } return ssiD; +#endif } } #if Android /// <summary> /// 瀹氫箟鍏ㄥ眬鍙橀噺 /// </summary> - private Com.Hdl.Hdlelianzigbee.ElianNative hdlWiFi = null; + private Com.Mediatek.Elian.ElianNative hdlWiFi = null; #endif #endregion @@ -68,8 +91,9 @@ { if (hdlWiFi == null) { + Com.Mediatek.Elian.ElianNative.LoadLib(); //鍒濆鍖朩i-Fi閰嶇綉 - this.hdlWiFi = new Com.Hdl.Hdlelianzigbee.ElianNative(); + this.hdlWiFi = new Com.Mediatek.Elian.ElianNative(); hdlWiFi.InitSmartConnection(null, 1, 1); } //寮�濮媁i-Fi閰嶇綉 @@ -116,6 +140,22 @@ } #endif + /// <summary> + /// 鎵撳紑鎵嬫満wifi璁剧疆鐣岄潰 + /// </summary> + public void OpenAppWifiSettion() + { + if (Application.DeviceType == Shared.Device.Android) + { + ///鎵撳紑WI-IF鐣岄潰 + CommonClass.OpenAction("android.settings.WIFI_SETTINGS"); + } + else + { + CommonClass.OpenAction("App-Prefs:root=WIFI"); + } + } + #endregion } } -- Gitblit v1.8.0