From 59d9f0ad6dc40b079fa1f8f514698429ead04a75 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期一, 17 七月 2023 13:28:22 +0800 Subject: [PATCH] Merge branch 'Dev-Branch' into Dev-Wxr-1.8.1 --- HDL_ON/DAL/DriverLayer/UdpSocket.cs | 3 HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs | 2 HDL-ON_iOS/AppDelegate.cs | 2 HDL_ON/DAL/Mqtt/MqttClient.cs | 7 +- HDL_ON/Entity/FunctionList.cs | 4 HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs | 30 +++++----- HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs | 10 ++ HDL-ON_Android/SplashActivity.cs | 20 ++++-- HDL-ON_iOS/Info.plist | 4 HDL-ON_Android/Other/HDLONUtils.cs | 12 ++-- HDL_ON/DAL/DriverLayer/Packet.cs | 3 HDL_ON/DAL/DriverLayer/Control.cs | 22 ++++++ HDL_ON/UI/MainPage.cs | 2 HDL-ON_Android/Application.cs | 5 - 14 files changed, 76 insertions(+), 50 deletions(-) diff --git a/HDL-ON_Android/Application.cs b/HDL-ON_Android/Application.cs index 1888200..105a0fe 100644 --- a/HDL-ON_Android/Application.cs +++ b/HDL-ON_Android/Application.cs @@ -125,7 +125,6 @@ multicast.Release(); //杩涘叆鍚庡彴 UserInfo.Current.unlockTime = DateTime.Now; - } } @@ -153,7 +152,7 @@ /// </summary> void BusSocketStop() { - //IsEnterBackground = true; + CloseTime = DateTime.Now; MainPage.IsEnterBackground = true; //杩涘叆鍚庡彴mqtt姝e湪杩炴帴閲嶇疆鐘舵�� @@ -167,8 +166,6 @@ /// </summary> void BusSocketStart() { - //IsEnterBackground = false; - if (CloseTime.AddSeconds(10) < DateTime.Now) { //鍚庡彴瓒呰繃10s灏辨柇寮�MQTT閲嶈繛 diff --git a/HDL-ON_Android/Other/HDLONUtils.cs b/HDL-ON_Android/Other/HDLONUtils.cs index 5f184b9..570b56c 100644 --- a/HDL-ON_Android/Other/HDLONUtils.cs +++ b/HDL-ON_Android/Other/HDLONUtils.cs @@ -32,12 +32,12 @@ } } - public static void StartSplashActivity() - { - Intent intent = new Intent(Shared.Application.Activity, typeof(SplashActivity)); - Shared.Application.Activity.StartActivity(intent); - Shared.Application.Activity.Finish(); - } + //public static void StartSplashActivity() + //{ + // Intent intent = new Intent(Shared.Application.Activity, typeof(SplashActivity)); + // Shared.Application.Activity.StartActivity(intent); + // Shared.Application.Activity.Finish(); + //} } } diff --git a/HDL-ON_Android/SplashActivity.cs b/HDL-ON_Android/SplashActivity.cs index afcffdf..4fccb42 100644 --- a/HDL-ON_Android/SplashActivity.cs +++ b/HDL-ON_Android/SplashActivity.cs @@ -24,10 +24,6 @@ [IntentFilter(new string[] { "com.hdl.onpro.SplashActivity", Intent.ActionView })] public class SplashActivity : Activity { - - - - protected override void OnActivityResult(int requestCode, Result resultVal, Intent data) { if (requestCode == 99) @@ -54,12 +50,20 @@ { base.OnCreate(savedInstanceState); + if(Shared.Application.Activity != null && Shared.Application.Activity.GetType() == typeof(BaseActivity)) + { + Finish(); + return; + } + //Intent i = new Intent(this, typeof(BaseActivity));//Intent intent=new Intent( 璧峰缁勪欢瀵硅薄 , 鐩爣 Service.class); //StartActivityForResult(i, 1); //OverridePendingTransition(0, 0); //initAll(); if (HDL_ON.OnAppConfig.Instance.FirstRunApp || !HDL_ON.OnAppConfig.Instance.isAgreePrivacyPolicy) { + //OnAppConfig.Instance.FirstRunApp = false; + //OnAppConfig.Instance.SaveConfig(); Language.CurrentLanguage = "Chinese"; Locale locale1 = Locale.Default; var localeList = Resources.Configuration.Locale; @@ -185,7 +189,7 @@ } }; - BaseActivity.OnCreateActoin += (activity, application) => + BaseActivity.OnCreateActoin = (activity, application) => { Language.CurrentLanguage = "Chinese"; Locale locale1 = Locale.Default; @@ -234,7 +238,7 @@ HDLCommon.Current.UpdateInternetStatus((int)internetStatus, MainPage.IsEnterBackground); }; }; - BaseActivity.RefreshUIAction += (activity) => + BaseActivity.RefreshUIAction = (activity) => { Language.CurrentLanguage = "Chinese"; Locale locale1 = Locale.Default; @@ -263,11 +267,11 @@ MainPage.Show(); checkSomeInfo(); }; - BaseActivity.OnResumeAction += (activity) => + BaseActivity.OnResumeAction = (activity) => { checkSomeInfo(); }; - BaseActivity.OnDestroyAction += (activity) => + BaseActivity.OnDestroyAction = (activity) => { Console.WriteLine("OnDestroyAction"); //BusSocket.Stop(); diff --git a/HDL-ON_iOS/AppDelegate.cs b/HDL-ON_iOS/AppDelegate.cs index 57666c1..4c89487 100644 --- a/HDL-ON_iOS/AppDelegate.cs +++ b/HDL-ON_iOS/AppDelegate.cs @@ -484,7 +484,7 @@ //杩涘叆鍚庡彴mqtt姝e湪杩炴帴閲嶇疆鐘舵�� HDL_ON.DAL.Mqtt.MqttClient.RemoteMqttIsConnecting = false; HDL_ON.DriverLayer.UdpSocket._BusSocket.Stop(); - + } diff --git a/HDL-ON_iOS/Info.plist b/HDL-ON_iOS/Info.plist index d45f503..3edb6dd 100644 --- a/HDL-ON_iOS/Info.plist +++ b/HDL-ON_iOS/Info.plist @@ -11,7 +11,7 @@ <key>CFBundleName</key> <string>On Pro</string> <key>CFBundleShortVersionString</key> - <string>1.8.0</string> + <string>1.8.1</string> <key>CFBundleURLTypes</key> <array> <dict> @@ -36,7 +36,7 @@ </dict> </array> <key>CFBundleVersion</key> - <string>1.8.0</string> + <string>1.8.1</string> <key>LSApplicationQueriesSchemes</key> <array> <string>weixinULAPI</string> diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs index c89474a..0df687c 100644 --- a/HDL_ON/DAL/DriverLayer/Control.cs +++ b/HDL_ON/DAL/DriverLayer/Control.cs @@ -1,6 +1,7 @@ 锘縰sing System; using System.Collections.Generic; using System.Text; +using HDL_ON.DAL.Mqtt; using HDL_ON.DAL.Server; using HDL_ON.Entity; using HDL_ON.UI; @@ -124,6 +125,10 @@ HomePage.LoadEvent_CheckLinkStatus(); } } + else + { + MainPage.Log($"鐘舵�佷竴鑷达紝涓嶆洿鏂版暟鎹�(鏈湴)"); + } } } bool _GatewayOnline_Cloud = false; @@ -169,7 +174,16 @@ MainPage.Log($"缃戝叧浜戠鍦ㄧ嚎锛屽埛鏂拌澶囩姸鎬�"); new System.Threading.Thread(() => { - System.Threading.Thread.Sleep(1000); + int count = 20; + while (true) + { + System.Threading.Thread.Sleep(500); + if (MqttClient.isSubscribeSuccess || count<1) + { + break; + } + count--; + } FunctionList.List.ReadAllFunctionStatus(); }) { IsBackground = true, Priority = System.Threading.ThreadPriority.AboveNormal }.Start(); @@ -179,6 +193,10 @@ //淇敼涓婚〉杩炴帴鐘舵�� HomePage.LoadEvent_CheckLinkStatus(); } + } + else + { + MainPage.Log($"鐘舵�佷竴鑷达紝涓嶆洿鏂版暟鎹�(浜戠)"); } }catch(Exception ex) { @@ -277,6 +295,7 @@ } else if (MainPage.InternetStatus == 2) { + DAL.Mqtt.MqttClient.InitState(); OpenUdp(DB_ResidenceData.Instance.GatewayType == 0 ? 6000 : 8585); //閲嶇疆鎼滅储缃戝叧鏍囧織 IsSearchLocalGatewaySuccessful = false; @@ -303,7 +322,6 @@ System.Threading.Thread.Sleep(500); } - DAL.Mqtt.MqttClient.InitState(); }) { IsBackground = true }.Start(); } diff --git a/HDL_ON/DAL/DriverLayer/Packet.cs b/HDL_ON/DAL/DriverLayer/Packet.cs index 258939e..0e8f8dc 100644 --- a/HDL_ON/DAL/DriverLayer/Packet.cs +++ b/HDL_ON/DAL/DriverLayer/Packet.cs @@ -14,8 +14,9 @@ { /// <summary> /// 缂撳啿鍖哄ぇ灏� + /// Link鍗忚鐜板湪涓�涓寘鐨勬暟鎹瘮杈冨ぇ锛岀紦鍐插尯澶皬瀛樹笉瀹屽叏閮ㄦ暟鎹� 2023-07-14 16:03:56 wxr /// </summary> - public const int Size = 1024 + 200; + public const int Size = 1024 * 10; /// <summary> /// 鎺ユ敹鍒扮殑鏁版嵁 diff --git a/HDL_ON/DAL/DriverLayer/UdpSocket.cs b/HDL_ON/DAL/DriverLayer/UdpSocket.cs index f454bf1..36637f9 100644 --- a/HDL_ON/DAL/DriverLayer/UdpSocket.cs +++ b/HDL_ON/DAL/DriverLayer/UdpSocket.cs @@ -77,7 +77,7 @@ } catch { } busSocket = null; - MainPage.Log("Socket鍏抽棴"); + MainPage.Log("Socket鍏抽棴"); } /// <summary> @@ -140,7 +140,6 @@ //mqtt杩炴帴鏁版嵁璇诲彇 A鍗忚缃戠粶璁惧淇℃伅璇诲彇鍥炲 澶勭悊 if (((IPEndPoint)packet.RemoteEndPoint).Port == 8585) { - MainPage.Log($"灞�鍩熺綉udp淇℃伅"); Control.Ins.ConvertReceiveData(bytes, ((IPEndPoint)packet.RemoteEndPoint).Address.ToString()); } else if (((IPEndPoint)packet.RemoteEndPoint).Port == 6000)//澶勭悊bus 6000绔彛鐨勬暟鎹� diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs index b6be181..bf5dd53 100644 --- a/HDL_ON/DAL/Mqtt/MqttClient.cs +++ b/HDL_ON/DAL/Mqtt/MqttClient.cs @@ -110,6 +110,7 @@ { MqttInfoConfig.Current.IfGetMqttInfoSuccess = false; } + Control.Ins.GatewayOnline_Cloud = Control.Ins.GatewayOnline_Local = false; await DisConnectRemoteMqttClient(s); } @@ -159,7 +160,7 @@ StartCloudMqtt(); } - static bool isSubscribeSuccess; + public static bool isSubscribeSuccess; /// <summary> /// 璁㈤槄涓婚 /// </summary> @@ -261,8 +262,8 @@ #endregion - Utlis.WriteLine("寮�濮嬭闃咃紒"); - var result = await RemoteMqttClient.SubscribeAsync(new MqttTopicFilter[] { + Utlis.WriteLine("寮�濮嬭闃咃紒"); + var result = await RemoteMqttClient.SubscribeAsync(new MqttTopicFilter[] { pirStatus,pirStudy, appDeviceRefresh,appHomeRefresh,appRoomRefresh,residenceChange, topicFilterPush2, topicAlinkStatus ,mqttkeyChange, diff --git a/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs b/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs index 620bd9d..c5bd54b 100644 --- a/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs +++ b/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs @@ -338,7 +338,7 @@ #region 鈻� -- 鏂版帴鍚拰寮�閿佹帴鍙______________________________ /// <summary> - /// 寮�閿� + /// 鍙瀵硅寮�閿� /// </summary> public void HDLUnlockAction() { diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs index 2b3bb70..f6aad52 100644 --- a/HDL_ON/Entity/FunctionList.cs +++ b/HDL_ON/Entity/FunctionList.cs @@ -586,14 +586,14 @@ { if (lockReadFunctionStatus) { - MainPage.Log($"澶氭杩涘叆--杩斿洖"); + MainPage.Log($"澶氭杩涘叆--杩斿洖1"); return; } new Thread(() => { if (lockReadFunctionStatus) { - MainPage.Log($"澶氭杩涘叆--杩斿洖"); + MainPage.Log($"澶氭杩涘叆--杩斿洖2"); return; } MainPage.Log($"杩涘叆--璇诲彇"); diff --git a/HDL_ON/UI/MainPage.cs b/HDL_ON/UI/MainPage.cs index a237a77..91c3948 100644 --- a/HDL_ON/UI/MainPage.cs +++ b/HDL_ON/UI/MainPage.cs @@ -26,7 +26,7 @@ /// <summary> /// 鐗堟湰鍙� /// </summary> - public static string VersionString = "1.8.0"; + public static string VersionString = "1.8.1"; ///// <summary> ///// 瀹㈡埛绔被鍨� ///// </summary> diff --git a/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs b/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs index 066db11..db8615e 100644 --- a/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs +++ b/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs @@ -134,25 +134,25 @@ } } - LoadMothed_EnableResetButton(); }; - //etVerificationCode.TextChangeEventHandler = (sender, e) => { + etVerificationCode.TextChangeEventHandler = (sender, e) => + { - // if (etVerificationCode.Text.Length > 1) - // { - // LoadMothed_EnableResetButton(); - // } - //}; + if (etVerificationCode.Text.Length > 1) + { + LoadMothed_EnableResetButton(); + } + }; - //Action<View, string> textChangeEventHandler = (view, textStr) => - //{ - // LoadMothed_EnableResetButton(); - //}; - ////etAccount.TextChangeEventHandler += textChangeEventHandler; - //etPassword.TextChangeEventHandler += textChangeEventHandler; - //etRepeatPassword.TextChangeEventHandler += textChangeEventHandler; - //etVerificationCode.TextChangeEventHandler += textChangeEventHandler; + Action<View, string> textChangeEventHandler = (view, textStr) => + { + LoadMothed_EnableResetButton(); + }; + //etAccount.TextChangeEventHandler += textChangeEventHandler; + etPassword.TextChangeEventHandler += textChangeEventHandler; + etRepeatPassword.TextChangeEventHandler += textChangeEventHandler; + etVerificationCode.TextChangeEventHandler += textChangeEventHandler; } /// <summary> diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs index 564dd00..fbadb7f 100644 --- a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs +++ b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs @@ -269,9 +269,15 @@ { Application.RunOnMainThread(() => { - if (bodyView != null) + try { - bodyView.CheckLinkStatus(); + if (bodyView != null) + { + bodyView.CheckLinkStatus(); + } + }catch(Exception ex) + { + MainPage.Log($"LoadEvent_CheckLinkStatus : {ex.Message}"); } }); } -- Gitblit v1.8.0