From 29a6e6d747d13fc285c8dd86649417f60613388f Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期一, 25 十一月 2019 13:11:31 +0800 Subject: [PATCH] 20191125 --- HDL-ON_iOS/Resources/Phone/LoginIcon/3.png | 0 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/40.png | 0 HDL-ON_iOS/Resources/Phone/LoginIcon/ShowPasswordIcon.png | 0 HDL-ON_iOS/HDL-ON_iOS.csproj | 191 asset/logo/29·29.png | 0 HDL_ON/Entity/ResponseEntity/DeviceInfoRes.cs | 28 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/152.png | 0 asset/logo/20·20.png | 0 HDL_ON/HDL_ON.projitems | 80 HDL_ON/UI/UI1-Login/LoginBaseView.cs | 13 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/640X960.png | 0 HDL_ON/DAL/Net/MqttCommon.cs | 574 ++ HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/60·60@3x.png | 0 HDL_ON/HDL/Operation/DeviceModular/CommonModular.cs | 52 asset/logo/60·60@3x.png | 0 HDL_ON/UI/UI0-Public/PublicAssmebly.cs | 85 HDL-ON_iOS/Resources/Phone/Public/Logo.png | 0 HDL_ON/DAL/Server/HttpServerRequestBase.cs | 64 HDL_ON/HDL/Operation/Target.cs | 150 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1536X2008.png | 0 HDL-ON_iOS/Resources/LaunchScreen.xib | 43 HDL_ON/UI/UI1-Login/ResetPassword_VerificationCode.cs | 22 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/180.png | 0 HDL-ON_iOS/Resources/Phone/LoginIcon/VerificationCodeIcon.png | 0 HDL_ON/DAL/FileUtils.cs | 593 ++ HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/40·40@2x-1.png | 0 HDL_ON/Entity/ResponseEntity/ResponsePack.cs | 27 HDL-ON_iOS/Entitlements.plist | 6 HDL-ON_iOS/Resources/Phone/LoginIcon/PasswordIcon.png | 0 HDL_ON/UI/UI1-Login/LoginPageBLL.cs | 408 + HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/80·80@2x.png | 0 HDL_ON/Entity/ResponseEntity/SubAccountRes.cs | 19 CommonLib/dll/Shared.IOS.TBL.dll | 0 CommonLib/android/Xamarin.Android.Arch.Lifecycle.Runtime.dll | 0 HDL-ON_iOS/Resources/Phone/Public/BackIcon.png | 0 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/768X1004.png | 0 HDL_ON/Entity/ResponseEntity/SceneObjectiveRes.cs | 17 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/750X1334.png | 0 HDL-ON_iOS/Resources/Phone/LoginIcon/1.png | 0 HDL-ON_iOS/Resources/Phone/.DS_Store | 0 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1125X2436.png | 0 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json | 227 HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs | 15 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1242x2208.png | 0 HDL-ON_iOS/ViewController.cs | 86 CommonLib/android/Xamarin.Android.Support.Fragment.dll | 0 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/2048X1536.png | 0 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/640X1136.png | 0 HDL-ON_iOS/Resources/Phone/LoginIcon/HidePasswordIcon.png | 0 HDL-ON_iOS/.DS_Store | 0 HDL-ON_iOS/Resources/Phone/Public/Logo-bg.png | 0 HDL_ON/Entity/ResponseEntity/SendJson.cs | 555 ++ HDL_ON/Entity/ResponseEntity/RoomInfoRes.cs | 15 HDL-ON_iOS/AppDelegate.cs | 265 + HDL-ON_iOS/ViewController.designer.cs | 18 HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs | 388 + HDL-ON_iOS/Resources/Language.ini | 40 HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/40·40@2x.png | 0 HDL_ON/DAL/Net/HttpListener.cs | 224 CommonLib/android/Xamarin.Android.Support.Core.UI.dll | 0 HDL_ON/HDL/Operation/DeviceModular/PanelModular.cs | 11 HDL_ON/UI/CSS/CSS.cs | 118 HDL_ON/UI/UI1-Login/RegisterPageBLL.cs | 387 + HDL_ON/DAL/Net/MyWebClient.cs | 38 HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/120·120@2x.png | 0 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/Contents.json | 220 asset/logo/87·87@3x.png | 0 CommonLib/dll/ICSharpCode.SharpZipLib.dll | 0 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/768X1024.png | 0 HDL_ON/HDL/Operation/BusSocket.cs | 169 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/2048X1496.png | 0 HDL_APP_Project.sln | 31 asset/logo/512·512.png | 0 HDL-ON_iOS/ViewControllerBase.cs | 138 HDL-ON_iOS/iTunesArtwork | 0 HDL-ON_iOS/iTunesArtwork@2x | 0 HDL_ON/Entity/ResponseEntity/SceneRes.cs | 13 HDL_ON/UI/UI1-Login/RegisterPage.cs | 498 + HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/2048X2732 .png | 0 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/60.png | 0 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/4096X4096.png | 0 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/1024.png | 0 HDL_ON/DAL/Net/CommonPage.cs | 2803 ++++++++++ HDL_ON/DAL/Server/HttpServerRequest.cs | 74 CommonLib/android/Xamarin.Android.Support.Annotations.dll | 0 CommonLib/dll/Shared.Droid.TouchID.dll | 0 HDL_ON/Entity/ResponseEntity/BackupInfoRes.cs | 12 asset/logo/80·80@2x.png | 0 asset/logo/120·120@2x.png | 0 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1024X768.png | 0 HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/29·29.png | 0 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/58.png | 0 HDL-ON_iOS/LaunchScreen.storyboard | 29 HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs | 503 + HDL-ON_iOS/Properties/AssemblyInfo.cs | 36 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1024x500.png | 0 CommonLib/android/Xamarin.Android.Support.Core.Utils.dll | 0 HDL_ON/Entity/ResponseEntity/ResultStatus.cs | 43 CommonLib/dll/Shared.IOS.dll | 0 HDL-ON_iOS/Info.plist | 109 HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/Contents.json | 244 HDL_ON/Entity/ResponseEntity/SensorHistory.cs | 84 HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/180·180@3x.png | 0 HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/58·58@2x.png | 0 HDL_ON/HDL/Operation/UserInfo.cs | 88 HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/20·20.png | 0 HDL-ON_iOS/Resources/Phone/LoginIcon/2.png | 0 HDL_ON/Entity/ResponseEntity/Timer.cs | 114 HDL_ON/UI/UI1-Login/LoginPage.cs | 427 + HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/76.png | 0 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/120.png | 0 CommonLib/android/Xamarin.Android.Arch.Lifecycle.Common.dll | 0 DLL/Shared.IOS.TCL.dll | 0 HDL-ON_iOS/Reachability.cs | 151 CommonLib/dll/Shared.Droid.HDLWidget.dll | 0 HDL-ON_iOS/Resources/Phone/LoginIcon/WechatIcon.png | 0 CommonLib/dll/videoBind.dll | 0 HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/58·58@2x-1.png | 0 HDL_ON/HDL/Operation/UserConfig.cs | 217 HDL_ON/HDL/Operation/MyEnum.cs | 3462 +++++++++++++ asset/logo/58·58@2x.png | 0 CommonLib/dll/video.dll | 0 HDL_ON/Entity/ResponseEntity/FolderRes.cs | 14 HDL_ON/HDL/Operation/Device/Common.cs | 104 HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/1024·1024@2x.png | 0 CommonLib/android/Xamarin.Android.Support.v7.AppCompat.dll | 0 CommonLib/android/Xamarin.Android.Support.v4.dll | 0 HDL_ON/Entity/ResponseEntity/RoomObjectiveRes.cs | 17 HDL-ON_iOS/Resources/Phone/LoginIcon/QQIcon.png | 0 HDL_ON/HDL/Operation/RemoteInfo.cs | 56 HDL-ON_iOS/Resources/Phone/LoginIcon/SearchIcon.png | 0 HDL_ON/HDL/Operation/Packet.cs | 103 HDL_ON/UI/UI2-4-PersonalCenter/PersonalCenterPage.cs | 54 HDL_ON/HDL/Operation/CRC.cs | 95 HDL_ON/Entity/ResponseEntity/GatewayRes.cs | 34 HDL-ON_iOS/Main.storyboard | 27 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/320X480.png | 0 HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/87·87@3x.png | 0 CommonLib/android/Xamarin.Android.Support.Vector.Drawable.dll | 0 DLL/Shared.IOS.TBL.dll | 0 HDL_ON/Entity/ResponseEntity/MessageInfoRes.cs | 33 asset/logo/180·180@3x.png | 0 HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/120·120@3x.png | 0 HDL-ON_iOS/Info的副本.plist | 63 HDL_ON/HDL/Operation/Control.cs | 701 ++ HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/2208X1242.png | 0 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/167.png | 0 CommonLib/dll/Shared.Droid.dll | 0 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/29.png | 0 asset/logo/40·40@2x.png | 0 CommonLib/android/Xamarin.Android.Support.Compat.dll | 0 HDL_ON/Entity/ResponseEntity/ResultSubaccount.cs | 33 CommonLib/android/Xamarin.Android.Arch.Core.Common.dll | 0 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/20.png | 0 asset/logo/1024·1024@2x.png | 0 CommonLib/android/Xamarin.Android.Support.Animated.Vector.Drawable.dll | 0 HDL_ON/UI/MainPage.cs | 75 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1024X748.png | 0 HDL-ON_iOS/Resources/Phone/LoginIcon/AccountIcon.png | 0 HDL_ON/UI/UI0-Public/PublicMothed.cs | 16 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/750X1134.png | 0 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/80.png | 0 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1536X2048.png | 0 asset/logo/120·120@3x.png | 0 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/2436X1125.png | 0 HDL-ON_iOS/Main.cs | 15 HDL_ON/Entity/Enumerative/EmptyHttpReques.cs | 41 CommonLib/dll/Shared.IOS.TCL.dll | 0 CommonLib/dll/Xamarin.Essentials.dll | 0 DLL/Shared.IOS.dll | 0 HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/87.png | 0 HDL_ON/Common/R.cs | 50 HDL_ON/HDL_ON.shproj | 11 CommonLib/android/Xamarin.Android.Support.Media.Compat.dll | 0 HDL-ON_iOS/Resources/Phone/LoginIcon/EmailIcon.png | 0 HDL_ON/Entity/ResponseEntity/UserLoginRes.cs | 27 176 files changed, 15,793 insertions(+), 0 deletions(-) diff --git a/CommonLib/android/Xamarin.Android.Arch.Core.Common.dll b/CommonLib/android/Xamarin.Android.Arch.Core.Common.dll new file mode 100755 index 0000000..069193a --- /dev/null +++ b/CommonLib/android/Xamarin.Android.Arch.Core.Common.dll Binary files differ diff --git a/CommonLib/android/Xamarin.Android.Arch.Lifecycle.Common.dll b/CommonLib/android/Xamarin.Android.Arch.Lifecycle.Common.dll new file mode 100755 index 0000000..951a579 --- /dev/null +++ b/CommonLib/android/Xamarin.Android.Arch.Lifecycle.Common.dll Binary files differ diff --git a/CommonLib/android/Xamarin.Android.Arch.Lifecycle.Runtime.dll b/CommonLib/android/Xamarin.Android.Arch.Lifecycle.Runtime.dll new file mode 100755 index 0000000..d9c2b94 --- /dev/null +++ b/CommonLib/android/Xamarin.Android.Arch.Lifecycle.Runtime.dll Binary files differ diff --git a/CommonLib/android/Xamarin.Android.Support.Animated.Vector.Drawable.dll b/CommonLib/android/Xamarin.Android.Support.Animated.Vector.Drawable.dll new file mode 100755 index 0000000..094b9fd --- /dev/null +++ b/CommonLib/android/Xamarin.Android.Support.Animated.Vector.Drawable.dll Binary files differ diff --git a/CommonLib/android/Xamarin.Android.Support.Annotations.dll b/CommonLib/android/Xamarin.Android.Support.Annotations.dll new file mode 100755 index 0000000..f320c42 --- /dev/null +++ b/CommonLib/android/Xamarin.Android.Support.Annotations.dll Binary files differ diff --git a/CommonLib/android/Xamarin.Android.Support.Compat.dll b/CommonLib/android/Xamarin.Android.Support.Compat.dll new file mode 100755 index 0000000..a2138ea --- /dev/null +++ b/CommonLib/android/Xamarin.Android.Support.Compat.dll Binary files differ diff --git a/CommonLib/android/Xamarin.Android.Support.Core.UI.dll b/CommonLib/android/Xamarin.Android.Support.Core.UI.dll new file mode 100755 index 0000000..8cfa0ed --- /dev/null +++ b/CommonLib/android/Xamarin.Android.Support.Core.UI.dll Binary files differ diff --git a/CommonLib/android/Xamarin.Android.Support.Core.Utils.dll b/CommonLib/android/Xamarin.Android.Support.Core.Utils.dll new file mode 100755 index 0000000..abd396b --- /dev/null +++ b/CommonLib/android/Xamarin.Android.Support.Core.Utils.dll Binary files differ diff --git a/CommonLib/android/Xamarin.Android.Support.Fragment.dll b/CommonLib/android/Xamarin.Android.Support.Fragment.dll new file mode 100755 index 0000000..afe2d75 --- /dev/null +++ b/CommonLib/android/Xamarin.Android.Support.Fragment.dll Binary files differ diff --git a/CommonLib/android/Xamarin.Android.Support.Media.Compat.dll b/CommonLib/android/Xamarin.Android.Support.Media.Compat.dll new file mode 100755 index 0000000..1262bd6 --- /dev/null +++ b/CommonLib/android/Xamarin.Android.Support.Media.Compat.dll Binary files differ diff --git a/CommonLib/android/Xamarin.Android.Support.Vector.Drawable.dll b/CommonLib/android/Xamarin.Android.Support.Vector.Drawable.dll new file mode 100755 index 0000000..63ef6cc --- /dev/null +++ b/CommonLib/android/Xamarin.Android.Support.Vector.Drawable.dll Binary files differ diff --git a/CommonLib/android/Xamarin.Android.Support.v4.dll b/CommonLib/android/Xamarin.Android.Support.v4.dll new file mode 100755 index 0000000..dfb0593 --- /dev/null +++ b/CommonLib/android/Xamarin.Android.Support.v4.dll Binary files differ diff --git a/CommonLib/android/Xamarin.Android.Support.v7.AppCompat.dll b/CommonLib/android/Xamarin.Android.Support.v7.AppCompat.dll new file mode 100755 index 0000000..6becc95 --- /dev/null +++ b/CommonLib/android/Xamarin.Android.Support.v7.AppCompat.dll Binary files differ diff --git a/CommonLib/dll/ICSharpCode.SharpZipLib.dll b/CommonLib/dll/ICSharpCode.SharpZipLib.dll new file mode 100644 index 0000000..60ef0c9 --- /dev/null +++ b/CommonLib/dll/ICSharpCode.SharpZipLib.dll Binary files differ diff --git a/CommonLib/dll/Shared.Droid.HDLWidget.dll b/CommonLib/dll/Shared.Droid.HDLWidget.dll new file mode 100644 index 0000000..2d459cd --- /dev/null +++ b/CommonLib/dll/Shared.Droid.HDLWidget.dll Binary files differ diff --git a/CommonLib/dll/Shared.Droid.TouchID.dll b/CommonLib/dll/Shared.Droid.TouchID.dll new file mode 100644 index 0000000..484bf27 --- /dev/null +++ b/CommonLib/dll/Shared.Droid.TouchID.dll Binary files differ diff --git a/CommonLib/dll/Shared.Droid.dll b/CommonLib/dll/Shared.Droid.dll new file mode 100644 index 0000000..b8e0520 --- /dev/null +++ b/CommonLib/dll/Shared.Droid.dll Binary files differ diff --git a/CommonLib/dll/Shared.IOS.TBL.dll b/CommonLib/dll/Shared.IOS.TBL.dll new file mode 100644 index 0000000..cd3a196 --- /dev/null +++ b/CommonLib/dll/Shared.IOS.TBL.dll Binary files differ diff --git a/CommonLib/dll/Shared.IOS.TCL.dll b/CommonLib/dll/Shared.IOS.TCL.dll new file mode 100644 index 0000000..7cf4860 --- /dev/null +++ b/CommonLib/dll/Shared.IOS.TCL.dll Binary files differ diff --git a/CommonLib/dll/Shared.IOS.dll b/CommonLib/dll/Shared.IOS.dll new file mode 100644 index 0000000..71c1fcf --- /dev/null +++ b/CommonLib/dll/Shared.IOS.dll Binary files differ diff --git a/CommonLib/dll/Xamarin.Essentials.dll b/CommonLib/dll/Xamarin.Essentials.dll new file mode 100755 index 0000000..2953d8b --- /dev/null +++ b/CommonLib/dll/Xamarin.Essentials.dll Binary files differ diff --git a/CommonLib/dll/video.dll b/CommonLib/dll/video.dll new file mode 100644 index 0000000..f1ed560 --- /dev/null +++ b/CommonLib/dll/video.dll Binary files differ diff --git a/CommonLib/dll/videoBind.dll b/CommonLib/dll/videoBind.dll new file mode 100644 index 0000000..47e37a4 --- /dev/null +++ b/CommonLib/dll/videoBind.dll Binary files differ diff --git a/DLL/Shared.IOS.TBL.dll b/DLL/Shared.IOS.TBL.dll new file mode 100644 index 0000000..cd3a196 --- /dev/null +++ b/DLL/Shared.IOS.TBL.dll Binary files differ diff --git a/DLL/Shared.IOS.TCL.dll b/DLL/Shared.IOS.TCL.dll new file mode 100644 index 0000000..7cf4860 --- /dev/null +++ b/DLL/Shared.IOS.TCL.dll Binary files differ diff --git a/DLL/Shared.IOS.dll b/DLL/Shared.IOS.dll new file mode 100644 index 0000000..71c1fcf --- /dev/null +++ b/DLL/Shared.IOS.dll Binary files differ diff --git a/HDL-ON_iOS/.DS_Store b/HDL-ON_iOS/.DS_Store new file mode 100644 index 0000000..badc119 --- /dev/null +++ b/HDL-ON_iOS/.DS_Store Binary files differ diff --git a/HDL-ON_iOS/AppDelegate.cs b/HDL-ON_iOS/AppDelegate.cs new file mode 100644 index 0000000..4663b3d --- /dev/null +++ b/HDL-ON_iOS/AppDelegate.cs @@ -0,0 +1,265 @@ +锘縰sing System; +using Foundation; +using HDL_ON; +using Shared; +using UIKit; +using UserNotifications; + +namespace SharedMethod +{ + public static class SharedMethod + { + public static UIApplication sharedApp; + public static void ChangeSkin() + { + switch (UserConfig.Instance.SkinCode) + { + case 0: + sharedApp.StatusBarStyle = UIStatusBarStyle.LightContent; + break; + case 1: + sharedApp.StatusBarStyle = UIStatusBarStyle.Default; + break; + } + } + public static PageLayout CurPageLayout = null; + public static bool IsBackground; + + //public static string CheckVersion() + //{ + + // Harpy.Harpy.SharedInstance.CheckVersion(); + + // UserConfig.Instance.IsAppStoreVersionNewer = Harpy.Harpy.SharedInstance.TestIsAppStoreVersionNewer; + // UserConfig.Instance.StoreVersion = Harpy.Harpy.SharedInstance.CurrentAppStoreVersion; + // UserConfig.Instance.SaveUserConfig(); + + // if (Shared.SimpleControl.MainPage.LoginUser.AccountString == @"464027401@qq.com") + // { + // return $"TestIsAppStoreVersionNewer : {UserConfig.Instance.IsAppStoreVersionNewer};; CurrentAppStoreVersion : {UserConfig.Instance.StoreVersion}"; + // } + // else + // { + // return ""; + // } + //} + } + +} + +namespace HDL_ON_iOS +{ + // The UIApplicationDelegate for the application. This class is responsible for launching the + // User Interface of the application, as well as listening (and optionally responding) to application events from iOS. + [Register("AppDelegate")] + public class AppDelegate : BaseApplicationDelegate + { + // class-level declarations + + public override UIWindow Window + { + get; + set; + } + + //public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) + //{ + // // Override point for customization after application launch. + // // If not required for your application you can safely delete this method + // return true; + //} + + public static void CleanApplicationIconBadgeNumber() + { + UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0; + } + + public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken) + { + + byte[] array = new byte[(ulong)deviceToken.Length]; + System.Runtime.InteropServices.Marshal.Copy(deviceToken.Bytes, array, 0, array.Length); + System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); + for (int i = 0; i < array.Length; i++) + { + stringBuilder.AppendFormat("{0:x2}", array[i]); + } + string text = stringBuilder.ToString(); + if (NSUserDefaults.StandardUserDefaults.StringForKey("PushDeviceToken") != text) + { + NSUserDefaults.StandardUserDefaults.SetString(text, "PushDeviceToken"); + } + + /// Get current device token + var DeviceToken = text; + if (!string.IsNullOrWhiteSpace(DeviceToken)) + { + DeviceToken = DeviceToken.Trim('<').Trim('>').Replace(" ", ""); + } + + // Get previous device token + var oldDeviceToken = NSUserDefaults.StandardUserDefaults.StringForKey("PushDeviceToken"); + + // Has the token changed? + if (string.IsNullOrEmpty(oldDeviceToken) || !oldDeviceToken.Equals(DeviceToken)) + { + //TODO: Put your own logic here to notify your server that the device token has changed/been created! + + // Save new device token + NSUserDefaults.StandardUserDefaults.SetString(DeviceToken, "PushDeviceToken"); + string userPhoneName = UIDevice.CurrentDevice.Name; + + UserConfig.Instance.tokenID = DeviceToken; + UserConfig.Instance.phoneName = userPhoneName; + UserConfig.Instance.SaveUserConfig(); + } + if (UserConfig.Instance.tokenID != DeviceToken) + { + string userPhoneName = UIDevice.CurrentDevice.Name; + UserConfig.Instance.tokenID = DeviceToken; + UserConfig.Instance.phoneName = userPhoneName; + UserConfig.Instance.SaveUserConfig(); + } + } + + public override void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, Action<UIBackgroundFetchResult> completionHandler) + { + Console.WriteLine("DidReceiveRemoteNotification:" + application.ApplicationState.ToString()); + + UserConfig.Instance.SaveUserConfig(); + + //璇诲彇鎺ㄩ�佷俊鎭� + UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0; + } + + public override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo) + { + if (application.ApplicationState == UIApplicationState.Active) + { + Console.WriteLine("ReceivedRemoteNotification1"); + } + else if (application.ApplicationState == UIApplicationState.Background) + { + Console.WriteLine("ReceivedRemoteNotification2"); + } + else if (application.ApplicationState == UIApplicationState.Inactive) + { + Console.WriteLine("ReceivedRemoteNotification3"); + } + + //string extKey1 = "PushResType"; + //NSString extValue1 = userInfo.ValueForKey ((NSString)extKey1); + + } + + public override void OnResignActivation(UIApplication application) + { + Console.WriteLine("OnResignActivation"); + BusSocket.Stop(); + } + + public override void DidEnterBackground(UIApplication application) + { + SharedMethod.SharedMethod.IsBackground = true; + Console.WriteLine("DidEnterBackground"); + } + + public override void WillEnterForeground(UIApplication application) + { + SharedMethod.SharedMethod.IsBackground = false; + Console.WriteLine("WillEnterForeground"); + UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0; + } + + public override void WillTerminate(UIApplication application) + { + Console.WriteLine("WillTerminate"); + } + + public override void OnActivated(UIApplication application) + { + Console.WriteLine("OnActivated"); + base.OnActivated(application); + } + + public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) + { + //AppCenter.Start("b95f7814-49fb-4345-bac5-98e70d098252", typeof(Analytics), typeof(Crashes)); + Console.WriteLine("FinishedLaunching"); + base.FinishedLaunching(application, launchOptions); + + SharedMethod.SharedMethod.sharedApp = application; + + //NSString* nsCount = [[NSLocale currentLocale] objectForKey: NSLocaleCountryCode]; + string nsCount = NSLocale.CurrentLocale.CountryCode; + if (nsCount != UserConfig.Instance.CountryCode) + { + UserConfig.Instance.CountryCode = nsCount; + UserConfig.Instance.SaveUserConfig(); + } + application.IdleTimerDisabled = true; + application.RegisterForRemoteNotificationTypes(UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound); + + Window = new UIWindow(UIScreen.MainScreen.Bounds); + var Root = new UINavigationController(new ViewController()) { NavigationBarHidden = true }; + Window.RootViewController = Root; + Window.MakeKeyAndVisible(); + //window.AccessibilityNavigationStyle = UIAccessibilityNavigationStyle.Automatic; + // check for a notification + if (launchOptions != null) + { + // check for a remote notification + if (launchOptions.ContainsKey(UIApplication.LaunchOptionsRemoteNotificationKey)) + { + + NSDictionary remoteNotification = launchOptions[UIApplication.LaunchOptionsRemoteNotificationKey] as NSDictionary; + if (remoteNotification != null) + { + //UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0; + } + } + } + if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0)) + { + var notificationSettings = UIUserNotificationSettings.GetSettingsForTypes(UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, null); + application.RegisterUserNotificationSettings(notificationSettings); + application.RegisterForRemoteNotifications(); + } + else + { + //==== register for remote notifications and get the device token + // set what kind of notification types we want + UIRemoteNotificationType notificationTypes = UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge; + // register for remote notifications + UIApplication.SharedApplication.RegisterForRemoteNotificationTypes(notificationTypes); + } + + if (UIApplication.SharedApplication.ApplicationIconBadgeNumber > 0) + { + //RemoteInfo.Current.ReadMsgList(true); + } + //if (UserConfig.Instance.SkinCode == 0) + //{ + // application.StatusBarStyle = UIStatusBarStyle.LightContent; + // Shared.Application.Skin = UserConfig.Instance.CurrentSkinName; + //} + //else if (UserConfig.Instance.SkinCode == 1) + //{ + application.StatusBarStyle = UIStatusBarStyle.Default; + //application.SetStatusBarStyle(UIStatusBarStyle.LightContent, false); + Console.WriteLine($"application.StatusBarStyle:{application.StatusBarStyle}"); + // Shared.Application.Skin = UserConfig.Instance.CurrentSkinName; + //} + //SkinStyle.Current.ChangeColor(); + + + //Harpy.Harpy.SharedInstance.PresentingViewController = this.Window.RootViewController; + //Harpy.Harpy.SharedInstance.WeakDelegate = this; + //Harpy.Harpy.SharedInstance.AlertType = Harpy.HarpyAlertType.Skip; + //Harpy.Harpy.SharedInstance.DebugEnabled = false; + //Harpy.Harpy.SharedInstance.ForceLanguageLocalization = Harpy.Constants.HarpyLanguageChineseSimplified; + return true; + } + } +} + diff --git "a/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/1024\302\2671024@2x.png" "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/1024\302\2671024@2x.png" new file mode 100755 index 0000000..e4ceb09 --- /dev/null +++ "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/1024\302\2671024@2x.png" Binary files differ diff --git "a/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/120\302\267120@2x.png" "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/120\302\267120@2x.png" new file mode 100755 index 0000000..4d03d25 --- /dev/null +++ "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/120\302\267120@2x.png" Binary files differ diff --git "a/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/120\302\267120@3x.png" "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/120\302\267120@3x.png" new file mode 100755 index 0000000..71dca78 --- /dev/null +++ "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/120\302\267120@3x.png" Binary files differ diff --git "a/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/180\302\267180@3x.png" "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/180\302\267180@3x.png" new file mode 100755 index 0000000..51ac63f --- /dev/null +++ "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/180\302\267180@3x.png" Binary files differ diff --git "a/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/20\302\26720.png" "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/20\302\26720.png" new file mode 100755 index 0000000..4c2b0bc --- /dev/null +++ "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/20\302\26720.png" Binary files differ diff --git "a/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/29\302\26729.png" "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/29\302\26729.png" new file mode 100755 index 0000000..0f95b74 --- /dev/null +++ "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/29\302\26729.png" Binary files differ diff --git "a/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/40\302\26740@2x-1.png" "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/40\302\26740@2x-1.png" new file mode 100755 index 0000000..db9b919 --- /dev/null +++ "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/40\302\26740@2x-1.png" Binary files differ diff --git "a/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/40\302\26740@2x.png" "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/40\302\26740@2x.png" new file mode 100755 index 0000000..db9b919 --- /dev/null +++ "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/40\302\26740@2x.png" Binary files differ diff --git "a/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/58\302\26758@2x-1.png" "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/58\302\26758@2x-1.png" new file mode 100755 index 0000000..2afe2fd --- /dev/null +++ "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/58\302\26758@2x-1.png" Binary files differ diff --git "a/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/58\302\26758@2x.png" "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/58\302\26758@2x.png" new file mode 100755 index 0000000..2afe2fd --- /dev/null +++ "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/58\302\26758@2x.png" Binary files differ diff --git "a/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/60\302\26760@3x.png" "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/60\302\26760@3x.png" new file mode 100755 index 0000000..0db2dd7 --- /dev/null +++ "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/60\302\26760@3x.png" Binary files differ diff --git "a/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/80\302\26780@2x.png" "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/80\302\26780@2x.png" new file mode 100755 index 0000000..9fb08a5 --- /dev/null +++ "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/80\302\26780@2x.png" Binary files differ diff --git "a/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/87\302\26787@3x.png" "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/87\302\26787@3x.png" new file mode 100755 index 0000000..5802ceb --- /dev/null +++ "b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/87\302\26787@3x.png" Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/Contents.json b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..4d6f470 --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,244 @@ +{ + "images": [ + { + "filename": "40路40@2x.png", + "size": "20x20", + "scale": "2x", + "idiom": "iphone" + }, + { + "filename": "60路60@3x.png", + "size": "20x20", + "scale": "3x", + "idiom": "iphone" + }, + { + "filename": "58路58@2x.png", + "size": "29x29", + "scale": "2x", + "idiom": "iphone" + }, + { + "filename": "87路87@3x.png", + "size": "29x29", + "scale": "3x", + "idiom": "iphone" + }, + { + "filename": "80路80@2x.png", + "size": "40x40", + "scale": "2x", + "idiom": "iphone" + }, + { + "filename": "120路120@2x.png", + "size": "40x40", + "scale": "3x", + "idiom": "iphone" + }, + { + "filename": "120路120@3x.png", + "size": "60x60", + "scale": "2x", + "idiom": "iphone" + }, + { + "filename": "180路180@3x.png", + "size": "60x60", + "scale": "3x", + "idiom": "iphone" + }, + { + "filename": "20路20.png", + "size": "20x20", + "scale": "1x", + "idiom": "ipad" + }, + { + "filename": "40路40@2x-1.png", + "size": "20x20", + "scale": "2x", + "idiom": "ipad" + }, + { + "filename": "29路29.png", + "size": "29x29", + "scale": "1x", + "idiom": "ipad" + }, + { + "filename": "58路58@2x-1.png", + "size": "29x29", + "scale": "2x", + "idiom": "ipad" + }, + { + "size": "40x40", + "scale": "1x", + "idiom": "ipad" + }, + { + "size": "40x40", + "scale": "2x", + "idiom": "ipad" + }, + { + "size": "83.5x83.5", + "scale": "2x", + "idiom": "ipad" + }, + { + "size": "76x76", + "scale": "1x", + "idiom": "ipad" + }, + { + "size": "76x76", + "scale": "2x", + "idiom": "ipad" + }, + { + "filename": "1024路1024@2x.png", + "size": "1024x1024", + "scale": "1x", + "idiom": "ios-marketing" + }, + { + "size": "60x60", + "scale": "2x", + "idiom": "car" + }, + { + "size": "60x60", + "scale": "3x", + "idiom": "car" + }, + { + "role": "notificationCenter", + "size": "24x24", + "subtype": "38mm", + "scale": "2x", + "idiom": "watch" + }, + { + "role": "notificationCenter", + "size": "27.5x27.5", + "subtype": "42mm", + "scale": "2x", + "idiom": "watch" + }, + { + "role": "companionSettings", + "size": "29x29", + "scale": "2x", + "idiom": "watch" + }, + { + "role": "companionSettings", + "size": "29x29", + "scale": "3x", + "idiom": "watch" + }, + { + "role": "appLauncher", + "size": "40x40", + "subtype": "38mm", + "scale": "2x", + "idiom": "watch" + }, + { + "role": "appLauncher", + "size": "44x44", + "subtype": "40mm", + "scale": "2x", + "idiom": "watch" + }, + { + "role": "appLauncher", + "size": "50x50", + "subtype": "44mm", + "scale": "2x", + "idiom": "watch" + }, + { + "role": "quickLook", + "size": "86x86", + "subtype": "38mm", + "scale": "2x", + "idiom": "watch" + }, + { + "role": "quickLook", + "size": "98x98", + "subtype": "42mm", + "scale": "2x", + "idiom": "watch" + }, + { + "role": "quickLook", + "size": "108x108", + "subtype": "44mm", + "scale": "2x", + "idiom": "watch" + }, + { + "size": "1024x1024", + "scale": "1x", + "idiom": "watch-marketing" + }, + { + "size": "16x16", + "scale": "1x", + "idiom": "mac" + }, + { + "size": "16x16", + "scale": "2x", + "idiom": "mac" + }, + { + "size": "32x32", + "scale": "1x", + "idiom": "mac" + }, + { + "size": "32x32", + "scale": "2x", + "idiom": "mac" + }, + { + "size": "128x128", + "scale": "1x", + "idiom": "mac" + }, + { + "size": "128x128", + "scale": "2x", + "idiom": "mac" + }, + { + "size": "256x256", + "scale": "1x", + "idiom": "mac" + }, + { + "size": "256x256", + "scale": "2x", + "idiom": "mac" + }, + { + "size": "512x512", + "scale": "1x", + "idiom": "mac" + }, + { + "size": "512x512", + "scale": "2x", + "idiom": "mac" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +} \ No newline at end of file diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1024X748.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1024X748.png new file mode 100755 index 0000000..26c144b --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1024X748.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1024X768.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1024X768.png new file mode 100755 index 0000000..2b5d389 --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1024X768.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1024x500.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1024x500.png new file mode 100755 index 0000000..619f888 --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1024x500.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1125X2436.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1125X2436.png new file mode 100644 index 0000000..4dd50f1 --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1125X2436.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1242x2208.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1242x2208.png new file mode 100755 index 0000000..169e20d --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1242x2208.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1536X2008.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1536X2008.png new file mode 100755 index 0000000..36b64be --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1536X2008.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1536X2048.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1536X2048.png new file mode 100755 index 0000000..698f4f1 --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/1536X2048.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/2048X1496.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/2048X1496.png new file mode 100755 index 0000000..d76c5ff --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/2048X1496.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/2048X1536.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/2048X1536.png new file mode 100755 index 0000000..06f4b9a --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/2048X1536.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/2048X2732 .png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/2048X2732 .png new file mode 100755 index 0000000..428ab50 --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/2048X2732 .png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/2208X1242.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/2208X1242.png new file mode 100755 index 0000000..aa43a29 --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/2208X1242.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/2436X1125.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/2436X1125.png new file mode 100644 index 0000000..5be5a89 --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/2436X1125.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/320X480.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/320X480.png new file mode 100755 index 0000000..01e0b41 --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/320X480.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/4096X4096.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/4096X4096.png new file mode 100755 index 0000000..6f7602a --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/4096X4096.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/640X1136.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/640X1136.png new file mode 100755 index 0000000..cd5a8aa --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/640X1136.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/640X960.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/640X960.png new file mode 100755 index 0000000..a0228c9 --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/640X960.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/750X1134.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/750X1134.png new file mode 100755 index 0000000..4b2c54e --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/750X1134.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/750X1334.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/750X1334.png new file mode 100755 index 0000000..d65cc5f --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/750X1334.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/768X1004.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/768X1004.png new file mode 100755 index 0000000..b9757b8 --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/768X1004.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/768X1024.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/768X1024.png new file mode 100755 index 0000000..08928cc --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/768X1024.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/1024.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/1024.png new file mode 100644 index 0000000..c35e5cf --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/1024.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/120.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/120.png new file mode 100644 index 0000000..0fc149c --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/120.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/152.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/152.png new file mode 100644 index 0000000..f292ba1 --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/152.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/167.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/167.png new file mode 100644 index 0000000..788fcf4 --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/167.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/180.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/180.png new file mode 100644 index 0000000..1c6ae63 --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/180.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/20.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/20.png new file mode 100644 index 0000000..2d6ff60 --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/20.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/29.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/29.png new file mode 100644 index 0000000..0cccb3a --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/29.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/40.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/40.png new file mode 100644 index 0000000..f8e61d2 --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/40.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/58.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/58.png new file mode 100644 index 0000000..cf19f47 --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/58.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/60.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/60.png new file mode 100644 index 0000000..d3ae322 --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/60.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/76.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/76.png new file mode 100644 index 0000000..d8783a6 --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/76.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/80.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/80.png new file mode 100644 index 0000000..256b202 --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/80.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/87.png b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/87.png new file mode 100644 index 0000000..2c6cbb7 --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/87.png Binary files differ diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/Contents.json b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..347cfcf --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset/Contents.json @@ -0,0 +1,220 @@ +{ + "images": [ + { + "filename": "40.png", + "size": "20x20", + "scale": "2x", + "idiom": "iphone" + }, + { + "filename": "60.png", + "size": "20x20", + "scale": "3x", + "idiom": "iphone" + }, + { + "filename": "58.png", + "size": "29x29", + "scale": "2x", + "idiom": "iphone" + }, + { + "filename": "87.png", + "size": "29x29", + "scale": "3x", + "idiom": "iphone" + }, + { + "filename": "80.png", + "size": "40x40", + "scale": "2x", + "idiom": "iphone" + }, + { + "filename": "120.png", + "size": "40x40", + "scale": "3x", + "idiom": "iphone" + }, + { + "filename": "120.png", + "size": "60x60", + "scale": "2x", + "idiom": "iphone" + }, + { + "filename": "180.png", + "size": "60x60", + "scale": "3x", + "idiom": "iphone" + }, + { + "filename": "20.png", + "size": "20x20", + "scale": "1x", + "idiom": "ipad" + }, + { + "filename": "40.png", + "size": "20x20", + "scale": "2x", + "idiom": "ipad" + }, + { + "filename": "29.png", + "size": "29x29", + "scale": "1x", + "idiom": "ipad" + }, + { + "filename": "58.png", + "size": "29x29", + "scale": "2x", + "idiom": "ipad" + }, + { + "filename": "40.png", + "size": "40x40", + "scale": "1x", + "idiom": "ipad" + }, + { + "filename": "80.png", + "size": "40x40", + "scale": "2x", + "idiom": "ipad" + }, + { + "filename": "167.png", + "size": "83.5x83.5", + "scale": "2x", + "idiom": "ipad" + }, + { + "filename": "76.png", + "size": "76x76", + "scale": "1x", + "idiom": "ipad" + }, + { + "filename": "152.png", + "size": "76x76", + "scale": "2x", + "idiom": "ipad" + }, + { + "filename": "1024.png", + "size": "1024x1024", + "scale": "1x", + "idiom": "ios-marketing" + }, + { + "role": "notificationCenter", + "size": "24x24", + "subtype": "38mm", + "scale": "2x", + "idiom": "watch" + }, + { + "role": "notificationCenter", + "size": "27.5x27.5", + "subtype": "42mm", + "scale": "2x", + "idiom": "watch" + }, + { + "role": "companionSettings", + "size": "29x29", + "scale": "2x", + "idiom": "watch" + }, + { + "role": "companionSettings", + "size": "29x29", + "scale": "3x", + "idiom": "watch" + }, + { + "role": "appLauncher", + "size": "40x40", + "subtype": "38mm", + "scale": "2x", + "idiom": "watch" + }, + { + "role": "longLook", + "size": "44x44", + "subtype": "42mm", + "scale": "2x", + "idiom": "watch" + }, + { + "role": "quickLook", + "size": "86x86", + "subtype": "38mm", + "scale": "2x", + "idiom": "watch" + }, + { + "role": "quickLook", + "size": "98x98", + "subtype": "42mm", + "scale": "2x", + "idiom": "watch" + }, + { + "size": "16x16", + "scale": "1x", + "idiom": "mac" + }, + { + "size": "16x16", + "scale": "2x", + "idiom": "mac" + }, + { + "size": "32x32", + "scale": "1x", + "idiom": "mac" + }, + { + "size": "32x32", + "scale": "2x", + "idiom": "mac" + }, + { + "size": "128x128", + "scale": "1x", + "idiom": "mac" + }, + { + "size": "128x128", + "scale": "2x", + "idiom": "mac" + }, + { + "size": "256x256", + "scale": "1x", + "idiom": "mac" + }, + { + "size": "256x256", + "scale": "2x", + "idiom": "mac" + }, + { + "size": "512x512", + "scale": "1x", + "idiom": "mac" + }, + { + "size": "512x512", + "scale": "2x", + "idiom": "mac" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +} \ No newline at end of file diff --git a/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json new file mode 100755 index 0000000..14e03cd --- /dev/null +++ b/HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,227 @@ +{ + "images": [ + { + "orientation": "landscape", + "extent": "full-screen", + "size": "1920x1080", + "scale": "1x", + "idiom": "tv", + "minimum-system-version": "9.0" + }, + { + "orientation": "landscape", + "extent": "full-screen", + "size": "1920x1080", + "scale": "2x", + "idiom": "tv", + "minimum-system-version": "11.0" + }, + { + "minimum-system-version": "11.0", + "orientation": "portrait", + "extent": "full-screen", + "filename": "1125X2436.png", + "size": "375x812", + "subtype": "2436h", + "scale": "3x", + "idiom": "iphone" + }, + { + "minimum-system-version": "11.0", + "orientation": "landscape", + "extent": "full-screen", + "filename": "2436X1125.png", + "size": "812x375", + "subtype": "2436h", + "scale": "3x", + "idiom": "iphone" + }, + { + "minimum-system-version": "8.0", + "orientation": "portrait", + "extent": "full-screen", + "filename": "1242x2208.png", + "size": "414x736", + "subtype": "736h", + "scale": "3x", + "idiom": "iphone" + }, + { + "minimum-system-version": "8.0", + "orientation": "portrait", + "extent": "full-screen", + "filename": "750X1334.png", + "size": "375x667", + "subtype": "667h", + "scale": "2x", + "idiom": "iphone" + }, + { + "minimum-system-version": "8.0", + "orientation": "landscape", + "extent": "full-screen", + "filename": "2208X1242.png", + "size": "736x414", + "subtype": "736h", + "scale": "3x", + "idiom": "iphone" + }, + { + "minimum-system-version": "7.0", + "orientation": "portrait", + "extent": "full-screen", + "filename": "2048X2732.png", + "size": "1024x1366", + "scale": "2x", + "idiom": "ipad" + }, + { + "minimum-system-version": "7.0", + "orientation": "portrait", + "extent": "full-screen", + "filename": "640X960.png", + "size": "320x480", + "scale": "2x", + "idiom": "iphone" + }, + { + "minimum-system-version": "7.0", + "orientation": "portrait", + "extent": "full-screen", + "filename": "640X1136.png", + "size": "320x568", + "subtype": "retina4", + "scale": "2x", + "idiom": "iphone" + }, + { + "minimum-system-version": "7.0", + "orientation": "portrait", + "extent": "full-screen", + "filename": "768X1024.png", + "size": "768x1024", + "scale": "1x", + "idiom": "ipad" + }, + { + "minimum-system-version": "7.0", + "orientation": "portrait", + "extent": "full-screen", + "filename": "1536X2048.png", + "size": "768x1024", + "scale": "2x", + "idiom": "ipad" + }, + { + "minimum-system-version": "7.0", + "orientation": "landscape", + "extent": "full-screen", + "filename": "1024X768.png", + "size": "1024x768", + "scale": "1x", + "idiom": "ipad" + }, + { + "minimum-system-version": "7.0", + "orientation": "landscape", + "extent": "full-screen", + "filename": "2048X1536.png", + "size": "1024x768", + "scale": "2x", + "idiom": "ipad" + }, + { + "orientation": "portrait", + "extent": "full-screen", + "filename": "320X480.png", + "size": "320x480", + "scale": "1x", + "idiom": "iphone" + }, + { + "orientation": "portrait", + "extent": "full-screen", + "filename": "640X960.png", + "size": "320x480", + "scale": "2x", + "idiom": "iphone" + }, + { + "orientation": "portrait", + "extent": "full-screen", + "filename": "640X1136.png", + "size": "320x568", + "subtype": "retina4", + "scale": "2x", + "idiom": "iphone" + }, + { + "orientation": "portrait", + "extent": "to-status-bar", + "filename": "768X1004.png", + "size": "768x1004", + "scale": "1x", + "idiom": "ipad" + }, + { + "orientation": "portrait", + "extent": "to-status-bar", + "filename": "1536X2008.png", + "size": "768x1004", + "scale": "2x", + "idiom": "ipad" + }, + { + "orientation": "portrait", + "extent": "full-screen", + "filename": "768X1024.png", + "size": "768x1024", + "scale": "1x", + "idiom": "ipad" + }, + { + "orientation": "portrait", + "extent": "full-screen", + "filename": "1536X2048.png", + "size": "768x1024", + "scale": "2x", + "idiom": "ipad" + }, + { + "orientation": "landscape", + "extent": "to-status-bar", + "filename": "1024X748.png", + "size": "1024x748", + "scale": "1x", + "idiom": "ipad" + }, + { + "orientation": "landscape", + "extent": "to-status-bar", + "filename": "2048X1496.png", + "size": "1024x748", + "scale": "2x", + "idiom": "ipad" + }, + { + "orientation": "landscape", + "extent": "full-screen", + "filename": "1024X768.png", + "size": "1024x768", + "scale": "1x", + "idiom": "ipad" + }, + { + "orientation": "landscape", + "extent": "full-screen", + "filename": "2048X1536.png", + "size": "1024x768", + "scale": "2x", + "idiom": "ipad" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +} \ No newline at end of file diff --git a/HDL-ON_iOS/Entitlements.plist b/HDL-ON_iOS/Entitlements.plist new file mode 100644 index 0000000..36a8706 --- /dev/null +++ b/HDL-ON_iOS/Entitlements.plist @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> + <dict> + </dict> +</plist> diff --git a/HDL-ON_iOS/HDL-ON_iOS.csproj b/HDL-ON_iOS/HDL-ON_iOS.csproj new file mode 100644 index 0000000..f6e615c --- /dev/null +++ b/HDL-ON_iOS/HDL-ON_iOS.csproj @@ -0,0 +1,191 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform> + <ProjectGuid>{D998E133-F0DD-4760-BE3C-461632F54DA4}</ProjectGuid> + <ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <TemplateGuid>{edc1b0fa-90cd-4038-8fad-98fe74adb368}</TemplateGuid> + <OutputType>Exe</OutputType> + <RootNamespace>HDL_ON_iOS</RootNamespace> + <AssemblyName>HDL_ON_iOS</AssemblyName> + <IPhoneResourcePrefix>Resources</IPhoneResourcePrefix> + <MtouchEnableSGenConc>true</MtouchEnableSGenConc> + <MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler> + <RestoreProjectStyle>PackageReference</RestoreProjectStyle> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\iPhoneSimulator\Debug</OutputPath> + <DefineConstants>DEBUG</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <MtouchArch>x86_64</MtouchArch> + <MtouchLink>Full</MtouchLink> + <MtouchDebug>true</MtouchDebug> + <CodesignKey>iPhone Developer</CodesignKey> + <MtouchExtraArgs>-gcc_flags="-dead_strip -ObjC";-w</MtouchExtraArgs> + <MtouchSdkVersion>13.1</MtouchSdkVersion> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' "> + <DebugType>none</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\iPhoneSimulator\Release</OutputPath> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <MtouchLink>None</MtouchLink> + <MtouchArch>x86_64</MtouchArch> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\iPhone\Debug</OutputPath> + <DefineConstants>DEBUG</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <MtouchArch>ARM64</MtouchArch> + <CodesignEntitlements>Entitlements.plist</CodesignEntitlements> + <CodesignKey>iPhone Developer</CodesignKey> + <MtouchDebug>true</MtouchDebug> + <MtouchExtraArgs>-gcc_flags="-dead_strip -ObjC";-w</MtouchExtraArgs> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' "> + <DebugType>none</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\iPhone\Release</OutputPath> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <CodesignEntitlements>Entitlements.plist</CodesignEntitlements> + <MtouchArch>ARM64</MtouchArch> + <CodesignKey>iPhone Developer</CodesignKey> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Xml" /> + <Reference Include="System.Core" /> + <Reference Include="Xamarin.iOS" /> + <Reference Include="System.Numerics" /> + <Reference Include="System.Numerics.Vectors" /> + <Reference Include="System.Web.Services" /> + <Reference Include="Shared.IOS.TCL"> + <HintPath>..\..\ON\SmartHome\SmartHome\dll\Shared.IOS.TCL.dll</HintPath> + </Reference> + <Reference Include="Shared.IOS"> + <HintPath>..\..\ON\SmartHome\SmartHome\dll\Shared.IOS.dll</HintPath> + </Reference> + <Reference Include="Shared.IOS.TBL"> + <HintPath>..\..\ON\SmartHome\SmartHome\dll\Shared.IOS.TBL.dll</HintPath> + </Reference> + </ItemGroup> + <ItemGroup> + <PackageReference Include="Xamarin.Essentials" Version="1.1.0" /> + <PackageReference Include="Newtonsoft.Json"> + <Version>12.0.2</Version> + </PackageReference> + <PackageReference Include="MQTTnet"> + <Version>3.0.8</Version> + </PackageReference> + </ItemGroup> + <ItemGroup> + <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Contents.json" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1024x500.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1024X748.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1024X768.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1125X2436.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1242x2208.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1536X2008.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1536X2048.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048X1496.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048X1536.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048X2732 .png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2208X1242.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2436X1125.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\320X480.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\4096X4096.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640X1136.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640X960.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\750X1134.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\750X1334.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\768X1004.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\768X1024.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\AppIcon.appiconset\1024.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\AppIcon.appiconset\120.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\AppIcon.appiconset\152.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\AppIcon.appiconset\167.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\AppIcon.appiconset\180.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\AppIcon.appiconset\20.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\AppIcon.appiconset\29.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\AppIcon.appiconset\40.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\AppIcon.appiconset\58.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\AppIcon.appiconset\60.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\AppIcon.appiconset\76.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\AppIcon.appiconset\80.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\AppIcon.appiconset\87.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\AppIcon.appiconset\Contents.json" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\Contents.json" /> + <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\40路40%402x.png" /> + <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\60路60%403x.png" /> + <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\58路58%402x.png" /> + <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\87路87%403x.png" /> + <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\80路80%402x.png" /> + <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\120路120%402x.png" /> + <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\120路120%403x.png" /> + <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\180路180%403x.png" /> + <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\20路20.png" /> + <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\40路40%402x-1.png" /> + <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\29路29.png" /> + <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\58路58%402x-1.png" /> + <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\1024路1024%402x.png" /> + </ItemGroup> + <ItemGroup> + <Folder Include="Resources\" /> + <Folder Include="Resources\Phone\" /> + <Folder Include="Assets.xcassets\LaunchImage.launchimage\" /> + <Folder Include="Resources\Phone\Public\" /> + </ItemGroup> + <ItemGroup> + <InterfaceDefinition Include="LaunchScreen.storyboard" /> + <InterfaceDefinition Include="Main.storyboard" /> + </ItemGroup> + <ItemGroup> + <None Include="Info.plist" /> + <None Include="Entitlements.plist" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Main.cs" /> + <Compile Include="AppDelegate.cs" /> + <Compile Include="ViewController.cs" /> + <Compile Include="ViewController.designer.cs"> + <DependentUpon>ViewController.cs</DependentUpon> + </Compile> + <Compile Include="ViewControllerBase.cs" /> + <Compile Include="Reachability.cs" /> + </ItemGroup> + <ItemGroup> + <BundleResource Include="Resources\Phone\LoginIcon\ShowPasswordIcon.png" /> + <BundleResource Include="Resources\Phone\LoginIcon\SearchIcon.png" /> + <BundleResource Include="Resources\Phone\LoginIcon\VerificationCodeIcon.png" /> + <BundleResource Include="Resources\Phone\LoginIcon\AccountIcon.png" /> + <BundleResource Include="Resources\Phone\LoginIcon\QQIcon.png" /> + <BundleResource Include="Resources\Phone\LoginIcon\PasswordIcon.png" /> + <BundleResource Include="Resources\Phone\LoginIcon\WechatIcon.png" /> + <BundleResource Include="Resources\Phone\LoginIcon\HidePasswordIcon.png" /> + <BundleResource Include="Resources\Phone\LoginIcon\2.png" /> + <BundleResource Include="Resources\Phone\LoginIcon\EmailIcon.png" /> + <BundleResource Include="Resources\Phone\LoginIcon\3.png" /> + <BundleResource Include="Resources\Phone\LoginIcon\1.png" /> + <BundleResource Include="Resources\Language.ini" /> + <BundleResource Include="Resources\Phone\Public\BackIcon.png" /> + <BundleResource Include="Resources\Phone\Public\Logo.png" /> + <BundleResource Include="Resources\Phone\Public\Logo-bg.png" /> + </ItemGroup> + <ItemGroup> + <ITunesArtwork Include="iTunesArtwork" /> + <ITunesArtwork Include="iTunesArtwork%402x" /> + </ItemGroup> + <Import Project="..\HDL_ON\HDL_ON.projitems" Label="Shared" Condition="Exists('..\HDL_ON\HDL_ON.projitems')" /> + <Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" /> +</Project> \ No newline at end of file diff --git a/HDL-ON_iOS/Info.plist b/HDL-ON_iOS/Info.plist new file mode 100755 index 0000000..26155b8 --- /dev/null +++ b/HDL-ON_iOS/Info.plist @@ -0,0 +1,109 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>NSAppTransportSecurity</key> + <dict> + <key>NSExceptionDomains</key> + <dict> + <key>NSExceptionDomains</key> + <true/> + <key>NSExceptionMinimumTLSVersion</key> + <string>TLSv1.0</string> + </dict> + <key>NSAllowsArbitraryLoads</key> + <true/> + </dict> + <key>CFBundleIdentifier</key> + <string>com.hdl.SimpleControl</string> + <key>CFBundleShortVersionString</key> + <string>2.4191023</string> + <key>LSRequiresIPhoneOS</key> + <true/> + <key>MinimumOSVersion</key> + <string>9.1</string> + <key>UIDeviceFamily</key> + <array> + <integer>1</integer> + </array> + <key>UIRequiredDeviceCapabilities</key> + <array> + <string>armv7</string> + </array> + <key>UIRequiresFullScreen</key> + <true/> + <key>NSCameraUsageDescription</key> + <string>Set up your room or scene background.</string> + <key>NSPhotoLibraryUsageDescription</key> + <string>Set up your room or scene background.</string> + <key>UIBackgroundModes</key> + <array> + <string>location</string> + <string>remote-notification</string> + </array> + <key>Custom Property</key> + <string></string> + <key>CFBundleInfoDictionaryVersion</key> + <string>Required background modes (Watch)</string> + <key>CFBundleURLTypes</key> + <array> + <dict> + <key>CFBundleURLSchemes</key> + <array> + <string>com.hdl.SimpleControl</string> + </array> + <key>CFBundleURLName</key> + <string>on</string> + </dict> + </array> + <key>UISupportedInterfaceOrientations</key> + <array> + <string>UIInterfaceOrientationPortrait</string> + </array> + <key>LSApplicationQueriesSchemes </key> + <array> + <string>com.hdl.ezviz-monitor</string> + <string>qqmusic</string> + <string>spotify</string> + </array> + <key>NSMicrophoneUsageDescription</key> + <string>Phone microphones need to be used +</string> + <key>UIAppFonts</key> + <array> + <string>titilliumtext25l005.otf</string> + </array> + <key>UISupportedInterfaceOrientations~ipad</key> + <array> + <string>UIInterfaceOrientationPortrait</string> + </array> + <key>UIStatusBarTintParameters</key> + <dict> + <key>UINavigationBar</key> + <dict> + <key>Style</key> + <string>UIBarStyleBlack</string> + <key>Translucent</key> + <false/> + </dict> + </dict> + <key>UIViewControllerBasedStatusBarAppearance</key> + <false/> + <key>XSLaunchImageAssets</key> + <string>Assets.xcassets/LaunchImage.launchimage</string> + <key>CFBundleName</key> + <string>HDL-ON</string> + <key>NSAppleMusicUsageDescription</key> + <string>HDL ON needs to access your music library to connect to an external player to play music.</string> + <key>XSAppIconAssets</key> + <string>Assets.xcassets/AppIcon.appiconset</string> + <key>NSLocationWhenInUseUsageDescription</key> + <string>Get the weather</string> + <key>CFBundleDisplayName</key> + <string>HDL-ON</string> + <key>CFBundleVersion</key> + <string>2.41023</string> + <key>NSLocationAlwaysUsageDescription</key> + <string>Get the weather</string> +</dict> +</plist> diff --git "a/HDL-ON_iOS/Info\347\232\204\345\211\257\346\234\254.plist" "b/HDL-ON_iOS/Info\347\232\204\345\211\257\346\234\254.plist" new file mode 100644 index 0000000..9a95c4b --- /dev/null +++ "b/HDL-ON_iOS/Info\347\232\204\345\211\257\346\234\254.plist" @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDisplayName</key> + <string>HDL_ON</string> + <key>CFBundleIdentifier</key> + <string>com.hdl.SimpleControl</string> + <key>CFBundleShortVersionString</key> + <string>1.0</string> + <key>CFBundleVersion</key> + <string>1.0</string> + <key>LSRequiresIPhoneOS</key> + <true/> + <key>MinimumOSVersion</key> + <string>9.1</string> + <key>UIDeviceFamily</key> + <array> + <integer>1</integer> + </array> + <key>UIRequiredDeviceCapabilities</key> + <array> + <string>armv7</string> + </array> + <key>UISupportedInterfaceOrientations</key> + <array> + <string>UIInterfaceOrientationPortrait</string> + </array> + <key>UISupportedInterfaceOrientations~ipad</key> + <array> + <string>UIInterfaceOrientationPortrait</string> + <string>UIInterfaceOrientationPortraitUpsideDown</string> + <string>UIInterfaceOrientationLandscapeLeft</string> + <string>UIInterfaceOrientationLandscapeRight</string> + </array> + <key>CFBundleName</key> + <string>HDL_ON</string> + <key>UIRequiresFullScreen</key> + <true/> + <key>UIStatusBarHidden</key> + <false/> + <key>XSAppIconAssets</key> + <string>Assets.xcassets/LaunchImage.launchimage/AppIcon.appiconset</string> + <key>XSLaunchImageAssets</key> + <string>Assets.xcassets/LaunchImage.launchimage</string> + <key>UIStatusBarStyle</key> + <string>UIStatusBarStyleBlackTranslucent</string> + <key>UIStatusBarTintParameters</key> + <dict> + <key>UINavigationBar</key> + <dict> + <key>Style</key> + <string>UIBarStyleBlack</string> + <key>Translucent</key> + <true/> + </dict> + </dict> + <key>UIBackgroundModes</key> + <array> + <string>remote-notification</string> + </array> +</dict> +</plist> diff --git a/HDL-ON_iOS/LaunchScreen.storyboard b/HDL-ON_iOS/LaunchScreen.storyboard new file mode 100644 index 0000000..c0e5c52 --- /dev/null +++ b/HDL-ON_iOS/LaunchScreen.storyboard @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15400" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> + <device id="retina6_1" orientation="portrait" appearance="light"/> + <dependencies> + <deployment identifier="iOS"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15404"/> + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> + </dependencies> + <scenes> + <!--View Controller--> + <scene sceneID="EHf-IW-A2E"> + <objects> + <viewController id="01J-lp-oVM" sceneMemberID="viewController"> + <layoutGuides> + <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/> + <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/> + </layoutGuides> + <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> + <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + </view> + </viewController> + <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> + </objects> + <point key="canvasLocation" x="53" y="375"/> + </scene> + </scenes> +</document> diff --git a/HDL-ON_iOS/Main.cs b/HDL-ON_iOS/Main.cs new file mode 100644 index 0000000..fdcd632 --- /dev/null +++ b/HDL-ON_iOS/Main.cs @@ -0,0 +1,15 @@ +锘縰sing UIKit; + +namespace HDL_ON_iOS +{ + public class Application + { + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, "AppDelegate"); + } + } +} \ No newline at end of file diff --git a/HDL-ON_iOS/Main.storyboard b/HDL-ON_iOS/Main.storyboard new file mode 100644 index 0000000..a3f40d6 --- /dev/null +++ b/HDL-ON_iOS/Main.storyboard @@ -0,0 +1,27 @@ +锘�<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r"> + <dependencies> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772" /> + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0" /> + </dependencies> + <scenes> + <!--View Controller--> + <scene sceneID="tne-QT-ifu"> + <objects> + <viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController"> + <layoutGuides> + <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ" /> + <viewControllerLayoutGuide type="bottom" id="wfy-db-euE" /> + </layoutGuides> + <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> + <rect key="frame" x="0.0" y="0.0" width="414" height="736" /> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" /> + <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB" /> + </view> + </viewController> + <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder" /> + </objects> + <point key="canvasLocation" x="0.0" y="0.0" /> + </scene> + </scenes> +</document> \ No newline at end of file diff --git a/HDL-ON_iOS/Properties/AssemblyInfo.cs b/HDL-ON_iOS/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..a2bd491 --- /dev/null +++ b/HDL-ON_iOS/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +锘縰sing System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("HDL_ON_iOS")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("HDL_ON_iOS")] +[assembly: AssemblyCopyright("Copyright 漏 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("50c7b8c9-e664-45af-b88e-0c9b8b9c1be1")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/HDL-ON_iOS/Reachability.cs b/HDL-ON_iOS/Reachability.cs new file mode 100644 index 0000000..eaf7071 --- /dev/null +++ b/HDL-ON_iOS/Reachability.cs @@ -0,0 +1,151 @@ +锘縰sing System; +using System.Net; +using CoreFoundation; +using SystemConfiguration; + +namespace HDL_ON_iOS +{ + public enum NetworkStatus + { + NotReachable = 0, + ReachableViaCarrierDataNetwork = 1, + ReachableViaWiFiNetwork = 2 + } + + public static class Reachability + { + public static string HostName = "service.hdlcontrol.com"; + + public static bool IsReachableWithoutRequiringConnection (NetworkReachabilityFlags flags) + { + // Is it reachable with the current network configuration? + bool isReachable = (flags & NetworkReachabilityFlags.Reachable) != 0; + + // Do we need a connection to reach it? + bool noConnectionRequired = (flags & NetworkReachabilityFlags.ConnectionRequired) == 0 + || (flags & NetworkReachabilityFlags.IsWWAN) != 0; + + return isReachable && noConnectionRequired; + } + + // Is the host reachable with the current network configuration + public static bool IsHostReachable (string host) + { + if (string.IsNullOrEmpty (host)) + return false; + + using (var r = new NetworkReachability (host)) { + NetworkReachabilityFlags flags; + + if (r.TryGetFlags (out flags)) + return IsReachableWithoutRequiringConnection (flags); + } + return false; + } + + // + // Raised every time there is an interesting reachable event, + // we do not even pass the info as to what changed, and + // we lump all three status we probe into one + // + public static event EventHandler ReachabilityChanged; + + static void OnChange (NetworkReachabilityFlags flags) + { + var h = ReachabilityChanged; + if (h != null) + h (null, EventArgs.Empty); + } + + // + // Returns true if it is possible to reach the AdHoc WiFi network + // and optionally provides extra network reachability flags as the + // out parameter + // + static NetworkReachability adHocWiFiNetworkReachability; + + public static bool IsAdHocWiFiNetworkAvailable (out NetworkReachabilityFlags flags) + { + if (adHocWiFiNetworkReachability == null) { + adHocWiFiNetworkReachability = new NetworkReachability (new IPAddress (new byte [] { 115, 29, 191, 136 })); + adHocWiFiNetworkReachability.SetNotification (OnChange); + adHocWiFiNetworkReachability.Schedule (CFRunLoop.Current, CFRunLoop.ModeDefault); + } + + return adHocWiFiNetworkReachability.TryGetFlags (out flags) && IsReachableWithoutRequiringConnection (flags); + } + + static NetworkReachability defaultRouteReachability; + + static bool IsNetworkAvailable (out NetworkReachabilityFlags flags) + { + if (defaultRouteReachability == null) { + defaultRouteReachability = new NetworkReachability (new IPAddress (new byte [] { 115, 29, 191, 136 })); + defaultRouteReachability.SetNotification (OnChange); + defaultRouteReachability.Schedule (CFRunLoop.Current, CFRunLoop.ModeDefault); + } + return defaultRouteReachability.TryGetFlags (out flags) && IsReachableWithoutRequiringConnection (flags); + } + + static NetworkReachability remoteHostReachability; + + public static NetworkStatus RemoteHostStatus () + { + NetworkReachabilityFlags flags; + bool reachable; + + if (remoteHostReachability == null) { + remoteHostReachability = new NetworkReachability (HostName); + + // Need to probe before we queue, or we wont get any meaningful values + // this only happens when you create NetworkReachability from a hostname + reachable = remoteHostReachability.TryGetFlags (out flags); + + remoteHostReachability.SetNotification (OnChange); + remoteHostReachability.Schedule (CFRunLoop.Current, CFRunLoop.ModeDefault); + } else { + reachable = remoteHostReachability.TryGetFlags (out flags); + } + + if (!reachable) + return NetworkStatus.NotReachable; + + if (!IsReachableWithoutRequiringConnection (flags)) + return NetworkStatus.NotReachable; + + return (flags & NetworkReachabilityFlags.IsWWAN) != 0 ? + NetworkStatus.ReachableViaCarrierDataNetwork : NetworkStatus.ReachableViaWiFiNetwork; + } + + public static NetworkStatus InternetConnectionStatus () + { + NetworkReachabilityFlags flags; + bool defaultNetworkAvailable = IsNetworkAvailable (out flags); + if (defaultNetworkAvailable && ((flags & NetworkReachabilityFlags.IsDirect) != 0)) + return NetworkStatus.NotReachable; + else if ((flags & NetworkReachabilityFlags.IsWWAN) != 0) + return NetworkStatus.ReachableViaCarrierDataNetwork; + else if (flags == 0) + return NetworkStatus.NotReachable; + return NetworkStatus.ReachableViaWiFiNetwork; + } + + public static bool Online () + { + NetworkReachabilityFlags flags; + bool defaultNetworkAvailable = IsNetworkAvailable (out flags); + return defaultNetworkAvailable; + } + + + public static NetworkStatus LocalWifiConnectionStatus () + { + NetworkReachabilityFlags flags; + if (IsAdHocWiFiNetworkAvailable (out flags)) + if ((flags & NetworkReachabilityFlags.IsDirect) != 0) + return NetworkStatus.ReachableViaWiFiNetwork; + + return NetworkStatus.NotReachable; + } + } +} diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini new file mode 100755 index 0000000..1b1ca4e --- /dev/null +++ b/HDL-ON_iOS/Resources/Language.ini @@ -0,0 +1,40 @@ +锘縖English] +1=Login +2=Mobile login +3=Lights +4=Mailbox login +7=Forget? +8=Sign up +9=Verification code login +10=Please wait... +11=Close +12=Get Verification Code +13=Password login +14=Register +[Chinese] +1=鐧诲綍 +2=鎵嬫満鍙风櫥褰� +3=鐏厜 +4=閭鐧诲綍 +5=璇疯緭鍏ヨ处鍙� +6=璇疯緭鍏ュ瘑鐮� +7=蹇樿瀵嗙爜 +8=娉ㄥ唽 +9=楠岃瘉鐮佺櫥褰� +10=璇风瓑寰�... +11=鍏抽棴 +12=鑾峰彇楠岃瘉鐮� +13=瀵嗙爜鐧诲綍 +14=娉ㄥ唽 +15=璇疯緭鍏ユ偍鐨勬墜鏈哄彿 +16=璇疯緭鍏�6-13涓瓧绗︾殑瀵嗙爜 +17=璇峰啀娆¤緭鍏ュ瘑鐮� +18=璇疯緭鍏ラ獙璇佺爜 +19=璇疯緭鍏ユ纭殑鎵嬫満鍙风爜 +20=浜屾瀵嗙爜杈撳叆涓嶅尮閰嶏紝璇烽噸鏂拌緭鍏� +21=瀵嗙爜涓嶇鍚堣姹傦紝璇烽噸鏂拌緭鍏� +22=璇ョ敤鎴峰凡瀛樺湪锛屽彲鐩存帴鐧诲綍 +23=楠岃瘉鐮佹湁璇紝璇烽噸鏂拌緭鍏� +24=璇疯緭鍏ユ纭殑閭鍦板潃 +25=璇疯緭鍏ユ偍鐨勯偖绠� +[Czech] \ No newline at end of file diff --git a/HDL-ON_iOS/Resources/LaunchScreen.xib b/HDL-ON_iOS/Resources/LaunchScreen.xib new file mode 100644 index 0000000..9131928 --- /dev/null +++ b/HDL-ON_iOS/Resources/LaunchScreen.xib @@ -0,0 +1,43 @@ +锘�<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6214" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES"> + <dependencies> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207" /> + <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1" /> + </dependencies> + <objects> + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" /> + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder" /> + <view contentMode="scaleToFill" id="iN0-l3-epB"> + <rect key="frame" x="0.0" y="0.0" width="480" height="480" /> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" /> + <subviews> + <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2017 " textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" + minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye"> + <rect key="frame" x="20" y="439" width="441" height="21" /> + <fontDescription key="fontDescription" type="system" pointSize="17" /> + <color key="textColor" cocoaTouchSystemColor="darkTextColor" /> + <nil key="highlightedColor" /> + </label> + <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="HDL_ON_iOS" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" + minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX"> + <rect key="frame" x="20" y="140" width="441" height="43" /> + <fontDescription key="fontDescription" type="boldSystem" pointSize="36" /> + <color key="textColor" cocoaTouchSystemColor="darkTextColor" /> + <nil key="highlightedColor" /> + </label> + </subviews> + <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite" /> + <constraints> + <constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC" /> + <constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk" /> + <constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l" /> + <constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0" /> + <constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9" /> + <constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g" /> + </constraints> + <nil key="simulatedStatusBarMetrics" /> + <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics" /> + <point key="canvasLocation" x="548" y="455" /> + </view> + </objects> +</document> diff --git a/HDL-ON_iOS/Resources/Phone/.DS_Store b/HDL-ON_iOS/Resources/Phone/.DS_Store new file mode 100644 index 0000000..238882f --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/.DS_Store Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/LoginIcon/1.png b/HDL-ON_iOS/Resources/Phone/LoginIcon/1.png new file mode 100755 index 0000000..f875705 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/LoginIcon/1.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/LoginIcon/2.png b/HDL-ON_iOS/Resources/Phone/LoginIcon/2.png new file mode 100755 index 0000000..0dc1c53 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/LoginIcon/2.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/LoginIcon/3.png b/HDL-ON_iOS/Resources/Phone/LoginIcon/3.png new file mode 100755 index 0000000..2954076 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/LoginIcon/3.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/LoginIcon/AccountIcon.png b/HDL-ON_iOS/Resources/Phone/LoginIcon/AccountIcon.png new file mode 100755 index 0000000..fa00d1e --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/LoginIcon/AccountIcon.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/LoginIcon/EmailIcon.png b/HDL-ON_iOS/Resources/Phone/LoginIcon/EmailIcon.png new file mode 100755 index 0000000..62e332b --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/LoginIcon/EmailIcon.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/LoginIcon/HidePasswordIcon.png b/HDL-ON_iOS/Resources/Phone/LoginIcon/HidePasswordIcon.png new file mode 100755 index 0000000..fd10cfa --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/LoginIcon/HidePasswordIcon.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/LoginIcon/PasswordIcon.png b/HDL-ON_iOS/Resources/Phone/LoginIcon/PasswordIcon.png new file mode 100755 index 0000000..42a8827 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/LoginIcon/PasswordIcon.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/LoginIcon/QQIcon.png b/HDL-ON_iOS/Resources/Phone/LoginIcon/QQIcon.png new file mode 100644 index 0000000..9e529c4 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/LoginIcon/QQIcon.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/LoginIcon/SearchIcon.png b/HDL-ON_iOS/Resources/Phone/LoginIcon/SearchIcon.png new file mode 100755 index 0000000..6c565a3 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/LoginIcon/SearchIcon.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/LoginIcon/ShowPasswordIcon.png b/HDL-ON_iOS/Resources/Phone/LoginIcon/ShowPasswordIcon.png new file mode 100755 index 0000000..8af897e --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/LoginIcon/ShowPasswordIcon.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/LoginIcon/VerificationCodeIcon.png b/HDL-ON_iOS/Resources/Phone/LoginIcon/VerificationCodeIcon.png new file mode 100755 index 0000000..2e83d9d --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/LoginIcon/VerificationCodeIcon.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/LoginIcon/WechatIcon.png b/HDL-ON_iOS/Resources/Phone/LoginIcon/WechatIcon.png new file mode 100644 index 0000000..194adea --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/LoginIcon/WechatIcon.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Public/BackIcon.png b/HDL-ON_iOS/Resources/Phone/Public/BackIcon.png new file mode 100644 index 0000000..0a876cc --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Public/BackIcon.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Public/Logo-bg.png b/HDL-ON_iOS/Resources/Phone/Public/Logo-bg.png new file mode 100644 index 0000000..8a20a46 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Public/Logo-bg.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Public/Logo.png b/HDL-ON_iOS/Resources/Phone/Public/Logo.png new file mode 100644 index 0000000..92ade0d --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Public/Logo.png Binary files differ diff --git a/HDL-ON_iOS/ViewController.cs b/HDL-ON_iOS/ViewController.cs new file mode 100644 index 0000000..89ca7a7 --- /dev/null +++ b/HDL-ON_iOS/ViewController.cs @@ -0,0 +1,86 @@ +锘縰sing System; +using CoreLocation; +using Foundation; +using HDL_ON; +using Shared; +using UIKit; + +namespace HDL_ON_iOS +{ + public partial class ViewController : ViewControllerBase + { + public override void ViewDidLoad() + { + base.ViewDidLoad(); + + + if (string.IsNullOrEmpty(UserConfig.Instance.SetLanguage)) + { + if (NSLocale.PreferredLanguages[0].Contains("zh-")) + { + Language.CurrentLanguage = "Chinese"; + } + else if (NSLocale.PreferredLanguages[0].Contains("cs-")) + { + Language.CurrentLanguage = "Czech"; + } + else + { + Language.CurrentLanguage = "English"; + } + } + else + { + Language.CurrentLanguage = UserConfig.Instance.SetLanguage; + } + HDL_ON.UI.MainPage.Show(); + + //渚︽祴缃戠粶鍙樺寲 + Reachability.ReachabilityChanged += UpdateStatus; + + UITapGestureRecognizer oTapRecognizer = new UITapGestureRecognizer(); + oTapRecognizer.CancelsTouchesInView = false; + oTapRecognizer.AddTarget( + this, + new ObjCRuntime.Selector("ViewTappedSelector:") + ); + this.View.AddGestureRecognizer(oTapRecognizer); + } + public override UIStatusBarStyle PreferredStatusBarStyle() + { + return UIStatusBarStyle.LightContent; + } + + [Export("ViewTappedSelector:")] + public void ViewTapped(UIGestureRecognizer sender) + { + //Txt鎺т欢鍚嶇О.ResignFirstResponder(); + UIView v = View.FindFirstResponder(); + if (v != null) + { + v.ResignFirstResponder(); + } + } + + public override void DidReceiveMemoryWarning() + { + base.DidReceiveMemoryWarning(); + // Release any cached data, images, etc that aren't in use. + } + + NetworkStatus internetStatus; + void UpdateStatus(object sender, EventArgs e) + { + internetStatus = Reachability.InternetConnectionStatus(); + if (internetStatus == NetworkStatus.NotReachable)//娌℃湁缃戠粶杩炴帴 0 + { + } + else if (internetStatus == NetworkStatus.ReachableViaCarrierDataNetwork)//3,4G鐨勭綉缁滆繛鎺� 1 + { + } + else if (internetStatus == NetworkStatus.ReachableViaWiFiNetwork) + { //wifi鐨勭綉缁滆繛鎺� 2 + } + } + } +} \ No newline at end of file diff --git a/HDL-ON_iOS/ViewController.designer.cs b/HDL-ON_iOS/ViewController.designer.cs new file mode 100644 index 0000000..d3610fb --- /dev/null +++ b/HDL-ON_iOS/ViewController.designer.cs @@ -0,0 +1,18 @@ +锘�// WARNING +// +// This file has been generated automatically by Visual Studio from the outlets and +// actions declared in your storyboard file. +// Manual changes to this file will not be maintained. +// +using Foundation; +using System; +using System.CodeDom.Compiler; +using UIKit; + +namespace HDL_ON_iOS +{ + [Register("ViewController")] + partial class ViewController + { + } +} \ No newline at end of file diff --git a/HDL-ON_iOS/ViewControllerBase.cs b/HDL-ON_iOS/ViewControllerBase.cs new file mode 100644 index 0000000..053c35c --- /dev/null +++ b/HDL-ON_iOS/ViewControllerBase.cs @@ -0,0 +1,138 @@ +锘縰sing System; +using System.Drawing; +using Foundation; +using UIKit; + +namespace HDL_ON_iOS +{ + public class ViewControllerBase : Shared.BaseViewController + { + //public override bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOrientation toInterfaceOrientation) + //{ + // return false; + //} + + NSObject _keyboardObserverWillShow; + NSObject _keyboardObserverWillHide; + + + //public override bool ShouldAutorotate () + //{ + // return false; + //} + + //public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations () + //{ + // if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) { + // UIApplication.SharedApplication.SetStatusBarOrientation (UIInterfaceOrientation.LandscapeRight, false); + // return UIInterfaceOrientationMask.LandscapeRight; + // } else { + // return UIInterfaceOrientationMask.Portrait; + // } + //} + + public override void ViewDidLoad () + { + base.ViewDidLoad (); + //璁剧疆閿洏浜嬩欢澶勭悊绋嬪簭 + RegisterForKeyboardNotifications (); + } + protected virtual void RegisterForKeyboardNotifications () + { + _keyboardObserverWillShow = NSNotificationCenter.DefaultCenter.AddObserver + (UIKeyboard.WillShowNotification, KeyboardWillShowNotification); + _keyboardObserverWillHide = NSNotificationCenter.DefaultCenter.AddObserver + (UIKeyboard.WillHideNotification, KeyboardWillHideNotification); + } + protected virtual void UnregisterKeyboardNotifications () + { + NSNotificationCenter.DefaultCenter.RemoveObserver (_keyboardObserverWillShow); + NSNotificationCenter.DefaultCenter.RemoveObserver (_keyboardObserverWillHide); + } + protected virtual UIView KeyboardGetActiveView () + { + return this.View.FindFirstResponder (); + } + protected virtual void KeyboardWillShowNotification (NSNotification notification) + { + UIView activeView = KeyboardGetActiveView (); + if (activeView == null) + return; + UIView scrollView = activeView.FindSuperviewOfType_Self (this.View, typeof (UIView)) as UIView; + if (scrollView == null) + return; + CoreGraphics.CGRect keyboardBounds = UIKeyboard.BoundsFromNotification (notification); + //UIEdgeInsets contentInsets = new UIEdgeInsets (0.0f, 0.0f, keyboardBounds.Size.Height, 0.0f); + //scrollView.ContentInset = contentInsets; + //scrollView.ScrollIndicatorInsets = contentInsets; + CoreGraphics.CGRect viewRectAboveKeyboard = new CoreGraphics.CGRect (this.View.Frame.Location, + new CoreGraphics.CGSize (this.View.Frame.Width, this.View.Frame.Size.Height - keyboardBounds.Size.Height)); + CoreGraphics.CGRect activeFieldAbsoluteFrame = activeView.Superview.ConvertRectToView (activeView.Frame, this.View); + if (!viewRectAboveKeyboard.Contains (activeFieldAbsoluteFrame)) { + //PointF scrollPoint = new PointF (0.0f, + // (float)(activeFieldAbsoluteFrame.Location.Y + activeFieldAbsoluteFrame.Height + // + scrollView.ContentOffset.Y - viewRectAboveKeyboard.Height)); + // scrollView.SetContentOffset (scrollPoint, true); + + scrollView.Bounds = new CoreGraphics.CGRect (0.0f, + (float)(activeFieldAbsoluteFrame.Location.Y + activeFieldAbsoluteFrame.Height + + scrollView.Frame.Y - viewRectAboveKeyboard.Height) + , this.View.Frame.Width, this.View.Frame.Height); + } + //if (this.View.Frame.Height - activeView.Frame.Bottom < keyboardBounds.Size.Height) + // scrollView.Bounds = new CoreGraphics.CGRect (0.0f, this.View.Frame.Height - activeView.Frame.Height - keyboardBounds.Size.Height, this.View.Frame.Width, this.View.Frame.Height); + } + protected virtual void KeyboardWillHideNotification (NSNotification notification) + { + UIView activeView = KeyboardGetActiveView (); + if (activeView == null) + return; + UIView scrollView = activeView.FindSuperviewOfType_Self (this.View, typeof (UIView)) as UIView; + if (scrollView == null) + return; + double animationDuration = UIKeyboard.AnimationDurationFromNotification (notification); + //UIEdgeInsets contentInsets = new UIEdgeInsets (0.0f, 0.0f, 0.0f, 0.0f); + //UIView.Animate (animationDuration, delegate { + // scrollView.ContentInset = contentInsets; + // scrollView.ScrollIndicatorInsets = contentInsets; + //}); + scrollView.Bounds = new CoreGraphics.CGRect (0.0f, 0.0f, this.View.Frame.Width, this.View.Frame.Height); + + } + } + + public static class ViewExtensions + { + public static UIView FindFirstResponder (this UIView view) + { + if (view.IsFirstResponder) { + return view; + } + foreach (UIView subView in view.Subviews) { + var firstResponder = subView.FindFirstResponder (); + if (firstResponder != null) + return firstResponder; + } + return null; + } + public static UIView FindSuperviewOfType (this UIView view, UIView stopAt, Type type) + { + if (view.Superview != null) { + if (type.IsAssignableFrom (view.Superview.GetType ())) { + return view.Superview; + } + if (view.Superview != stopAt) + return view.Superview.FindSuperviewOfType (stopAt, type); + } + return null; + } + + public static UIView FindSuperviewOfType_Self (this UIView view, UIView stopAt, Type type) + { + if (view.Superview != null) { + return view.Superview.FindSuperviewOfType_Self (stopAt, type); + } + return view; + } + } +} diff --git a/HDL-ON_iOS/iTunesArtwork b/HDL-ON_iOS/iTunesArtwork new file mode 100755 index 0000000..f88b1b6 --- /dev/null +++ b/HDL-ON_iOS/iTunesArtwork Binary files differ diff --git a/HDL-ON_iOS/iTunesArtwork@2x b/HDL-ON_iOS/iTunesArtwork@2x new file mode 100755 index 0000000..e4ceb09 --- /dev/null +++ b/HDL-ON_iOS/iTunesArtwork@2x Binary files differ diff --git a/HDL_APP_Project.sln b/HDL_APP_Project.sln new file mode 100644 index 0000000..0ba7460 --- /dev/null +++ b/HDL_APP_Project.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "HDL_ON", "HDL_ON\HDL_ON.shproj", "{A5C296B4-CF9A-4205-ACF0-3A6FEA786F12}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HDL-ON_iOS", "HDL-ON_iOS\HDL-ON_iOS.csproj", "{D998E133-F0DD-4760-BE3C-461632F54DA4}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + Debug|iPhoneSimulator = Debug|iPhoneSimulator + Release|iPhoneSimulator = Release|iPhoneSimulator + Debug|iPhone = Debug|iPhone + Release|iPhone = Release|iPhone + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D998E133-F0DD-4760-BE3C-461632F54DA4}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator + {D998E133-F0DD-4760-BE3C-461632F54DA4}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator + {D998E133-F0DD-4760-BE3C-461632F54DA4}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator + {D998E133-F0DD-4760-BE3C-461632F54DA4}.Release|Any CPU.Build.0 = Release|iPhoneSimulator + {D998E133-F0DD-4760-BE3C-461632F54DA4}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {D998E133-F0DD-4760-BE3C-461632F54DA4}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {D998E133-F0DD-4760-BE3C-461632F54DA4}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {D998E133-F0DD-4760-BE3C-461632F54DA4}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {D998E133-F0DD-4760-BE3C-461632F54DA4}.Debug|iPhone.ActiveCfg = Debug|iPhone + {D998E133-F0DD-4760-BE3C-461632F54DA4}.Debug|iPhone.Build.0 = Debug|iPhone + {D998E133-F0DD-4760-BE3C-461632F54DA4}.Release|iPhone.ActiveCfg = Release|iPhone + {D998E133-F0DD-4760-BE3C-461632F54DA4}.Release|iPhone.Build.0 = Release|iPhone + EndGlobalSection +EndGlobal diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs new file mode 100644 index 0000000..0c630da --- /dev/null +++ b/HDL_ON/Common/R.cs @@ -0,0 +1,50 @@ +using System; + +namespace HDL_ON.R +{ + public static class InternationalizationString + { + public readonly static int Login = 1; + public readonly static int LoginByPhone = 2; + public readonly static int Lights = 3; + public readonly static int TV = 41; + public readonly static int AC = 42; + public readonly static int Curtain = 43; + public readonly static int Music = 44; + public readonly static int Security = 45; + public readonly static int Monitor = 46; + public readonly static int Projector = 47; + public readonly static int ElectricalControl = 265; + public readonly static int FoolHeat = 104; + public readonly static int Scenes = 82; + public readonly static int Thermostat = 527; + public readonly static int VideoIntercom = 464; + public readonly static int Fan = 266; + public readonly static int DoorLock = 10104; + public readonly static int UniversalDevice = 358; + public readonly static int Environmental = 435; + + public readonly static int PlsEntryEmailAddress = 25; + public readonly static int PlsEntryCorrectEmailAddress = 24; + public readonly static int VerificationCodeWrong = 23; + public readonly static int AccountAlreadyExists = 22; + public readonly static int PasswordIsUnqualified=21; + public readonly static int IncorrectRepeatPassword = 20; + public readonly static int PlsEntryCorrectMobilNeumber = 19; + public readonly static int PlsEntryVerificationCode = 18; + public readonly static int PlsRegisterPassword = 16; + public readonly static int PlsRegisterRepeatPassword = 17; + public readonly static int PlsEntryPhoneNumber = 15; + public readonly static int Register = 14; + public readonly static int PasswordLogin = 13; + public readonly static int GetVerificationCode = 12; + public readonly static int Close = 11; + public readonly static int PleaseWait = 10; + public readonly static int VerificationCodeLogin = 9; + public readonly static int SingUp = 8; + public readonly static int ForgetPassword = 7; + public readonly static int PlsEntryPassword = 6; + public readonly static int PlsEntryAccount = 5; + public readonly static int LoginByEmail = 4; + } +} \ No newline at end of file diff --git a/HDL_ON/DAL/FileUtils.cs b/HDL_ON/DAL/FileUtils.cs new file mode 100644 index 0000000..1954b2c --- /dev/null +++ b/HDL_ON/DAL/FileUtils.cs @@ -0,0 +1,593 @@ +锘縰sing System; +using System.IO; +using System.Collections.Generic; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using Shared; +using HDL_ON.UI; +using HDL_ON.DAL.Net; +using HDL_ON.DAL; + +namespace HDL_ON.MyIO +{ + public static class FileUtils + { + public static string RootPath = Environment.GetFolderPath(System.Environment.SpecialFolder.Personal) + "/"; + + /// <summary> + /// 鍒涘缓涓�涓綇瀹呯殑澶囦唤鏂囦欢澶� + /// </summary> + public static string CreateRegionBackup(string regionId) + { + var path = Path.Combine(RootPath, regionId); + if (!Directory.Exists(path)) + { + Directory.CreateDirectory(path); + } + return path + "/"; + } + /// <summary> + /// 鍒ゆ柇鏄惁宸茬粡瀛樺湪浣忓畢鐨勬湰鍦版枃浠跺す + /// </summary> + public static bool ExistRegion(string regionId) + { + var path = Path.Combine(RootPath, regionId); + return Directory.Exists(path); + } + + /// <summary> + /// 鍒犻櫎鎸囧畾鍖哄煙閲岄潰鐨勬墍鏈夋枃浠� + /// </summary> + /// <param name="path">Path.</param> + public static void DeleteRegionFiles(string path) + { + foreach (var fileName in ReadRegionFiles(path)) + { + System.IO.File.Delete(System.IO.Path.Combine(path, fileName)); + MainPage.Log("Del region file :" + fileName); + } + } + + /// <summary> + /// 璇诲彇鍖哄煙鏂囦欢澶归噷闈㈢殑鏂囦欢 + /// </summary> + static List<string> ReadRegionFiles(string regionRootPath) + { + List<string> listFiles = new List<string>(); + DirectoryInfo TheFolder = new DirectoryInfo(regionRootPath); + foreach (FileInfo NextFile in TheFolder.GetFiles()) + { + listFiles.Add(NextFile.Name); + } + return listFiles; + } + + /// <summary> + /// 鎭㈠鍖哄煙鏂囦欢澶归噷闈㈢殑鏂囦欢 + /// </summary> + public static void RestoreRegionFiles(string regionRootPath) + { + DirectoryInfo TheFolder = new DirectoryInfo(regionRootPath); + int index = 0; + var thFolders = TheFolder.GetFiles(); + int folderCount = thFolders.Length; + foreach (FileInfo NextFile in thFolders) + { + index++; + if (NextFile.Name == "null" || NextFile.Name == "UserConfig" || NextFile.Name == "Register_File" || NextFile.Name == "AccountListDB") + { + continue; + } + System.IO.FileInfo fileInfo = new System.IO.FileInfo(regionRootPath + NextFile.Name); + if (fileInfo.Exists) + { + fileInfo.MoveTo(Application.RootPath + NextFile.Name); + MainPage.Log("Restroe : " + NextFile.Name); + } + } + } + + + + /// <summary> + /// 閬嶅巻鏂囦欢 + /// </summary> + public static List<string> ReadFiles(bool reInit = true) + { + List<string> listFiles = new List<string>(); + DirectoryInfo TheFolder = new DirectoryInfo(RootPath); + foreach (FileInfo NextFile in TheFolder.GetFiles()) + { + listFiles.Add(NextFile.Name); + } + try + { + if (reInit) + { + MainPage.LocationFiles = listFiles; + } + } + catch { } + return listFiles; + } + + /// <summary> + /// 鏇存敼鏂囦欢鍚� + /// </summary> + /// <param name="oldFilePath">Old file path.</param> + /// <param name="newFilePath">New file path.</param> + public static void ReNameFile(string oldFilePath, string newFilePath) + { + if (oldFilePath == newFilePath) + { + return; + } + DeleteFile(newFilePath); + System.IO.FileInfo fileInfo = new System.IO.FileInfo(Application.RootPath + oldFilePath); + if (fileInfo.Exists) + { + fileInfo.MoveTo(Application.RootPath + newFilePath); + } + //if (!UserConfig.Instance.LocalFiles.Contains (newFilePath)) { + // UserConfig.Instance.LocalFiles.Add (newFilePath); + //} + } + + + public static void ReNameFoler(string srcFolderPath, string destFolderPath) + { + if (srcFolderPath == destFolderPath) + { + return; + } + var srcPath = Path.Combine(RootPath, srcFolderPath); +#if DEBUG + DirectoryInfo root = new DirectoryInfo (RootPath); + foreach (DirectoryInfo d in root.GetDirectories ()) { + MainPage.Log ("鏂囦欢澶癸細" + d.Name); + } +#endif + if (System.IO.Directory.Exists(srcPath)) + { + System.IO.DirectoryInfo folder = new System.IO.DirectoryInfo(srcPath); + var path = Path.Combine(RootPath, destFolderPath); + if (Directory.Exists(path)) + { + FileAttributes attr0 = File.GetAttributes(path); + if (attr0 == FileAttributes.Directory) + { + Directory.Delete(path, true); + } + else + { + File.Delete(path); + } + } + folder.MoveTo(path); + + +#if DEBUG + List<string> listFiles = new List<string> (); + DirectoryInfo TheFolder = new DirectoryInfo (path); + foreach (FileInfo NextFile in TheFolder.GetFiles ()) { + MainPage.Log (NextFile.Name); + } +#endif + } + +#if DEBUG + foreach (DirectoryInfo d in root.GetDirectories ()) { + MainPage.Log ("鏂囦欢澶癸細" + d.Name); + } +#endif + } + + /// <summary> + /// 鏂囦欢鏄惁瀛樺湪 + /// </summary> + /// <param name="filePath">File path.</param> + public static bool Exists(string filePath) + { + //System.MainPage.WriteLog ("Exists==" + System.IO.Path.Combine (RootPath, filePath)); + return System.IO.File.Exists(System.IO.Path.Combine(RootPath, filePath)); + } + + /// <summary> + /// Deletes the file. + /// </summary> + /// <param name="fileName">File name.</param> + public static void DeleteFile(string fileName) + { + if (fileName == null || fileName == "Language.ini" || fileName == "AccountListDB") + { + return; + } + System.IO.File.Delete(System.IO.Path.Combine(RootPath, fileName)); + MainPage.Log("鍒犻櫎鏂囦欢鍚嶄负锛�" + fileName); + //if (UserConfig.Instance.LocalFiles.Contains (fileName)) { + // UserConfig.Instance.LocalFiles.Remove (fileName); + //} + } + + /// <summary> + /// Deletes all file. + /// </summary> + public static void DeleteAllFile() + { + List<string> filesList = ReadFiles(); + for (int j = 0; j < filesList.Count; j++) + { + var f = filesList[j]; + if (f == "linphonerc" || f == "AccountListDB") + continue; + DeleteFile(f); + } + } + + /// <summary> + /// Reads the equipment message. + /// </summary> + /// <returns>The equipment json data.</returns> + /// <param name="common">Common.</param> + /// <param name="isList">If set to <c>true</c> is list.</param> + /// + /// <param name="commonType"> + /// Commons鏄墍鏈夎澶囩殑鍩虹被锛屼絾鏄綋浼犺繃鏉ョ殑Common鏄疞ightDevice鏃讹紝LightDevice涓嶆槸鐪熸鐨勮澶囷紝 + /// 鐪熸鐨勮澶囨槸瀹冧笅闈㈢殑璋冨厜鍣紙LightDimming锛夋垨鑰呯户鐢靛櫒. + /// 鎵�浠ommon.GetType()鑾峰彇涓嶅埌鐪熷疄鐨勮澶囩被鍨� + /// 鎵�浠ヨ繖閲岃鎵嬪姩浼犲叆璁惧鐨勭被鍨� + /// </param> + public static string ReadEquipmentMessage(Common common) + { + string fileName = "Equipment_"; + if (common.Type.ToString() == "WirelessPanel") + { + fileName += DeviceType.ButtonPanel.ToString() + "_" + common.SubnetID.ToString() + "_" + common.DeviceID.ToString(); + } + else + { + fileName += common.Type + "_" + common.SubnetID.ToString() + "_" + common.DeviceID.ToString(); + } + byte[] bytes1 = ReadFile(fileName); + string one = System.Text.Encoding.UTF8.GetString(bytes1); + return one; + } + + /// <summary> + /// Saves the equipment message. + /// </summary> + public static void SaveEquipmentMessage(Common common, string loopID = "") + { + string deviceType = common.Type.ToString(); + if (common.Type == DeviceType.LightSwitchSocket) + deviceType = DeviceType.LightSwitch.ToString(); + string fileName = "Equipment_" + deviceType + "_" + common.SubnetID + "_" + common.DeviceID; + if (loopID != "") + { + fileName += "_" + (loopID.Length < 2 ? "0" + loopID : loopID); + } + common.SavePath = fileName; + MainPage.Log(fileName); + WriteFileByBytes(fileName, CommonPage.MyEncodingUTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(common))); + } + + /// <summary> + /// Writes the file by bytes. + /// </summary> + /// <returns><c>true</c>, if file by bytes was writed, <c>false</c> otherwise.</returns> + /// <param name="fileName">File name.</param> + /// <param name="bytes">Bytes.</param> + public static bool WriteFileByBytes(string fileName, byte[] bytes) + { + if (fileName == null || (fileName = fileName.Trim()) == ("")) + { + return false; + } + + System.IO.FileStream fs = null; + + try + { + fs = new FileStream(System.IO.Path.Combine(RootPath, fileName), FileMode.Create, FileAccess.Write); + fs.Write(bytes, 0, bytes.Length); + fs.Flush(); + MainPage.Log("SaveFile:" + fileName); + //if (!UserConfig.Instance.LocalFiles.Contains (fileName)) { + // UserConfig.Instance.LocalFiles.Add (fileName); + //} + return true; + } + catch (Exception ex) + { + MainPage.Log("FileUtiles Code 113:" + ex.ToString()); + return false; + } + finally + { + try + { + if (fs != null) + { + fs.Close(); + } + } + catch (Exception ex) + { + MainPage.Log("FileUtils Code 121 :" + ex.ToString()); + } + } + } + + /// <summary> + /// Writes the file by input stream. + /// </summary> + /// <returns><c>true</c>, if file by input stream was writed, <c>false</c> otherwise.</returns> + /// <param name="fileName">File name.</param> + /// <param name="inputStream">Input stream.</param> + /// <param name="isNeedRootPath">If set to <c>true</c> is need root path.</param> + public static bool WriteFileByInputStream(string fileName, System.IO.Stream inputStream) + { + if (fileName == null || (fileName = fileName.Trim()) == ("")) + { + return false; + } + System.IO.FileStream fs = null; + + try + { + byte[] buffer = new byte[4 * 1024]; + int length = 0; + while ((length = inputStream.Read(buffer, 0, buffer.Length)) != 0) + { + if (fs == null) + { + fs = new FileStream(System.IO.Path.Combine(RootPath, fileName), FileMode.Create, FileAccess.Write); + } + fs.Write(buffer, 0, length); + fs.Flush(); + } + + return true; + } + catch + { + return false; + } + finally + { + try + { + if (fs != null) + { + fs.Close(); + } + } + catch + { + } + } + } + + /// <summary> + /// read file + /// </summary> + /// <returns>The file.</returns> + /// <param name="fileName">File name.</param> + public static byte[] ReadImage(string fileName) + { + if (Shared.Application.IsPad) + { + fileName = "Pad/" + fileName; + } + else + { + fileName = "Phone/" + fileName; + } + System.IO.FileStream fs = null; + try + { + if (System.IO.File.Exists(System.IO.Path.Combine(RootPath, fileName))) + { + fs = new FileStream(System.IO.Path.Combine(RootPath, fileName), FileMode.Open, FileAccess.Read); + } + else if (System.IO.File.Exists(fileName)) + { + fs = new FileStream(fileName, FileMode.Open, FileAccess.Read); + } + else + { + return new byte[0]; + } + byte[] bytes = new byte[fs.Length]; + fs.Read(bytes, 0, bytes.Length); + return bytes; + } + catch + { + return new byte[0]; + } + finally + { + try + { + if (fs != null) + { + fs.Close(); + } + } + catch + { + + } + } + } + + public static byte[] ReadFile(string fileName) + { + System.IO.FileStream fs = null; + try + { + if (System.IO.File.Exists(System.IO.Path.Combine(RootPath, fileName))) + { + fs = new FileStream(System.IO.Path.Combine(RootPath, fileName), FileMode.Open, FileAccess.Read); + } + else if (System.IO.File.Exists(fileName)) + { + fs = new FileStream(fileName, FileMode.Open, FileAccess.Read); + } + else + { + return new byte[0]; + } + byte[] bytes = new byte[fs.Length]; + fs.Read(bytes, 0, bytes.Length); + return bytes; + } + catch + { + return new byte[0]; + } + finally + { + try + { + if (fs != null) + { + fs.Close(); + } + } + catch + { + + } + } + } + + /// <summary> + /// 涓嬭浇鐢靛彴銆侀煶涔愩�丏LNA绛夌瓑缃戠粶鍥剧墖 + /// </summary> + /// <param name="fileName"></param> + /// <param name="url"></param> + public static void DownLoadImage(string fileName, string url) + { + #region 濡傛灉褰撳墠鐩綍涓嶅瓨鍦紝灏卞垵濮嬪寲 + string directioryPath = null; + if (Shared.Application.IsPad) + { + directioryPath = "Pad/" + "MusicImage"; + } + else + { + directioryPath = "Phone/" + "MusicImage"; + } + directioryPath = System.IO.Path.Combine(RootPath, directioryPath); + if (!System.IO.Directory.Exists(directioryPath)) + { + System.IO.Directory.CreateDirectory(directioryPath); + } + #endregion + + if (!System.IO.File.Exists(fileName)) + { + System.Threading.Tasks.Task.Run(() => + { + FileStream fs = null; + try + { + HDL_ON.DAL.Net.MyWebClient webClient = new HDL_ON.DAL.Net.MyWebClient(); + byte[] recevieBytes = webClient.DownloadData(new Uri(url)); + fs = new FileStream(fileName, FileMode.Create, FileAccess.Write); + fs.Write(recevieBytes, 0, recevieBytes.Length); + fs.Flush(); + } + catch { } + finally + { + if (fs != null) + { + fs.Close(); + } + } + }); + } + } + + /// <summary> + /// 涓嬭浇鐢靛彴銆侀煶涔愩�丏LNA绛夌瓑缃戠粶鍥剧墖 + /// </summary> + /// <param name="fileName"></param> + /// <param name="url"></param> + public static string DownLoadImageFormBaidu(string album, string artist) + { + var url = "http://tingapi.ting.baidu.com/v1/restserver/ting?from=qianqian&version=2.1.0&method=baidu.ting.search.catalogSug&format=json&query=" + artist; + string directioryPath = "MusicImage"; + directioryPath = System.IO.Path.Combine(RootPath, directioryPath); + if (!System.IO.Directory.Exists(directioryPath)) + { + System.IO.Directory.CreateDirectory(directioryPath); + } + try + { + var song = Newtonsoft.Json.JsonConvert.DeserializeObject<Song>(new HDL_ON.DAL.Net.MyWebClient().DownloadString(new Uri(url))); + if (song == null) + { + return null; + } + foreach (var tempAlbum in song.album) + { + if (tempAlbum.albumname == album && artist == tempAlbum.artistname) + { + var bytes = new HDL_ON.DAL.Net.MyWebClient().DownloadData(new Uri(tempAlbum.artistpic.Split('@')[0] + "@s_1,w_160,h_160")); + var filePath = System.IO.Path.Combine(directioryPath, "AlbumArtistImage_" + album); + var fs = new FileStream(filePath, FileMode.Create, FileAccess.Write); + fs.Write(bytes, 0, bytes.Length); + fs.Flush(); + fs.Close(); + return filePath; + } + } + + foreach (var tempArtist in song.artist) + { + if (artist == tempArtist.artistname) + { + var bytes = new HDL_ON.DAL.Net.MyWebClient().DownloadData(new Uri(tempArtist.artistpic.Split('@')[0] + "@s_1,w_160,h_160")); + var filePath = System.IO.Path.Combine(directioryPath, "AlbumArtistImage_" + artist); + var fs = new FileStream(filePath, FileMode.Create, FileAccess.Write); + fs.Write(bytes, 0, bytes.Length); + fs.Flush(); + fs.Close(); + return filePath; + } + } + + } + catch { } + return null; + } + + } + [System.Serializable] + class Song + { + //string [] ss = new string [] { }; + public List<Album> album = new List<Album>(); + public List<Artist> artist = new List<Artist>(); + public string sss; + } + [System.Serializable] + class Album + { + public string albumname; + public string artistname; + public string artistpic; + } + [System.Serializable] + class Artist + { + public string artistname; + public string artistpic; + } + + +} \ No newline at end of file diff --git a/HDL_ON/DAL/Net/CommonPage.cs b/HDL_ON/DAL/Net/CommonPage.cs new file mode 100644 index 0000000..cd24830 --- /dev/null +++ b/HDL_ON/DAL/Net/CommonPage.cs @@ -0,0 +1,2803 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +//using Newtonsoft.Json.Linq; +////using service.hdlcontrol.com_WebServiceAirQuality; +using HDL_ON.DAL.Net; +using HDL_ON.UI; +using Shared; +using Shared.IOS; +using Shared.Net; + +namespace HDL_ON.DAL +{ + public static class CommonPage + { + + public static bool IsRemote; + //public static AirQuality AirQuality; + public static Action RefreshAir; + public static bool FindGateway = false; + public static bool FindGatewayChilren = false; + public static string FindGatewayChilrenIPAddress = new NetWiFi ().BroadcastIpAddress.ToString (); + public static bool LocalPhoneFindDevice = false; + private static string ip = "0.0.0.0"; + public static System.Net.IPEndPoint EndPoint { + get { + try { + if (FindGateway) { + return new System.Net.IPEndPoint (System.Net.IPAddress.Parse (new NetWiFi ().BroadcastIpAddress.ToString ()), 6000); + } else if (FindGatewayChilren) { + try { + return new System.Net.IPEndPoint (System.Net.IPAddress.Parse (FindGatewayChilrenIPAddress), 6000); + } catch { + return new System.Net.IPEndPoint (System.Net.IPAddress.Parse ("224.0.168.188"), 6000); + } + } else { + return new System.Net.IPEndPoint (System.Net.IPAddress.Parse (new NetWiFi ().BroadcastIpAddress.ToString ()), 6000); + } + } catch { + //闃叉寮傚父瀵艰嚧绋嬪簭閫�鍑� + return new System.Net.IPEndPoint (System.Net.IPAddress.Parse ("127.0.0.1"), 6000); + } + } + } + + ///淇濆瓨璁惧澶囨敞鎵嶇敤gb2312锛屽叾浠栨儏鍐电敤utf8 + public static Encoding MyEncodingUTF8 = Encoding.UTF8;//Get + public static Encoding MyEncodingGB2312 { + get { + try { + if (System.Globalization.CultureInfo.InstalledUICulture.EnglishName.ToUpper().StartsWith("CZECH")) { + return System.Text.Encoding.GetEncoding (1250); + } else { + return Encoding.GetEncoding ("gb2312"); + } + }catch (Exception ex) { + MainPage.Log ("MyEncodingGB2312 Erorr : "+ex.Message); + return Encoding.GetEncoding ("gb2312"); + } + } + } + static bool isHttpListenerStart; + public static DateTime dt; + + //public static byte currentSubnetID = 0; + public static void InitHttpListener () + { + if (isHttpListenerStart) { + return; + } + HttpListener.Start (new NetWiFi ().IpAddress, 6001); + HttpListener.EventHandler -= httpListener_EventHandler; + HttpListener.EventHandler += httpListener_EventHandler; + isHttpListenerStart = true; + } + public static void CloseHttpListener () + { + //isHttpListenerStart = false; + //return; + if (!isHttpListenerStart) + return; + HttpListener.Close (); + isHttpListenerStart = false; + } + /// <summary> + /// 鍒濆鍖栧鐞唖ocket鎺ユ敹鐨勬暟鎹� + /// </summary> + public static void InitReceiveEvent () + { + Packet.ReceiveEvent += Packet_ReceiveEvent; + } + + public static float floatChange (byte b1, byte b2, byte b3, byte b4) + { + byte [] byteTemp = new byte [4] { b4, b3, b2, b1 }; + return BitConverter.ToSingle (byteTemp, 0); + } + + + static void Packet_ReceiveEvent (byte subnetID, byte deviceID, Command command, byte [] usefullBytes, string revGatewayIP) + { + + //try { + // List<byte> ButtonBkeyModelList = new List<byte> (); + // switch (command) { + // case Command.ReadAnalogACK: + // if (UserConfig.Instance.IsSetHomePageSensor) { + // DeviceType deviceType2 = (DeviceType)(usefullBytes [0] * 256 + usefullBytes [1]); + // switch (deviceType2) { + // case DeviceType.SensorPM25: + // if(UserConfig.Instance.pm25.SubnetID == subnetID&& UserConfig.Instance.pm25.DeviceID == deviceID && UserConfig.Instance.pm25.LoopID == usefullBytes[2]) { + // switch(usefullBytes [3]) { + // case 1://鏃犵鍙锋暣褰� + // UserConfig.Instance.pm25.values = usefullBytes [5] * 256 * 256 * 256 + usefullBytes [6] * 256 * 256 + usefullBytes [7] * 256 + usefullBytes [8]; + // break; + // case 2://鏈夌鍙锋暣褰� + // if (usefullBytes [5] > 128) { + // UserConfig.Instance.pm25.values = (1 - (usefullBytes [5] - 128) * 256 * 256 * 256 + usefullBytes [6] * 256 * 256 + usefullBytes [7] * 256 + usefullBytes [8]); + // } else { + // UserConfig.Instance.pm25.values = usefullBytes [5] * 256 * 256 * 256 + usefullBytes [6] * 256 * 256 + usefullBytes [7] * 256 + usefullBytes [8]; + // } + // break; + // case 3://Float + // UserConfig.Instance.pm25.values = (double) floatChange (usefullBytes [5], usefullBytes [6], usefullBytes [7], usefullBytes [8]); + // break; + // } + // } + // break; + // case DeviceType.SensorTemperature: + // if (UserConfig.Instance.temp.SubnetID == subnetID && UserConfig.Instance.temp.DeviceID == deviceID && UserConfig.Instance.temp.LoopID == usefullBytes [2]) { + // switch (usefullBytes [3]) { + // case 1://鏃犵鍙锋暣褰� + // UserConfig.Instance.temp.values = usefullBytes [5] * 256 * 256 * 256 + usefullBytes [6] * 256 * 256 + usefullBytes [7] * 256 + usefullBytes [8]; + // break; + // case 2://鏈夌鍙锋暣褰� + // if (usefullBytes [5] > 128) { + // UserConfig.Instance.temp.values = (1 - (usefullBytes [5] - 128) * 256 * 256 * 256 + usefullBytes [6] * 256 * 256 + usefullBytes [7] * 256 + usefullBytes [8]); + // } else { + // UserConfig.Instance.temp.values = usefullBytes [5] * 256 * 256 * 256 + usefullBytes [6] * 256 * 256 + usefullBytes [7] * 256 + usefullBytes [8]; + // } + // break; + // case 3://Float + // UserConfig.Instance.temp.values = (double)floatChange (usefullBytes [8], usefullBytes [7], usefullBytes [6], usefullBytes [5]); + // break; + // } + // } + // break; + // case DeviceType.SensorCO2: + // if (UserConfig.Instance.co2.SubnetID == subnetID && UserConfig.Instance.co2.DeviceID == deviceID && UserConfig.Instance.co2.LoopID == usefullBytes [2]) { + // switch (usefullBytes [3]) { + // case 1://鏃犵鍙锋暣褰� + // UserConfig.Instance.co2.values = usefullBytes [5] * 256 * 256 * 256 + usefullBytes [6] * 256 * 256 + usefullBytes [7] * 256 + usefullBytes [8]; + // break; + // case 2://鏈夌鍙锋暣褰� + // if (usefullBytes [5] > 128) { + // UserConfig.Instance.co2.values = (1 - (usefullBytes [5] - 128) * 256 * 256 * 256 + usefullBytes [6] * 256 * 256 + usefullBytes [7] * 256 + usefullBytes [8]); + // } else { + // UserConfig.Instance.co2.values = usefullBytes [5] * 256 * 256 * 256 + usefullBytes [6] * 256 * 256 + usefullBytes [7] * 256 + usefullBytes [8]; + // } + // break; + // case 3://Float + // UserConfig.Instance.co2.values = (double)floatChange (usefullBytes [8], usefullBytes [7], usefullBytes [6], usefullBytes [5]); + // break; + // } + // } + // break; + // case DeviceType.SensorHumidity: + // if (UserConfig.Instance.humidity.SubnetID == subnetID && UserConfig.Instance.humidity.DeviceID == deviceID && UserConfig.Instance.humidity.LoopID == usefullBytes [2]) { + // switch (usefullBytes [3]) { + // case 1://鏃犵鍙锋暣褰� + // UserConfig.Instance.humidity.values = usefullBytes [5] * 256 * 256 * 256 + usefullBytes [6] * 256 * 256 + usefullBytes [7] * 256 + usefullBytes [8]; + // break; + // case 2://鏈夌鍙锋暣褰� + // if (usefullBytes [5] > 128) { + // UserConfig.Instance.humidity.values = (1 - (usefullBytes [5] - 128) * 256 * 256 * 256 + usefullBytes [6] * 256 * 256 + usefullBytes [7] * 256 + usefullBytes [8]); + // } else { + // UserConfig.Instance.humidity.values = usefullBytes [5] * 256 * 256 * 256 + usefullBytes [6] * 256 * 256 + usefullBytes [7] * 256 + usefullBytes [8]; + // } + // break; + // case 3://Float + // UserConfig.Instance.humidity.values = (double)floatChange (usefullBytes [8], usefullBytes [7], usefullBytes [6], usefullBytes [5]); + // break; + // } + // } + // break; + // case DeviceType.SensorTVOC: + // if (UserConfig.Instance.tvoc.SubnetID == subnetID && UserConfig.Instance.tvoc.DeviceID == deviceID && UserConfig.Instance.tvoc.LoopID == usefullBytes [2]) { + // switch (usefullBytes [3]) { + // case 1://鏃犵鍙锋暣褰� + // UserConfig.Instance.tvoc.values = usefullBytes [5] * 256 * 256 * 256 + usefullBytes [6] * 256 * 256 + usefullBytes [7] * 256 + usefullBytes [8]; + // break; + // case 2://鏈夌鍙锋暣褰� + // if (usefullBytes [5] > 128) { + // UserConfig.Instance.tvoc.values = (1 - (usefullBytes [5] - 128) * 256 * 256 * 256 + usefullBytes [6] * 256 * 256 + usefullBytes [7] * 256 + usefullBytes [8]); + // } else { + // UserConfig.Instance.tvoc.values = usefullBytes [5] * 256 * 256 * 256 + usefullBytes [6] * 256 * 256 + usefullBytes [7] * 256 + usefullBytes [8]; + // } + // break; + // case 3://Float + // UserConfig.Instance.tvoc.values = (double)floatChange (usefullBytes [8], usefullBytes [7], usefullBytes [6], usefullBytes [5]); + // break; + // } + // } + // break; + // } + // } + // break; + // case Command.ReadThermostatExtensionACK: + // case Command.SetThermostatExtensionACK: + // foreach (var room in Room.Lists) { + // var commons = room.DeviceList.FindAll ((obj) => obj.SubnetID == subnetID && obj.DeviceID == deviceID && obj.Type == DeviceType.Thermostat); + // if (commons != null && commons.Count>0) { + // foreach (var common in commons) { + // var cac = common as Thermostat; + // if (cac.ExtensionID == usefullBytes [0]) { + // // 1 閫氶亾鍙� 1-255 + // // 2 娓╂帶鍣ㄥ紑/鍏虫満 0-鍏虫満锛�1-寮�鏈� + // // 3 妯℃嫙閲忔縺娲讳綅 浠庝綆浣嶅紑濮� 濡俠it0瀵瑰簲娓╂帶鍣ㄧ幆澧冩俯搴﹀�� + // // 4-7 娓╂帶鍣ㄧ幆澧冩俯搴﹀�� 娴偣鍨嬫暟鎹� 鈩� IEEE 754娴偣鏁� + // // 8-11 娓╂帶鍣ㄨ缃俯搴﹀�� 娴偣鍨嬫暟鎹� 鈩� IEEE 754娴偣鏁� + // // 12-15 娓╂帶鍣ㄧ幆澧冩箍搴﹀�� 娴偣鍨嬫暟鎹� % IEEE 754娴偣鏁� + // // 16-19 娓╂帶鍣ㄨ缃箍搴﹀�� 娴偣鍨嬫暟鎹� % IEEE 754娴偣鏁� + // cac.Power = usefullBytes [1]; + // cac.AnalogActivationByte = usefullBytes [2]; + // cac.Indoor_Temperature_Values1 = usefullBytes [3]; + // cac.Indoor_Temperature_Values2 = usefullBytes [4]; + // cac.Indoor_Temperature_Values3 = usefullBytes [5]; + // cac.Indoor_Temperature_Values4 = usefullBytes [6]; + // cac.Setting_Temperature_Values1 = usefullBytes [7]; + // cac.Setting_Temperature_Values2 = usefullBytes [8]; + // cac.Setting_Temperature_Values3 = usefullBytes [9]; + // cac.Setting_Temperature_Values4 = usefullBytes [10]; + // cac.Indoor_Humidity_Values1 = usefullBytes [11]; + // cac.Indoor_Humidity_Values2 = usefullBytes [12]; + // cac.Indoor_Humidity_Values3 = usefullBytes [13]; + // cac.Indoor_Humidity_Values4 = usefullBytes [14]; + // cac.Setting_Humidity_Values1 = usefullBytes [15]; + // cac.Setting_Humidity_Values2 = usefullBytes [16]; + // cac.Setting_Humidity_Values3 = usefullBytes [17]; + // cac.Setting_Humidity_Values4 = usefullBytes [18]; + + // MainPage.WriteLog ("ReadThermostatExtensionACK : 222"); + // UserRoom.UpdateThermostatExtensionTempAndHumidityValues (cac); + // MainPage.WriteLog ("ReadThermostatExtensionACK : 333"); + // ThermostatExtensionPage.UpdateStatus (cac); + // MainPage.WriteLog ("ReadThermostatExtensionACK : 444"); + // ThermostatHostPage.UpdateExtensionStatus (cac); + // MainPage.WriteLog ("ReadThermostatExtensionACK : 555"); + // IO.FileUtils.SaveEquipmentMessage (cac, cac.LoopID.ToString ()); + // } + // } + // } + // } + // break; + + // case Command.ReadThermostatHostACK: + // case Command.SetThermostatHostACK: + // foreach (var cac in Room.Thermostat_HostList) { + // if (cac.SubnetID == subnetID && cac.DeviceID == deviceID && cac.HostID == usefullBytes [0]) { + // // 1 閫氶亾鍙� + // // 2 寮�/鍏虫満 0--鍏� 1--寮� + // // 3 杩愯妯″紡 1-鍒跺喎锛�2-鍒剁儹锛�3-閫氶锛�4-闄ゆ箍锛�5-鍒剁儹闄ゆ箍 + // // 4 杩愯鍦烘櫙 1-鍦ㄥ锛�2-绂诲锛�3-鐫$湢 + // // 5 婀垮害妗d綅 1-浣庯紝2-涓紝3-楂橈紙鍙湪鍒剁儹妯″紡涓嬪彲浠ヨ缃級 + // // 6 婊ょ綉鐧惧垎姣� % + // // 7 娓╂帶鍣ㄥ垎鏈烘暟閲� 1-32 + // // 8-9 鏁呴殰淇℃伅1 + // // 10-11 鏁呴殰淇℃伅2 + // // 12-13 鏁呴殰淇℃伅3 + // // 14-15 鏁呴殰淇℃伅4 + // // 16-17 鏁呴殰淇℃伅5 + // // 18-19 鏁呴殰淇℃伅6 + // // 20-21 妯℃嫙閲忔縺娲讳綅 浠庝綆浣嶅紑濮嬶紝濡俥nable[0] 鐨刡it0--->瀹ゅ唴娓╁害 + // // 22-25 妯℃嫙閲�1锛坆it0锛夊鍐呮俯搴� 娴偣鍨嬫暟鎹� IEEE 754娴偣鏁� + // // 26-29 妯℃嫙閲�2锛坆it1锛夊鍐呮箍搴� 娴偣鍨嬫暟鎹� 0-100 % IEEE 754娴偣鏁� + // // 30-33 妯℃嫙閲�3锛坆it2锛夊鍐匔O2 娴偣鍨嬫暟鎹� PPM IEEE 754娴偣鏁� + // // 34-37 妯℃嫙閲�4锛坆it3锛夊鍐匱VOC 娴偣鍨嬫暟鎹� 绾� IEEE 754娴偣鏁� + // // 38-41 妯℃嫙閲�5锛坆it4锛夊鍐匬M2.5 娴偣鍨嬫暟鎹� PPM IEEE 754娴偣鏁� + // // 42-45 妯℃嫙閲�6锛坆it5锛夊澶栨俯搴� 娴偣鍨嬫暟鎹� IEEE 754娴偣鏁� + // // 46-49 妯℃嫙閲�7锛坆it6锛夊澶栨箍搴� 娴偣鍨嬫暟鎹� 0-100 % IEEE 754娴偣鏁� + // // 50-53 妯℃嫙閲�8锛坆it7锛夊澶朠M2.5 娴偣鍨嬫暟鎹� PPM IEEE 754娴偣鏁� + // cac.LoopID = 1; + // cac.Power = usefullBytes [1]; + // cac.CurrentMode = usefullBytes [2]; + // cac.CurrentScene = usefullBytes [3]; + // cac.HumidityLevel = usefullBytes [4]; + // cac.StrainerState = usefullBytes [5]; + // cac.ExtensionCount = usefullBytes [6]; + // cac.FaultInformation1 = usefullBytes [7] * 256 + usefullBytes [8]; + // cac.FaultInformation1 = usefullBytes [9] * 256 + usefullBytes [10]; + // cac.FaultInformation1 = usefullBytes [11] * 256 + usefullBytes [12]; + // cac.FaultInformation1 = usefullBytes [13] * 256 + usefullBytes [14]; + // cac.FaultInformation1 = usefullBytes [15] * 256 + usefullBytes [16]; + // cac.FaultInformation1 = usefullBytes [17] * 256 + usefullBytes [18]; + // cac.AnalogActivationByte = usefullBytes [19]; + // cac.AnalogActivationByte2 = usefullBytes [20]; + // var AnalogActivationIndexString = Convert.ToString (cac.AnalogActivationByte2,2).PadLeft(8,'0'); + // if (AnalogActivationIndexString [7] == '1') { + // cac.Indoor_Temperature_Values1 = usefullBytes [21]; + // cac.Indoor_Temperature_Values2 = usefullBytes [22]; + // cac.Indoor_Temperature_Values3 = usefullBytes [23]; + // cac.Indoor_Temperature_Values4 = usefullBytes [24]; + // } + // if (AnalogActivationIndexString [6] == '1') { + // cac.Indoor_Humidity_Values1 = usefullBytes [25]; + // cac.Indoor_Humidity_Values2 = usefullBytes [26]; + // cac.Indoor_Humidity_Values3 = usefullBytes [27]; + // cac.Indoor_Humidity_Values4 = usefullBytes [28]; + // } + // if (AnalogActivationIndexString [5] == '1') { + // cac.Indoor_CO2_Values1 = usefullBytes [29]; + // cac.Indoor_CO2_Values2 = usefullBytes [30]; + // cac.Indoor_CO2_Values3 = usefullBytes [31]; + // cac.Indoor_CO2_Values4 = usefullBytes [32]; + // } + // if (AnalogActivationIndexString [4] == '1') { + // cac.Indoor_TVOC_Values1 = usefullBytes [33]; + // cac.Indoor_TVOC_Values2 = usefullBytes [34]; + // cac.Indoor_TVOC_Values3 = usefullBytes [35]; + // cac.Indoor_TVOC_Values4 = usefullBytes [36]; + // } + // if (AnalogActivationIndexString [3] == '1') { + // cac.Indoor_PM25_Values1 = usefullBytes [37]; + // cac.Indoor_PM25_Values2 = usefullBytes [38]; + // cac.Indoor_PM25_Values3 = usefullBytes [39]; + // cac.Indoor_PM25_Values4 = usefullBytes [40]; + // } + // if (AnalogActivationIndexString [2] == '1') { + // cac.Outdoor_Temperature_Values1 = usefullBytes [41]; + // cac.Outdoor_Temperature_Values2 = usefullBytes [42]; + // cac.Outdoor_Temperature_Values3 = usefullBytes [43]; + // cac.Outdoor_Temperature_Values4 = usefullBytes [44]; + // } + // if (AnalogActivationIndexString [1] == '1') { + // cac.Outdoor_Humidity_Values1 = usefullBytes [45]; + // cac.Outdoor_Humidity_Values2 = usefullBytes [46]; + // cac.Outdoor_Humidity_Values3 = usefullBytes [47]; + // cac.Outdoor_Humidity_Values4 = usefullBytes [48]; + // } + // if (AnalogActivationIndexString [0] == '1') { + // cac.Outdoor_PM25_Values1 = usefullBytes [49]; + // cac.Outdoor_PM25_Values2 = usefullBytes [50]; + // cac.Outdoor_PM25_Values3 = usefullBytes [51]; + // cac.Outdoor_PM25_Values4 = usefullBytes [52]; + // } + + + // ThermostatHostPage.UpdateStatus (cac); + // ThermostatExtensionPage.UptateMode (cac); + // foreach (var room in Room.Lists) { + // foreach (var device in room.DeviceList) { + // if (device.Type == DeviceType.Thermostat) { + // var cac1 = device as Thermostat; + // if (cac.SubnetID == cac1.SubnetID && cac.DeviceID == cac1.DeviceID && cac.HostID == cac1.HostID) { + // cac1.CurrentMode = cac.CurrentMode; + // UserRoom.UpdateThermostatModeStatus (cac1); + // IO.FileUtils.SaveEquipmentMessage (cac1, cac1.LoopID.ToString ()); + // } + // } + // } + // } + // IO.FileUtils.SaveEquipmentMessage (cac); + // } + // } + // break; + // case Command.FreshAirReadACK: + // case Command.FreshAirControlACK: + // foreach (var room in Room.Lists) { + // var common = room.DeviceList.Find ((obj) => obj.SubnetID == subnetID && obj.DeviceID == deviceID && obj.LoopID == usefullBytes [0] && obj.Type == DeviceType.FreshAir); + // if (common != null) { + // var fresAirReceive = common as FreshAir; + // fresAirReceive.SwitchStatus = usefullBytes [1]; + // fresAirReceive.WindSpeed = usefullBytes [2]; + // fresAirReceive.SetPattern = usefullBytes [3]; + // fresAirReceive.EnableValue1 = usefullBytes [4]; + // fresAirReceive.EnableValue2 = usefullBytes [5]; + // if (usefullBytes.Length > 6) { + // fresAirReceive.InTemp = floatChange (usefullBytes [6], usefullBytes [7], usefullBytes [8], usefullBytes [9]); + // fresAirReceive.OutTemp = floatChange (usefullBytes [10], usefullBytes [11], usefullBytes [12], usefullBytes [13]); + // fresAirReceive.Humidity = floatChange (usefullBytes [14], usefullBytes [15], usefullBytes [16], usefullBytes [17]); + // fresAirReceive.PM25 = floatChange (usefullBytes [18], usefullBytes [19], usefullBytes [20], usefullBytes [21]); + // fresAirReceive.TVOC = floatChange (usefullBytes [22], usefullBytes [23], usefullBytes [24], usefullBytes [25]); + // fresAirReceive.CO2 = floatChange (usefullBytes [26], usefullBytes [27], usefullBytes [28], usefullBytes [29]); + // } + // IO.FileUtils.SaveEquipmentMessage (fresAirReceive, fresAirReceive.LoopID.ToString ()); + // UserFresAirList.UpdateStatus (fresAirReceive); + // UserRoom.UpdataDeviceStatus (fresAirReceive); + // UserFreshAirPage.UpdateStatus (fresAirReceive); + // } + // } + // break; + // case Command.SetArmACK: + // case Command.ReadArmACK: + // if (Application.IsPad) { } else { + // SecurityModul sm = new SecurityModul () { + // SubnetID = subnetID, + // DeviceID = subnetID, + // LoopID = usefullBytes [0], + // AreaType = usefullBytes [1], + // }; + // UserSecurityAreaPage.UpdateStatus (sm); + // } + // break; + // case Command.ReadLightEquipmentAllLoopBrightnessACK://18145611909 + // for (byte i = 1; i <= usefullBytes [0]; i++) { + // bool updateLightStatus = true; + // foreach (var room in Room.Lists) { + // Common common = null; + // var commons = room.DeviceList.FindAll ((obj) => obj.SubnetID == subnetID && obj.DeviceID == deviceID); + // if (commons.Count > 0) { + // foreach (var c in commons) { + // if (c.Type == DeviceType.LightMixDimming) { + // var rcuDimming = (c as LightMixDimming); + // if (rcuDimming.SubnetID == subnetID && rcuDimming.DeviceID == deviceID && rcuDimming.PhysicsLoopID == i) { + // if (rcuDimming.CurrentBrightness == usefullBytes [i]) { + // updateLightStatus = false; + // } + // rcuDimming.CurrentBrightness = usefullBytes [i]; + // common = rcuDimming; + // } + // } + // if (c.Type == DeviceType.LightMixSwitch) { + // var rcuSwitch = (c as LightMixSwitch); + // if (rcuSwitch.SubnetID == subnetID && rcuSwitch.DeviceID == deviceID && rcuSwitch.PhysicsLoopID == i) { + // if (rcuSwitch.CurrentBrightness == usefullBytes [i]) { + // updateLightStatus = false; + // } + // rcuSwitch.CurrentBrightness = usefullBytes [i]; + // common = rcuSwitch; + // } + // } + // } + // } + // if (common == null) + // common = room.DeviceList.Find ((obj) => obj.SubnetID == subnetID && obj.DeviceID == deviceID && obj.LoopID == i); + // if (common != null) { + // //foreach (var common in room.DeviceList) { + // //if (common.SubnetID != subnetID || common.DeviceID != deviceID || common.LoopID != i) { + // // continue; + // //} + // common.LastUpdateTime = DateTime.Now; + // if (common.Type == DeviceType.LightSwitch || common.Type == DeviceType.LightSwitchSocket || common.Type == DeviceType.LightEnergySwitch) { + // if ((common as LightSwitch).CurrentBrightness == usefullBytes [i]) { + // updateLightStatus = false; + // } + // (common as LightSwitch).CurrentBrightness = usefullBytes [i]; + // } else if (common.Type == DeviceType.LightDimming) { + // if ((common as LightDimming).CurrentBrightness == usefullBytes [i]) { + // updateLightStatus = false; + // } + // (common as LightDimming).CurrentBrightness = usefullBytes [i]; + // } else if (common.Type == DeviceType.FanModule) { + // if ((common as FanModule).Switch == usefullBytes [i]) { + // updateLightStatus = false; + // } + // (common as FanModule).Switch = usefullBytes [i]; + // if (usefullBytes [i] != 0) + // (common as FanModule).WindSpeed = usefullBytes [i]; + // } else if (common.Type == DeviceType.LightDALI) { + // if ((common as LightDALI).CurrentBrightness == usefullBytes [i]) { + // updateLightStatus = false; + // } + // (common as LightDALI).CurrentBrightness = usefullBytes [i]; + // } + // string updateFlag = common.CommonLoopID; + // if (Application.IsPad) { + // //Pad.UserLightPage.UpdateStatus (updateFlag, usefullBytes [i]); + // //Pad.UserDeviceToLight.UpdateStatus (); + // //Pad.UserDeviceToLight.UpdateAllLightsStatus (updateFlag, usefullBytes [i]); + // //Pad.UserDeviceToSocket.UpdateStatus (updateFlag, usefullBytes [i]); + // //Pad.UserFan.UpdataFanView (updateFlag, usefullBytes [i]); + // } else { + // UserDeviceToLight.UpdateBrighingCount (updateFlag); + // if (updateLightStatus) { + // UserRoom.UpdataDeviceStatus (common); + // UserLightPage.UpdateStatus (updateFlag, usefullBytes [i]); + // UserDeviceToLight.UpdateStatus (updateFlag, usefullBytes [i]); + // UserFan.UpdataFanView (updateFlag, usefullBytes [i]); + // UserDeviceToFan.UpdataStatus (updateFlag, usefullBytes [i]); + // UserDeviceToSocket.UpdateStatus (updateFlag, usefullBytes [i]); + // } + // } + // } + // } + // } + // break; + // case Command.SetSingleLightACK: + // foreach (var room in Room.Lists) { + // var common = room.DeviceList.Find ((obj) => obj.CommonLoopID == subnetID.ToString () + "_" + deviceID.ToString () + "_" + usefullBytes [0].ToString ()); + // if (common != null) { + // //foreach (var common in room.DeviceList) { + // if (common.CommonLoopID != subnetID.ToString () + "_" + deviceID.ToString () + "_" + usefullBytes [0].ToString ()) { + // continue; + // } + // string updateFlag = common.CommonLoopID; + // if (common.Type == DeviceType.LightRGB) { + // break; + // } + // common.LastUpdateTime = DateTime.Now; + // bool hadBeUpdate = true; + // if (common.Type == DeviceType.LightSwitch || common.Type == DeviceType.LightSwitchSocket || common.Type == DeviceType.LightSwitchSocket) { + // if ((common as LightSwitch).CurrentBrightness == usefullBytes [2]) + // hadBeUpdate = false; + // (common as LightSwitch).CurrentBrightness = usefullBytes [2]; + // } else if (common.Type == DeviceType.LightDimming) { + // if ((common as LightDimming).CurrentBrightness == usefullBytes [2]) + // hadBeUpdate = false; + // (common as LightDimming).CurrentBrightness = usefullBytes [2]; + // } else if (common.Type == DeviceType.FanModule) { + // if ((common as FanModule).Switch == usefullBytes [2]) + // hadBeUpdate = false; + // (common as FanModule).Switch = usefullBytes [2]; + // if (usefullBytes [2] != 0) + // (common as FanModule).WindSpeed = usefullBytes [2]; + // } else if (common.Type == DeviceType.LightMixSwitch) { + // if ((common as LightMixSwitch).CurrentBrightness == usefullBytes [2]) + // hadBeUpdate = false; + // (common as LightMixSwitch).CurrentBrightness = usefullBytes [2]; + // } else if (common.Type == DeviceType.LightMixDimming) { + // if ((common as LightMixDimming).CurrentBrightness == usefullBytes [2]) + // hadBeUpdate = false; + // (common as LightMixDimming).CurrentBrightness = usefullBytes [2]; + // } else if (common.Type == DeviceType.LightDALI) { + // if ((common as LightDALI).CurrentBrightness == usefullBytes [2]) + // hadBeUpdate = false; + // (common as LightDALI).CurrentBrightness = usefullBytes [2]; + // } + // if (Application.IsPad) { + // //Pad.UserLightPage.UpdateStatus (updateFlag, usefullBytes [2]); + // //Pad.UserDeviceToLight.UpdateStatus (); + // //Pad.UserDeviceToLight.UpdateAllLightsStatus (updateFlag, usefullBytes [2]); + // //Pad.UserDeviceToSocket.UpdateStatus (updateFlag, usefullBytes [2]); + // //Pad.UserFan.UpdataFanView (updateFlag, usefullBytes [2]); + // //break; + // } else { + // UserDeviceToLight.UpdateBrighingCount (updateFlag); + // if (hadBeUpdate) { + // UserRoom.UpdataDeviceStatus (common); + // UserLightPage.UpdateStatus (updateFlag, usefullBytes [2]); + // UserDeviceToLight.UpdateStatus (updateFlag, usefullBytes [2]); + // UserFan.UpdataFanView (updateFlag, usefullBytes [2]); + // UserDeviceToFan.UpdataStatus (updateFlag, usefullBytes [2]); + // UserDeviceToSocket.UpdateStatus (updateFlag, usefullBytes [2]); + // } + // //break; + // } + // } + // } + // break; + // case Command.SetSceneACK: + // /// [0]// 鍖哄彿1-n锛� 255琛ㄧず鎵�鏈夊尯(鐢ㄤ簬骞挎挱鍦烘櫙) 1byte // /// [1]// 鍦哄彿0-x 1byte + // /// [2]// 鍥炶矾鎬绘暟n 1byte + // /// [3]// 鍥炶矾鐘舵��:bit浣� 0鍏炽��1寮�锛�(byte锛歜it0-7瀵瑰簲1-8鍥炶矾 ...n鍥炶矾) ((n+7)/8) byte + // foreach (var room in Room.Lists) { + // var commonList = room.DeviceList.FindAll ((obj) => obj.CommonLoopID == subnetID.ToString () + "_" + deviceID.ToString () + "_" + usefullBytes [0].ToString ()); + // if (commonList != null && commonList.Count > 0) { + // foreach (var common in commonList) { + // if (common.LoopID > usefullBytes [2]) { + // continue; + // } + // string updateFlag = common.CommonLoopID; + // int useIndex = common.LoopID / 8; + // int selfIndex = common.LoopID % 8; + // var binaryString = Convert.ToString (usefullBytes [2 + useIndex], 2).ToCharArray(); + // byte ackSceneBrightness = 100; + // if (binaryString [selfIndex] == '0') { + // ackSceneBrightness = 0; + // } + // if (common.Type == DeviceType.LightRGB) { + // break; + // } + // common.LastUpdateTime = DateTime.Now; + // bool hadBeUpdate = true; + // if (common.Type == DeviceType.LightSwitch || common.Type == DeviceType.LightSwitchSocket || common.Type == DeviceType.LightSwitchSocket) { + // if ((common as LightSwitch).CurrentBrightness == ackSceneBrightness) + // hadBeUpdate = false; + // (common as LightSwitch).CurrentBrightness = ackSceneBrightness; + // } else if (common.Type == DeviceType.LightDimming) { + // if ((common as LightDimming).CurrentBrightness == ackSceneBrightness) + // hadBeUpdate = false; + // (common as LightDimming).CurrentBrightness = ackSceneBrightness; + // } else if (common.Type == DeviceType.FanModule) { + // if ((common as FanModule).Switch == ackSceneBrightness) + // hadBeUpdate = false; + // (common as FanModule).Switch = ackSceneBrightness; + // if (ackSceneBrightness != 0) + // (common as FanModule).WindSpeed = ackSceneBrightness; + // } else if (common.Type == DeviceType.LightMixSwitch) { + // if ((common as LightMixSwitch).CurrentBrightness == ackSceneBrightness) + // hadBeUpdate = false; + // (common as LightMixSwitch).CurrentBrightness = ackSceneBrightness; + // } else if (common.Type == DeviceType.LightMixDimming) { + // if ((common as LightMixDimming).CurrentBrightness == ackSceneBrightness) + // hadBeUpdate = false; + // (common as LightMixDimming).CurrentBrightness = ackSceneBrightness; + // } else if (common.Type == DeviceType.LightDALI) { + // if ((common as LightDALI).CurrentBrightness == ackSceneBrightness) + // hadBeUpdate = false; + // (common as LightDALI).CurrentBrightness = ackSceneBrightness; + // } + // if (Application.IsPad) { + + // } else { + // UserDeviceToLight.UpdateBrighingCount (updateFlag); + // if (hadBeUpdate) { + // UserRoom.UpdataDeviceStatus (common); + // UserLightPage.UpdateStatus (updateFlag, ackSceneBrightness); + // UserDeviceToLight.UpdateStatus (updateFlag, ackSceneBrightness); + // UserFan.UpdataFanView (updateFlag, ackSceneBrightness); + // UserDeviceToFan.UpdataStatus (updateFlag, ackSceneBrightness); + // UserDeviceToSocket.UpdateStatus (updateFlag, ackSceneBrightness); + // } + // //break; + // } + // } + // } + // } + // break; + // case Command.ReadAnalogValueACK: + // foreach (var room in Room.Lists) { + // foreach (var common in room.DeviceList) { + // if (common.SubnetID != subnetID || common.DeviceID != deviceID || common.LoopID != usefullBytes [1]) { + // continue; + // } + // if (common.Type == DeviceType.LightEnergySwitch) { + // string updateFlag = common.CommonLoopID; + // if (!Application.IsPad) { + // UserDeviceToSocket.UpdataEnergy (updateFlag, usefullBytes [2] * 256 + usefullBytes [3]); + // UserRoom.UpdataEnergy (updateFlag, usefullBytes [2] * 256 + usefullBytes [3]); + // break; + // } else { + // //Pad.UserDeviceToSocket.UpdataEnergy (updateFlag, usefullBytes [2] + usefullBytes [3]); + // break; + // } + // } + + // int dddd = usefullBytes [0] & 0x3F; + + // // 0xXX锛氬叕鍙稿唴閮ㄥ崗璁搴旂殑搴忓彿 + // // common.Type锛氬搴旂殑鏄紪杈戣蒋浠剁殑搴忓彿(娌℃湁涓�涓�瀵瑰簲锛屾槸涓轰簡灏嗙浉杩戠殑璋冩暣鍦ㄤ竴璧凤紝鏂逛究瀹㈡埛浣跨敤) + // if (dddd == 0x09 && common.Type == DeviceType.SensorPM25) { + // // PM2.5 + // int value = (usefullBytes [2] & 0xFF) * 256 + (usefullBytes [3] & 0xFF); + // (common as SensorPM25).CurrentPM25 = value; + // //} else if (dddd == 0x13 && common.Type == 1) { + // // PM10 + // //int value = (usefullBytes [2] & 0xFF) * 256 + (usefullBytes [3] & 0xFF); + // //common.value = value; + // //} else if (dddd == 0x0D && common.Type == DeviceType.SensorCH4) { + // //// 姘ф皵 + // //int value = (usefullBytes [2] & 0xFF) * 256 + (usefullBytes [3] & 0xFF); + // //common.value = value; + // } else if (dddd == 0x07 && common.Type == DeviceType.SensorCO2) { + // // CO2 + // int value = (usefullBytes [2] & 0xFF) * 256 + (usefullBytes [3] & 0xFF); + // (common as SensorCO2).CurrentCO2 = value; + // //} else if (dddd == 0x10 && common.Type == DeviceType.co) { + // //// CO + // //int value = (usefullBytes [2] & 0xFF) * 256 + (usefullBytes [3] & 0xFF); + // //common.value = value; + // } else if (dddd == 0x05 && common.Type == DeviceType.SensorHumidity) { + // // 婀垮害 + // int value = (usefullBytes [2] & 0xFF) * 256 + (usefullBytes [3] & 0xFF); + // (common as SensorHumidity).CurrentHumidity = value; + // } else if (dddd == 0x01 && common.Type == DeviceType.SensorTemperature) { + // // Temperature + // if (usefullBytes [2] >> 7 == 0) {// 娓╁害 + // int value = usefullBytes [3] & 0xFF; + // (common as SensorTemperature).CurrentTemperature = value; + // } else { + // int value = -(usefullBytes [3] & 0xFF); + // (common as SensorTemperature).CurrentTemperature = value; + // } + // } else if (dddd == 0x0C && common.Type == DeviceType.SensorTVOC) { + // // VOC + // int value = (usefullBytes [2] & 0xFF) * 256 + (usefullBytes [3] & 0xFF); + // (common as SensorTVOC).CurrentTVOC = value; + // //} else if (dddd == 0x04 && common.Type == DeviceType.SensorTVOC) { + // // // Air_ppressure 姘斿帇 + // // int value = (usefullBytes [2] & 0xFF) * 256 + (usefullBytes [3] & 0xFF); + // // common.value = value; + // //} else if (dddd == 0x00 && common.Type == DeviceType.SensorIllumination) { + // // // 浜害 + // // int value = (usefullBytes [2] & 0xFF) * 256 + (usefullBytes [3] & 0xFF); + // // (common as SensorIllumination).CurrentIllumination = value; + // //} else if (dddd == 0x02 && common.Type == DeviceType.SensorVoltage) { + // // // 鐢靛帇 + // // int value = (usefullBytes [2] & 0xFF) * 256 + (usefullBytes [3] & 0xFF); + // // (common as SensorVoltage).CurrentVoltage = value; + // //} else if (dddd == 0x03 && common.Type == DeviceType.SensorCurrent) { + // // // 鐢垫祦 + // // int value = (usefullBytes [2] & 0xFF) * 256 + (usefullBytes [3] & 0xFF); + // // (common as SensorCurrent).CurrentCurrent = value; + // //} else if (dddd == 0x04 && common.Type == DeviceType.SensorVoltage) { + // // // 鍘嬪姏 + // // int value = (usefullBytes [2] & 0xFF) * 256 + (usefullBytes [3] & 0xFF); + // // (common as SensorVoltage).CurrentVoltage = value; + // //} else if (dddd == 0x06 && common.Type == DeviceType.SensorWindSpeed) { + // // // 椋庨�� + // // int value = (usefullBytes [2] & 0xFF) * 256 + (usefullBytes [3] & 0xFF); + // // (common as SensorWindSpeed).CurrentWindSpeed = value; + + // //} else if (dddd == 0x0A && common.Type == DeviceType.SensorVoltage) { + // // // 鍔熺巼 + // // int value = (usefullBytes [2] & 0xFF) * 256 + (usefullBytes [3] & 0xFF); + // // (common as SensorVoltage).CurrentVoltage = value; + // //} else if (dddd == 0x0B && common.Type == DeviceType.SensorVoltage) { + // // // 鐢佃兘 + // // int value = (usefullBytes [2] & 0xFF) * 256 + (usefullBytes [3] & 0xFF); + // // (common as SensorVoltage).CurrentVoltage = value; + // //} else if (dddd == 0x0E && common.Type == DeviceType.SensorVoltage) { + // // // 鐑熼浘 + // // int value = (usefullBytes [2] & 0xFF) * 256 + (usefullBytes [3] & 0xFF); + // // (common as SensorVoltage).CurrentVoltage = value; + // //} else if (dddd == 0x0F && common.Type == DeviceType.SensorVoltage) { + // // // 鐢查啗 + // // int value = (usefullBytes [2] & 0xFF) * 256 + (usefullBytes [3] & 0xFF); + // // (common as SensorVoltage).CurrentVoltage = value; + // //} else if (dddd == 0x11 && common.Type == DeviceType.SensorVoltage) { + // // // 鐢茬兎 + // // int value = (usefullBytes [2] & 0xFF) * 256 + (usefullBytes [3] & 0xFF); + // // (common as SensorVoltage).CurrentVoltage = value; + // //} else if (dddd == 0x12 && common.Type == DeviceType.SensorVoltage) { + // // // 鍣煶 + // // int value = (usefullBytes [2] & 0xFF) * 256 + (usefullBytes [3] & 0xFF); + // // (common as SensorVoltage).CurrentVoltage = value; + // //} else if (dddd == 0x14 && common.Type == DeviceType.SensorVoltage) { + // //// 绌烘皵璐ㄩ噺 + // //int value = (usefullBytes [2] & 0xFF) * 256 + (usefullBytes [3] & 0xFF); + // //(common as SensorVoltage).CurrentVoltage = value; + + // } + + + + // } + // } + // break; + // case Command.SetLogicLoopColorACK: + // case Command.ReadLogicLoopColorACK: + // foreach (var room in Room.Lists) { + // foreach (var common in room.DeviceList) { + // if (common.SubnetID != subnetID || common.DeviceID != deviceID || common.LoopID != usefullBytes [0]) { + // continue; + // } + // common.LastUpdateTime = DateTime.Now; + // if (common.Type == DeviceType.LightRGB) { + // (common as LightLogic).CurrentBrightness = usefullBytes [1]; + // string updateFlag = common.CommonLoopID + "RGB"; + // if (Application.IsPad) { + // UserLightPage.UpdateStatus (updateFlag, usefullBytes [1]); + // UserDeviceToLight.UpdateStatus (updateFlag, usefullBytes [1]); + // } else { + // UserRoom.UpdataDeviceStatus (common); + // UserLightPage.UpdateStatus (updateFlag, usefullBytes [1]); + // UserDeviceToLight.UpdateStatus (updateFlag, usefullBytes [1]); + // } + // } + // } + // } + // break; + // case Command.SetFoolHeatACK: + // case Command.ReadFoolHeatACK: + // case Command.Serverx_FH_CMD_ACK: + // foreach (var room in Room.Lists) { + // var fhCommon = room.DeviceList.Find ((obj) => obj.SubnetID == subnetID && obj.DeviceID == deviceID && obj.LoopID == usefullBytes [0]); + // if (fhCommon != null) { + // (fhCommon as FoolHeat).Serverx_FH_CMD (FoolHeat.CommandType.Null, usefullBytes); + // } + // } + // break; + // case Command.BroadcastDryContactStatus://骞叉帴鐐瑰箍鎾嚭鏉ョ殑鏁版嵁鎺ュ彈锛屼笉鏄洖澶嶆暟鎹� + // if (Application.IsPad) { } else { + // UserDryContact.UpdataView (subnetID, deviceID, usefullBytes [0], usefullBytes [2]); + // } + // break; + + // #region 闂ㄩ攣 + // case Command.ReadDoorLockClockACK: + // //闂ㄩ攣111 + // foreach (var room in Room.Lists) { + // foreach (var common in room.DeviceList) { + // if (common.SubnetID != subnetID || common.DeviceID != deviceID || common.LoopID != usefullBytes [0]) { + // continue; + // } + // if (common.Type == DeviceType.DoorLock) { + // common.LastUpdateTime = DateTime.Now; + // var doorLock = common as DoorLock; + // doorLock.DoorLockNum = usefullBytes [1]; + // if (Application.IsPad) { + // //Pad.UserDoorLockPage.UpdateStatus (doorLock); + // } else { + // //PasswordList.UpdateStatus (doorLock); + // } + // } + // } + // } + // break; + // //骞挎挱闂ㄩ攣鐘舵�佸拰鎶ヨ, + // //闂ㄩ攣111,BroadcastDoorLockStateAndAlarm + // case Command.BroadcastDoorLockStateAndAlarm: + // if (Application.IsPad) { } else { + // UserDryContact.UpdataView (subnetID, deviceID, usefullBytes [0], usefullBytes [2]); + // } + // break; + // #endregion + // case Command.ReadCurtainStutasACK: + // case Command.UpdataCurtainModelStutasACK: + // #region 绐楀笜 + // foreach (var room in Room.Lists) { + // foreach (var common in room.DeviceList) { + // if (common.SubnetID != subnetID || common.DeviceID != deviceID) { + // continue; + // } + // common.LastUpdateTime = DateTime.Now; + // if (common.Type == DeviceType.CurtainModel) { + // if (common.LoopID == usefullBytes [0]) { + // (common as CurtainModel).Status = (CurtainStatus)usefullBytes [1]; + // if (Application.IsPad) { + // //Pad.UserCurtainPage.UpdateStatus (common); + // } else { + // UserCurtainPage.UpdateStatus (common); + // } + // } + // } else if (common.Type == DeviceType.CurtainRoller) { + // if (usefullBytes [0] == 17) { + // (common as CurtainRoller).CurtainProress = usefullBytes [1]; + // } else { + // (common as CurtainRoller).Status = (CurtainStatus)usefullBytes [1]; + // } + // if (Application.IsPad) { + // //Pad.UserCurtainPage.UpdateStatus (common); + // } else { + // UserCurtainPage.UpdateStatus (common); + // } + // } else if (common.Type == DeviceType.CurtainTrietex) { + // if (usefullBytes [0] == 17) { + // (common as CurtainTrietex).CurtainProress = usefullBytes [1]; + // } else { + // (common as CurtainTrietex).Status = (CurtainStatus)usefullBytes [1]; + // } + // if (Application.IsPad) { + // //Pad.UserCurtainPage.UpdateStatus (common); + // } else { + // UserCurtainPage.UpdateStatus (common); + // } + // } + // } + // } + // break; + // #endregion + + // case Command.SonosControlACK: { + // #region Sonos闊充箰鎾斁鍣� + // var result = Encoding.UTF8.GetString (usefullBytes); + // if (result != null) { + // var jObject = JObject.Parse (result); + // if (jObject == null) { + // return; + // } + // var sid = jObject ["sid"]?.ToString (); + // if (sid == null) { + // return; + // } + // var sidUlong = Convert.ToUInt64 (sid, 16); + // var property = (byte)((sidUlong >> 16) & 0xFF); + // var subnetId = (byte)((sidUlong >> 40) & 0xFF); + // var deviceId = (byte)((sidUlong >> 32) & 0xFF); + // var targetNumber = (uint)((sidUlong >> 0) & 0xFFFF); + // string CommonLoopID = subnetId.ToString () + "_" + deviceId.ToString () + "_" + targetNumber.ToString (); + // foreach (var music in SonosMusic.SonosMusicList) { + // if (music.CommonLoopID == CommonLoopID && music.sidlist.Contains (sid)) { + + // var Issuccess = Convert.ToBoolean (jObject ["event"] ["success"]); + // var job = jObject ["event"] ["data"]; + // if (Issuccess) { + // if (property == 35) { + // //music.sonosPlayStatus.vol = job ["groupVolume"]?.ToString ();//缁勯煶閲� + // if (music.ServerClientType == -1) { + // //music.sonosPlayStatus.playbackState = job.Value<int> ("playbackState"); + // //if (music.sonosPlayStatus.playbackState != 4) { + // music.sonosPlayStatus.vol = job ["playerVolume"]?.ToString ();//闊抽噺 + // //} + // } else { + // music.sonosPlayStatus.vol = job ["playerVolume"]?.ToString ();//闊抽噺 + // music.sonosPlayStatus.positionMillis = job.Value<int> ("positionMillis"); + // music.sonosPlayStatus.durationMillis = job.Value<int> ("durationMillis"); + // music.sonosPlayStatus.playModes = job.Value<int> ("playModes"); + // music.sonosPlayStatus.playbackState = job.Value<int> ("playbackState"); + // music.sonosPlayStatus.mute = Convert.ToBoolean (job ["muted"]); + // music.sonosPlayStatus.DateTime = DateTime.Now; + // if (music.sonosPlayStatus.playbackState != 4) { + // music.sonosPlayStatus.songName = job ["songName"]?.ToString (); + // music.sonosPlayStatus.artist = job ["artist"]?.ToString (); + // music.sonosPlayStatus.album = job ["album"]?.ToString (); + // music.sonosPlayStatus.imageUrl = job ["imageUrl"]?.ToString (); + // } + + // } + // } + // } + + // //if(Issuccess){ + // // if (property == 27) { + // // //music.sonosPlayStatus.vol = job ["playerVolume"]?.ToString (); + // // } + // // // + // //}else{ + // // ////鎻愮ず锛氭帶鍒跺け璐� + // //} + + // } + // } + // } + // #endregion + // } + // break; + + // case Command.ControlMusicModel1ACK: + // #region 闊充箰 + // foreach (var m in Room.Lists) { + // var device = m.DeviceList.Find ((v) => { + // return v.Type == DeviceType.MusicModel && v.SubnetID == subnetID && v.DeviceID == deviceID; + // }); + // if (device == null) { + // continue; + // } + // MusicModel music = device as MusicModel; + + // //鎶婃帴鏀跺埌鐨勬暟鎹浆鎹负瀛楃涓� + // string backAllString = CommonPage.MyEncodingGB2312.GetString (usefullBytes); + + // //鎶婂綋鍓嶅瓧绗︿覆浠ワ紝鍙峰垎寮� + // string [] backResult = backAllString.Split (','); + + // string commandString = backResult [0]; + + + + // if (commandString.StartsWith ("#Z")) { + // if (2 <= backResult.Length) { + // //music.PlayStatus = backResult [1] == "ON" ? MusicModel.Status.Play : MusicModel.Status.Stop; + // } + // if (backResult.Length > 3) { + // //璁剧疆闊充箰鐨勫尯鍙凤紝婧愬彿锛岄煶閲忓�笺�� + // if (backResult [0].StartsWith ("#Z") && backResult [1] == "ON" && backResult [2].StartsWith ("SRC") && backResult [3].StartsWith ("VOL")) { + + // music.ZoneID = backResult [0].Replace ("#Z", ""); + // music.SourceID = backResult [2].Replace ("SRC", ""); + // music.CurVol = backResult [3].Replace ("VOL", "").TrimEnd (new char [] { '\r', '\n' }); + // } + // } + // } + + // if (commandString.Length > 3) { + // if (commandString.StartsWith ("#S")) { + // //music_SourceID=commandString.Substring (2, 1); + // } + + // commandString = commandString.Substring (3, commandString.Length - 3); + // byte [] bytes = null; + // switch (commandString) { + // case "DISPLINE4": + // //褰撳墠鎾斁姝屾洸鍚� + // var len = 0; + // for (var i = 14; i < usefullBytes.Length; i += 2) { + // if (usefullBytes [i] == 0x00 && usefullBytes [i + 1] == 0x03) { + // break; + // } + // len += 2; + // } + // bytes = new byte [len]; + + // for (var j = 0; j < bytes.Length;) { + + // bytes [j + 1] = usefullBytes [14 + j]; + // bytes [j] = usefullBytes [14 + j + 1]; + // j += 2; + // } + + // music.curPlayMusicName = Encoding.Unicode.GetString (bytes); + // break; + // case "DISPLINE1": + // //鍒楄〃鍙枫�佸垪琛ㄦ�绘暟锛岃繑鍥炴牸寮�: L:1/2 + // bytes = new byte [usefullBytes.Length - 4 - 14]; + // for (int i = 14, j = 0; j < bytes.Length;) { + // bytes [j + 1] = usefullBytes [i++]; + // bytes [j] = usefullBytes [i++]; + // j += 2; + // } + // string curPlayListNumberAndCount = Encoding.Unicode.GetString (bytes); + + // // mm1ACK.musicListNumber = "0"; + + // int number = 0; + + // if (curPlayListNumberAndCount.StartsWith ("L:")) { + // curPlayListNumberAndCount = curPlayListNumberAndCount.Replace ("L:", ""); + + // if (curPlayListNumberAndCount.Contains ("/")) { + // number = int.Parse (curPlayListNumberAndCount.Split ('/') [0]); + // music.curListNumber = number < 10 ? "00" + number : (number < 100 ? "0" + number : number.ToString ()); + + // } + // } + // break; + // case "DISPLINE2": + // //褰撳墠鍒楄〃鍚嶏紝杩斿洖鏍煎紡: SOME.PLS + // bytes = new byte [usefullBytes.Length - 4 - 14]; + // for (int i = 14, j = 0; j < bytes.Length;) { + // bytes [j + 1] = usefullBytes [i++]; + // bytes [j] = usefullBytes [i++]; + // j += 2; + // } + // string curPlayMusicListName = Encoding.Unicode.GetString (bytes); + + // string curMusicListName = curPlayMusicListName; + + // if (curPlayMusicListName.Contains (".PLS")) { + // curMusicListName = curPlayMusicListName.Split ('.') [0]; + // } + // music.curMusicListName = curMusicListName; + + // //MusicStatusFunction.updateMusicStatus_PlayListName (subnetID, deviceID, music_SourceID, curMusicListName, iPEndPoint.Address.ToString (), iPEndPoint.Port); + // break; + // case "DISPLINE3": + // //姝屾洸鍙枫�佹瓕鏇叉�绘暟锛岃繑鍥炴牸寮�: S:10/23 + // bytes = new byte [usefullBytes.Length - 4 - 14]; + // for (int i = 14, j = 0; j < bytes.Length;) { + // bytes [j + 1] = usefullBytes [i++]; + // bytes [j] = usefullBytes [i++]; + // j += 2; + // } + // string curPlayMusicNumberAndCount = System.Text.Encoding.Unicode.GetString (bytes); + + // int musicFileNumber = 0; + + // if (curPlayMusicNumberAndCount.StartsWith ("S:")) { + // curPlayMusicNumberAndCount = curPlayMusicNumberAndCount.Replace ("S:", ""); + + // if (curPlayMusicNumberAndCount.Contains ("/")) { + // musicFileNumber = int.Parse (curPlayMusicNumberAndCount.Split ('/') [0]); + // } + // } + // music.curSongNumber = musicFileNumber < 10 ? "00" + musicFileNumber : (musicFileNumber < 100 ? "0" + musicFileNumber : musicFileNumber.ToString ()); + // //MusicStatusFunction.updateMusicStatus_PlayMusicFileNumber (subnetID, deviceID, music_SourceID, musicFileNumber, iPEndPoint.Address.ToString (), iPEndPoint.Port); + // break; + // case "DISPINFO": + // //褰撳墠鎾斁姝屾洸鐨勭姸鎬侊紝杩斿洖鏍煎紡: #SsDISPINFO,DUR1945,POS0,STATUS2 + // //DUR鍚庢暟鍊硷細涓烘瓕鏇叉挱鏀炬�绘椂闂� 锛堢脳10锛屽疄闄呮椂闂寸殑10鍊嶏級 + // //POS鍚庢暟鍊硷細涓烘瓕鏇插凡鎾斁鏃堕棿 锛堢脳10锛屽疄闄呮椂闂寸殑10鍊嶏級 + // //STATUS鍚庢暟鍊硷細涓�1琛ㄧずstop,涓�2琛ㄧずplay,涓�3琛ㄧずpause + + // if (backResult [1].StartsWith ("DUR") && backResult [2].StartsWith ("POS") && backResult [3].StartsWith ("STATUS")) { + // music.SoundGenerator = backResult [0] [2].ToString (); + // music.musicTime = backResult [1].Replace ("DUR", ""); + // music.musicPalyTime = backResult [2].Replace ("POS", ""); + // music.musicCurPalyStatus = backResult [3] [6].ToString ();//.Replace ("STATUS", "")[0]; + // music.PlayStatus = music.musicCurPalyStatus == "2" ? MusicModel.Status.Play : MusicModel.Status.Stop; + // music.LastDateTime = DateTime.Now; + // } + // // UserMusicModelRoom.UpdateControls(mm1ACK); + // //UserMusicModel.UpdateRoomMusicStatus(mm1ACK); + // break; + + // //鎾斁妯″紡 + // case "DISPMODE": + // if (7 <= backResult [1].Length) { + // music.playMode = int.Parse (backResult [1].Substring (6, 1)); + // System.MainPage.WriteLog ("DISPMODE=====" + music.playMode); + // } + // break; + // } + // } + // } + // break; + // #endregion + // #region 绌鸿皟 + // case Command.ReadPanelTempTypeACK: + // foreach (var room in Room.Lists) { + // foreach (var common in room.DeviceList) { + // if (common.SubnetID != subnetID || common.DeviceID != deviceID || common.LoopID != usefullBytes [0]) { + // continue; + // } + // common.LastUpdateTime = DateTime.Now; + // if (common.Type == DeviceType.ACPanel ) { + // var ac = common as ACPanel; + // ac.TemperatureMode = usefullBytes [0]; + // } + // } + // } + // break; + // case Command.ReadACModeACK: + // case Command.SetACModeACK: + // foreach (var room in Room.Lists) { + // foreach (var common in room.DeviceList) { + // if (common.SubnetID != subnetID || common.DeviceID != deviceID || common.LoopID != usefullBytes [0]) { + // continue; + // } + // common.LastUpdateTime = DateTime.Now; + // if (common.Type == DeviceType.HVAC || common.Type == DeviceType.ACPanel || common.Type == DeviceType.ACInfrared + // || common.Type == DeviceType.LongXiAC) { + // if (common.Type == DeviceType.LongXiAC) { + // var ac = common as LongXiAC; + // ac.TemperatureMode = usefullBytes [1]; + // ac.IndoorTemperature = usefullBytes [2]; + // ac.CoolTemperature = usefullBytes [3]; + // ac.HeatTemperature = usefullBytes [4]; + // ac.AutoTemperature = usefullBytes [5]; + // ac.ChuShiTemperature = usefullBytes [6]; + // ac.RealModeAndFanSpeed = usefullBytes [7]; + // ac.Power = usefullBytes [8]; + // ac.SetMode = usefullBytes [9]; + // ac.SetFanSpeed = usefullBytes [10]; + // ac.Wave = usefullBytes [12]; + // if (usefullBytes.Length == 23) {//棣栧煄鐝戠幒瀹氬埗鐨勬柊椋庣┖璋冨浐浠舵槸涓嶄竴鏍风殑 + // ac.ElectricHeating = usefullBytes [15]; + // ac.Antifreeze = usefullBytes [16]; + // ac.OutTemp = usefullBytes [17] > 50 ? (byte)(0 - (usefullBytes [17] - 50)) : usefullBytes [17]; + // ac.Humidity = usefullBytes [18]; + // ac.TVOC = usefullBytes [19] * 256 + usefullBytes [20]; + // ac.PM25 = usefullBytes [21] * 256 + usefullBytes [22]; + + // } + // if (Application.IsPad) { + // //Pad.UserACPage.UpdateStatus (ac); + // } else { + // UserLongXiACPage.UpdateStatus (ac); + // UserDeviceToAC.UpdateStatus (ac); + // UserRoom.UpdataDeviceStatus (ac); + // } + // } else { + // var ac = common as AC; + // ac.TemperatureMode = usefullBytes [1]; + // ac.IndoorTemperature = usefullBytes [2]; + // ac.CoolTemperature = usefullBytes [3]; + // ac.HeatTemperature = usefullBytes [4]; + // ac.AutoTemperature = usefullBytes [5]; + // ac.ChuShiTemperature = usefullBytes [6]; + // ac.RealModeAndFanSpeed = usefullBytes [7]; + // ac.Power = usefullBytes [8]; + // ac.SetMode = usefullBytes [9]; + // ac.SetFanSpeed = usefullBytes [10]; + // //if (usefullBytes [11] < 16 || usefullBytes [11] == 0) { + // // ac.SetTemperature = (byte)16; + // //} else { + // // ac.SetTemperature = usefullBytes [11]; + // //} + // ac.ShaoFanMode = usefullBytes [12]; + // //IO.F + // if (Application.IsPad) { + // //Pad.UserACPage.UpdateStatus (ac); + // } else { + // UserACPage.UpdateStatus (ac); + // UserDeviceToAC.UpdateStatus (ac); + // UserRoom.UpdataDeviceStatus (ac); + // } + // } + // } + // } + // } + // break; + // case Command.ReadPanleTempACK: + // case Command.PanleBroadcastTemp: + // foreach (var room in Room.Lists) { + // foreach (var common in room.DeviceList) { + // if (common.CommonLoopID == subnetID + "_" + deviceID + "_" + usefullBytes [0]) { + // if (common.Type == DeviceType.ACPanel) { + // var tempAC = common as ACPanel; + // tempAC.IndoorTemperature = usefullBytes [1]; + // UserACPage.UpdateIndoorTemp (tempAC.Type + "_" + tempAC.SubnetID + "_" + tempAC.DeviceID, usefullBytes [1]); + // } else if (common.Type == DeviceType.FoolHeatPanel) { + // var tempFH22 = common as FoolHeatPanel; + // tempFH22.IndoorTemperature = usefullBytes [1]; + // UserFHPage.UpdateIndoorTemp (tempFH22.Type + "_" + tempFH22.SubnetID + "_" + tempFH22.DeviceID, usefullBytes [1]); + // } + // } + // } + // } + // break; + // case Command.InstructionPanelKeyACK: + // case Command.ReadInstructionPanelKeyACK: + // byte reACPanel = 0; + // if (usefullBytes.Length == 2) { + // reACPanel = 1; + // } else if (usefullBytes.Length == 3) { + // reACPanel = usefullBytes [2]; + // } else { + // break; + // } + // foreach (var room in Room.Lists) { + // foreach (var common in room.DeviceList) { + // if (common.SubnetID != subnetID || common.DeviceID != deviceID || common.LoopID != reACPanel) { + // continue; + // } + // common.LastUpdateTime = DateTime.Now; + // if (common.Type == DeviceType.ACPanel) { + // var ac = common as ACPanel; + // switch (usefullBytes [0]) { + // case 3:// + // ac.Power = usefullBytes [1]; + // UserACPage.UpdatePower (ac.CommonLoopID, usefullBytes [1]); + // UserDeviceToAC.UpdatePower (ac.CommonLoopID, usefullBytes [1]); + // UserRoom.Update_ACPanel_Power (ac.Type.ToString () + "_" + ac.CommonLoopID, usefullBytes [1]); + // break; + // case 4: + // ac.CoolTemperature = usefullBytes [1]; + // if (ac.SetMode == 0) { + // ac.SetTemperature = usefullBytes [1]; + // UserACPage.UpdateWorkingTemp (ac.CommonLoopID, usefullBytes [1]); + // UserDeviceToAC.UpdateWorkingTemp (ac.CommonLoopID, usefullBytes [1]); + // UserRoom.Update_ACPanel_WorkingTemp (ac.Type.ToString () + "_" + ac.CommonLoopID, usefullBytes [1], ac.TemperatureMode); + // } + // break; + // case 5: + // ac.SetFanSpeed = usefullBytes [1]; + // UserACPage.UpdateSetFanSpeed (ac.CommonLoopID, usefullBytes [1]); + // UserDeviceToAC.UpdateFanSpeed (ac.CommonLoopID, usefullBytes [1]); + // UserRoom.Update_ACPanel_FanIcon (ac.Type.ToString () + "_" + ac.CommonLoopID, usefullBytes [1]); + // break; + // case 6: + // ac.SetMode = usefullBytes [1]; + // UserACPage.UpdateSetMode (ac.CommonLoopID, usefullBytes [1]); + // UserDeviceToAC.UpdateSetMode (ac.CommonLoopID, usefullBytes [1]); + // UserRoom.Update_ACPanel_ModeIcon (ac.Type.ToString () + "_" + ac.CommonLoopID, usefullBytes [1]); + // break; + // case 7: + // ac.HeatTemperature = usefullBytes [1]; + // if (ac.SetMode == 1) { + // ac.SetTemperature = usefullBytes [1]; + // UserACPage.UpdateWorkingTemp (ac.CommonLoopID, usefullBytes [1]); + // UserDeviceToAC.UpdateWorkingTemp (ac.CommonLoopID, usefullBytes [1]); + // UserRoom.Update_ACPanel_WorkingTemp (ac.Type.ToString () + "_" + ac.CommonLoopID, usefullBytes [1], ac.TemperatureMode); + // } + // break; + // case 8: + // ac.AutoTemperature = usefullBytes [1]; + // if (ac.SetMode == 3) { + // ac.SetTemperature = usefullBytes [1]; + // UserACPage.UpdateWorkingTemp (ac.CommonLoopID, usefullBytes [1]); + // UserDeviceToAC.UpdateWorkingTemp (ac.CommonLoopID, usefullBytes [1]); + // UserRoom.Update_ACPanel_WorkingTemp (ac.Type.ToString () + "_" + ac.CommonLoopID, usefullBytes [1], ac.TemperatureMode); + // } + // break; + // case 19: + // ac.ChuShiTemperature = usefullBytes [1]; + // if (ac.SetMode == 4) { + // ac.SetTemperature = usefullBytes [1]; + // UserACPage.UpdateWorkingTemp (ac.CommonLoopID, usefullBytes [1]); + // UserDeviceToAC.UpdateWorkingTemp (ac.CommonLoopID, usefullBytes [1]); + // UserRoom.Update_ACPanel_WorkingTemp (ac.Type.ToString () + "_" + ac.CommonLoopID, usefullBytes [1], ac.TemperatureMode); + // } + // break; + // } + // if (Application.IsPad) { + // //Pad.UserACPage.UpdateStatus (ac); + // } else { + // //UserACPage.UpdateStatus (ac); + // //UserDeviceToAC.UpdateStatus (ac); + // //UserRoom.UpdataDeviceStatus (ac); + // } + // } else if (common.Type == DeviceType.FoolHeatPanel) { + // var fh = common as FoolHeatPanel; + + // switch (usefullBytes [0]) { + // case 20:// + // fh.Status = usefullBytes [1]; + // UserDeviceToFH.UpdatePower (fh.CommonLoopID, usefullBytes [1]); + // UserFHPage.UpdatePower (fh.CommonLoopID, usefullBytes [1]); + // UserRoom.Update_FoolHeatPanel_Power (fh.Type.ToString () + "_" + fh.CommonLoopID, usefullBytes [1]); + // break; + // case 21: + // fh.TemperatureType = usefullBytes [1]; + // UserFHPage.UpdateWorkingMode (fh.CommonLoopID, usefullBytes [1]); + // if (usefullBytes [1] == 5) { + // if (fh.Timer == 0)//鏃堕棿妯″紡鐨勬椂闂存鏍囧織 (0锛氱櫧澶╋紝1锛氬鏅�) (1byte) //20110112鍔犳椂闂存鏍囧織 + // Control.ControlBytesSend (Command.ReadInstructionPanelKey, fh.SubnetID, fh.DeviceID, new byte [] { 26, 2, fh.LoopID }, SendCount.Zero); + // else + // Control.ControlBytesSend (Command.ReadInstructionPanelKey, fh.SubnetID, fh.DeviceID, new byte [] { 27, 3, fh.LoopID }, SendCount.Zero); + // } else + // Control.ControlBytesSend (Command.ReadInstructionPanelKey, fh.SubnetID, fh.DeviceID, new byte [] { (byte)(usefullBytes [1] + 24), fh.LoopID }, SendCount.Zero); + // break; + // case 25: + // fh.NormalTemperature = usefullBytes [1]; + // if (fh.TemperatureType == 1) { + // fh.WorkingTemperature = usefullBytes [1]; + // UserDeviceToFH.UpdateWorkingTemp (fh.CommonLoopID, usefullBytes [1]); + // UserFHPage.UpdateWorkingTemp (fh.CommonLoopID, usefullBytes [1]); + // UserRoom.Update_FoolHeatPanel_WorkingTemp (fh.Type.ToString () + "_" + fh.CommonLoopID, usefullBytes [1]); + // } + // break; + // case 26: + // fh.DayTemperature = usefullBytes [1]; + // if (fh.TemperatureType == 2) { + // fh.WorkingTemperature = usefullBytes [1]; + // UserDeviceToFH.UpdateWorkingTemp (fh.CommonLoopID, usefullBytes [1]); + // UserFHPage.UpdateWorkingTemp (fh.CommonLoopID, usefullBytes [1]); + // UserRoom.Update_FoolHeatPanel_WorkingTemp (fh.Type.ToString () + "_" + fh.CommonLoopID, usefullBytes [1]); + // } + // break; + // case 27: + // fh.NightTemperature = usefullBytes [1]; + // if (fh.TemperatureType == 3) { + // fh.WorkingTemperature = usefullBytes [1]; + // UserDeviceToFH.UpdateWorkingTemp (fh.CommonLoopID, usefullBytes [1]); + // UserFHPage.UpdateWorkingTemp (fh.CommonLoopID, usefullBytes [1]); + // UserRoom.Update_FoolHeatPanel_WorkingTemp (fh.Type.ToString () + "_" + fh.CommonLoopID, usefullBytes [1]); + // } + // break; + // case 28: + // fh.AwayTemperature = usefullBytes [1]; + // if (fh.TemperatureType == 4) { + // fh.WorkingTemperature = usefullBytes [1]; + // UserDeviceToFH.UpdateWorkingTemp (fh.CommonLoopID, usefullBytes [1]); + // UserFHPage.UpdateWorkingTemp (fh.CommonLoopID, usefullBytes [1]); + // UserRoom.Update_FoolHeatPanel_WorkingTemp (fh.Type + "_" + fh.CommonLoopID, usefullBytes [1]); + // } + // break; + // } + // if (Application.IsPad) { + // //SimpleControl.Pad.UserFHPage.UpdateStatus (fh); + // } else { + // //UserDeviceToFH.UpdateStatus (fh); + // //UserFHPage.UpdateStatus (fh); + // //UserRoom.UpdataDeviceStatus (fh); + // } + // } + // } + // } + + // break; + // case Command.Read_Air_Condition_Set_ack: + // byte acpanelLoopId = 0; + // if (usefullBytes.Length == 10) { + // acpanelLoopId = 1; + // } else if (usefullBytes.Length == 11) { + // acpanelLoopId = usefullBytes [10]; + // } + // foreach (var room in Room.Lists) { + // var common = room.DeviceList.Find ((obj) => obj.SubnetID == subnetID && obj.DeviceID == deviceID && obj.LoopID == usefullBytes [1] && obj.Type == DeviceType.ACPanel); + // if (common == null) + // continue; + // common.LastUpdateTime = DateTime.Now; + // var ac = common as ACPanel; + // ac.Power = usefullBytes [0]; + // ac.CoolTemperature = usefullBytes [1]; + // ac.SetMode = (byte)(usefullBytes [2] >> 4);//妯″紡鍜岄閫� + // ac.SetFanSpeed = (byte)(usefullBytes [2] & 0x0F); + // //绌鸿皟閿� + // ac.SetTemperature = usefullBytes [4];//褰撳墠娓╁害 + // ac.HeatTemperature = usefullBytes [5];//鍒剁儹娓╁害 + // //绌鸿皟瀹為檯杩愯妯″紡鍜岄閫� + // ac.AutoTemperature = usefullBytes [7];//鑷姩娓╁害 + // ac.ChuShiTemperature = usefullBytes [8];//鎶芥箍娓╁害 + // ac.ShaoFanMode = usefullBytes [9];//绌鸿皟鏄惁鎵(浣庡洓浣�) + // if (Application.IsPad) { + + // } else { + // UserACPage.UpdateStatus (ac); + // UserDeviceToAC.UpdateStatus (ac); + // UserRoom.UpdataDeviceStatus (ac); + // } + // } + // break; + // case Command.Set_Air_State_New_ack: + // if (usefullBytes.Length == 15) { + // /// [0]//MODIFY_SUCCESS 1byte + // /// [1]//绌鸿皟椤靛彿(0-8) 1byte + // /// [2]//绌鸿皟寮�鍏�(1寮�0鍏�) 1byte + // /// [3]//鍒跺喎鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) 1byte + // /// [4]//鍒剁儹鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) 1byte + // /// [5]//鑷姩鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) 1byte + // /// [6]//闄ゆ箍鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) 1byte + // /// [7]//璁剧疆妯″紡(0鍒跺喎锛�1鍒剁儹锛�2閫氶锛�3鑷姩锛�4闄ゆ箍) 1byte + // /// [8]//璁剧疆椋庨��(0鑷姩锛�1楂橀锛�2涓锛�3浣庨) 1byte //娉ㄦ剰:褰撴ā寮忎负闄ゆ箍鎴栨ā寮忎负閫氶鍙婇閫熶负鑷姩鏃讹紝椋庨�熻涓哄皬椋庝负鍑� + // /// [9]//璁剧疆鎵(0涓嶆壂椋庯紝1鎵) 1byte + // /// [10]//娓╁害妯″紡(鎽勬皬Celsius:0锛屽崕姘廎ahrenheit:1) 1byte + // /// [11]//妯″紡瀹為檯宸ヤ綔鐘舵��(0鍒跺喎锛�1鍒剁儹锛�2閫氶锛�3鑷姩锛�4闄ゆ箍) 1byte + // /// [12]//椋庨�熷疄闄呭伐浣滅姸鎬�(0鍏抽棴锛�1楂橀锛�2涓锛�3浣庨) 1byte + // /// [13]//鎵瀹為檯宸ヤ綔鐘舵��(0涓嶆壂椋庯紝1鎵) 1byte + // /// [14]//鐜娓╁害(鎽勬皬0-40锛屽崕姘�32-99) 1byte + // foreach (var room in Room.Lists) { + // //foreach (var common in room.DeviceList) { + // var common = room.DeviceList.Find ((obj) => obj.SubnetID == subnetID && obj.DeviceID == deviceID && obj.LoopID == usefullBytes [1] && obj.Type == DeviceType.ACPanel); + // if (common == null) + // continue; + // //if (common.SubnetID != subnetID || common.DeviceID != deviceID || common.LoopID != usefullBytes[1]) { + // // continue; + // //} + // common.LastUpdateTime = DateTime.Now; + // var ac = common as ACPanel; + // ac.Power = usefullBytes [2]; + // ac.CoolTemperature = usefullBytes [3]; + // ac.SetMode = usefullBytes [7];//妯″紡鍜岄閫� + // ac.SetFanSpeed = (byte)(usefullBytes [2] & 0x0F); + // //绌鸿皟閿� + // ac.SetTemperature = usefullBytes [4];//褰撳墠娓╁害 + // ac.HeatTemperature = usefullBytes [4];//鍒剁儹娓╁害 + // //绌鸿皟瀹為檯杩愯妯″紡鍜岄閫� + // ac.AutoTemperature = usefullBytes [5];//鑷姩娓╁害 + // ac.ChuShiTemperature = usefullBytes [6];//鎶芥箍娓╁害 + // ac.ShaoFanMode = usefullBytes [9];//绌鸿皟鏄惁鎵(浣庡洓浣�) + // ac.IndoorTemperature = usefullBytes [14]; + // if (Application.IsPad) { + + // } else { + // UserACPage.UpdateStatus (ac); + // UserDeviceToAC.UpdateStatus (ac); + // UserRoom.UpdataDeviceStatus (ac); + // } + // //} + // } + // } + // break; + // #endregion + + // #region 鍦扮儹 + // case Command.Read_Floor_Heat_State_ack: + // foreach (var room in Room.Lists) { + // byte fhLoopId = 1; + // if (usefullBytes.Length == 11) { + // fhLoopId = usefullBytes [10]; + // } + + // var common = room.DeviceList.Find ((obj) => obj.SubnetID == subnetID && obj.DeviceID == deviceID && obj.LoopID == fhLoopId && obj.Type == DeviceType.FoolHeatPanel); + // if (common == null) + // continue; + // /// 1娓╁害妯″紡(鎽勬皬Celsius:0锛屽崕姘廎ahrenheit:1) (1byte) + // /// 2娓╁害婧愭俯搴�(鏈�楂樹綅0:姝�,1:璐�.鍚�7bit涓哄��) (1byte) + // /// 3鍦扮儹鍦板喎寮�鍏筹細锛�0鍏炽��1寮� (1byte) + // /// 4宸ヤ綔娓╁害妯″紡锛�1:鏅��,2:鐧藉ぉ,3:澶滄櫄,4:绂诲紑,5:鏃堕棿 (1-5) (1byte) + // /// 5鏅�氭俯搴� (鎽勬皬0-99锛屽崕姘�32-210) (1byte) + // /// 6鐧藉ぉ娓╁害 (鎽勬皬0-99锛屽崕姘�32-210) (1byte) + // /// 7澶滄櫄娓╁害 (鎽勬皬0-99锛屽崕姘�32-210) (1byte) + // /// 8绂诲紑娓╁害 (鎽勬皬0-99锛屽崕姘�32-210) (1byte) + // /// 9鏃堕棿妯″紡鐨勬椂闂存鏍囧織 (0锛氱櫧澶╋紝1锛氬鏅�) (1byte) //20110112鍔犳椂闂存鏍囧織 + // /// 10妯″紡锛�0鍦扮儹妯″紡銆�1鍦板喎妯″紡銆�2鑷姩 (1byte) //20120802鍔�//20140805鍔犺嚜鍔� + // /// 11鍦扮儹椤靛彿0-8 (1byte)//褰╁睆鍔犲叆20150714 + // var th = common as FoolHeatPanel; + // th.IndoorTemperature = usefullBytes [1] > 128 ? (byte)(0 - (usefullBytes [1] - 128)) : usefullBytes [1]; + // th.Status = usefullBytes [2]; + // th.TemperatureType = usefullBytes [3]; + // th.NormalTemperature = usefullBytes [4]; + // th.DayTemperature = usefullBytes [5]; + // th.NightTemperature = usefullBytes [6]; + // th.AwayTemperature = usefullBytes [7]; + // switch (usefullBytes [3]) { + // case 1://鏅�� + // th.WorkingTemperature = th.NormalTemperature; + // break; + // case 2://鐧藉ぉ + // th.WorkingTemperature = th.DayTemperature; + // break; + // case 3://澶滄櫄 + // th.WorkingTemperature = th.NightTemperature; + // break; + // case 4://绂诲紑 + // th.WorkingTemperature = th.AwayTemperature; + // break; + // case 5://鏃堕棿妯″紡 + // th.Timer = usefullBytes [9]; + // if (usefullBytes [9] == 1)//鏃堕棿妯″紡鐨勬椂闂存鏍囧織 (0锛氱櫧澶╋紝1锛氬鏅�) (1byte) //20110112鍔犳椂闂存鏍囧織 + // th.WorkingTemperature = th.DayTemperature; + // else + // th.WorkingTemperature = th.NightTemperature; + // break; + // } + // UserDeviceToFH.UpdateStatus (th); + // UserFHPage.UpdateStatus (th,fhLoopId); + // UserRoom.UpdataDeviceStatus (th); + // } + // break; + // case Command.Set_Floor_Heat_State_ack: + // foreach (var room in Room.Lists) { + // byte fhLoopId = 1; + // if (usefullBytes.Length == 12) { + // fhLoopId = usefullBytes [11]; + // } + + // var common = room.DeviceList.Find ((obj) => obj.SubnetID == subnetID && obj.DeviceID == deviceID && obj.LoopID == fhLoopId && obj.Type == DeviceType.FoolHeatPanel); + // if (common == null) + // continue; + // /// 1 MODIFY_SUCCESS 1 byte + // /// 2娓╁害妯″紡(鎽勬皬Celsius:0锛屽崕姘廎ahrenheit:1) (1byte) + // /// 3鍦扮儹鍦板喎寮�鍏筹細锛�0鍏炽��1寮� (1byte) + // /// 4宸ヤ綔娓╁害妯″紡锛�1:鏅��,2:鐧藉ぉ,3:澶滄櫄,4:绂诲紑,5:鏃堕棿 (1-5) (1byte) + // /// 5鏅�氭俯搴� (鎽勬皬0-99锛屽崕姘�32-210) (1byte) + // /// 6鐧藉ぉ娓╁害 (鎽勬皬0-99锛屽崕姘�32-210) (1byte) + // /// 7澶滄櫄娓╁害 (鎽勬皬0-99锛屽崕姘�32-210) (1byte) + // /// 8绂诲紑娓╁害 (鎽勬皬0-99锛屽崕姘�32-210) (1byte) + // /// 9鏃堕棿妯″紡鐨勬椂闂存鏍囧織 (0锛氱櫧澶╋紝1锛氬鏅�) (1byte) //20120802鍔� + // /// 10宸ヤ綔妯″紡锛�0鍦扮儹銆�1鍦板喎銆�2鑷姩 (1byte) //20120802鍔�//20140805鍔犺嚜鍔� + // var th = common as FoolHeatPanel; + // th.Status = usefullBytes [2]; + // th.TemperatureType = usefullBytes [3]; + // th.NormalTemperature = usefullBytes [4]; + // th.DayTemperature = usefullBytes [5]; + // th.NightTemperature = usefullBytes [6]; + // th.AwayTemperature = usefullBytes [7]; + // switch (usefullBytes [3]) { + // case 1://鏅�� + // th.WorkingTemperature = th.NormalTemperature; + // break; + // case 2://鐧藉ぉ + // th.WorkingTemperature = th.DayTemperature; + // break; + // case 3://澶滄櫄 + // th.WorkingTemperature = th.NightTemperature; + // break; + // case 4://绂诲紑 + // th.WorkingTemperature = th.AwayTemperature; + // break; + // case 5://鏃堕棿妯″紡 + // th.Timer = usefullBytes [9]; + // if (usefullBytes [9] == 1)//鏃堕棿妯″紡鐨勬椂闂存鏍囧織 (0锛氱櫧澶╋紝1锛氬鏅�) (1byte) //20110112鍔犳椂闂存鏍囧織 + // th.WorkingTemperature = th.DayTemperature; + // else + // th.WorkingTemperature = th.NightTemperature; + // break; + // } + // UserDeviceToFH.UpdateStatus (th); + // UserFHPage.UpdateStatus (th,fhLoopId); + // UserRoom.UpdataDeviceStatus (th); + // } + // break; + // #endregion + // //璇诲彇缃戝叧璁惧鍥炲 + // case Command.ReadGatewayACK: + // if (!LocalPhoneFindDevice) {//r濡傛灉涓嶆槸鏈満鍦ㄦ煡鎵捐澶� + // break; + // } + // if (usefullBytes [0] != RandomHigh | usefullBytes [1] != RandomLow) { + // return; + // } + + // if (GateWayList.Find ((l) => { return l.SubnetID == subnetID && l.DeviceID == deviceID; }) != null) { + // return; + // } + // DeviceType deviceType = (DeviceType)(usefullBytes [2] * 256 + usefullBytes [3]); + // bool notHasRemake = false; + // for (int ki = 0; ki < 20; ki++) { + // if (usefullBytes [13 + ki] != 255) { + // break; + // } else { + // notHasRemake = true; + // } + // } + + // if (notHasRemake) { + // byte [] ddd = CommonPage.MyEncodingGB2312.GetBytes ("Gateway " + subnetID.ToString ()); + // //byte [] newddd = new byte [20]; + // //Array.Copy (ddd, 0, newddd, 0, 20 < ddd.Length ? 20 : ddd.Length); + // Array.Copy (ddd, 0, usefullBytes, 13, 20 < ddd.Length ? 20 : ddd.Length); + // } + // switch (deviceType) { + // case DeviceType.SuperWireless: + // //string macstring = byteToHex16 (usefullBytes [5]) + byteToHex16 (usefullBytes [6]) + byteToHex16 (usefullBytes [7]) + byteToHex16 (usefullBytes [8]) + byteToHex16 (usefullBytes [9]) + byteToHex16 (usefullBytes [10]) + byteToHex16 (usefullBytes [11]) + byteToHex16 (usefullBytes [12]); + // //if (!UserConfig.Instance.GatewayMACList.Contains (macstring) && MainPage.LoginUser.AccountString != "464027401@qq.com") { + // // HasNotInListMAC = true; + // // break; + // //} + // #region + // SuperWireless superWireless = new SuperWireless (); + // string superWirelessPath = "Equipment_" + typeof (SuperWireless).Name + "_" + subnetID + "_" + deviceID; + // var superWirelessbytes = IO.FileUtils.ReadFile (superWirelessPath); + // if (superWirelessbytes.Length > 1) { + // superWireless = Newtonsoft.Json.JsonConvert.DeserializeObject<SuperWireless> (MyEncodingUTF8.GetString (superWirelessbytes)); + // } + // superWireless.SubnetID = subnetID; + // superWireless.DeviceID = deviceID; + // superWireless.MAC = byteToHex16 (usefullBytes [5]) + "." + byteToHex16 (usefullBytes [6]) + "." + byteToHex16 (usefullBytes [7]) + "." + byteToHex16 (usefullBytes [8]) + "." + byteToHex16 (usefullBytes [9]) + "." + byteToHex16 (usefullBytes [10]) + "." + byteToHex16 (usefullBytes [11]) + "." + byteToHex16 (usefullBytes [12]); + + // superWireless.Name = MyEncodingGB2312.GetString (usefullBytes, 13, 20).Trim ('\0');//============= + // superWireless.IPAddress = usefullBytes [33] + "." + usefullBytes [34] + "." + usefullBytes [35] + "." + usefullBytes [36]; + // superWireless.RouteIPAddress = usefullBytes [37] + "." + usefullBytes [38] + "." + usefullBytes [39] + "." + usefullBytes [40]; + // superWireless.IPMAC = (char)usefullBytes [41] + "." + (char)usefullBytes [42] + "." + (char)usefullBytes [43] + "." + usefullBytes [44] + "." + usefullBytes [45] + "." + usefullBytes [46]; + // superWireless.SubnetMask = usefullBytes [47] + "." + usefullBytes [48] + "." + usefullBytes [49] + "." + usefullBytes [50]; + // superWireless.DHCP = usefullBytes [51] == 0 ? false : true; + // if (usefullBytes.Length == 80) { + // superWireless.EncryptionFlag = usefullBytes [53]; + // superWireless.Password = MyEncodingGB2312.GetString (usefullBytes, 54, 8).Trim ('\0'); + // superWireless.WirelessBand = usefullBytes [62]; + // superWireless.WirelessChannel = usefullBytes [63]; + // superWireless.WirelessPassword = MyEncodingGB2312.GetString (usefullBytes, 64, 16).Trim ('\0'); + // } + // GateWayList.Add (superWireless); + // //IO.FileUtils.SaveEquipmentMessage (superWireless); + // //System.Threading.Tasks.Task.Run (() => { + // // if (string.IsNullOrEmpty (UserConfig.Current.RemoteModeFile)) { + // // var gatewayBytes = Control.ControlBytesSendHasReturn (Command.ReadGateWayModelInfo, superWireless.SubnetID, superWireless.DeviceID, new byte [] { }); + // // if (gatewayBytes!=null&&gatewayBytes [0] == 2) { + // // UserConfig.Current.RemoteModeFile = "Equipment_" + superWireless.Type.ToString () + "_" + superWireless.SubnetID.ToString () + "_" + superWireless.DeviceID.ToString (); + // // UserConfig.Current.SaveUserConfig (); + // // } + // // } + // //}); + // #endregion + // break; + // case DeviceType.OnePortWirelessFR: + // #region + // OnePortWirelessFR onePortWirelessFR = new OnePortWirelessFR (); + // string wirelessPath = "Equipment_" + typeof (OnePortWirelessFR).Name + "_" + subnetID + "_" + deviceID; + // var bytes = IO.FileUtils.ReadFile (wirelessPath); + // if (bytes.Length > 1) { + // onePortWirelessFR = Newtonsoft.Json.JsonConvert.DeserializeObject<OnePortWirelessFR> (MyEncodingUTF8.GetString (bytes)); + // } + // onePortWirelessFR.SubnetID = subnetID; + // onePortWirelessFR.DeviceID = deviceID; + // onePortWirelessFR.MAC = byteToHex16 (usefullBytes [5]) + "." + byteToHex16 (usefullBytes [6]) + "." + byteToHex16 (usefullBytes [7]) + "." + byteToHex16 (usefullBytes [8]) + "." + byteToHex16 (usefullBytes [9]) + "." + byteToHex16 (usefullBytes [10]) + "." + byteToHex16 (usefullBytes [11]) + "." + byteToHex16 (usefullBytes [12]); + // onePortWirelessFR.Name = MyEncodingGB2312.GetString (usefullBytes, 13, 20).Trim ('\0');//============= + // onePortWirelessFR.IPAddress = usefullBytes [33] + "." + usefullBytes [34] + "." + usefullBytes [35] + "." + usefullBytes [36]; + // onePortWirelessFR.RouteIPAddress = usefullBytes [37] + "." + usefullBytes [38] + "." + usefullBytes [39] + "." + usefullBytes [40]; + // onePortWirelessFR.IPMAC = (char)usefullBytes [41] + "." + (char)usefullBytes [42] + "." + (char)usefullBytes [43] + "." + usefullBytes [44] + "." + usefullBytes [45] + "." + usefullBytes [46]; + // onePortWirelessFR.SubnetMask = usefullBytes [47] + "." + usefullBytes [48] + "." + usefullBytes [49] + "." + usefullBytes [50]; + // onePortWirelessFR.DHCP = usefullBytes [51] == 0 ? false : true; + // if (usefullBytes.Length == 80) { + // onePortWirelessFR.EncryptionFlag = usefullBytes [53]; + // onePortWirelessFR.Password = MyEncodingGB2312.GetString (usefullBytes, 54, 8).Trim ('\0'); + // onePortWirelessFR.WirelessBand = usefullBytes [62]; + // onePortWirelessFR.WirelessChannel = usefullBytes [63]; + // onePortWirelessFR.WirelessPassword = MyEncodingGB2312.GetString (usefullBytes, 64, 16).Trim ('\0'); + // } + // GateWayList.Add (onePortWirelessFR); + // if (onePortWirelessFR.Name == "") { + // onePortWirelessFR.Name = onePortWirelessFR.CommonLoopID.ToString (); + // } + // //IO.FileUtils.SaveEquipmentMessage (onePortWirelessFR); + // //System.Threading.Tasks.Task.Run (() => { + // // if (string.IsNullOrEmpty (UserConfig.Current.RemoteModeFile)) { + // // var gatewayBytes = Control.ControlBytesSendHasReturn (Command.ReadGateWayModelInfo, onePortWirelessFR.SubnetID, onePortWirelessFR.DeviceID, new byte [] { }); + // // if (gatewayBytes!=null&&gatewayBytes [0] == 2) { + // // UserConfig.Current.RemoteModeFile = "Equipment_" + onePortWirelessFR.Type.ToString () + "_" + onePortWirelessFR.SubnetID.ToString () + "_" + onePortWirelessFR.DeviceID.ToString (); + // // UserConfig.Current.SaveUserConfig (); + // // } + // // } + // //}); + // #endregion + // break; + // case DeviceType.OnePortBus: + // #region + // OnePortBus onePortBus = new OnePortBus (); + // string onePath = "Equipment_" + typeof (OnePortBus).Name + "_" + subnetID + "_" + deviceID; + // var bytesOne = IO.FileUtils.ReadFile (onePath); + // if (bytesOne.Length > 1) { + // onePortBus = Newtonsoft.Json.JsonConvert.DeserializeObject<OnePortBus> (MyEncodingUTF8.GetString (bytesOne)); + // } + // onePortBus.SubnetID = subnetID; + // onePortBus.DeviceID = deviceID; + // //onePortBus.ChNumberCount = usefullBytes [4]; + // onePortBus.MAC = byteToHex16 (usefullBytes [5]) + "." + byteToHex16 (usefullBytes [6]) + "." + byteToHex16 (usefullBytes [7]) + "." + byteToHex16 (usefullBytes [8]) + "." + byteToHex16 (usefullBytes [9]) + "." + byteToHex16 (usefullBytes [10]) + "." + byteToHex16 (usefullBytes [11]) + "." + byteToHex16 (usefullBytes [12]); + // onePortBus.Name = MyEncodingGB2312.GetString (usefullBytes, 13, 20).Trim ('\0'); ; + // onePortBus.IPAddress = usefullBytes [33] + "." + usefullBytes [34] + "." + usefullBytes [35] + "." + usefullBytes [36]; + // onePortBus.RouteIPAddress = usefullBytes [37] + "." + usefullBytes [38] + "." + usefullBytes [39] + "." + usefullBytes [40]; + // onePortBus.IPMAC = (char)usefullBytes [41] + "." + (char)usefullBytes [42] + "." + (char)usefullBytes [43] + "." + usefullBytes [44] + "." + usefullBytes [45] + "." + usefullBytes [46]; + // onePortBus.SubnetMask = usefullBytes [47] + "." + usefullBytes [48] + "." + usefullBytes [49] + "." + usefullBytes [50]; + // onePortBus.DHCP = usefullBytes [51] == 0 ? false : true; + // //onePortBus.SubnetID = usefullBytes [52]; + // if (usefullBytes.Length == 53 + 1 + 8) { + // onePortBus.EncryptionFlag = usefullBytes [53]; + // onePortBus.Password = MyEncodingGB2312.GetString (usefullBytes, 54, 8).Trim ('\0'); + // } + // GateWayList.Add (onePortBus); + // if (onePortBus.Name == "") { + // onePortBus.Name = onePortBus.CommonLoopID.ToString (); + // } + // //IO.FileUtils.SaveEquipmentMessage (onePortBus); + // //System.Threading.Tasks.Task.Run (() => { + // // if (string.IsNullOrEmpty (UserConfig.Current.RemoteModeFile)) { + // // var gatewayBytes = Control.ControlBytesSendHasReturn (Command.ReadGateWayModelInfo, onePortBus.SubnetID, onePortBus.DeviceID, new byte [] { }); + // // if (gatewayBytes!=null&&gatewayBytes [0] == 2) { + // // UserConfig.Current.RemoteModeFile = "Equipment_" + onePortBus.Type.ToString () + "_" + onePortBus.SubnetID.ToString () + "_" + onePortBus.DeviceID.ToString (); + // // UserConfig.Current.SaveUserConfig (); + // // } + // // } + // //}); + // #endregion + // break; + // case DeviceType.RCU: + // RCU RCU_Device = new RCU (); + // string RCU_DevicePath = "Equipment_" + typeof (RCU).Name + "_" + subnetID + "_" + deviceID; + // var RCU_DeviceBytes = IO.FileUtils.ReadFile (RCU_DevicePath); + // if (RCU_DeviceBytes.Length > 1) { + // RCU_Device = Newtonsoft.Json.JsonConvert.DeserializeObject<RCU> (MyEncodingUTF8.GetString (RCU_DeviceBytes)); + // } + // RCU_Device.SubnetID = subnetID; + // RCU_Device.DeviceID = deviceID; + // RCU_Device.LoopID = usefullBytes [4]; + // RCU_Device.MAC = byteToHex16 (usefullBytes [5]) + "." + byteToHex16 (usefullBytes [6]) + "." + byteToHex16 (usefullBytes [7]) + "." + byteToHex16 (usefullBytes [8]) + "." + byteToHex16 (usefullBytes [9]) + "." + byteToHex16 (usefullBytes [10]) + "." + byteToHex16 (usefullBytes [11]) + "." + byteToHex16 (usefullBytes [12]); + // RCU_Device.Name = MyEncodingGB2312.GetString (usefullBytes, 13, 20).Trim ('\0');//============= + // RCU_Device.IPAddress = usefullBytes [33] + "." + usefullBytes [34] + "." + usefullBytes [35] + "." + usefullBytes [36]; + // RCU_Device.RouteIPAddress = usefullBytes [37] + "." + usefullBytes [38] + "." + usefullBytes [39] + "." + usefullBytes [40]; + // RCU_Device.IPMAC = (char)usefullBytes [41] + "." + (char)usefullBytes [42] + "." + (char)usefullBytes [43] + "." + usefullBytes [44] + "." + usefullBytes [45] + "." + usefullBytes [46]; + // RCU_Device.SubnetMask = usefullBytes [47] + "." + usefullBytes [48] + "." + usefullBytes [49] + "." + usefullBytes [50]; + // RCU_Device.DHCP = usefullBytes [51] == 0 ? false : true; + // RCU_Device.LinkNetworkLine = true; + // GateWayList.Add (RCU_Device); + // if (RCU_Device.Name == "") { + // RCU_Device.Name = RCU_Device.CommonLoopID.ToString (); + // } + // //IO.FileUtils.SaveEquipmentMessage (RCU_Device); + // break; + // case DeviceType.MusicModel: + // MusicModel mm = new MusicModel (); + // GateWayList.Add (mm); + // mm.SubnetID = subnetID; + // mm.DeviceID = deviceID; + // mm.ChNumberCount = usefullBytes [4]; + // mm.MAC = byteToHex16 (usefullBytes [5]) + "." + byteToHex16 (usefullBytes [6]) + "." + byteToHex16 (usefullBytes [7]) + "." + byteToHex16 (usefullBytes [8]) + "." + byteToHex16 (usefullBytes [9]) + "." + byteToHex16 (usefullBytes [10]) + "." + byteToHex16 (usefullBytes [11]) + "." + byteToHex16 (usefullBytes [12]); + // mm.Name = MyEncodingGB2312.GetString (usefullBytes, 13, 20).Trim ('\0');//============= + // mm.IPAddress = usefullBytes [33] + "." + usefullBytes [34] + "." + usefullBytes [35] + "." + usefullBytes [36]; + // mm.RouteIPAddress = usefullBytes [37] + "." + usefullBytes [38] + "." + usefullBytes [39] + "." + usefullBytes [40]; + // mm.IPMAC = (char)usefullBytes [41] + "." + (char)usefullBytes [42] + "." + (char)usefullBytes [43] + "." + usefullBytes [44] + "." + usefullBytes [45] + "." + usefullBytes [46]; + // mm.SubnetMask = usefullBytes [47] + "." + usefullBytes [48] + "." + usefullBytes [49] + "." + usefullBytes [50]; + // mm.DHCP = 0; + // if (mm.Name == "") { + // mm.Name = mm.CommonLoopID.ToString (); + // } + // IO.FileUtils.SaveEquipmentMessage (mm); + // IO.FileUtils.SaveEquipmentMessage (mm, "1"); + // break; + // case DeviceType.MusicA31: + // MusicA31 mm31 = new MusicA31 (); + // GateWayList.Add (mm31); + // mm31.SubnetID = subnetID; + // mm31.DeviceID = deviceID; + // mm31.ChNumberCount = usefullBytes [4]; + // mm31.MAC = byteToHex16 (usefullBytes [5]) + "." + byteToHex16 (usefullBytes [6]) + "." + byteToHex16 (usefullBytes [7]) + "." + byteToHex16 (usefullBytes [8]) + "." + byteToHex16 (usefullBytes [9]) + "." + byteToHex16 (usefullBytes [10]) + "." + byteToHex16 (usefullBytes [11]) + "." + byteToHex16 (usefullBytes [12]); + // mm31.Name = MyEncodingGB2312.GetString (usefullBytes, 13, 20).Trim ('\0');//============= + // mm31.IPAddress = usefullBytes [33] + "." + usefullBytes [34] + "." + usefullBytes [35] + "." + usefullBytes [36]; + // mm31.RouteIPAddress = usefullBytes [37] + "." + usefullBytes [38] + "." + usefullBytes [39] + "." + usefullBytes [40]; + // mm31.IPMAC = (char)usefullBytes [41] + "." + (char)usefullBytes [42] + "." + (char)usefullBytes [43] + "." + usefullBytes [44] + "." + usefullBytes [45] + "." + usefullBytes [46]; + // mm31.SubnetMask = usefullBytes [47] + "." + usefullBytes [48] + "." + usefullBytes [49] + "." + usefullBytes [50]; + // mm31.DHCP = usefullBytes [51]; + // if (mm31.Name == "") { + // mm31.Name = mm31.CommonLoopID.ToString (); + // } + // //mm31.SubnetID + // IO.FileUtils.SaveEquipmentMessage (mm31); + // IO.FileUtils.SaveEquipmentMessage (mm31, "1"); + // break; + // default: + + // break; + // } + // break; + // //璇诲彇闈炵綉缁滆澶囧洖澶� + // case Command.ReadDeviceModulACK: + // if (!LocalPhoneFindDevice) {//r濡傛灉涓嶆槸鏈満鍦ㄦ煡鎵捐澶� + // break; + // } + // if (!string.IsNullOrEmpty (SystemMiddle.curGatewayIP) && SystemMiddle.curGatewayIP != revGatewayIP) { + // return; + // } + // if (usefullBytes [0] != RandomHigh || usefullBytes [1] != RandomLow) { + // return; + // } + // if (DeviceList.Find ((l) => { return l.SubnetID == subnetID && l.DeviceID == deviceID; }) != null) { + // return; + // } + + + + // notHasRemake = false; + // for (int ki = 0; ki < 20; ki++) { + // if (usefullBytes [3 + ki] != 255) { + // break; + // } else { + // notHasRemake = true; + // } + // } + // if (usefullBytes [24] == 0) { + + + // } else { + // for (int i = 22; i < usefullBytes.Length; i += 3) { + // if (usefullBytes [i + 2] == 0) { + // continue; + // } + // deviceType = (DeviceType)(usefullBytes [i] * 256 + usefullBytes [i + 1]); + // //MainPage.WriteLog (deviceType.ToString ()); + // //if (notHasRemake ) { + // // byte [] ddd = CommonPage.MyEncodingGB2312.GetBytes (deviceType.ToString () + "-" + subnetID.ToString () + "-" + deviceID.ToString ()); + // // Array.Copy (ddd, 0, usefullBytes, 2, 20 < ddd.Length ? 20 : ddd.Length); + // //} + // if (deviceType.ToString () == (usefullBytes [i] * 256 + usefullBytes [i + 1]).ToString ()) { + // continue; + // } + // if (deviceType == DeviceType.MusicModel || deviceType == DeviceType.RCU || deviceType == DeviceType.MusicPanel) {//|| deviceType == DeviceType.LogicModule) {// || deviceType == DeviceType.FoolHeat){// ||deviceType == DeviceType.InfraredMode) { + // continue; + // } + // if (deviceType == DeviceType.Thermostat) { + // if (i > 24) + // continue; + // } + // Common common = new Common () { + // GatewayMAC = SystemMiddle.curGatewayMAC, + // SubnetID = subnetID, DeviceID = deviceID, + // Name = MyEncodingGB2312.GetString (usefullBytes, 2, 20).Trim ('\0'), Type = deviceType, LoopCount = usefullBytes [i + 2], + // }; + + // DeviceList.Add (common); + // if (i > 24) { + + // common.isMixBox = true; + // common.MixType = (DeviceType)(usefullBytes [22] * 256 + usefullBytes [23]); + // } + // IO.FileUtils.SaveEquipmentMessage (common); + // } + // } + // break; + // //璁惧瀵瑰簲鍥炶矾 + // case Command.ReadDeviceLoopInfoACK: + // MainPage.WriteLog ("ReadDeviceLoopInfoACK : " + LocalPhoneFindDevice); + // if (!LocalPhoneFindDevice) {//r濡傛灉涓嶆槸鏈満鍦ㄦ煡鎵捐澶� + // if (usefullBytes [0] * 256 != 5) + // break; + // //Application.RunOnMainThread (() => { + // // try { + // // new Alert (Language.StringByID (R.MyInternationalizationString.Tip), "ReadDeviceLoopInfoACK fail", Language.StringByID (R.MyInternationalizationString.Close)).Show (); + // // } catch { + // // } + // //}); + // } + // DeviceType deviceType1 = (DeviceType)(usefullBytes [0] * 256 + usefullBytes [1]); + // bool notHasRemake2 = false; + // for (int ki = 0; ki < 20; ki++) { + // if (usefullBytes [3 + ki] != 255) { + // break; + // } else { + // notHasRemake2 = true; + // } + // } + + // //澶勭悊鐗规畩瀛楃 + // for (var remakeIndex = 22; remakeIndex >= 3; remakeIndex--) { + // if (usefullBytes [remakeIndex] == 0xFF) { + // usefullBytes [remakeIndex] = 0; + // } else { + // break; + // } + // } + + // if (notHasRemake2 || MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0') == "") { + // byte [] ddd = CommonPage.MyEncodingGB2312.GetBytes (deviceType1.ToString () + "-" + subnetID.ToString () + "-" + deviceID.ToString () + "-" + usefullBytes [2].ToString ()); + // Array.Copy (ddd, 0, usefullBytes, 3, 20 < ddd.Length ? 20 : ddd.Length); + // } + + // if (null != DeviceLoopList.Find ((common) => { + // return common.Type == deviceType1 && common.SubnetID == subnetID & common.DeviceID == deviceID && common.LoopID == usefullBytes [2]; + // })) { + // //瀛樺湪褰撳墠璁惧灏辫繑鍥� + // return; + // } + + // //if (ModuleType.YIPanel == (ModuleType)(usefullBytes [0] * 256 + usefullBytes [1])){ + // // var yIPanel = new YIPanel () { + // // SubnetID = subnetID, DeviceID = deviceID, Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'), + // // }; + // // IO.FileUtils.SaveEquipmentMessage (yIPanel); + // //} + + // switch (deviceType1) { + // case DeviceType.Thermostat: + // var thermostat = new Thermostat () { + // SubnetID = subnetID, DeviceID = deviceID, LoopID = usefullBytes [2], Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'), + // HostID = usefullBytes[23],ExtensionID = usefullBytes[24] + // }; + // DeviceLoopList.Add (thermostat); + // IO.FileUtils.SaveEquipmentMessage (thermostat, thermostat.LoopID.ToString ()); + // break; + // case DeviceType.FreshAir: + // //閫氶亾鍙凤紙1 - 200锛� + 澶囨敞 + 寮�鍏筹紙0锛�1锛� + 椋庨�燂紙0 鍏筹紝1浣庯紝2涓紝3楂橈級 + 妯″紡锛�0鎵嬪姩锛�1 鑷姩锛� + 鎹㈡皵鎵囷紙0 鍏筹紝1浣庯紝2涓紝3楂橈級 + 瀹ゅ唴娓╁害 + 瀹ゅ娓╁害 + 瀹ゅ唴婀垮害+ PM2.5 + VOC +CO2 + + // FreshAir fresAir = new FreshAir () { + // SubnetID = subnetID, DeviceID = deviceID, LoopID = usefullBytes [2], Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'), + // //SwitchStatus = usefullBytes[23], WindSpeed = usefullBytes [24], SetPattern= usefullBytes [25], InTemp = usefullBytes [26], + // //OutTemp =usefullBytes [27], InHumidity =usefullBytes [28], PM25 = usefullBytes [29], TVOC = usefullBytes [30], CO2 = usefullBytes [31] + // }; + // DeviceLoopList.Add (fresAir); + // IO.FileUtils.SaveEquipmentMessage (fresAir, fresAir.LoopID.ToString ()); + // break; + + // case DeviceType.MusicPanel: + // MusicPanel mm = new MusicPanel (); + // mm.SubnetID = subnetID; + // mm.DeviceID = deviceID; + // mm.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // mm.Status = usefullBytes [23]; + // mm.isMixBox = true; + // DeviceLoopList.Add (mm); + // IO.FileUtils.SaveEquipmentMessage (mm, "1"); + // break; + // case DeviceType.DryContact: + // #region + // DryContact sdc = new DryContact (); + // sdc.SubnetID = subnetID; + // sdc.DeviceID = deviceID; + // sdc.LoopID = usefullBytes [2];//鍓嶄袱浣嶄负闅忔満鏁� + // sdc.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // sdc.Mode = usefullBytes [23]; + // DeviceLoopList.Add (sdc); + // IO.FileUtils.SaveEquipmentMessage (sdc, sdc.LoopID.ToString ()); + // #endregion + // break; + // case DeviceType.FoolHeat: + // #region + // var thRDD = new FoolHeat (); + // thRDD.SubnetID = subnetID; + // thRDD.DeviceID = deviceID; + // thRDD.LoopID = usefullBytes [2]; + // thRDD.Name = Encoding.Unicode.GetString (usefullBytes, 3, 20).Trim ('\0'); + // thRDD.Status = usefullBytes [23]; + // thRDD.WorkingMode = usefullBytes [24]; + // thRDD.WorkingTemperature = usefullBytes [25]; + // thRDD.PIDSpeed = usefullBytes [26]; + // thRDD.IndoorTemperature = usefullBytes [27]; + // thRDD.FloorTemperature = usefullBytes [28]; + // DeviceLoopList.Add (thRDD); + // IO.FileUtils.SaveEquipmentMessage (thRDD, thRDD.LoopID.ToString ()); + // #endregion + // break; + // case DeviceType.FoolHeatPanel: + // #region + // var thp = new FoolHeatPanel (); + // thp.SubnetID = subnetID; + // thp.DeviceID = deviceID; + // thp.LoopID = usefullBytes [2]; + // thp.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // thp.Status = usefullBytes [23]; + // thp.WorkingMode = usefullBytes [24]; + // thp.WorkingTemperature = usefullBytes [25]; + // thp.PIDSpeed = usefullBytes [26]; + // thp.IndoorTemperature = usefullBytes [27]; + // thp.FloorTemperature = usefullBytes [28]; + // DeviceLoopList.Add (thp); + // IO.FileUtils.SaveEquipmentMessage (thp, thp.LoopID.ToString ()); + // #endregion + // break; + // case DeviceType.LightDimming: + // #region + // var lightDimming = new LightDimming (); + // lightDimming.SubnetID = subnetID; + // lightDimming.DeviceID = deviceID; + // lightDimming.LoopID = usefullBytes [2]; + // lightDimming.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // lightDimming.Minimum = usefullBytes [23]; + // lightDimming.MaxLevel = usefullBytes [24]; + // lightDimming.CurrentBrightness = usefullBytes [25]; + + // DeviceLoopList.Add (lightDimming); + // IO.FileUtils.SaveEquipmentMessage (lightDimming, lightDimming.LoopID.ToString ()); + // #endregion + // break; + // case DeviceType.LightDALI: + // #region + // /* + // 鍥炶矾鍙凤紝澶囨敞锛屼綆闄愶紝鏈�澶ф按骞筹紝褰撳墠浜害鍊硷紝 24byte + // 鍥炶矾鍦ㄧ嚎(0x00涓嶅湪锛宱xff鍦ㄧ嚎)锛屽洖璺被鍨�(鍏ㄩ儴鏈変寒搴︼紝鍙�8鏈夎壊娓�)锛� 2byte + // 鑹叉俯鐗╃悊鏈�鏆朒 + 鏈�鏆朙锛岃壊娓╃墿鐞嗘渶鍐稨 + 鏈�鍐稬锛� 4byte + // 鑹叉俯鏈�鏆朒 + 鏈�鏆朙锛岃壊娓╂渶鍐稨 + 鏈�鍐稬锛� 4byte + // 褰撳墠鑹叉俯H + L锛� 2byte + // */ + // var lightDALI = new LightDALI (); + // lightDALI.Type = DeviceType.LightDALI; + // lightDALI.SubnetID = subnetID; + // lightDALI.DeviceID = deviceID; + // lightDALI.LoopID = usefullBytes [2]; + // lightDALI.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // lightDALI.Minimum = usefullBytes [23]; + // lightDALI.MaxLevel = usefullBytes [24]; + // if (usefullBytes.Length > 27) { + // //lightDALI.LinkLightStatus = usefullBytes [24]; + // lightDALI.CurrentBrightness = usefullBytes [25]; + // lightDALI.DALIModule = true; + // lightDALI.Online = usefullBytes [26]; + // lightDALI.LoopType = usefullBytes [27]; + // lightDALI.WarmTones_High_Modular = usefullBytes [28]; + // lightDALI.WarmTones_Low_Modular = usefullBytes [29]; + // lightDALI.CoolTones_High_Modular = usefullBytes [30]; + // lightDALI.CoolTones_Low_Modular = usefullBytes [31]; + // lightDALI.WarmTones_High = usefullBytes [32]; + // lightDALI.WarmTones_Low = usefullBytes [33]; + // lightDALI.CoolTones_High = usefullBytes [34]; + // lightDALI.CoolTones_Low = usefullBytes [35]; + // lightDALI.CurTones_High = usefullBytes [36]; + // lightDALI.CurTones_Low = usefullBytes [37]; + // } + // //lightDALI.MinClass = 7; + // DeviceLoopList.Add (lightDALI); + // IO.FileUtils.SaveEquipmentMessage (lightDALI, lightDALI.LoopID.ToString ()); + // #endregion + // break; + // case DeviceType.LightSwitch: + // #region + // var lightSwitch = new LightSwitch (); + // lightSwitch.SubnetID = subnetID; + // lightSwitch.DeviceID = deviceID; + // lightSwitch.LoopID = usefullBytes [2]; + // lightSwitch.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // lightSwitch.CurrentBrightness = usefullBytes [23]; + // if (UserConfig.Instance.SocketList.Contains (lightSwitch.CommonLoopID)) { + // lightSwitch.Type = DeviceType.LightSwitchSocket; + // lightSwitch.DeviceTextID = SimpleControl.R.MyInternationalizationString.ElectricalControl; + // } + // DeviceLoopList.Add (lightSwitch); + // IO.FileUtils.SaveEquipmentMessage (lightSwitch, lightSwitch.LoopID.ToString ()); + // #endregion + // break; + // case DeviceType.LightEnergySwitch: + // #region + // var lightEnergySwitch = new LightEnergySwitch (); + // lightEnergySwitch.SubnetID = subnetID; + // lightEnergySwitch.DeviceID = deviceID; + // lightEnergySwitch.LoopID = usefullBytes [2]; + // lightEnergySwitch.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // lightEnergySwitch.CurrentBrightness = usefullBytes [23]; + // //if (UserConfig.Current.SocketList.Contains (lightEnergySwitch.CommonLoopID)) { + // // lightEnergySwitch.Type = DeviceType.LightSwitchSocket; + // // lightEnergySwitch.DeviceTextID = SimpleControl.R.MyInternationalizationString.ElectricalControl; + // //} + // DeviceLoopList.Add (lightEnergySwitch); + // IO.FileUtils.SaveEquipmentMessage (lightEnergySwitch, lightEnergySwitch.LoopID.ToString ()); + // #endregion + // break; + // case DeviceType.LightMixDimming: + // #region + // var lightMixDimming = new LightMixDimming (); + // lightMixDimming.SubnetID = subnetID; + // lightMixDimming.DeviceID = deviceID; + // lightMixDimming.LoopID = usefullBytes [2]; + // lightMixDimming.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // lightMixDimming.Minimum = usefullBytes [23]; + // lightMixDimming.MaxLevel = usefullBytes [24]; + // lightMixDimming.CurrentBrightness = usefullBytes [25]; + // lightMixDimming.PhysicsLoopID = usefullBytes [26]; + // DeviceLoopList.Add (lightMixDimming); + // IO.FileUtils.SaveEquipmentMessage (lightMixDimming, lightMixDimming.LoopID.ToString ()); + // #endregion + // break; + // case DeviceType.LightMixSwitch: + // #region + // var lightMixSwitch = new LightMixSwitch (); + // lightMixSwitch.SubnetID = subnetID; + // lightMixSwitch.DeviceID = deviceID; + // lightMixSwitch.LoopID = usefullBytes [2]; + // lightMixSwitch.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // lightMixSwitch.CurrentBrightness = usefullBytes [23]; + // lightMixSwitch.PhysicsLoopID = usefullBytes [24]; + // DeviceLoopList.Add (lightMixSwitch); + // IO.FileUtils.SaveEquipmentMessage (lightMixSwitch, lightMixSwitch.LoopID.ToString ()); + // #endregion + // break; + // case DeviceType.LightRGB: + // var lightRGB = new LightLogic (); + // lightRGB.Type = DeviceType.LightRGB; + // lightRGB.SubnetID = subnetID; + // lightRGB.DeviceID = deviceID; + // lightRGB.LoopID = usefullBytes [2]; + // lightRGB.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // lightRGB.RStatus = usefullBytes [23]; + // lightRGB.GStatus = usefullBytes [24]; + // lightRGB.BStatus = usefullBytes [25]; + // DeviceLoopList.Add (lightRGB); + // IO.FileUtils.SaveEquipmentMessage (lightRGB, lightRGB.LoopID.ToString ()); + // break; + // case DeviceType.LightRGBW: + // //var lightRGBW = new LightLogic (); + // //lightRGBW.Type = DeviceType.LightRGBW; + // //lightRGBW.SubnetID = subnetID; + // //lightRGBW.DeviceID = deviceID; + // //lightRGBW.LoopID = usefullBytes [2]; + // //lightRGBW.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // //lightRGBW.RStatus = usefullBytes [23] /100 * 255; + // //lightRGBW.GStatus = usefullBytes [24] /100 * 255; + // //lightRGBW.BStatus = usefullBytes [25] /100 * 255; + // //lightRGBW.WStatus = usefullBytes [26] /100 * 255; + // //DeviceLoopList.Add (lightRGBW); + // //IO.FileUtils.SaveEquipmentMessage (lightRGBW, lightRGBW.LoopID.ToString ()); + // break; + // case DeviceType.LightCCT: + // //var lightCCT = new LightLogic (); + // //lightCCT.Type = DeviceType.LightCCT; + // //lightCCT.SubnetID = subnetID; + // //lightCCT.DeviceID = deviceID; + // //lightCCT.LoopID = usefullBytes [2]; + // //lightCCT.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // //lightCCT.CTHStatus = usefullBytes [23]; + // //lightCCT.CTLStatus = usefullBytes [24]; + // //DeviceLoopList.Add (lightCCT); + // //IO.FileUtils.SaveEquipmentMessage (lightCCT, lightCCT.LoopID.ToString ()); + // break; + // case DeviceType.LightRGBandCCT: + // //var lightRGBandCCT = new LightLogic (); + // //lightRGBandCCT.Type = DeviceType.LightRGBandCCT; + // //lightRGBandCCT.SubnetID = subnetID; + // //lightRGBandCCT.DeviceID = deviceID; + // //lightRGBandCCT.LoopID = usefullBytes [2]; + // //lightRGBandCCT.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // //lightRGBandCCT.RStatus = usefullBytes [23] /100 * 255; + // //lightRGBandCCT.GStatus = usefullBytes [24] /100 * 255; + // //lightRGBandCCT.BStatus = usefullBytes [25] /100 * 255; + // //lightRGBandCCT.CTHStatus = usefullBytes [26]; + // //lightRGBandCCT.CTLStatus = usefullBytes [27]; + // //DeviceLoopList.Add (lightRGBandCCT); + // //IO.FileUtils.SaveEquipmentMessage (lightRGBandCCT, lightRGBandCCT.LoopID.ToString ()); + // break; + // case DeviceType.CurtainModel: + // #region + // var curtain = new CurtainModel (); + // curtain.SubnetID = subnetID; + // curtain.DeviceID = deviceID; + // curtain.LoopID = usefullBytes [2]; + // curtain.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // curtain.RunTime = (usefullBytes [23] * 256 + usefullBytes [24])/10; + // curtain.Status = (CurtainStatus)(usefullBytes [25]); + // DeviceLoopList.Add (curtain); + // FileUtils.SaveEquipmentMessage (curtain, curtain.LoopID.ToString ()); + // #endregion + // break; + // case DeviceType.CurtainTrietex: + // #region + // var curtaintrietex = new CurtainTrietex (); + // curtaintrietex.SubnetID = subnetID; + // curtaintrietex.DeviceID = deviceID; + // curtaintrietex.LoopID = usefullBytes [2]; + // curtaintrietex.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // curtaintrietex.CurtainLength = usefullBytes [23] * 256 + usefullBytes [24]; + // //curtaintrietex.Status = (CurtainStatus)(usefullBytes [24]); + // curtaintrietex.CurtainProress = usefullBytes [25]; + // curtaintrietex.MotorRotation = usefullBytes [26]; + // DeviceLoopList.Add (curtaintrietex); + // FileUtils.SaveEquipmentMessage (curtaintrietex, curtaintrietex.LoopID.ToString ()); + // #endregion + // break; + // case DeviceType.CurtainRoller: + // #region + // var CurtainRoller = new CurtainRoller (); + // CurtainRoller.SubnetID = subnetID; + // CurtainRoller.DeviceID = deviceID; + // CurtainRoller.LoopID = usefullBytes [2]; + // CurtainRoller.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // CurtainRoller.CurtainProress = usefullBytes [23]; + // CurtainRoller.MotorRotation = usefullBytes [24]; + // DeviceLoopList.Add (CurtainRoller); + // FileUtils.SaveEquipmentMessage (CurtainRoller, CurtainRoller.LoopID.ToString ()); + // #endregion + // break; + // case DeviceType.HVAC: + // #region + // var acHost = new HVAC (); + // acHost.SubnetID = subnetID; + // acHost.DeviceID = deviceID; + // acHost.LoopID = usefullBytes [2]; + + // acHost.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // DeviceLoopList.Add (acHost); + // IO.FileUtils.SaveEquipmentMessage (acHost, acHost.LoopID.ToString ()); + // #endregion + // break; + // case DeviceType.ACPanel: + // #region + // var acPanel = new ACPanel (); + // acPanel.SubnetID = subnetID; + // acPanel.DeviceID = deviceID; + // acPanel.LoopID = usefullBytes [2]; + // acPanel.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // DeviceLoopList.Add (acPanel); + // IO.FileUtils.SaveEquipmentMessage (acPanel, acPanel.LoopID.ToString ()); + // #endregion + // break; + // case DeviceType.ButtonPanel: + // #region MyRegion + // if (usefullBytes [23] == 255) + // break; + // ButtonPanel wirelessPanelButtonKey = new ButtonPanel (); + // DeviceLoopList.Add (wirelessPanelButtonKey); + // wirelessPanelButtonKey.SubnetID = subnetID; + // wirelessPanelButtonKey.DeviceID = deviceID; + // wirelessPanelButtonKey.LoopID = usefullBytes [2]; + // wirelessPanelButtonKey.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // wirelessPanelButtonKey.Mode = usefullBytes [23]; + // ButtonBkeyModelList.Add (wirelessPanelButtonKey.Mode); + // System.MainPage.WriteLog ("璇诲彇闈㈡澘鎸夐敭锛氬洖璺彿锛�" + wirelessPanelButtonKey.LoopID + " 妯″紡锛�" + wirelessPanelButtonKey.Mode); + // IO.FileUtils.SaveEquipmentMessage (wirelessPanelButtonKey, wirelessPanelButtonKey.LoopID.ToString ()); + // #endregion + // break; + // case DeviceType.InfraredMode: + // #region 绾㈠妯″潡 + // InfraredMode infrared = new InfraredMode (); + // DeviceLoopList.Add (infrared); + // infrared.SubnetID = subnetID; + // infrared.DeviceID = deviceID; + // infrared.LoopID = usefullBytes [2]; + // infrared.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // IO.FileUtils.SaveEquipmentMessage (infrared, infrared.LoopID.ToString ()); + // SystemWirelessGateway.Waiting = true; + // try { + // Control.ControlBytesSendHasReturn (Command.DownloadInfrared, subnetID, deviceID, new byte [] { usefullBytes [2], 0, 0 }); + // SystemWirelessGateway.Waiting = false; + // } catch { + // SystemWirelessGateway.Waiting = false; + // } + // #endregion + // break; + // case DeviceType.ACInfrared: + // #region + // var acInfrared = new ACInfrared (); + // acInfrared.SubnetID = subnetID; + // acInfrared.DeviceID = deviceID; + // acInfrared.LoopID = usefullBytes [2]; + // acInfrared.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // DeviceLoopList.Add (acInfrared); + // IO.FileUtils.SaveEquipmentMessage (acInfrared, acInfrared.LoopID.ToString ()); + // #endregion + // break; + // case DeviceType.SecurityModule: + // #region 瀹夐槻妯″潡 + // var SecurityMould = new SecurityModul (); + // SecurityMould.SubnetID = subnetID; + // SecurityMould.DeviceID = deviceID; + // SecurityMould.LoopID = usefullBytes [2]; + // SecurityMould.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // SecurityMould.AreaType = usefullBytes [23]; + // DeviceLoopList.Add (SecurityMould); + // IO.FileUtils.SaveEquipmentMessage (SecurityMould, SecurityMould.LoopID.ToString ()); + // #endregion + // break; + // case DeviceType.FanModule: + // #region 椋庢墖妯″潡 + // var fanModule = new FanModule (); + // fanModule.SubnetID = subnetID; + // fanModule.DeviceID = deviceID; + // fanModule.LoopID = usefullBytes [2]; + // fanModule.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // fanModule.WindSpeed = 1; + // //fanModule.WindSpeed = usefullBytes [23]; + // IO.FileUtils.SaveEquipmentMessage (fanModule, fanModule.LoopID.ToString ()); + // #endregion + // break; + // case DeviceType.LogicModule: + // LogicModule logicModule = new LogicModule (); + // logicModule.SubnetID = subnetID; + // logicModule.DeviceID = deviceID; + // logicModule.LoopID = usefullBytes [2]; + // logicModule.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // logicModule.AreaID = usefullBytes [23]; + // logicModule.AreaSceneID = usefullBytes [24]; + // IO.FileUtils.SaveEquipmentMessage (logicModule, logicModule.LoopID.ToString ()); + // break; + // case DeviceType.DoorLock: + // var doorLock = new DoorLock ();//闂ㄩ攣111 + // doorLock.SubnetID = subnetID; + // doorLock.DeviceID = deviceID; + // doorLock.LoopID = usefullBytes [2]; + // doorLock.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // DeviceLoopList.Add (doorLock); + // IO.FileUtils.SaveEquipmentMessage (doorLock, doorLock.LoopID.ToString ()); + // UserConfig.Instance.HideDeviceTypes.Remove (R.MyInternationalizationString.DoorLock); + // UserConfig.Instance.SaveUserConfig (); + // break; + // #region 浼犳劅鍣� + // case DeviceType.SensorMobileDetection: + // //var sensor = new SensorMobileDetection (); + // //sensor.SubnetID = subnetID; + // //sensor.DeviceID = deviceID; + // //sensor.LoopID = usefullBytes [2]; + // //sensor.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // //sensor.Enable = usefullBytes [23] == 1 ? true : false; + // //sensor.Sensitivity = usefullBytes [24]; + // //sensor.Status = usefullBytes [25]; + // //IO.FileUtils.SaveEquipmentMessage (sensor, sensor.LoopID.ToString ()); + // break; + // /// <summary> + // /// 娓╁害 + // /// </summary> + // case DeviceType.SensorTemperature: + // var sensor1 = new SensorTemperature (); + // sensor1.SubnetID = subnetID; + // sensor1.DeviceID = deviceID; + // sensor1.LoopID = usefullBytes [2]; + // sensor1.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // byte [] tempBytes = new byte [] { usefullBytes [24], usefullBytes [25], usefullBytes [26], usefullBytes [27] }; + // sensor1.CurrentTemperature = Math.Round (BitConverter.ToSingle (tempBytes, 0), 1); + // bool inLocal1 = false; + // foreach (var room in Room.Lists) { + // var roomSensor = room.DeviceList.Find ((obj) => obj.MinClass == sensor1.MinClass && obj.SubnetID == sensor1.SubnetID && obj.DeviceID == sensor1.DeviceID && obj.LoopID == sensor1.LoopID); + // if (roomSensor != null) { + // (roomSensor as SensorTemperature).CurrentTemperature = sensor1.CurrentTemperature; + // inLocal1 = true; + // } + // } + // //if(!inLocal1){ + // IO.FileUtils.SaveEquipmentMessage (sensor1, sensor1.LoopID.ToString ()); + // //} + // break; + // /// <summary> + // /// 婀垮害 + // /// </summary> + // case DeviceType.SensorHumidity: + // var sensor2 = new SensorHumidity (); + // sensor2.SubnetID = subnetID; + // sensor2.DeviceID = deviceID; + // sensor2.LoopID = usefullBytes [2]; + // sensor2.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // sensor2.Enable = usefullBytes [23] == 1 ? true : false; + // sensor2.CurrentHumidity = Convert.ToDouble (usefullBytes [24] * 256 + usefullBytes [25]) / 10; + // bool inLocal2 = false; + // foreach (var room in Room.Lists) { + // var roomSensor = room.DeviceList.Find ((obj) => obj.MinClass == sensor2.MinClass && obj.SubnetID == sensor2.SubnetID && obj.DeviceID == sensor2.DeviceID && obj.LoopID == sensor2.LoopID); + // if (roomSensor != null) { + // (roomSensor as SensorHumidity).CurrentHumidity = sensor2.CurrentHumidity; + // inLocal2 = true; + // } + // } + // //if(!inLocal2){ + // IO.FileUtils.SaveEquipmentMessage (sensor2, sensor2.LoopID.ToString ()); + // //} + // break; + // ///// <summary> + // ///// 鍏夌収 + // ///// </summary> + // case DeviceType.SensorIllumination: + // //var sensor3 = new SensorIllumination (); + // //sensor3.SubnetID = subnetID; + // //sensor3.DeviceID = deviceID; + // //sensor3.LoopID = usefullBytes [2]; + // //sensor3.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // //sensor3.Enable = usefullBytes [23] == 1 ? true : false; + // //sensor3.CurrentIllumination = Convert.ToInt32(usefullBytes [24] * 256 + usefullBytes [25]); + // //IO.FileUtils.SaveEquipmentMessage (sensor3, sensor3.LoopID.ToString ()); + // break; + // ///// <summary> + // ///// TVOC锛�05锛� + // ///// </summary> + // case DeviceType.SensorTVOC: + // var sensor4 = new SensorTVOC (); + // sensor4.SubnetID = subnetID; + // sensor4.DeviceID = deviceID; + // sensor4.LoopID = usefullBytes [2]; + // sensor4.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // sensor4.Enable = usefullBytes [23] == 1 ? true : false; + // sensor4.CurrentTVOC = Convert.ToDouble (usefullBytes [24] * 256 + usefullBytes [25]) / 100; + // bool inLocal3 = false; + // foreach (var room in Room.Lists) { + // var roomSensor = room.DeviceList.Find ((obj) => obj.MinClass == sensor4.MinClass && obj.SubnetID == sensor4.SubnetID && obj.DeviceID == sensor4.DeviceID && obj.LoopID == sensor4.LoopID); + // if (roomSensor != null) { + // inLocal3 = true; + // (roomSensor as SensorTVOC).CurrentTVOC = sensor4.CurrentTVOC; + // } + // } + // //if (!inLocal3) { + // IO.FileUtils.SaveEquipmentMessage (sensor4, sensor4.LoopID.ToString ()); + // //} + // break; + // ///// <summary> + // ///// The sensor PM 25. + // ///// </summary> + // case DeviceType.SensorPM25: + // var sensor5 = new SensorPM25 (); + // sensor5.SubnetID = subnetID; + // sensor5.DeviceID = deviceID; + // sensor5.LoopID = usefullBytes [2]; + // sensor5.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // sensor5.Enable = usefullBytes [23] == 1 ? true : false; + // sensor5.CurrentPM25 = Convert.ToInt32 (usefullBytes [24] * 256 + usefullBytes [25]); + // bool inLocal4 = false; + // foreach (var room in Room.Lists) { + // var roomSensor = room.DeviceList.Find ((obj) => obj.MinClass == sensor5.MinClass && obj.SubnetID == sensor5.SubnetID && obj.DeviceID == sensor5.DeviceID && obj.LoopID == sensor5.LoopID); + // if (roomSensor != null) { + // (roomSensor as SensorPM25).CurrentPM25 = sensor5.CurrentPM25; + // inLocal4 = true; + // } + // } + // //if(!inLocal4){ + // IO.FileUtils.SaveEquipmentMessage (sensor5, sensor5.LoopID.ToString ()); + // //} + // break; + // ///// <summary> + // ///// The sensor CO2. + // ///// </summary> + // case DeviceType.SensorCO2: + // var sensor6 = new SensorCO2 (); + // sensor6.SubnetID = subnetID; + // sensor6.DeviceID = deviceID; + // sensor6.LoopID = usefullBytes [2]; + // sensor6.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // sensor6.Enable = usefullBytes [23] == 1 ? true : false; + // sensor6.CurrentCO2 = Convert.ToInt32 (usefullBytes [24] * 256 + usefullBytes [25]); + // bool inLocal5 = false; + // foreach (var room in Room.Lists) { + // var roomSensor = room.DeviceList.Find ((obj) => obj.MinClass == sensor6.MinClass && obj.SubnetID == sensor6.SubnetID && obj.DeviceID == sensor6.DeviceID && obj.LoopID == sensor6.LoopID); + // if (roomSensor != null) { + // (roomSensor as SensorCO2).CurrentCO2 = sensor6.CurrentCO2; + // inLocal5 = true; + // } + // } + // //if(!inLocal5) + // //{ + // IO.FileUtils.SaveEquipmentMessage (sensor6, sensor6.LoopID.ToString ()); + // //} + // break; + // ///// <summary> + // ///// 娑插寲鐭虫补姘旓紙LPG锛夛紙08锛� + // ///// </summary> + // //SensorLPG = 0x0508, + // case DeviceType.SensorLPG: + // //var sensor7 = new SensorLPG (); + // //sensor7.SubnetID = subnetID; + // //sensor7.DeviceID = deviceID; + // //sensor7.LoopID = usefullBytes [2]; + // //sensor7.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // //sensor7.Enable = usefullBytes [23] == 1 ? true : false; + // //sensor7.CurrentLPG = Convert.ToInt32(usefullBytes [24] * 256 + usefullBytes [25]); + // //IO.FileUtils.SaveEquipmentMessage (sensor7, sensor7.LoopID.ToString ()); + // break; + // ///// <summary> + // ///// 浜哄伐鐓ゆ皵锛圕O锛孒2锛夛紙09锛� + // ///// </summary> + // case DeviceType.SensorCOH2: + // //var sensor8 = new SensorCOH2 (); + // //sensor8.SubnetID = subnetID; + // //sensor8.DeviceID = deviceID; + // //sensor8.LoopID = usefullBytes [2]; + // //sensor8.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // //sensor8.Enable = usefullBytes [23] == 1 ? true : false; + // //sensor8.CurrentCOH2 = Convert.ToInt32(usefullBytes [24] * 256 + usefullBytes [25]); + // //IO.FileUtils.SaveEquipmentMessage (sensor8, sensor8.LoopID.ToString ()); + // break; + // ///// <summary> + // ///// 澶╃劧姘旓紙CH4锛夛紙10锛� + // ///// </summary> + // case DeviceType.SensorCH4: + // //var sensor9 = new SensorCH4 (); + // //sensor9.SubnetID = subnetID; + // //sensor9.DeviceID = deviceID; + // //sensor9.LoopID = usefullBytes [2]; + // //sensor9.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // //sensor9.Enable = usefullBytes [23] == 1 ? true : false; + // //sensor9.CurrentCH4 = Convert.ToInt32(usefullBytes [24] * 256 + usefullBytes [25]); + // //IO.FileUtils.SaveEquipmentMessage (sensor9, sensor9.LoopID.ToString ()); + // break; + // ///// <summary> + // ///// 鐑熼浘锛�11锛� + // ///// </summary> + // case DeviceType.SensorSmoke: + // //var sensor10 = new SensorSmoke (); + // //sensor10.SubnetID = subnetID; + // //sensor10.DeviceID = deviceID; + // //sensor10.LoopID = usefullBytes [2]; + // //sensor10.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // //sensor10.Enable = usefullBytes [23] == 1 ? true : false; + // //sensor10.CurrentStatus = Convert.ToInt32(usefullBytes [24] * 256 + usefullBytes [25]); + // //IO.FileUtils.SaveEquipmentMessage (sensor10, sensor10.LoopID.ToString ()); + // break; + // ///// <summary> + // ///// 椋庨�燂紙12锛� + // ///// </summary> + // case DeviceType.SensorWindSpeed: + // //var sensor11 = new SensorWindSpeed (); + // //sensor11.SubnetID = subnetID; + // //sensor11.DeviceID = deviceID; + // //sensor11.LoopID = usefullBytes [2]; + // //sensor11.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // //sensor11.Enable = usefullBytes [23] == 1 ? true : false; + // //sensor11.CurrentWindSpeed = Convert.ToInt32(usefullBytes [24] * 256 + usefullBytes [25]); + // //IO.FileUtils.SaveEquipmentMessage (sensor11, sensor11.LoopID.ToString ()); + // break; + // ///// <summary> + // ///// 椋庡帇锛�13锛� + // ///// </summary> + // case DeviceType.SensorWindPressure: + // //var sensor12 = new SensorWindPressure (); + // //sensor12.SubnetID = subnetID; + // //sensor12.DeviceID = deviceID; + // //sensor12.LoopID = usefullBytes [2]; + // //sensor12.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // //sensor12.Enable = usefullBytes [23] == 1 ? true : false; + // //sensor12.CurrentWindPressure = Convert.ToInt32(usefullBytes [24] * 256 + usefullBytes [25]); + // //IO.FileUtils.SaveEquipmentMessage (sensor12, sensor12.LoopID.ToString ()); + // break; + // ///// <summary> + // ///// 娑蹭綋娴侀噺锛�14锛� + // ///// </summary> + // case DeviceType.SensorLiquidFlow: + // //var sensor13 = new SensorLiquidFlow (); + // //sensor13.SubnetID = subnetID; + // //sensor13.DeviceID = deviceID; + // //sensor13.LoopID = usefullBytes [2]; + // //sensor13.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // //sensor13.Enable = usefullBytes [23] == 1 ? true : false; + // //sensor13.CurrentLiquidFlow = Convert.ToInt32(usefullBytes [24] * 256 + usefullBytes [25]); + // //IO.FileUtils.SaveEquipmentMessage (sensor13, sensor13.LoopID.ToString ()); + // break; + // ///// <summary> + // ///// 娑蹭綋鍘嬪姏锛�15锛� + // ///// </summary> + // case DeviceType.SensorLiquidPressure: + // //var sensor14 = new SensorLiquidPressure (); + // //sensor14.SubnetID = subnetID; + // //sensor14.DeviceID = deviceID; + // //sensor14.LoopID = usefullBytes [2]; + // //sensor14.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // //sensor14.Enable = usefullBytes [23] == 1 ? true : false; + // //sensor14.CurrentLiquidPressure = Convert.ToInt32(usefullBytes [24] * 256 + usefullBytes [25]); + // //IO.FileUtils.SaveEquipmentMessage (sensor14, sensor14.LoopID.ToString ()); + // break; + // ///// <summary> + // ///// 娑蹭綋娣卞害锛�16锛� + // ///// </summary> + // case DeviceType.SensorLiquidDepth: + // //var sensor15 = new SensorLiquidDepth (); + // //sensor15.SubnetID = subnetID; + // //sensor15.DeviceID = deviceID; + // //sensor15.LoopID = usefullBytes [2]; + // //sensor15.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // //sensor15.Enable = usefullBytes [23] == 1 ? true : false; + // //sensor15.CurrentLiquidDepth = Convert.ToInt32(usefullBytes [24] * 256 + usefullBytes [25]); + // //IO.FileUtils.SaveEquipmentMessage (sensor15, sensor15.LoopID.ToString ()); + // break; + // ///// <summary> + // ///// 闆ㄩ噺锛�17锛� + // ///// </summary> + // //SensorRainfall = 0x0517, + // case DeviceType.SensorRainfall: + // //var sensor16 = new SensorRainfall (); + // //sensor16.SubnetID = subnetID; + // //sensor16.DeviceID = deviceID; + // //sensor16.LoopID = usefullBytes [2]; + // //sensor16.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // //sensor16.Enable = usefullBytes [23] == 1 ? true : false; + // //sensor16.CurrentRainfall = Convert.ToInt32(usefullBytes [24] * 256 + usefullBytes [25]); + // //IO.FileUtils.SaveEquipmentMessage (sensor16, sensor16.LoopID.ToString ()); + // break; + // ///// <summary> + // ///// 閲嶉噺 + // ///// </summary> + // case DeviceType.SensorWeight: + // //var sensor17 = new SensorWeight (); + // //sensor17.SubnetID = subnetID; + // //sensor17.DeviceID = deviceID; + // //sensor17.LoopID = usefullBytes [2]; + // //sensor17.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // //sensor17.Enable = usefullBytes [23] == 1 ? true : false; + // //sensor17.CurrentWeight = Convert.ToInt32(usefullBytes [24] * 256 + usefullBytes [25]); + // //IO.FileUtils.SaveEquipmentMessage (sensor17, sensor17.LoopID.ToString ()); + // break; + // ///// <summary> + // ///// 楂樺害/闀垮害 + // ///// </summary> + // case DeviceType.SensorHeightLength: + // //var sensor18 = new SensorHeightLength (); + // //sensor18.SubnetID = subnetID; + // //sensor18.DeviceID = deviceID; + // //sensor18.LoopID = usefullBytes [2]; + // //sensor18.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // //sensor18.Enable = usefullBytes [23] == 1 ? true : false; + // //sensor18.CurrentHeightLength = Convert.ToInt32(usefullBytes [24] * 256 + usefullBytes [25]); + // //IO.FileUtils.SaveEquipmentMessage (sensor18, sensor18.LoopID.ToString ()); + // break; + // ///// <summary> + // ///// 鐗╀綋閫熷害锛�20锛� + // ///// </summary> + // case DeviceType.SensorVelocity: + // //var sensor19 = new SensorVelocity (); + // //sensor19.SubnetID = subnetID; + // //sensor19.DeviceID = deviceID; + // //sensor19.LoopID = usefullBytes [2]; + // //sensor19.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // //sensor19.Enable = usefullBytes [23] == 1 ? true : false; + // //sensor19.CurrentVelocity = Convert.ToInt32(usefullBytes [24] * 256 + usefullBytes [25]); + // //IO.FileUtils.SaveEquipmentMessage (sensor19, sensor19.LoopID.ToString ()); + // break; + // ///// <summary> + // ///// 闇囧姩锛�21锛� + // ///// </summary> + // case DeviceType.SensorVibration: + // //var sensor20 = new SensorVibration (); + // //sensor20.SubnetID = subnetID; + // //sensor20.DeviceID = deviceID; + // //sensor20.LoopID = usefullBytes [2]; + // //sensor20.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // //sensor20.Enable = usefullBytes [23] == 1 ? true : false; + // //sensor20.CurrentVibration = Convert.ToInt32(usefullBytes [24] * 256 + usefullBytes [25]); + // //IO.FileUtils.SaveEquipmentMessage (sensor20, sensor20.LoopID.ToString ()); + // break; + // ///// <summary> + // ///// 鐢靛帇 + // ///// </summary> + // case DeviceType.SensorVoltage: + // //var sensor21 = new SensorVoltage (); + // //sensor21.SubnetID = subnetID; + // //sensor21.DeviceID = deviceID; + // //sensor21.LoopID = usefullBytes [2]; + // //sensor21.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // //sensor21.Enable = usefullBytes [23] == 1 ? true : false; + // //sensor21.CurrentVoltage = Convert.ToInt32(usefullBytes [24] * 256 + usefullBytes [25]); + // //IO.FileUtils.SaveEquipmentMessage (sensor21, sensor21.LoopID.ToString ()); + // break; + // ///// <summary> + // ///// 鐢垫祦 + // ///// </summary> + // case DeviceType.SensorCurrent: + // //var sensor22 = new SensorCurrent (); + // //sensor22.SubnetID = subnetID; + // //sensor22.DeviceID = deviceID; + // //sensor22.LoopID = usefullBytes [2]; + // //sensor22.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // //sensor22.Enable = usefullBytes [23] == 1 ? true : false; + // //sensor22.CurrentCurrent = Convert.ToInt32(usefullBytes [24] * 256 + usefullBytes [25]); + // //IO.FileUtils.SaveEquipmentMessage (sensor22, sensor22.LoopID.ToString ()); + // break; + // ///// <summary> + // ///// 鍔熺巼 + // ///// </summary> + // case DeviceType.SensorPower: + // //var sensor23 = new SensorPower (); + // //sensor23.SubnetID = subnetID; + // //sensor23.DeviceID = deviceID; + // //sensor23.LoopID = usefullBytes [2]; + // //sensor23.Name = MyEncodingGB2312.GetString (usefullBytes, 3, 20).Trim ('\0'); + // //sensor23.Enable = usefullBytes [23] == 1 ? true : false; + // //sensor23.CurrentPower = Convert.ToInt32(usefullBytes [24] * 256 + usefullBytes [25]); + // //IO.FileUtils.SaveEquipmentMessage (sensor23, sensor23.LoopID.ToString ()); + // break; + + // #endregion + // default: + // //DeviceLoopList.Add (new Common () { SubnetID = subnetID, DeviceID = deviceID }); + // break; + // } + // MainPage.WriteLog ("ReadDeviceLoopInfoACK " + deviceType1); + // break; + // case Command.WriteWirelessPanelButtonKey: + // //01 01 59(+30) 02 0D 03 64 00 01 + // break; + // case Command.AssignedAddressACK: + // MainPage.WriteLog (usefullBytes [0].ToString ()); + // if (usefullBytes [0] == 3) { + // dt = DateTime.Now; + // } else if (usefullBytes [0] == 4) { + // dt = System.DateTime.MinValue; + // } + // break; + // case Command.Remote3thACK: + // MainPage.WriteLog (usefullBytes [0]); + // break; + // case Command.DownloadInfraredACK: + // string loopID_IM = usefullBytes [0] < 10 ? "0" + usefullBytes [0].ToString () : usefullBytes [0].ToString (); + // if ((InfraredType)usefullBytes [2] != InfraredType.AC) { + // if ((InfraredType)usefullBytes [2] == InfraredType.NULL) { + // MainPage.WriteLog ("NULL-------------"); + // } + // string filePath = "Equipment_InfraredMode_" + subnetID + "_" + deviceID + "_" + loopID_IM; + // InfraredMode im = Newtonsoft.Json.JsonConvert.DeserializeObject<InfraredMode> (CommonPage.MyEncodingUTF8.GetString (IO.FileUtils.ReadFile (filePath))); + // im.InfraredType = (InfraredType)usefullBytes [2]; + // MainPage.WriteLog (im.InfraredType.ToString () + "----------------------------------------"); + // IO.FileUtils.SaveEquipmentMessage (im, im.LoopID.ToString ()); + // } + // break; + // } + //} catch (Exception ex) { + // MainPage.WriteLog ("Packet_ReceiveEvent锛�" + ex.ToString ()); + //} + + } + /// <summary> + /// byte 鍙樺瓧绗︿覆 + /// </summary> + /// <returns>The to hex16.</returns> + /// <param name="b">The blue component.</param> + public static string byteToHex16 (byte b) + { + string s = Convert.ToString (b, 16).ToUpper (); + if (s.Length <= 1) { + return "0" + s; + } + return s;// + } + + static void httpListener_EventHandler (System.Collections.Specialized.NameValueCollection nameValueCollection, System.IO.Stream outputStream, System.IO.Stream inputStream) + { + try { + if (nameValueCollection ["Command"] != null && nameValueCollection ["Command"].StartsWith ("Get")) { + string tempFileName = nameValueCollection ["Command"].Replace ("Get", ""); + if ("AllFiles" == tempFileName) { + byte [] bytes = System.Text.Encoding.UTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (MyIO.FileUtils.ReadFiles ())); + outputStream.Write (bytes, 0, bytes.Length); + outputStream.Flush (); + } else { + byte [] bytes; + if (!MyIO.FileUtils.Exists (tempFileName)) { + bytes = System.Text.Encoding.UTF8.GetBytes ("鏂囦欢鍚嶄笉瀛樺湪锛�"); + outputStream.Write (bytes, 0, bytes.Length); + outputStream.Flush (); + return; + } + System.IO.FileStream fs = new System.IO.FileStream (Application.RootPath + tempFileName, System.IO.FileMode.Open); + bytes = new byte [fs.Length]; + fs.Read (bytes, 0, bytes.Length); + fs.Close (); + outputStream.Write (bytes, 0, bytes.Length); + outputStream.Flush (); + } + } else if (nameValueCollection ["Command"].StartsWith ("Upload")) { + string path = Application.RootPath + nameValueCollection ["Command"].Replace ("Upload", ""); + string dePath = nameValueCollection ["Command"].Replace ("Upload", ""); + //if (dePath.Contains ("Room_")) { + // new Room ().Add (dePath); + //} + //if (dePath.Split ('_').Length == 5) { + // if (dePath.Split ('_') [1] == (typeof (OnePortBus).Name) || dePath.Split ('_') [1] == (typeof (OnePortWirelessFR).Name)) { + // UserConfig.Instance.RemoteModeFile = dePath; + // UserConfig.Instance.SaveUserConfig (); + // } + // if (dePath.Split ('_') [1] == (typeof (SecurityModul).Name)) { + // if (UserConfig.Instance.HideDeviceTypes.Contains ((InternationalizationString.Security))) { + // UserConfig.Instance.HideDeviceTypes.Remove (InternationalizationString.Security); + // UserConfig.Instance.SaveUserConfig (); + // } + // } + //} + + //if (dePath.Split ('_').Length == 2 && dePath.StartsWith ("GlobalScene")) { + // var sceneFileList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<string>> (System.Text.Encoding.UTF8.GetString (IO.FileUtils.ReadFile (Scene.GlobalSceneFilePath))); + // if (!sceneFileList.Contains (dePath)) { + // sceneFileList.Add (dePath); + // IO.FileUtils.WriteFileByBytes (Scene.GlobalSceneFilePath, CommonPage.MyEncodingUTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (sceneFileList))); + // } + //} + //FileUtils.WriteFileByInputStream (path, inputStream); + //Common common = Newtonsoft.Json.JsonConvert.DeserializeObject<Common> (CommonPage.MyEncodingUTF8.GetString (IO.FileUtils.ReadFile (path))); + //if (common.DeviceTextID == R.MyInternationalizationString.ElectricalControl) { + // UserConfig.Instance.SocketList.Add (common.CommonLoopID); + //} + } else { + byte [] bytes = System.Text.Encoding.UTF8.GetBytes ("璇锋眰鍛戒护鏃犳晥锛�"); + outputStream.Write (bytes, 0, bytes.Length); + outputStream.Flush (); + } + } catch (Exception ex) { + MainPage.Log ("httpListener_EventHandler" + ex.ToString ()); + } + } + + /// <summary> + /// 闅忔満鏁伴珮浣� + /// </summary> + public static byte RandomHigh; + /// <summary> + /// 闅忔満鏁颁綆浣� + /// </summary> + public static byte RandomLow; + + /// <summary> + /// 璁惧鍒楄〃 + /// </summary> + public static System.Collections.Generic.List<Common> DeviceList = new System.Collections.Generic.List<Common> (); + /// <summary> + /// 缃戝叧璁惧鍒楄〃 + /// </summary> + public static System.Collections.Generic.List<Common> GateWayList = new System.Collections.Generic.List<Common> (); + /// <summary> + /// 璁惧瀵瑰簲鍥炶矾鍒楄〃 + /// </summary> + public static System.Collections.Generic.List<Common> DeviceLoopList = new System.Collections.Generic.List<Common> (); + + /// <summary> + /// Updates Device's remake. + /// </summary> + public static void UpdateRemark (byte subnetID, byte deviceID, string remark) + { + byte [] updateBytes = new byte [20]; + byte [] remakeBytes = MyEncodingGB2312.GetBytes (remark); + Array.Copy (remakeBytes, 0, updateBytes, 0, remakeBytes.Length < 20 ? remakeBytes.Length : 20); + Control.ControlBytesSend (Command.UpdataRemake, subnetID, deviceID, updateBytes); + } + + /// <summary> + /// 鐩戝惉璇锋眰鐨凥ttp绔彛 + /// </summary> + public static int Port = 5555; + static void httpListener_EventHandler (string rawUrl, System.IO.Stream outputStream, System.IO.Stream inputStream) + { + foreach (var musicInfo in MusicInfo.MusicInfoList) { + if ("audio-item-" + musicInfo.ID == rawUrl.TrimStart ('/')) { + var file = new System.IO.FileStream (musicInfo.Data, System.IO.FileMode.Open, System.IO.FileAccess.Read); + byte [] bytes = new byte [1024]; + try { + while (file.CanRead) { + int len = file.Read (bytes, 0, bytes.Length); + if (len == 0) { + break; + } + outputStream.Write (bytes, 0, len); + } + } catch { } + file.Close (); + break; + } + } + } + } +} \ No newline at end of file diff --git a/HDL_ON/DAL/Net/HttpListener.cs b/HDL_ON/DAL/Net/HttpListener.cs new file mode 100644 index 0000000..33cd716 --- /dev/null +++ b/HDL_ON/DAL/Net/HttpListener.cs @@ -0,0 +1,224 @@ +锘縰sing System; +using System.Linq; +using System.Web; +using HDL_ON.UI; + +namespace HDL_ON.DAL.Net +{ + public static class HttpListener + { + private static System.Net.HttpListener listener; + + /// <summary> + /// 鍚姩鐩戝惉鍙婂鐞� + /// </summary> + public static void Start(System.Net.IPAddress ipAddress, int port) + { + try + { + if (listener == null) + { + listener = new System.Net.HttpListener(); + + listener.AuthenticationSchemes = System.Net.AuthenticationSchemes.Anonymous; + + //listener.Prefixes.Add (string.Format ("http://{0}:{1}/", ipAddress.ToString (), port)); + listener.Prefixes.Add($"http://+:{port}/"); + listener.Start(); + + //beginGetContext(listener); + contextThread = new System.Threading.Thread(() => + { + while (true) + { + var context = listener.GetContext(); + System.Threading.Tasks.Task.Run(() => + { + manager(context); + }); + } + }) + { IsBackground = true }; + contextThread.Start(); + MainPage.Log("HttpListener宸茬粡鍚姩!"); + } + } + catch (Exception e) + { + MainPage.Log("HttpListener鍚姩澶辫触!\r\n" + e.Message); + } + } + /// <summary> + /// + /// </summary> + static System.Threading.Thread contextThread; + /// <summary> + /// 璇锋眰浜嬩欢 + /// </summary> + /// <param name="commandType">璇锋眰鍛戒护</param> + /// <param name="outStream">杈撳嚭娴�</param> + /// <param name="inStream">杈撳叆娴�</param> + public delegate void RequestEventHandler(System.Collections.Specialized.NameValueCollection nameValueCollection, System.IO.Stream outputStream, System.IO.Stream inputStream); + + /// <summary> + /// 璇锋眰浜嬩欢 + /// </summary> + public static event RequestEventHandler EventHandler; + + /// <summary> + /// 寮�濮嬪紓姝ユ帴鏀秇ttp璇锋眰 + /// </summary> + /// <param name="listerner"></param> + private static void beginGetContext(System.Net.HttpListener listerner) + { + try + { + if (listerner == null || !listerner.IsListening) + { + return; + } + listerner.BeginGetContext(new System.AsyncCallback(getContextCallBack), null); + + } + catch + { + System.Threading.Thread.Sleep(1); + beginGetContext(listerner); + } + } + + /// <summary> + /// 鑾峰彇http璇锋眰锛屽苟澶勭悊 + /// </summary> + /// <param name="ar"></param> + private static void getContextCallBack(System.IAsyncResult ar) + { + beginGetContext(listener); + try + { + System.Net.HttpListenerContext context = listener.EndGetContext(ar); + manager(context); + } + catch { } + } + + /// <summary> + /// 鍏抽棴 + /// </summary> + public static void Close() + { + try + { + if (contextThread != null) + { + contextThread.Abort(); + contextThread = null; + } + } + catch { } + try + { + if (listener != null) + { + listener.Close(); + listener = null; + } + } + catch { } + MainPage.Log("HttpListener宸茬粡鍏抽棴!"); + } + + private static void manager(System.Net.HttpListenerContext httpListenerContext) + { + System.Net.HttpListenerResponse httpListenerResponse = null; + + try + { + #region + httpListenerResponse = httpListenerContext.Response; + + httpListenerResponse.StatusCode = 200;//璁剧疆杩斿洖缁欏鏈嶇http鐘舵�佷唬鐮� + httpListenerResponse.ContentEncoding = System.Text.Encoding.UTF8; + + + if (EventHandler != null) + { + EventHandler(HttpUtility.ParseQueryString(System.IO.Path.GetFileName(httpListenerContext.Request.RawUrl)), httpListenerResponse.OutputStream, httpListenerContext.Request.InputStream); + } + httpListenerResponse.OutputStream.Flush(); + + #endregion + } + catch + { + + } + finally + { + #region + try + { + httpListenerContext.Request.InputStream.Close(); + } + catch { } + + try + { + httpListenerResponse.OutputStream.Close(); + } + catch { } + + + try + { + httpListenerResponse.Close(); + } + catch { } + + #endregion + } + } + + public static void PostData(string url, string postJson) + { + System.IO.Stream outputStream = null; + System.IO.Stream inputStream = null; + try + { + System.Net.HttpWebRequest webReq = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(new Uri(url)); + webReq.Method = "POST"; + //webReq + + byte[] byteData = System.Text.Encoding.UTF8.GetBytes(postJson); + //瀹氫箟浼犻�佹暟鎹牸寮� + webReq.ContentType = "application/json"; + webReq.Accept = "application/json"; + //webReq.ContentType = "application/x-www-form-urlencoded"; + //webReq.Timeout = 1000*2; + webReq.ContentLength = byteData.Length; + //瀹氫箟Stream淇℃伅 + outputStream = webReq.GetRequestStream(); + outputStream.Write(byteData, 0, byteData.Length); + outputStream.Flush(); + outputStream.Close(); + + //inputStream= webReq.GetResponse().GetResponseStream(); + } + catch + { + throw new Exception("鍙戦�佸け璐�"); + } + finally + { + if (null != outputStream) + { + outputStream.Close(); + } + if (null != inputStream) + { + inputStream.Close(); + } + } + } + } +} diff --git a/HDL_ON/DAL/Net/MqttCommon.cs b/HDL_ON/DAL/Net/MqttCommon.cs new file mode 100644 index 0000000..3d4a581 --- /dev/null +++ b/HDL_ON/DAL/Net/MqttCommon.cs @@ -0,0 +1,574 @@ +锘縰sing System.Collections.Generic; +using System; +using MQTTnet.Client; +using System.Threading.Tasks; +using Shared; +using System.Text; +using System.Security.Cryptography; +using System.IO; +using HDL_ON.DAL; +using HDL_ON.UI; +using MQTTnet; +using HDL_ON.DAL.Server; + +namespace HDL_ON.DAL.Net +{ + public static class MqttCommon + { + static string mqttEncryptKey = ""; + static string checkGatewayTopicBase64 = ""; + static RemoteMACInfo CurRemoteMACInfo = null; + + /// <summary> + /// 鎵嬫満鏍囪瘑 + /// </summary> + static Guid currentGuid = Guid.NewGuid(); + + /// <summary> + /// 澶栫綉鐨凪QTT鏄惁姝e湪杩炴帴 + /// </summary> + static object isConnecting = false.ToString(); + /// <summary> + /// 杩滅▼MqttClient + /// </summary> + public static IMqttClient RemoteMqttClient; + + static bool thisShowTip = true; + + public static async System.Threading.Tasks.Task Close(bool RemoveRemoteMqttClient = false) + { + try + { + if (RemoteMqttClient != null) + { + //thisShowTip = true; + await RemoteMqttClient.DisconnectAsync(); + } + if (RemoveRemoteMqttClient) + { + RemoteMqttClient = null; + } + CommonPage.IsRemote = false; + } + catch { } + } + + static DateTime dateTime = DateTime.MinValue; + + /// <summary> + /// 鍚姩杩滅▼Mqtt + /// </summary> + public static async System.Threading.Tasks.Task StartCloudMqtt() + { + /* + try + { + Application.RunOnMainThread(() => + { + if (5 < (DateTime.Now - dateTime).TotalSeconds) + { + return; + } + dateTime = DateTime.Now; + }); + if (!MainPage.LoginUser.IsLogin) + { + isConnecting = false.ToString(); + return; + } + while (isConnecting.ToString() == true.ToString()) + { + if (5 < (DateTime.Now - dateTime).TotalSeconds) + { + break; + } + await System.Threading.Tasks.Task.Delay(500); + } + lock (isConnecting) + { + if (isConnecting.ToString() == true.ToString()) + { + return; + } + isConnecting = true.ToString(); + if (RemoteMqttClient != null) + { + MainPage.Log($"RemoteMqttClient.IsConnected: {RemoteMqttClient.IsConnected}"); + } + //if (RemoteMqttClient != null && RemoteMqttClient.IsConnected) { + // return; + //} + + new System.Threading.Thread(async () => + { + try + { + //鏂紑鍚庨噸鏂伴摼鎺ラ渶瑕侀噸鏂扮櫥褰曡幏鍙栬繛鎺ョ殑瀵嗙爜 + var requestObj = new LoginObj() { Account = MainPage.LoginUser.AccountString.ToLower(), Password = MainPage.LoginUser.Password, Company = 1 }; + var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); + var tempResult = HttpServerRequest.RequestHttps("Login", requestJson, ""); + if (tempResult == null) + { + //---------- + return; + } + var responsePack = tempResult.ResponseData; + var dictrionaryResult = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, object>>(tempResult.ResponseData.ToString()); + var mqttRequestPar = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes>(tempResult.ResponseData.ToString()); + //杩樻湁绉嶆儏鍐垫槸鍚屼竴涓狪D 鏈夊涓澶囩敤杩欎釜id杩炴帴锛堜細瀵艰嚧涓柇锛� + //mqttEncryptKey = dictrionaryResult ["HdlOnMqttKey"]?.ToString (); + var url = dictrionaryResult["ConnectMqttBrokerLoadSubDomain"]?.ToString(); + var clientId = dictrionaryResult["ConnectMqttClientId"]?.ToString(); + var username = dictrionaryResult["ConnectMqttBrokerUserName"]?.ToString(); + var passwordRemote = dictrionaryResult["ConnectMqttBrokerPwd"]?.ToString(); + + if (RemoteMqttClient == null) + { + var requestObj3 = new GatewayByRegionListObj() { RegionID = UserConfig.Instance.CurrentRegion.RegionID }; + MainPage.Log("Remote mqtt get Region MAC : " + UserConfig.Instance.CurrentRegion.RegionID); + var requestJson3 = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj3); + var revertObj3 = HttpServerRequest.RequestHttps("GatewayByRegionList", requestJson3, true); + if (revertObj3.StateCode == "SUCCESS") + { + var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GatewayRes>>(revertObj3.ResponseData.ToString()); + var gatewayList = responseDataObj; + if (gatewayList != null && gatewayList.Count > 0) + { + UserConfig.Instance.CurrentRegion.MAC = gatewayList[0].MAC; + UserConfig.Instance.SaveUserConfig(); + MainPage.Log("Remote mqtt get Region MAC : " + gatewayList[0].MAC); + } + } + else + { + MainPage.Log("Remote mqtt get Region MAC Erorr !!"); + } + + //(2)鍒涘缓Mqtt瀹㈡埛绔� + RemoteMqttClient = new MqttFactory().CreateMqttClient(); + //(3)褰揫杩炴帴浜戠鐨凪qtt鎴愬姛鍚嶿鎴栬�匸浠ュ強鍚庨潰App閫氳繃浜戠Mqtt杞彂鏁版嵁缁欑綉鍏虫垚鍔熷悗],澶勭悊鎺ユ敹鍒颁簯绔暟鎹寘鍝嶅簲鏃跺湪mqttServerClient_ApplicationMessageReceived杩欎釜鏂规硶澶勭悊 + RemoteMqttClient.UseApplicationMessageReceivedHandler(async e => + { + if (isConnecting.ToString() == true.ToString()) + isConnecting = false.ToString(); + var aesDecryptTopic = e.ApplicationMessage.Topic; + var aesDecryptPayload = e.ApplicationMessage.Payload; + MainPage.Log(aesDecryptTopic); + + if (aesDecryptTopic == $"NotifyBusGateWayInfoChagne/{CurRemoteMACInfo.md5_mac_string}") + {//缃戝叧涓婄嚎锛岄渶瑕佹洿鏂癮eskey + //----绗簩姝ワ細璇诲彇璐﹀彿涓嬮潰鐨勭綉鍏冲垪琛� + var gatewayListUrl = @"https://developer.hdlcontrol.com/Center/Center/GetGatewayPagger"; //App銆丅uspro杞欢鐧诲綍鍚庤幏鍙栫綉鍏冲垪琛� http 璇锋眰 + var gatewayListRequestPar = new RemoteRequestParameters() { Mac = CurRemoteMACInfo.mac, LoginAccessToken = mqttRequestPar.Token, RequestVersion = "RequestVersion1", RequestProtocolType = 0, RequestSource = 1 }; + var gatewayListRequestResult = HttpServerRequest.RequestHttps("", Newtonsoft.Json.JsonConvert.SerializeObject(gatewayListRequestPar), false, gatewayListUrl); + var gatewayListRequestResult_Obj = Newtonsoft.Json.JsonConvert.DeserializeObject<MqttRemoteInfo>(gatewayListRequestResult.ResponseData.ToString()); + if (gatewayListRequestResult_Obj != null && gatewayListRequestResult_Obj.pageData.Count > 0) + { + CurRemoteMACInfo.aesKey = gatewayListRequestResult_Obj.pageData[0].aesKey; + mqttEncryptKey = CurRemoteMACInfo.aesKey; + } + + } + + if (aesDecryptTopic == "YouIpAndPortNoRecord" || aesDecryptTopic == "DecryptFail") + {// --> 浣犲綋鍓嶇殑IP鍙婄鍙e湪浜戠涓嶅瓨鍦�,璇烽噸鏂扮櫥褰曡繛鎺ヤ笅! + await Close(true); + //await MqttCheckGateway (); + } + else if (aesDecryptTopic == @"/BeingSqueezedOffline") + { + try + { + + } + catch (Exception ex) + { + MainPage.Log(ex.Message); + } + finally + { + + } + } + else + { + if (!string.IsNullOrEmpty(mqttEncryptKey)) + { + aesDecryptTopic = Shared.Securitys.EncryptionService.AesDecryptTopic(e.ApplicationMessage.Topic, mqttEncryptKey); + aesDecryptPayload = Shared.Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, mqttEncryptKey); + } + else + { + aesDecryptTopic = e.ApplicationMessage.Topic; + aesDecryptPayload = e.ApplicationMessage.Payload; + } + } + MainPage.Log($"Des Topic={aesDecryptTopic}"); + + + var packet = new Packet(); + packet.Bytes = aesDecryptPayload; + packet.Manager(); + + }); + + RemoteMqttClient.UseDisconnectedHandler(e => + { + if (thisShowTip) + { + if (CommonPage.IsRemote) + { + //---------- + } + } + else + { + thisShowTip = true; + } + }); + RemoteMqttClient.UseConnectedHandler(async e => + { + if (CurRemoteMACInfo != null) + { + if (CurRemoteMACInfo.isValid == "InValid") + { + //---------- + } + else + { + CommonPage.IsRemote = true; + //---------- + } + } + }); + } + + if (clientId == null || username == null || passwordRemote == null) + { + return; + } + + if (tempResult == null) + { + //---------- + return; + } + //--绗竴姝ワ細鑾峰彇mqtt閾炬帴鍙傛暟 + var mqttInfoUrl = @"https://developer.hdlcontrol.com/Center/Center/GetConnMqttInfo";//鑾峰彇杩炴帴杩滅▼浜戠Emq Mqtt 鏈嶅姟鍣ㄨ繛鎺ヤ俊鎭� + var mqttInfoRequestPar = new RemoteRequestParameters() { LoginAccessToken = mqttRequestPar.Token, RequestVersion = "RequestVersion1", RequestProtocolType = 0, RequestSource = 1 }; + var mqttInfoRequestResult = HttpServerRequest.RequestHttps("", Newtonsoft.Json.JsonConvert.SerializeObject(mqttInfoRequestPar), false, mqttInfoUrl); + + if (mqttInfoRequestResult != null && mqttInfoRequestResult.ResponseData != null) + { + try + { + var mqttInfoRequestResult_Obj = Newtonsoft.Json.JsonConvert.DeserializeObject<MqttInfo>(mqttInfoRequestResult.ResponseData.ToString()); + if (mqttInfoRequestResult_Obj != null) + { + url = mqttInfoRequestResult_Obj.connEmqDomainPort; + clientId = mqttInfoRequestResult_Obj.connEmqClientId; + username = mqttInfoRequestResult_Obj.connEmqUserName; + passwordRemote = mqttInfoRequestResult_Obj.connEmqPwd; + //----绗簩姝ワ細璇诲彇璐﹀彿涓嬮潰鐨勭綉鍏冲垪琛� + var gatewayListUrl = @"https://developer.hdlcontrol.com/Center/Center/GetGatewayPagger"; //App銆丅uspro杞欢鐧诲綍鍚庤幏鍙栫綉鍏冲垪琛� http 璇锋眰 + var gatewayListRequestPar = new RemoteRequestParameters() { LoginAccessToken = mqttRequestPar.Token, RequestVersion = "RequestVersion1", RequestProtocolType = 0, RequestSource = 1 }; + var gatewayListRequestResult = HttpServerRequest.RequestHttps("", Newtonsoft.Json.JsonConvert.SerializeObject(gatewayListRequestPar), false, gatewayListUrl); + var gatewayListRequestResult_Obj = Newtonsoft.Json.JsonConvert.DeserializeObject<MqttRemoteInfo>(gatewayListRequestResult.ResponseData.ToString()); + //--鎵惧嚭鏄惁瀛樺湪鍖归厤褰撳墠浣忓畢鐨刴ac锛屽瓨鍦ㄥ啀杩涜杩滅▼銆� + CurRemoteMACInfo = gatewayListRequestResult_Obj.pageData.Find((obj) => obj.mac == UserConfig.Instance.CurrentRegion.MAC); + if (CurRemoteMACInfo != null) + { + CurRemoteMACInfo.LoginAccessToken = mqttRequestPar.Token; + mqttEncryptKey = CurRemoteMACInfo.aesKey; + var options1 = new MQTTnet.Client.Options.MqttClientOptionsBuilder() + .WithClientId(clientId) + .WithTcpServer(url.Split(':')[1].Substring("//".Length), int.Parse(url.Split(':')[2])) + .WithCredentials(username, passwordRemote) + .WithCleanSession() + .WithCommunicationTimeout(new TimeSpan(0, 0, 10)) + .Build(); + await Close(); + await RemoteMqttClient.ConnectAsync(options1); + await MqttRemoteSend(new byte[] { 0 }, 1); + await MqttRemoteSend(new byte[] { 0 }, 2); + } + } + } + catch { } + } + } + catch (Exception ex) + { + Application.RunOnMainThread(() => + { + if (MqttCommon.RemoteMqttClient != null) + { + MqttCommon.RemoteMqttClient.Dispose(); + } + if (MqttCommon.RemoteMqttClient != null) + { + MqttCommon.RemoteMqttClient = null; + } + }); + } + finally + { + isConnecting = false.ToString(); + //---------- + } + }) + { IsBackground = true }.Start(); + } + } + catch (Exception ex) + { + MainPage.Log("============>" + ex.Message); + } + finally + { + isConnecting = false.ToString(); + } + + */ + } + + /// <summary> + /// + /// </summary> + /// <param name="message">闄勫姞鏁版嵁鍖�</param> + /// <param name="optionType">鎿嶄綔绫诲瀷锛�0=缃戝叧鎺у埗锛�1=璁㈤槄缃戝叧鏁版嵁;2=璁㈤槄缃戝叧涓婄嚎鏁版嵁</param> + /// <returns></returns> + public static async System.Threading.Tasks.Task MqttRemoteSend(byte[] message, int optionType = 0) + { + try + { + if (RemoteMqttClient == null || !RemoteMqttClient.IsConnected) + { + await StartCloudMqtt(); + } + if (!RemoteMqttClient.IsConnected) + { + return; + } + var topicName = @"/" + MainPage.LoginUser.AccountString.ToLower() + @"/" + UserConfig.Instance.GatewayMAC.Replace(".", "") + @"/" + currentGuid; + switch (optionType) + { + case 0: + if (!string.IsNullOrEmpty(mqttEncryptKey)) + { + topicName = $"/ClientToBusGateWay/{CurRemoteMACInfo.macMark}/Common/OldON"; + } + else + { + topicName = $"/ClientToBusGateWay/{CurRemoteMACInfo.macMark}/Common/NewON"; + } + //base64鍔犲瘑 + var messageSend = Shared.Securitys.EncryptionService.AesEncryptPayload(message, mqttEncryptKey); + var m = new MqttApplicationMessage { Topic = topicName, Payload = messageSend, Retain = false, QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.ExactlyOnce }; + await RemoteMqttClient?.PublishAsync(m); + break; + case 1: + topicName = $"/BusGateWayToClient/{CurRemoteMACInfo.macMark}/Common/#"; + await RemoteMqttClient?.SubscribeAsync(topicName); + break; + case 2: + var macStr = CurRemoteMACInfo.mac.ToUpper(); + char[] cArrs = macStr.ToCharArray(); + Array.Reverse(cArrs); + var sss = string.Join(string.Empty, cArrs); + + using (var provider = new MD5CryptoServiceProvider()) + { + byte[] buffer = provider.ComputeHash(Encoding.Default.GetBytes(sss)); + StringBuilder builder = new StringBuilder(); + for (int i = 0; i < buffer.Length; i++) + { + builder.Append(buffer[i].ToString("x2")); + } + CurRemoteMACInfo.md5_mac_string = builder.ToString().ToUpper(); + } + + topicName = $"/NotifyBusGateWayInfoChagne/{CurRemoteMACInfo.md5_mac_string}"; + await RemoteMqttClient?.SubscribeAsync(topicName); + break; + } + } + catch (Exception e) + { + isConnecting = false.ToString(); + } + } + } +} + +public class RemoteRequestParameters +{ + public string RequestVersion; + public int RequestSource; + public string LoginAccessToken; + public int RequestProtocolType; + + public string Mac = ""; + public string GroupName = ""; +} + +public class MqttRemoteInfo +{ + public List<RemoteMACInfo> pageData; + + public int pageIndex = 0; + public int pageSize = 10; + public int totalCount = 3; + public int totalPages = 1; + public bool hasPreviousPage = false; + public bool hasNextPage = false; +} + +public class MqttInfo +{ + public string connEmqDomainPort; + public string connEmqClientId; + public string connEmqUserName; + public string connEmqPwd; +} + +public class RemoteMACInfo +{ + public string mac; + public string macMark; + public string isValid; + public string aesKey; + public bool isNewBusproGateway; + public string groupName; + public string projectName; + public string userName; + + //app鑷畾涔夋暟鎹� + public string md5_mac_string; + public string LoginAccessToken; +} + +namespace Shared.Securitys +{ + public partial class EncryptionService + { + + #region 鍔犲瘑 + /// <summary> + /// 鍔犲瘑涓婚涓築ase64 + /// </summary> + /// <param name="pToEncrypt"></param> + /// <param name="key"></param> + /// <returns></returns> + public static string AesEncryptTopic(string pToEncrypt, string key) + { + if (string.IsNullOrEmpty(pToEncrypt)) return null; + if (string.IsNullOrEmpty(key)) return pToEncrypt; + //闇�瑕佸姞瀵嗗唴瀹圭殑鏄庢枃娴� + Byte[] toEncryptArray = Encoding.UTF8.GetBytes(pToEncrypt); + + //閰嶇疆AES鍔犲瘑Key(瀵嗛挜銆佸悜閲忋�佹ā寮忋�佸~鍏�) + RijndaelManaged rm = new RijndaelManaged + { + Key = Encoding.UTF8.GetBytes(key), + IV = Encoding.UTF8.GetBytes(key), + Mode = CipherMode.CBC, + Padding = PaddingMode.PKCS7 + }; + + //鍒涘缓AES鍔犲瘑鍣ㄥ璞� + ICryptoTransform cTransform = rm.CreateEncryptor(); + + //浣跨敤AES灏嗘槑鏂囨祦杞垚瀵嗘枃瀛楄妭鏁扮粍 + Byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length); + + //灏咥ES鐢熸垚鐨勫瘑鏂囧瓧鑺傛暟缁勮浆鎴怋ase64瀛楃涓� + return Convert.ToBase64String(resultArray, 0, resultArray.Length); + } + + + /// <summary> + /// 鍔犲瘑璐熻浇涓轰簩杩涘埗娴� + /// </summary> + /// <param name="toEncryptArray"></param> + /// <param name="key"></param> + /// <returns></returns> + public static byte[] AesEncryptPayload(byte[] toEncryptArray, string key) + { + if (string.IsNullOrEmpty(key)) return toEncryptArray; + //閰嶇疆AES鍔犲瘑Key(瀵嗛挜銆佸悜閲忋�佹ā寮忋�佸~鍏�) + var rm = new RijndaelManaged + { + Key = Encoding.UTF8.GetBytes(key), + IV = Encoding.UTF8.GetBytes(key), + Mode = CipherMode.CBC, + Padding = PaddingMode.PKCS7 + }; + + //鍒涘缓AES鍔犲瘑鍣ㄥ璞� + var cTransform = rm.CreateEncryptor(); + //浣跨敤AES灏嗘槑鏂囨祦杞垚瀵嗘枃瀛楄妭鏁扮粍 + return cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length); + } + #endregion + + + #region 瑙e瘑 + /// <summary> + /// 瑙e瘑涓婚鏁版嵁 + /// </summary> + /// <param name="pToDecrypt"></param> + /// <param name="key"></param> + /// <returns></returns> + public static string AesDecryptTopic(string pToDecrypt, string key) + { + //AES瀵嗘枃Base64杞垚瀛楃涓� + Byte[] toEncryptArray = Convert.FromBase64String(pToDecrypt); + + //閰嶇疆AES鍔犲瘑Key(瀵嗛挜銆佸悜閲忋�佹ā寮忋�佸~鍏�) + RijndaelManaged rm = new RijndaelManaged + { + Key = Encoding.UTF8.GetBytes(key), + IV = Encoding.UTF8.GetBytes(key), + Mode = CipherMode.CBC, + Padding = PaddingMode.PKCS7 + }; + + //鍒涘缓AES瑙e瘑鍣ㄥ璞� + ICryptoTransform cTransform = rm.CreateDecryptor(); + + //浣跨敤AES灏嗗瘑鏂囨祦杞垚鏄庢枃鐨勫瓧鑺傛暟缁� + Byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length); + + //杞垚瀛楃涓� + return Encoding.UTF8.GetString(resultArray); + } + + /// <summary> + /// 閲囩敤Aes瑙e瘑璐熻浇鏁版嵁 + /// </summary> + /// <param name="toEncryptArray"></param> + /// <param name="key"></param> + /// <returns></returns> + public static byte[] AesDecryptPayload(byte[] toEncryptArray, string key) + { + //閰嶇疆AES鍔犲瘑Key(瀵嗛挜銆佸悜閲忋�佹ā寮忋�佸~鍏�) + var rm = new RijndaelManaged + { + Key = Encoding.UTF8.GetBytes(key), + IV = Encoding.UTF8.GetBytes(key), + Mode = CipherMode.CBC, + Padding = PaddingMode.PKCS7 + }; + + //鍒涘缓AES瑙e瘑鍣ㄥ璞� + var cTransform = rm.CreateDecryptor(); + + //浣跨敤AES灏嗗瘑鏂囨祦杞垚鏄庢枃鐨勫瓧鑺傛暟缁� + return cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length); + } + #endregion + + + } +} diff --git a/HDL_ON/DAL/Net/MyWebClient.cs b/HDL_ON/DAL/Net/MyWebClient.cs new file mode 100644 index 0000000..37d4505 --- /dev/null +++ b/HDL_ON/DAL/Net/MyWebClient.cs @@ -0,0 +1,38 @@ +锘縰sing System; +using System.Net; + +namespace HDL_ON.DAL.Net +{ + public class MyWebClient : WebClient + { + int _timeout = 10000; + + /// <summary> + /// 瓒呮椂鏃堕棿(姣) + /// </summary> + public int Timeout { + get { + return _timeout; + } + set { + _timeout = value; + } + } + public MyWebClient () + { + + } + + public MyWebClient (int timeout) + { + this._timeout = timeout; + } + + protected override WebRequest GetWebRequest (Uri address) + { + var result = base.GetWebRequest (address); + result.Timeout = this._timeout; + return result; + } + } +} \ No newline at end of file diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs new file mode 100644 index 0000000..30f853f --- /dev/null +++ b/HDL_ON/DAL/Server/HttpServerRequest.cs @@ -0,0 +1,74 @@ +锘縩amespace HDL_ON.DAL.Server +{ + public partial class HttpServerRequest + { + /// <summary> + /// 璐﹀彿鐧诲綍-浣跨敤瀵嗙爜 + /// </summary> + public ResponsePack LoginByPassword(string account,string password,int company) + { + var requestObj = new LoginObj() { Account = account, Password = password, Company = company }; + var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); + var revertObj = RequestHttps(HttpRequesMethods.Login.ToString(), requestJson, ""); + return revertObj; + } + + /// <summary> + /// 鎵嬫満鍙风爜娉ㄥ唽寮犲悧 + /// </summary> + /// <param name="mobileNumber"></param> + /// <param name="password"></param> + /// <param name="language"></param> + public ResponsePack RegisterPhone(string mobileNumber, string password, string language) + { + var requestObj = new SignInObj() { Account = mobileNumber, Password = password, Language = language }; + var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); + return RequestHttps(HttpRequesMethods.SignIn.ToString(), requestJson, ""); + } + + /// <summary> + /// 楠岃瘉楠岃瘉鐮� + /// </summary> + public ResponsePack ValidateSmsCode(string mobileNumber, string code) + { + var requestObj = new ValidateSmsCodeObj() { Phone = mobileNumber, Code = code }; + var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); + return RequestHttps(HttpRequesMethods.ValidateSmsCode.ToString(), requestJson, ""); + } + + /// <summary> + /// 楠岃瘉鎵嬫満鍙锋槸鍚﹀凡缁忚娉ㄥ唽 + /// </summary> + /// <param name="phoneNum">鎵嬫満鍙风爜</param> + public ResponsePack IsExistingAccount(string phoneNum) + { + var requestObj = new IsExistingAccountObj() { Account = phoneNum }; + var requesetJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); + return RequestHttps(HttpRequesMethods.IsExistingAccount.ToString(), requesetJson, ""); + } + /// <summary> + /// 鑾峰彇楠岃瘉鐮� + /// </summary> + /// <param name="phoneNum">鎵嬫満鍙风爜</param> + public ResponsePack GetPhoneVerificationCode(string phoneNum, int company) + { + var requestObj = new SignPhoneObj() { Phone = phoneNum, Company = company }; + var requesetJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); + return RequestHttps(HttpRequesMethods.SignPhone.ToString(), requesetJson, ""); + } + + /// <summary> + /// 楠岃瘉楠岃瘉鐮� + /// </summary> + /// <param name="mobileNumber"></param> + /// <param name="vCode"></param> + /// <returns></returns> + public ResponsePack SendSms(string mobileNumber, string vCode) + { + var requestObj = new ValidateSmsCodeObj() { Phone = mobileNumber, Code = vCode }; + var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestObj); + return RequestHttps(HttpRequesMethods.ValidateSmsCode.ToString(), requestJson, ""); + } + + } +} \ No newline at end of file diff --git a/HDL_ON/DAL/Server/HttpServerRequestBase.cs b/HDL_ON/DAL/Server/HttpServerRequestBase.cs new file mode 100644 index 0000000..336685d --- /dev/null +++ b/HDL_ON/DAL/Server/HttpServerRequestBase.cs @@ -0,0 +1,64 @@ +锘縰sing System; +using System.Net; +using System.Text; + +namespace HDL_ON.DAL.Server +{ + public partial class HttpServerRequest + { + public string RequestHttpsHost = "https://developer.hdlcontrol.com/api/"; + + /// <summary> + /// 璇锋眰鏈嶅姟鍣ㄦ柟娉� + /// </summary> + /// <returns>The https.</returns> + /// <param name="methodType">璇锋眰鏂规硶.</param> + /// <param name="dataStringJson">璇锋眰鐨勫弬鏁�.</param> + /// <param name="needHeaders">鏄惁闇�瑕佸寘澶�.</param> + ResponsePack RequestHttps(string methodType, string dataStringJson, string loginToken) + { + ResponsePack revertObj = new ResponsePack() { StateCode = "HDL-ON-Self:NotData" }; + + var webClient = new WebClient(); + #region + var urlHead = $"{RequestHttpsHost}"; + //webClient.Headers.Add("CONTENT-TYPE", "application/json"); + string url = urlHead + methodType; + /* 濡傛灉涓嶉渶瑕侀獙璇乀oken鍙互涓嶇敤浼犲叆 */ + if (string.IsNullOrEmpty(loginToken)) + { + webClient.Headers.Add("Authorization", loginToken); + } + byte[] bytes = null; + try + { + bytes = webClient.UploadData(url, Encoding.UTF8.GetBytes(dataStringJson)); + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + revertObj.StateCode = "HDL-ON-Self:Net_Error"; + revertObj.ErrorInfo_En = "Network anomaly"; + revertObj.ErrorInfo_Zh = "缃戠粶寮傚父"; + } + try + { + if (bytes != null) + { + string responseString = Encoding.UTF8.GetString(bytes); + if (responseString != null) + { + revertObj = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponsePack>(responseString); + } + } + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + } + return revertObj; + #endregion + } + + } +} diff --git a/HDL_ON/Entity/Enumerative/EmptyHttpReques.cs b/HDL_ON/Entity/Enumerative/EmptyHttpReques.cs new file mode 100644 index 0000000..7c7ada1 --- /dev/null +++ b/HDL_ON/Entity/Enumerative/EmptyHttpReques.cs @@ -0,0 +1,41 @@ +锘縰sing System; +namespace HDL_ON.DAL.Server +{ + /// <summary> + /// 鏈嶅姟鍣ㄦ帴鍙� + /// </summary> + public enum HttpRequesMethods + { + /// <summary> + /// 鐧诲綍鏂规硶 + /// + /// </summary> + Login = 0, + /// <summary> + /// 妫�鏌ユ墜鏈哄彿鐮佹槸鍚﹀瓨鍦� + /// </summary> + IsExistingAccount=1, + /// <summary> + /// 鑾峰彇楠岃瘉鐮� + /// </summary> + SignPhone=2, + /// <summary> + /// 楠岃瘉楠岃瘉鐮� + /// </summary> + ValidateSmsCode=3, + /// <summary> + /// 娉ㄥ唽 + /// </summary> + SignIn=4, + } + + /// <summary> + /// 鏈嶅姟鍣ㄦ帴鍙h姹傛帴鍙g粨鏋� + /// </summary> + public enum HttpRequesResult + { + SUCCESS =1, + LoginFailed_PasswordErorr = 2, + LoginFailed_AccountErorr = 3, + } +} diff --git a/HDL_ON/Entity/ResponseEntity/BackupInfoRes.cs b/HDL_ON/Entity/ResponseEntity/BackupInfoRes.cs new file mode 100755 index 0000000..a57a87e --- /dev/null +++ b/HDL_ON/Entity/ResponseEntity/BackupInfoRes.cs @@ -0,0 +1,12 @@ +锘縰sing System; + +namespace HDL_ON +{ + [Serializable] + public class BackupInfoRes + { + public int Id { get; set; } + + public string FileName { get; set; } + } +} diff --git a/HDL_ON/Entity/ResponseEntity/DeviceInfoRes.cs b/HDL_ON/Entity/ResponseEntity/DeviceInfoRes.cs new file mode 100755 index 0000000..c1c5079 --- /dev/null +++ b/HDL_ON/Entity/ResponseEntity/DeviceInfoRes.cs @@ -0,0 +1,28 @@ +锘縰sing System; + +namespace HDL_ON +{ + [Serializable] + public class DeviceInfoRes + { + public int Id { get; set; } + + public string DeviceType { get; set; } + + public int SubnetID { get; set; } + + public int DeviceID { get; set; } + + public int LoopID { get; set; } + + public string DeviceName { get; set; } + + public int GatewayID { get; set; } + + public int UserID { get; set; } + + public string MAC { get; set; } + + public string Password { get; set; } + } +} diff --git a/HDL_ON/Entity/ResponseEntity/FolderRes.cs b/HDL_ON/Entity/ResponseEntity/FolderRes.cs new file mode 100755 index 0000000..3f865d4 --- /dev/null +++ b/HDL_ON/Entity/ResponseEntity/FolderRes.cs @@ -0,0 +1,14 @@ +锘縰sing System; + +namespace HDL_ON +{ + [Serializable] + public class FolderRes + { + public int FolderID { get; set; } + + public string FolderName { get; set; } + + public DateTime FolderAddTime { get; set; } + } +} diff --git a/HDL_ON/Entity/ResponseEntity/GatewayRes.cs b/HDL_ON/Entity/ResponseEntity/GatewayRes.cs new file mode 100755 index 0000000..32c4447 --- /dev/null +++ b/HDL_ON/Entity/ResponseEntity/GatewayRes.cs @@ -0,0 +1,34 @@ +锘縰sing System; + +namespace HDL_ON +{ + [Serializable] + public class GatewayRes + { + public int Id { get; set; } + + public string MAC { get; set; } + + public string ProjectName { get; set; } + + public string UserName { get; set; } + + public string GroupName { get; set; } + + public string IPAddress { get; set; } + + public int Port { get; set; } + + public int SubnetID { get; set; } + + public int DeviceID { get; set; } + + public int Type { get; set; } + + public string IsValid { get; set; } + + public string Password { get; set; } + + public string Region { get; set; } + } +} diff --git a/HDL_ON/Entity/ResponseEntity/MessageInfoRes.cs b/HDL_ON/Entity/ResponseEntity/MessageInfoRes.cs new file mode 100755 index 0000000..69b21fc --- /dev/null +++ b/HDL_ON/Entity/ResponseEntity/MessageInfoRes.cs @@ -0,0 +1,33 @@ +锘縰sing System; + + +namespace HDL_ON +{ + [Serializable] + public class MessageInfoRes + { + public int MsgID { get; set; } + + public int SwitchNum { get; set; } + + public int MessageMode { get; set; } + + public byte[] AlarmEmail { get; set; } + + public string DetailMessage { get; set; } + + public int ProjectId { get; set; } + + public string MAC { get; set; } + + public string ProjectName { get; set; } + + public string UserName { get; set; } + + public string GroupName { get; set; } + + public int SubnetID { get; set; } + + public int DeviceID { get; set; } + } +} diff --git a/HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs b/HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs new file mode 100755 index 0000000..1de4b05 --- /dev/null +++ b/HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs @@ -0,0 +1,15 @@ +锘縰sing System; + + +namespace HDL_ON +{ + [Serializable] + public class RegionInfoRes + { + public int RegionID { get; set; } + + public string RegionName { get; set; } + + public string MAC=""; + } +} diff --git a/HDL_ON/Entity/ResponseEntity/ResponsePack.cs b/HDL_ON/Entity/ResponseEntity/ResponsePack.cs new file mode 100644 index 0000000..ca93f90 --- /dev/null +++ b/HDL_ON/Entity/ResponseEntity/ResponsePack.cs @@ -0,0 +1,27 @@ +锘縰sing System; +using Shared; + +namespace HDL_ON +{ + [Serializable] + public class ResponsePack + { + public string StateCode { get; set; } + + public string ErrorInfo_En { get; set; } + public string ErrorInfo_Zh { get; set; } + + public string ErrorInfo { + get { + if (Language.CurrentLanguage == "Chinese") { + return ErrorInfo_Zh; + } else { + return ErrorInfo_En; + } + } + + } + + public object ResponseData { get; set; } + } +} diff --git a/HDL_ON/Entity/ResponseEntity/ResultStatus.cs b/HDL_ON/Entity/ResponseEntity/ResultStatus.cs new file mode 100755 index 0000000..077755f --- /dev/null +++ b/HDL_ON/Entity/ResponseEntity/ResultStatus.cs @@ -0,0 +1,43 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace HDL_ON +{ + [System.Serializable] + public class ResultStatus + { + /// <summary> + /// 鐘舵�佺爜 + /// </summary> + public int Code; + + /// <summary> + /// 鐘舵�� + /// </summary> + public string Status; + + /// <summary> + /// 褰撳墠璐︽埛ID + /// </summary> + public int ID; + + /// <summary> + /// 淇″彿鍊� + /// </summary> + public int Flag; + + /// <summary> + /// 璐︽埛绫诲瀷 + /// </summary> + public int AccountType; + + /// <summary> + /// 涓昏处鍙稩D + /// </summary> + public int MasterID; + } +} diff --git a/HDL_ON/Entity/ResponseEntity/ResultSubaccount.cs b/HDL_ON/Entity/ResponseEntity/ResultSubaccount.cs new file mode 100644 index 0000000..08b790e --- /dev/null +++ b/HDL_ON/Entity/ResponseEntity/ResultSubaccount.cs @@ -0,0 +1,33 @@ +锘縰sing System; +namespace HDL_ON +{ + [System.Serializable] + public class ResultSubaccount + { + + /// <summary> + /// 鐢ㄦ埛ID + /// </summary> + public int Id; + + /// <summary> + /// 璐﹀彿 + /// </summary> + public string Email; + + /// <summary> + /// 鏄惁绂佺敤 + /// </summary> + public int IsEnable; + + /// <summary> + /// 璐﹀彿绫诲瀷 + /// </summary> + public int AccountType; + + /// <summary> + /// 璐﹀彿澶囨敞 + /// </summary> + public string Remark; + } +} diff --git a/HDL_ON/Entity/ResponseEntity/RoomInfoRes.cs b/HDL_ON/Entity/ResponseEntity/RoomInfoRes.cs new file mode 100755 index 0000000..4b871f1 --- /dev/null +++ b/HDL_ON/Entity/ResponseEntity/RoomInfoRes.cs @@ -0,0 +1,15 @@ +锘縰sing System; + + +namespace HDL_ON +{ + [Serializable] + public class RoomInfoRes + { + public int RoomId { get; set; } + + public string RoomName { get; set; } + + public int UserID { get; set; } + } +} diff --git a/HDL_ON/Entity/ResponseEntity/RoomObjectiveRes.cs b/HDL_ON/Entity/ResponseEntity/RoomObjectiveRes.cs new file mode 100755 index 0000000..5225324 --- /dev/null +++ b/HDL_ON/Entity/ResponseEntity/RoomObjectiveRes.cs @@ -0,0 +1,17 @@ +锘縰sing System; + + +namespace HDL_ON +{ + [Serializable] + public class RoomObjectiveRes + { + public int RoomOBJId { get; set; } + + public string DeviceType { get; set; } + + public string DeviceName { get; set; } + + public int UserID { get; set; } + } +} diff --git a/HDL_ON/Entity/ResponseEntity/SceneObjectiveRes.cs b/HDL_ON/Entity/ResponseEntity/SceneObjectiveRes.cs new file mode 100755 index 0000000..5c7a11c --- /dev/null +++ b/HDL_ON/Entity/ResponseEntity/SceneObjectiveRes.cs @@ -0,0 +1,17 @@ +锘縰sing System; + + +namespace HDL_ON +{ + [Serializable] + public class SceneObjectiveRes + { + public int SceneOBJId { get; set; } + + public int Command { get; set; } + + public string DeviceName { get; set; } + + public string DeviceType { get; set; } + } +} diff --git a/HDL_ON/Entity/ResponseEntity/SceneRes.cs b/HDL_ON/Entity/ResponseEntity/SceneRes.cs new file mode 100755 index 0000000..feb6129 --- /dev/null +++ b/HDL_ON/Entity/ResponseEntity/SceneRes.cs @@ -0,0 +1,13 @@ +锘縰sing System; + + +namespace HDL_ON +{ + [Serializable] + public class SceneRes + { + public int SceneId { get; set; } + + public string SceneName { get; set; } + } +} diff --git a/HDL_ON/Entity/ResponseEntity/SendJson.cs b/HDL_ON/Entity/ResponseEntity/SendJson.cs new file mode 100644 index 0000000..cee8f41 --- /dev/null +++ b/HDL_ON/Entity/ResponseEntity/SendJson.cs @@ -0,0 +1,555 @@ +锘縰sing System; +using System.Collections.Generic; + +namespace HDL_ON +{ + + //#region ON杞欢璇诲彇鎸囧畾鍖哄煙缃戝叧鍒楄〃锛屾柟娉曞悕锛欸atewayListON 鍙傛暟锛歊egionID 绫诲瀷锛歩nt + ///// <summary> + ///// Need Authorzation + ///// </summary> + //[Serializable] + //public class GatewayListONObj + //{ + // public int RegionID; + //} + //#endregion + #region ON杞欢娣诲姞缃戝叧锛屾柟娉曞悕锛欸atewayByRegionListToON + /// <summary> + /// Need Authorization + /// </summary> + [Serializable] + public class GatewayByRegionListToONObj + { + //鍙傛暟锛� MAC 绫诲瀷锛歴tring RegionID 绫诲瀷锛歩nt + public string MAC; + public int RegionID; + } + + #endregion + #region ON杞欢鎺ヨЕ缃戝叧缁戝畾锛屾柟娉曞悕锛欴elGatewayByMac + /// <summary> + /// Need authorization + /// </summary> + [Serializable] + public class DelGatewayByMacObj + { + //鍙傛暟锛� MAC 绫诲瀷锛歴tring + public string MAC; + } + + #endregion + + #region Login 鐧诲綍 鍔熻兘鎻忚堪锛氱櫥褰曞悗鑾峰彇璁块棶浠ょ墝銆� + [System.Serializable] + public class LoginObj + { + public string Account; + + public string Password; + + public int Company; + + } + + #endregion + + #region IsExistingAccount 楠岃瘉璐﹀彿鏄惁琚娇鐢� 鍔熻兘鎻忚堪锛氶獙璇佹墜鏈哄拰閭鏄惁琚敞鍐� + [System.Serializable] + public class IsExistingAccountObj + { + public string Account; + } + + #endregion + + #region SignIn 娉ㄥ唽 鍔熻兘鎻忚堪锛氱敤鎴锋墜鏈哄拰閭娉ㄥ唽 + [System.Serializable] + public class SignInObj + { + public string Account; + public string Password; + public string Language;//璇█ (鍥哄畾涓猴細Chinese鍜孍nglish) string 鏄� + public int Company; + } + + #endregion + + #region SignPhone 鍔熻兘鎻忚堪锛氬彂閫佹墜鏈洪獙璇佺爜 + [System.Serializable] + public class SignPhoneObj + { + public string Phone; + public int Company;// 鐭俊妯℃澘缂栧彿 int 鏄� + } + + #endregion + + #region ValidateSmsCode 鍔熻兘鎻忚堪锛氶獙璇佹墜鏈洪獙璇佺爜 + [System.Serializable] + public class ValidateSmsCodeObj + { + public string Phone;// 鎵嬫満鍙� string 鏄� + public string Code;// 楠岃瘉鐮� string 鏄� + } + + #endregion + + #region ForgetPassword 鍔熻兘鎻忚堪锛氭牴鎹处鍙风被鍨嬪彂閫侀獙璇佹柟寮�(閭璐﹀彿鍙戦�侀偖浠讹紝鎵嬫満璐﹀彿鍙戦�佺煭淇¢獙璇佺爜锛� + [System.Serializable] + public class ForgetPasswordObj + { + public string Account;// 璐﹀彿 string 鏄� + public int Company; + } + + #endregion + + #region ForgetPasswordAction 鍔熻兘鎻忚堪锛氬繕璁板瘑鐮侊紝鎵嬫満鍙锋壘鍥炲瘑鐮佹柟娉� + [System.Serializable] + public class ForgetPasswordActionObj + { + public string Account;// 璐﹀彿 string 鏄� + public string Password;// 瀵嗙爜 string 鏄� + } + #endregion + + #region UpdatePassword 1.8淇敼瀵嗙爜 鍔熻兘鎻忚堪锛氫慨鏀瑰綋鍓嶈处鍙风殑瀵嗙爜 + /// <summary> + /// Need Authorization + /// </summary> + [System.Serializable] + public class UpdatePasswordObj + { + public string OldPassword;// 鍘熷瘑鐮� string 鏄� + public string Password;// 鏂板瘑鐮� string 鏄� + } + #endregion + + #region UpdateUserInformation 1.9鏇存柊鎴栬缃敤鎴峰熀鏈俊鎭� 鍔熻兘鎻忚堪锛氫慨鏀规垨璁剧疆褰撳墠鐧诲綍鐨勭敤鎴峰熀鏈俊鎭� + /// <summary> + /// Need Authorization + /// </summary> + [System.Serializable] + public class UpdateUserInformationObj + { + public string Country;// 鍥藉 string 鏄� + public string City;// 鍩庡競 string 鏄� + public string Company;// 鍏徃 string 鏄� + public string Contact;// 鑱旂郴浜� string 鏄� + } + #endregion + + #region BindPhone 1.10鏇存柊鎴栫粦瀹氭墜鏈哄彿 鍔熻兘鎻忚堪锛氫慨鏀规垨璁剧疆褰撳墠鐧诲綍鐨勭敤鎴峰熀鏈俊鎭� + /// <summary> + /// Need Authorization + /// </summary> + [System.Serializable] + public class BindPhoneObj + { + public string Phone; + } + + #endregion + + #region UpdateUserLanguage 1.11淇敼鐢ㄦ埛璇█ 鍔熻兘鎻忚堪锛氫慨鏀圭敤鎴疯瑷� + /// <summary> + /// Need Authorization + /// </summary> + [System.Serializable] + public class UpdateUserLanguageObj + { + public string Language; + } + #endregion + + #region GetSubAccountList 1.12瀛愯处鍙蜂互鍙婅皟璇曡处鍙峰垪琛� 鍔熻兘鎻忚堪锛氭煡鐪嬪綋鍓嶈处鍙蜂笅闈㈡墍鏈夌殑瀛愯处鍙峰拰璋冭瘯璐﹀彿 + /// <summary> + /// Need Authorization + /// </summary> + [System.Serializable] + public class GetSubAccountListObj + { + } + #endregion + + #region SignSubAccount 1.13娉ㄥ唽瀛愯处鍙� 鍔熻兘鎻忚堪锛氬綋鍓嶇櫥褰曡处鍙锋敞鍐屽瓙璐﹀彿 + /// <summary> + /// Need Authorzation + /// </summary> + [System.Serializable] + public class SignSubAccountObj + { + public string Email;// 璐﹀彿 string 鏄� + public string Password;// 瀵嗙爜 string 鏄� + public string Remark;// 澶囨敞 string 鏄� + } + #endregion + + + #region EditSubAccount 1.14缂栬緫瀛愯处鍙� 鍔熻兘鎻忚堪锛氱紪杈戝瓙璐﹀彿鐨勫娉ㄥ拰瀵嗙爜 + /// <summary> + /// Need Authorization + /// </summary> + [System.Serializable] + public class EditSubAccountObj + { + public int Id; + public string Email;// 璐﹀彿 string 鏄� + public string Password;// 瀵嗙爜 string 鏄� + public string Remark;// 澶囨敞 string 鏄� + } + #endregion + + + #region RemoveSubAccount 1.15鍒犻櫎瀛愯处鍙� 鍔熻兘鎻忚堪锛氬垹闄ゅ瓙璐﹀彿 + /// <summary> + /// Need Authorization + /// </summary> + [System.Serializable] + public class RemoveSubAccountObj + { + public string Email; + } + #endregion + + + #region DisableDebug 1.16绂佺敤璋冭瘯璐﹀彿 鍔熻兘鎻忚堪锛氱鐢ㄥ綋鍓嶈处鍙风殑璋冭瘯璐﹀彿 + /// <summary> + /// Need Authorization + /// </summary> + [System.Serializable] + public class DisableDebugObj + { + public string Account; + } + #endregion + + + #region EnableDebug 1.17鍚敤璋冭瘯璐﹀彿 鍔熻兘鎻忚堪锛氬惎鐢ㄥ綋鍓嶈处鍙风殑璋冭瘯璐﹀彿 + /// <summary> + /// Need Authorization + /// </summary> + [System.Serializable] + public class EnableDebugObj + { + public string Account; + } + #endregion + + + #region AddMessage 1.18娣诲姞涓�涓姤璀�/鎻愮ず娑堟伅 鍔熻兘鎻忚堪锛氭坊鍔犱竴涓敤浜庢帹閫佸緱鎶ヨ/鎻愮ず鐨勬秷鎭� + /// <summary> + /// Need Authorization + /// </summary> + [System.Serializable] + public class AddMessageObj + { + public int SubnetID;// 瀛愮綉鍙� int 鏄� + public int DeviceID;// 璁惧鍙� int 鏄� + public int SwitchNum;// 娑堟伅鍙� int 鏄� + public int MessageMode;// 娑堟伅绫诲瀷锛堟姤璀︿负0锛屾彁绀轰负1锛� int 鏄� + public byte [] AlarmEmail;// 鎺ㄩ�佹ā寮忥紙閭欢涓�1锛孉PP涓�2锛� byte[] 鏄� + public string DetailMessage;// 娑堟伅鍐呭 stirng 鏄� + public string MAC;// 涓�绔彛MAC string 鏄� + } + #endregion + + + #region EduitMessage 1.19缂栬緫涓�涓姤璀�/鎻愮ず娑堟伅 鍔熻兘鎻忚堪锛氱紪杈戜竴涓敤浜庢帹閫佸緱鎶ヨ/鎻愮ず鐨勬秷鎭� + /// <summary> + /// Need Authorization + /// </summary> + [System.Serializable] + public class EduitMessageObj + { + public int Id; + public int SubnetID;// 瀛愮綉鍙� int 鏄� + public int DeviceID;// 璁惧鍙� int 鏄� + public int SwitchNum;// 娑堟伅鍙� int 鏄� + public int MessageMode;// 娑堟伅绫诲瀷锛堟姤璀︿负0锛屾彁绀轰负1锛� int 鏄� + public byte [] AlarmEmail;// 鎺ㄩ�佹ā寮忥紙閭欢涓�1锛孉PP涓�2锛� byte[] 鏄� + public string DetailMessage;// 娑堟伅鍐呭 stirng 鏄� + public string MAC;// 涓�绔彛MAC string 鏄� + } + #endregion + + + #region MessageListFromUser 1.20鐢ㄦ埛鐨勬秷鎭垪琛� 鍔熻兘鎻忚堪锛氭煡鐪嬪綋鍓嶇敤鎴风殑娑堟伅鍒楄〃 + /// <summary> + /// Need Authorization + /// </summary> + [System.Serializable] + public class MessageListFromUserObj + { + + } + #endregion + + + #region 鍏充簬鍖哄煙鐨勬柟娉� + #region AddHome 1.23鍒涘缓涓�涓綇瀹呭尯鍩� 鍔熻兘鎻忚堪锛氬垱寤轰竴涓敤鎴蜂綇瀹呭尯鍩� + /// <summary> + /// Need Authorization + /// </summary> + [System.Serializable] + public class AddHomeObj + { + /// <summary> + /// 浣忓畢鍖哄煙鍚嶇О + /// </summary> + public string Name; + } + [System.Serializable] + public class AddHomeAndGatewayByONObj + { + /// <summary> + /// 浣忓畢鍖哄煙鍚嶇О + /// </summary> + public string Region; + /// <summary> + /// The mac. + /// </summary> + public string MAC; + } + + #endregion + + #region HomeList 1.24鑾峰彇鐢ㄦ埛鐨勪綇瀹呭尯鍩熷垪琛� 鍔熻兘鎻忚堪锛氳幏鍙栫敤鎴锋墍鏈変綇瀹呭尯鍩熺殑鍒楄〃 + /// <summary> + /// Need Authorization + /// </summary> + [System.Serializable] + public class HomeListObj + { + + } + #endregion + + #region EditHome 1.25缂栬緫浣忓畢鍖哄煙鍚嶇О 鍔熻兘鎻忚堪锛氱紪杈戜綇瀹呭尯鍩熷悕绉� + /// <summary> + /// Need Authorization + /// </summary> + [System.Serializable] + public class EditHomeObj + { + public string Name;// 浣忓畢鍖哄煙鍚嶇О string 鏄� + public int Id;// 浣忓畢鍖哄煙缂栧彿 Int 鏄� + } + #endregion + #region EditMACByON 淇敼浣忓畢缁戝畾鐨刴ac + [System.Serializable] + public class EditMACByONObj + { + /// <summary> + /// 淇敼鐨勬柊鐨刴ac + /// </summary> + public string MAC; + /// <summary> + /// mac 鐨刬d + /// </summary> + public int Id; + + } + [System.Serializable] + public class EditMACByHomeId + { + /// <summary> + /// 淇敼鐨勬柊鐨刴ac + /// </summary> + public string MAC; + /// <summary> + /// Home 鐨刬d + /// </summary> + public int RegionID; + + } + #endregion + #region DeleteHome 1.26鍒犻櫎鏁翠釜浣忓畢鍖哄煙 鍔熻兘鎻忚堪锛氬垹闄ゆ暣涓綇瀹呭尯鍩� + /// <summary> + /// Need Authorzation + /// </summary> + [System.Serializable] + public class DeleteHomeObj + { + public int Id;// 浣忓畢鍖哄煙缂栧彿 int 鏄� + } + #endregion + + #region UploadDevices 1.30涓婁紶缃戝叧璁惧 鍔熻兘鎻忚堪锛氫笂浼犵綉鍏充俊鎭� + /// <summary> + /// Need Authorization + /// </summary> + [System.Serializable] + public class UploadDevicesObjGateway + { + public string MAC;// 涓�绔彛鐨凪AC鐮� string 鏄� + public string Password;// 涓�绔彛鐨勮繙绋嬪瘑鐮� string 鏄� + public string UserName;// 涓�绔彛鐢ㄦ埛鍚� string 鏄� + public string ProjectName;// 涓�绔彛宸ョ▼鍚� string 鏄� + public int RegionID;// 浣忓畢鍖哄煙缂栧彿 int 鏄� + } + #endregion + #region UploadDevices 1.31涓婁紶璁惧淇℃伅 鍔熻兘鎻忚堪锛氫笂浼犺澶囦俊鎭�� + /// <summary> + /// Need Authorizatin + /// </summary> + [System.Serializable] + public class UploadDevicesObj + { + public string DeviceName;// 璁惧鍚� string 鏄� + public string DeviceType;// 璁惧埆绫诲瀷, 鍥哄畾涓� + public int SubnetID;// 瀛愮綉鍙� int 鏄� + public int DeviceID;// 璁惧鍙� int 鏄� + public int LoopID;// 鍥炶矾鍙� int 鏄� + public string MAC;// 闇�瑕佺粦瀹氱殑涓�绔彛MAC鐮� string 鏄� + public int RegionID;// 浣忓畢鍖哄煙缂栧彿 Int 鏄� + } + #endregion + #region GatewayList 1.32璇诲彇鐢ㄦ埛鎵�鏈夌綉鍏冲垪琛� 鍔熻兘鎻忚堪锛氳鍙栧綋鍓嶇敤鎴风殑鎵�鏈変竴绔彛 + /// <summary> + /// Need Authorization + /// </summary> + [System.Serializable] + public class GatewayListObj + { + + } + [System.Serializable] + public class GatewayMACObj + { + public string MAC;// string + public int Id;// int + } + [System.Serializable] + public class GatewayObj : GatewayMACObj + { + public string Password;// string + public string ProjectName;// string + public string UserName;// string + public string Region;// string + } + #endregion + #region GatewayByRegionList 1.33璇诲彇鐢ㄦ埛鎸囧畾鍖哄煙缃戝叧鍒楄〃 鍔熻兘鎻忚堪锛氳鍙栧綋鍓嶇敤鎴锋寚瀹氬尯鍩熺殑鎵�鏈変竴绔彛 + /// <summary> + /// Need Authorization + /// </summary> + [System.Serializable] + public class GatewayByRegionListObj + { + public int RegionID;// 浣忓畢鍖哄煙缂栧彿 int 鏄� + } + #endregion + #region DeviceList 1.34璇诲彇璁惧淇℃伅鍒楄〃 鍔熻兘鎻忚堪锛氳鍙栧綋鍓嶇敤鎴疯澶囧垪琛� + /// <summary> + /// Need Authorization + /// </summary> + [System.Serializable] + public class DeviceListObj + { + + } + #endregion + + /// <summary> + /// Need Autorization + /// </summary> + [Serializable] + public class DelGatewayObj + { + public int Id;// 缃戝叧缂栧彿 int 鏄� + } + + + /// <summary> + /// Need Autorization + /// </summary> + [Serializable] + public class EditGatewayMACByONObj + { + public int Id; + public string MAC; + } + #endregion + + #region 澶囦唤鎭㈠鏁版嵁 + /// <summary> + /// 娣诲姞澶囦唤鐩綍 + /// </summary> + [Serializable] + public class AddFolderObj + { + /// <summary> + /// 鍖哄煙ID + /// </summary> + public int LevelID ; + /// <summary> + /// 澶囦唤鐩綍鍚嶇О + /// </summary> + public string Name; + + } + + /// <summary> + /// 鑾峰彇鍖哄煙涓嬬殑澶囦唤鍒楄〃鐩綍 + /// </summary> + [Serializable] + public class GetUserFolderObj + { + /// <summary> + /// 鍖哄煙ID + /// </summary> + public int LevelID; + } + + /// <summary> + /// 澶囦唤鏂囦欢澶归噷闈㈢殑鏂囦欢鐩綍 + /// </summary> + [Serializable] + public class UserBackupListObj + { + public int LevelID; + } + + + /// <summary> + /// 鑾峰彇澶囦唤鏂囦欢鏁版嵁 + /// return 浜岃繘鍒舵祦鏁版嵁 + /// </summary> + [Serializable] + public class BackupDetailObj + { + public int Id; + } + + /// <summary> + /// 涓婁紶澶囦唤鏂囦欢鏁版嵁 + /// </summary> + [Serializable] + public class AddUserBackupObj + { + /// <summary> + /// wenjian mingcheng + /// </summary> + public string Name; + /// <summary> + /// 鏂囦欢鏁版嵁 + /// </summary> + public byte [] DetailByte; + /// <summary> + /// 鏂囦欢澶� ID + /// </summary> + public int LevelID; + } + /// <summary> + /// Delete backup data. + /// </summary> + [Serializable] + public class DeleteFolderDataObj + { + public int Id; + } + #endregion + + +} \ No newline at end of file diff --git a/HDL_ON/Entity/ResponseEntity/SensorHistory.cs b/HDL_ON/Entity/ResponseEntity/SensorHistory.cs new file mode 100644 index 0000000..53852a2 --- /dev/null +++ b/HDL_ON/Entity/ResponseEntity/SensorHistory.cs @@ -0,0 +1,84 @@ +锘縰sing System; +using System.Collections.Generic; + +namespace HDL_ON +{ + + public class SensorPushHistory + { + + /// <summary> + /// MAC + /// </summary> + public string MAC { get; set; } + + /// <summary> + /// 璁惧鐨勫瓙缃戝彿 + /// </summary> + public int SubnetID { get; set; } + + /// <summary> + /// 璁惧鍙� + /// </summary> + public int DeviceID { get; set; } + + /// <summary> + /// 濡傛灉娌℃湁鍒欓粯璁や负1 + /// </summary> + public int LoopID { get; set; } + + + /// <summary> + /// 澶х被鍨� + /// </summary> + public int LargeType { get; set; } + + /// <summary> + /// 灏忕被鍨� + /// </summary> + public int SmallType { get; set; } + + /// <summary> + /// 鐢ㄤ簬鏌ヨ鎸囧畾鏈堜唤锛堝鏋滀笉鏄煡璇㈡湀浠藉垯榛樿涓�0锛� + /// </summary> + public int NowMonth { get; set; } + + /// <summary> + /// 鏌ヨ绫诲瀷 + /// </summary> + public QueryType QueryType { get; set; } + + public int LocalTimeZone { + get { + try { + return Convert.ToInt32 (DateTime.Now.ToString ("%z")); + }catch{ + return 0; + } + } + } + } + + public enum QueryType + { + NowDay = 0,//褰撳ぉ + NowMonth = 1,//鎸囧畾鏈� + NowYear = 2,//浠婂勾 + LatelySevenDay = 3//鏈�杩戜竷澶� + } + + + public class SensorPushHistoryRes + { + + /// <summary> + /// 瀹為檯鐩爣鍊� + /// </summary> + public float TargetValue { get; set; } + + /// <summary> + /// 鏌ヨ鐨勬椂闂撮泦缇� + /// </summary> + public DateTime CreatedOnUtc { get; set; } + } +} diff --git a/HDL_ON/Entity/ResponseEntity/SubAccountRes.cs b/HDL_ON/Entity/ResponseEntity/SubAccountRes.cs new file mode 100755 index 0000000..9f2e91c --- /dev/null +++ b/HDL_ON/Entity/ResponseEntity/SubAccountRes.cs @@ -0,0 +1,19 @@ +锘縰sing System; + + +namespace HDL_ON +{ + [Serializable] + public class SubAccountRes + { + public int UserID { get; set; } + + public string Account { get; set; } + + public int IsEnable { get; set; } + + public int UserType { get; set; } + + public string Remark { get; set; } + } +} diff --git a/HDL_ON/Entity/ResponseEntity/Timer.cs b/HDL_ON/Entity/ResponseEntity/Timer.cs new file mode 100644 index 0000000..0ca27bd --- /dev/null +++ b/HDL_ON/Entity/ResponseEntity/Timer.cs @@ -0,0 +1,114 @@ +锘縰sing System; +namespace HDL_ON +{ + [Serializable] + public class Timer + { + /// <summary> + /// 瀹氭椂鍣ㄧ殑鍞竴ID + /// </summary> + public string Guid { get; set; } + + /// <summary> + /// 瀹氭椂鍣ㄥ娉ㄥ悕 + /// </summary> + public string TimerName { get; set; } + + /// <summary> + /// 缃戝叧ID + /// </summary> + public int RegionID { get; set; } + + /// <summary> + /// 鎵ц鏃堕棿鐐� + /// </summary> + public string ExecutionTime { get; set; } + + /// <summary> + /// 閲嶅鍛ㄦ湡 + /// </summary> + public string Periodicity { get; set; } + + /// <summary> + /// 鏄惁鍚敤 + /// </summary> + public bool IsStart { get; set; } + + /// <summary> + /// 瀹氭椂鍣ㄩ噸澶嶇被鍨� + /// </summary> + public TimerType TimerType { get; set; } + + /// <summary> + /// 鎺у埗鐨勮澶囨暟鎹� + /// </summary> + public string ControlDeviceData { get; set; } + + /// <summary> + /// 鎴块棿鍚嶇О + /// </summary> + public string RoomName { get; set; } + + /// <summary> + /// 鏃跺尯 + /// </summary> + public int TimeZone { get; set; } + + /// <summary> + /// 灏嗘墽琛屾椂闂磋浆鎴愭湰鍦版椂闂存樉绀猴紝鏈嶅姟闇�瑕乽tc鏃堕棿鎵ц瀹氭椂鎿嶄綔銆� + /// </summary> + public string ShowPeriodicity{ + get{ + return Periodicity + TimeZone; + } + } + + } + + public enum TimerType + { + EveryDay = 0, //姣忓ぉ + WorkingDay, //宸ヤ綔鏃� + Weekend, //鍛ㄦ湯 + Week, //鎸囧畾鏄熸湡鍑� + Period, //鎸囧畾鏃堕棿娈� + AppointDay, //鎸囧畾鏃� + + } + + #region 閫氳 + public class DeviceInfo + { + public string DevicePath { get; set; } + + public int DeviceType { get; set; } + + public byte SubnetID { get; set; } + + public byte DeviceID { get; set; } + + public byte LoopID { get; set; } + + public int Command { get; set; } + + public byte [] SendBytes { get; set; } + } + // AddTimer 娣诲姞瀹氭椂鍣� + //褰撳畾鏃跺櫒閲嶅绫诲瀷涓烘瘡鏃ャ�佸伐浣滄棩銆佸懆鏈紝鍙~鍏匱imerType + //濡傛灉鏈寚瀹氭槦鏈熷嚑Week锛屽~鍏匬eriodicity + + // EditTimer 缂栬緫瀹氭椂鍣� + //褰撳畾鏃跺櫒閲嶅绫诲瀷涓烘瘡鏃ャ�佸伐浣滄棩銆佸懆鏈紝鍙~鍏匱imerType + //濡傛灉鏈寚瀹氭槦鏈熷嚑Week锛屽~鍏匬eriodicity + + //GetOneTimerInfo 璇诲彇涓�涓畾鏃跺櫒淇℃伅 + //濉厖Id 瀛楁灏辫浜� + + //GetTimerList 璇诲彇瀹氭椂鍣ㄥ垪琛� 濉厖 GatewayId瀛楁 + + //IsEnableTimer 鍚敤鎴栫鐢ㄥ畾鏃跺櫒 濉厖Id 瀛楁灏辫浜� + + //DeleteTimer 鍒犻櫎瀹氭椂鍣� 濉厖Id 瀛楁灏辫浜� + #endregion + +} diff --git a/HDL_ON/Entity/ResponseEntity/UserLoginRes.cs b/HDL_ON/Entity/ResponseEntity/UserLoginRes.cs new file mode 100755 index 0000000..604689a --- /dev/null +++ b/HDL_ON/Entity/ResponseEntity/UserLoginRes.cs @@ -0,0 +1,27 @@ +锘縰sing System; + + +namespace HDL_ON +{ + [Serializable] + public class UserLoginRes + { + public string Token; + + public string TimeStamp; + + public int UserId; + + public string Account; + + public int UserType; + + public int MainUserId; + + public bool IsProxyAllVisionRegister; //<!--鏄惁鍦ㄥ叏瑙嗛�氫腑浠g悊娉ㄥ唽浜�--> + public bool IsAllVisionRoomBind; //<!-- 鏄惁鍦ㄧ粦瀹氫簡浣忔埧浜�,濡傛灉杩欎袱涓瓧娈礗sProxyAllVisionRegister+IsProxyAllVisionRegister閮戒负true鐨勮瘽锛屽垯App绔樉绀哄叏瑙嗛�氳烦杞殑鍔熻兘 --> + public string AllVisionRegisterDevUserNameGuid;//7D1fb999-20b6-4363-b731-732d9171071f" , <!--SIP 甯愬彿--> + public string TenantCode;// "TXXXX", + public string DevelopCode;//": "abc-51f5-123-982c-def" + } +} diff --git a/HDL_ON/HDL/Operation/BusSocket.cs b/HDL_ON/HDL/Operation/BusSocket.cs new file mode 100644 index 0000000..84f1942 --- /dev/null +++ b/HDL_ON/HDL/Operation/BusSocket.cs @@ -0,0 +1,169 @@ +锘縰sing System; +using System.Net.Sockets; +using System.Net; +using HDL_ON.UI; + +namespace HDL_ON +{ + /// <summary> + /// 鎺ユ敹澶勭悊UDP鏁版嵁鍖� + /// </summary> + /// <typeparam name="T"></typeparam> + public static class BusSocket + { + //鐩戝惉绔彛 + static int port; + + //鏈湴Socket + private static Socket busSocket; + + /// <summary> + /// 鍚姩Socket鎺ユ敹鍜屽彂閫佸姛鑳� + /// </summary> + /// <param name="port"></param> + public static void Start (int port) + { + if (IsRunning) { + return; + } + + BusSocket.port = port; + + busSocket = new Socket (AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); + busSocket.EnableBroadcast = true; + try { + busSocket.Bind (new IPEndPoint (IPAddress.Any, port)); + }catch{ + busSocket = null; + return; + } + + //socket = new Socket (AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP); + //socket.Bind (new IPEndPoint (IPAddress.Parse (ip), 0)); //缁戝畾濂楁帴瀛� + //socket.SetSocketOption (SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption (IPAddress.Parse ("224.0.168.188"))); + //if (SetSocketOption () == false) error_occurred = true; + + asyncBeginReceive (); + + MainPage.Log ("BusSocket鍚姩鎴愬姛锛�"); + } + + /// <summary> + /// 鍋滄Socket + /// </summary> + public static void Stop() + { + if (!IsRunning) + { + return; + } + try + { + busSocket.Close(); + } + catch { } + busSocket = null; + //HDL_ON.SimpleControl.Phone.Music.A31PlayMusicPage.isExit = true; + //SmartHome.MqttCommon.DisConnect (); + MainPage.Log("BusSocket鍏抽棴鎴愬姛!"); + } + + /// <summary> + /// 褰撳墠鐨凷ocket鏄惁杩愯 + /// </summary> + public static bool IsRunning + { + get + { + return null == busSocket ? false : true; + } + } + + /// <summary> + /// 寮�濮嬪紓姝ユ帴鏀舵暟鎹� + /// </summary> + private static void asyncBeginReceive() + { + if (!IsRunning) + { + return; + } + + try { + + Packet packet = new Packet (); + + busSocket.BeginReceiveFrom (packet.Bytes, 0, packet.Bytes.Length, SocketFlags.None, ref packet.RemoteEndPoint, new AsyncCallback (asyncEndReceive), packet); + + } + catch (Exception e) { + System.Threading.Thread.Sleep (1); + asyncBeginReceive (); + } + + } + + /// <summary> + /// 寮傛鎺ユ敹鏁版嵁缁撴潫 + /// </summary> + /// <param name="iar"></param> + private static void asyncEndReceive(IAsyncResult iar) + { + + if (!IsRunning) + { + return; + } + + try + { + asyncBeginReceive (); + + Packet packet = (Packet)iar.AsyncState; + + int len = busSocket.EndReceiveFrom(iar, ref packet.RemoteEndPoint); + byte[] bytes = packet.Bytes; + packet.Bytes = new byte[len]; + System.Array.Copy(bytes, 0, packet.Bytes, 0, packet.Bytes.Length); + packet.Manager(); + } + catch { } + } + + /// <summary> + /// 寮傛鍙戦�佹暟鎹� + /// </summary> + /// <param name="tempPacket"></param> + public static void AsyncBeginSend(Packet tempPacket) + { + try + { + if (!IsRunning) { + return; + } + tempPacket.FlagDateTime = System.DateTime.Now; + tempPacket.HaveSendCount++; + busSocket.BeginSendTo(tempPacket.Bytes, 0, tempPacket.Bytes.Length, SocketFlags.None, tempPacket.RemoteEndPoint, new AsyncCallback(asyncEndSend), tempPacket); + } + catch { + + } + } + + /// <summary> + /// 寮傛鍙戦�佹暟鎹粨鏉� + /// </summary> + /// <param name="iar"></param> + private static void asyncEndSend(IAsyncResult iar) + { + Packet tempUDPPacketBuffer = (Packet)iar.AsyncState; + try + { + int bytesSent = busSocket.EndSendTo(iar); + } + catch { + + } + } + } +} \ No newline at end of file diff --git a/HDL_ON/HDL/Operation/CRC.cs b/HDL_ON/HDL/Operation/CRC.cs new file mode 100644 index 0000000..fc19256 --- /dev/null +++ b/HDL_ON/HDL/Operation/CRC.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace HDL_ON +{ + /// <summary> + /// CRC 的摘要说明。 + /// </summary> + public class CRC + { + public CRC() + { + // + // TODO: 在此处添加构造函数逻辑 + // + } + + #region crctab + private static ushort[] crctab = new ushort[256] + { + 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, + 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, + 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, + 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, + 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, + 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, + 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, + 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, + 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, + 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, + 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, + 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, + 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, + 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, + 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, + 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, + 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, + 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, + 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, + 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, + 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, + 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, + 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, + 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, + 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, + 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, + 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, + 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, + 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, + 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, + 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, + 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 + }; + #endregion + + /// <summary> + /// CRC校验公式 + /// </summary> + /// <param name="crc">CRC</param> + /// <param name="cp">发送的数据序列</param> + /// <returns>新CRC</returns> + private static void xcrc(ref byte height,ref byte low,byte cp) + { + ushort t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0; + t2 =height; + t3 = cp; + t4 = (ushort)(low * 256); + t5 = (ushort)(t2 ^ t3); + t6 = (ushort)(crctab[t5] ^ t4); + height = (byte)(t6 / 256); + low = (byte)(t6 % 256); + } + + /// <summary> + /// 添加CRC校验字 + /// </summary> + /// <param name="bufin">信息串</param> + /// <param name="n">不包括校验字的串总长度</param> + public static void ConCRC(ref byte[] bufin, byte start, int n) + { + + byte height = 0; + byte low = 0; + byte i; + //n个数据的CRC校验 + for (i = start; i < n; i++) + { + xcrc(ref height,ref low, bufin[i]); + } + bufin [i] = height; + bufin[i + 1] = low; + } + } +} \ No newline at end of file diff --git a/HDL_ON/HDL/Operation/Control.cs b/HDL_ON/HDL/Operation/Control.cs new file mode 100644 index 0000000..1384441 --- /dev/null +++ b/HDL_ON/HDL/Operation/Control.cs @@ -0,0 +1,701 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using HDL_ON.DAL; +using HDL_ON.DAL.Net; +using HDL_ON.UI; + +namespace HDL_ON +{ + public class Control + { + public bool IsCanShowTip; + public System.DateTime LatestDateTime = System.DateTime.Now; + + /// <summary> + /// 鎵�鏈夊井淇″涓�绔彛鐨勬帶鍒堕兘浼氭斁鍒拌繖涓泦鍚堥噷 + /// </summary> + private static System.Collections.Generic.List<Control> controlList = new List<Control>(50); + + /// <summary> + /// 鍙戦�佹暟鎹紝绛夊緟鏈夊弽棣� + /// </summary> + /// <returns>The bytes send has return.</returns> + public static byte[] ControlBytesSendHasReturn(Command command, byte subnetID, byte deviceID, byte[] gatewayBytes, bool isShow = true) + { + + if (command == Command.ReadDeviceLoopInfo || command == Command.ReadDeviceModul) + CommonPage.LocalPhoneFindDevice = true; + if (command == Command.ReadGateway || command == Command.ReadGatewayProgrammingMode || command == Command.SetGateway) + { + CommonPage.FindGateway = true; + CommonPage.LocalPhoneFindDevice = true; + } + + Control control = new Control() { IsCanShowTip = isShow }; + control.Send(new Target() + { + IPEndPoint = CommonPage.EndPoint, + Command = command, + SubnetID = subnetID, + DeviceID = deviceID, + AddData = gatewayBytes, + }, SendCount.Three, true); + CommonPage.FindGateway = false; + + return control.UsefulBytes; + + } + + + /// <summary> + /// 鍙戦�佹暟鎹紝涓嶉渶瑕佺瓑寰呭洖澶� + /// </summary> + public static void ControlBytesSend(Command command, byte subnetID, byte deviceID, byte[] gatewayBytes, SendCount sendCount = SendCount.Three, System.Net.IPEndPoint ipEndpoint = null, bool isShowTip = true) + { + if (command == Command.ReadDeviceLoopInfo || command == Command.ReadDeviceModul) + CommonPage.LocalPhoneFindDevice = true; + if (command == Command.ReadGateway || command == Command.ReadGatewayProgrammingMode + || command == Command.SetGateway) + { + CommonPage.FindGateway = true; + CommonPage.LocalPhoneFindDevice = true; + } + Control control = new Control() { IsCanShowTip = isShowTip }; + control.Send(new Target() + { + IPEndPoint = ipEndpoint == null ? CommonPage.EndPoint : ipEndpoint,//new System.Net.IPEndPoint (System.Net.IPAddress.Parse (new Net.NetWiFi ().BroadcastIpAddress.ToString ()), 6000), + Command = command, + SubnetID = subnetID, + DeviceID = deviceID, + AddData = gatewayBytes, + }, sendCount, false); + CommonPage.FindGateway = false; + MainPage.Log(command.ToString() + "::" + CommonPage.EndPoint.ToString()); + + } + + /// <summary> + /// 澶勭悊鎺ユ敹鍥炴潵鐨勬暟鎹� + /// </summary> + /// <param name="subnetID">婧愬瓙缃戝彿</param> + /// <param name="deviceID">婧愯澶囧彿</param> + /// <param name="command">鎿嶄綔鐮�</param> + /// <param name="usefulBytes">鏈夌敤鐨勬暟鎹�</param> + /// <param name="remoteEndPoint">婧愮綉缁滃鎺ュ瓧</param> + public static void ManagerReceive(byte subnetID, byte deviceID, Command command, byte targetSubnetID, byte targetDeviceID, byte[] usefulBytes, System.Net.EndPoint remoteEndPoint) + { + try + { + string receiveFlag = string.Format("{0},{1},{2},", subnetID, deviceID, (int)command); + + switch ((Command)command) + { + case Command.YIPanelDeviceInofACK: + for (int i = 0; i < 4; i++) + { + receiveFlag += string.Format("{0}", usefulBytes[i]); + } + break; + case Command.ReadDoorLockSceneObjACK: + receiveFlag += string.Format("{0},{1},{2},{3},{4}", usefulBytes[0], usefulBytes[1], usefulBytes[2], usefulBytes[3], usefulBytes[4]); + break; + case Command.ReadDoorLockClockACK: + case Command.CreatConnectionACK: + receiveFlag += string.Format("{0}", usefulBytes[0]); + break; + //闂ㄩ攣,BroadcastDoorLockStateAndAlarm + //骞挎挱闂ㄩ攣鐘舵�佸拰鎶ヨ, + case Command.BroadcastDoorLockStateAndAlarm://骞挎挱闂ㄩ攣鐘舵�佸拰鎶ヨ + receiveFlag += string.Format("{0},{1}", usefulBytes[0], usefulBytes[1]); + break; + case Command.ReadDoorLockUseRemarkACK: + case Command.ReadSensorPushMessageACK: + case Command.SetSensorPushMessageACK: + case Command.ReadSensorScenceACK: + case Command.ReadAnalogACK: + receiveFlag += string.Format("{0},{1},{2}", usefulBytes[0], usefulBytes[1], usefulBytes[2]); + break; + case Command.SetSensorScenceACK: + receiveFlag += string.Format("{0},{1},{2}", usefulBytes[1], usefulBytes[2], usefulBytes[3]); + break; + case Command.SendRemoteInfoToServerACK: + for (int i = 1; i < 9; i++) + { + receiveFlag += string.Format("{0}", usefulBytes[i]); + } + break; + case Command.BroadcastDryContactStatus://鐢卞共鎺ョ偣骞挎挱鍑烘潵鐨勬暟鎹紝绋嬪簭涓嶅仛鍥炲銆� + receiveFlag += string.Format("{0}", usefulBytes[0]); + break; + case Command.SetSceneACK: + receiveFlag += string.Format("{0},{1}", usefulBytes[0], usefulBytes[1]); + break; + case Command.SetSeriesACK: + receiveFlag += string.Format("{0},{1}", usefulBytes[0], usefulBytes[1]); + break; + case Command.UpdataCurtainModelStutasACK: + case Command.SetHotelCurtainACK: + case Command.DownloadInfraredACK: + case Command.SetSensorPushValuesACK: + case Command.ReadSensorPushValuesACK: + receiveFlag += string.Format("{0},{1}", usefulBytes[0], usefulBytes[1]); + break; + case Command.ReadLightEquipmentAllLoopBrightnessACK: + break; + case Command.SetSingleLightACK: + receiveFlag += string.Format("{0},{1}", usefulBytes[0], usefulBytes[2]); + break; + case Command.UpLoadInfraredACK: + receiveFlag += string.Format("{0},{1}", usefulBytes[0], usefulBytes[1]); + break; + case Command.SetCommonACK: + case Command.InfraredChannelControlACK: + case Command.ReadACModeACK: + case Command.SetACModeACK: + case Command.Serverx_FH_CMD_ACK: + case Command.ReadSensorHistoryACK: + case Command.SetSensorAutomationTargetLevelEnableACK: + case Command.ReadSensorAutomationLevelTargetEnableACK: + receiveFlag += string.Format("{0}", usefulBytes[0]); + break; + case Command.ReadFoolHeatACK: + case Command.SetFoolHeatACK: + case Command.SetArmACK: + case Command.ReadArmACK: + receiveFlag += string.Format("{0}", usefulBytes[0]); + break; + case Command.ReadDeviceModulACK: + case Command.ReadGatewayACK: + case Command.ReadSecurityStatusACK: + receiveFlag = string.Format("{0},{1}", usefulBytes[0], usefulBytes[1]); + break; + case Command.UpdataLightDimmingTheLargestLevelACK: + case Command.UpdataLightDimmingMaximumOrMinimumACK: + case Command.WriteManageWirelessNetACK: + case Command.ReadGateWayModelInfoACK: + case Command.ReadGatewayServerIPACK: + case Command.SetGateWayModelInfoACK: + case Command.SetGateWayModelInternetInfoACK: + case Command.ReadDeviceMacACK: + case Command.SetDeviceSubnetIDACK: + case Command.PositioningEquipmentACK: + case Command.PositioningPanelACK: + case Command.GotoConfigModeACK: + case Command.CheckConfigSuccessACK: + case Command.SetACPanelACK: + case Command.ReadACPanelACK: + case Command.ReadTerrestriaHeatRemarkACK: + case Command.UpdateGatewayIpACK: + case Command.ReadWirelessPanelModeACK: + case Command.ReadDrycontactModeACK: + case Command.ReadACFloorHeatingSettingEquipmentACK: + case Command.SetACFloorHeatingSettingEquipmentACK: + case Command.Read43FloorHeatingSettingEquipmentACK: + case Command.Set43FloorHeatingSettingEquipmentACK: + case Command.READ_AIR_ALL_Parameter_ack: + case Command.Set_AIR_ALL_Parameter_ack: + case Command.ReadFloorHeatProbeACK: + case Command.ReadButtonKeyEnableACK: + case Command.UpdateLightDimmingLoopRemakeACK: + case Command.ReadMusicPanelSettingACK: + case Command.ReadMusicPanelEnableACK: + case Command.SetMusicPanelEnableACK: + case Command.SetMusicPanelSettingACK: + case Command.SetGatewayACK: + case Command.ReadGatewayProgrammingModeACK: + case Command.RED_HSFH_TOTAL_ACK: + case Command.RED_HSFH_INFORMATION_ACK: + case Command.RED_HSRM_TOTAL_ACK: + case Command.RED_HSRM_INFORMATION_ACK: + case Command.CLEAR_SYSTEM_HISTORY_ACK: + case Command.SetSensorTargetRemarkACK: + case Command.ReadSensorAutomationEnableListACK: + case Command.SetSensorAutomationEnableListACK: + case Command.SetSensorAutomationListIDACK: + case Command.ReadSensorAutomationListIDACK: + case Command.ReadSensorAutomationNameACK: + case Command.SetSensorAutomationNameACK: + case Command.Set_Floor_Heat_State_ack: + case Command.Read_Floor_Heat_State_ack: + case Command.Read_Air_Condition_Set_ack: + case Command.HornAlarmBroadcast: + case Command.ReadHornLoopCountACK: + case Command.UpdateHornLoopRemakeACK: + case Command.ReadPanelTempTypeACK: + receiveFlag += ""; + break; + case Command.ControlMusicModel1ACK: + receiveFlag += ""; + break; + case Command.ControlMusicModel2ACK: + for (int i = 1; i < usefulBytes.Length; i++) + { + if (usefulBytes[i + 1] == 44) + { + break; + } + receiveFlag += string.Format("{0},", usefulBytes[i]); + } + break; + + case Command.Remote3thACK: + receiveFlag = string.Format("{0},", (int)command); + break; + case Command.ReadDeviceLoopInfoACK: + if (usefulBytes[0] == 1) + { + receiveFlag += string.Format("{0},{1}", usefulBytes[0], usefulBytes[2]); ; + } + else + receiveFlag += string.Format("{0},{1},{2}", usefulBytes[0], usefulBytes[1], usefulBytes[2]); + break; + case Command.SetDeviceLoopInfoACK: + case Command.InfraredControlACK: + case Command.SetLogicLoopColorACK: + case Command.SetSecurityByPassACK: + case Command.SetSensorAutomationDateTimeCycleACK: + case Command.ReadSensorAutomationDateTimeCycleACK: + receiveFlag += string.Format("{0},{1},{2}", usefulBytes[0], usefulBytes[1], usefulBytes[2]); + break; + case Command.UpdataRemakeACK: + break; + case Command.ReadWirelessPanelButtonKeyACK: + case Command.WriteWirelessPanelButtonKeyACK: + case Command.ReadDryContactStatusACK: + case Command.InstructionPanelKeyACK: + case Command.ReadInstructionPanelKeyACK: + case Command.ReadAnalogValueACK: + case Command.ReadSensorTargetRemarkACK: + case Command.SetHornTargetStateACK: + case Command.ReadHornTargetStateACK: + receiveFlag += string.Format("{0},{1}", usefulBytes[0], usefulBytes[1]); + break; + case Command.AssignedAddressACK: + case Command.UpdataCurtainModelRunTimeACK: + case Command.ReadCurtainStutasACK: + case Command.ReadLogicLoopColorACK: + case Command.ReadPanleTempACK: + case Command.FreshAirReadACK: + case Command.FreshAirControlACK: + case Command.Set_Air_State_New_ack: + case Command.ReadHornHistoryACK: + case Command.ReadHornLoopsStatusACK: + case Command.ReadHornPushACK: + case Command.SetHornPushACK: + case Command.ReadHornLoopAlarmACK: + case Command.SetHornTargetEnableACK: + case Command.ReadHornTargetEnableACK: + receiveFlag += string.Format("{0}", usefulBytes[0]); + break; + case Command.RemoteFirstACK: + for (int i = 1; i < 1 + 28; i++) + { + receiveFlag += string.Format("{0}", usefulBytes[i]); + } + break; + case Command.RemoteSecoudACK: + for (int i = 0; i < 7; i++) + { + receiveFlag += string.Format("{0}", usefulBytes[i]); + } + break; + default: + break; + } + //System.MainPage.WriteLog ("鎺ユ敹鍒版暟鎹細" + receiveFlag); + + for (int i = 0; i < controlList.Count; i++) + { + try + { + var control = controlList[i]; + if (control.SendFlag == receiveFlag) + { + control.LatestDateTime = System.DateTime.Now; + control.UsefulBytes = usefulBytes;// + control.run(); + } + } + catch + { + + } + } + } + catch (Exception ex) + { + MainPage.Log("ManagerReceive鎶涘嚭寮傚父锛�" + ex.ToString()); + } + } + + /// <summary> + /// 娣诲姞鍒板唴瀛樻暟缁勯噷闈� + /// </summary> + void add() + { + /// <summary> + /// 杈惧埌50鏉℃暟鎹悗灏辨竻鐞嗕竴涓� + /// </summary> + if (50 < controlList.Count) + { + lock (controlList) + { + for (int i = 0; i < controlList.Count;) + { + if (controlList[i] == null || 3 <= controlList[i].Packet.HaveSendCount) + { + controlList.RemoveAt(i); + } + else + { + i++; + } + } + + } + //System.MainPage.WriteLog ("++++++++"+controlList.Count.ToString ()); + } + controlList.Add(this); + } + + //褰撳墠鏁版嵁鐨勫叧閿暟鎹� + string sendFlag = string.Empty; + protected string SendFlag + { + get + { + return sendFlag; + } + set + { + sendFlag = value; + usefulBytes = null; + } + } + + private byte[] usefulBytes; + /// <summary> + /// 鑾峰彇鍥炴潵鐨勬湁鐢ㄤ俊鎭�,濡傛灉鑾峰彇鍥炴潵鐨勬暟鎹负null锛屽氨浼氭姏鍑哄紓甯镐俊鎭� + /// </summary> + public byte[] UsefulBytes + { + get + { + if (null == usefulBytes) + { + // throw new Exception("涓嶅ソ鎰忔�濓紝缃戠粶涓嶇ǔ瀹氭垨鑰呰繙绋嬭澶囦笉鍦ㄧ嚎锛岃绋嶅�欏啀璇曪紒"); + } + + return this.usefulBytes; + } + set + { + usefulBytes = value; + } + } + + //鍙戦�佹暟鎹簡涔嬪悗褰撳墠绾跨▼绛夊緟鎴栬�呰繍琛岀殑淇″彿 + System.Threading.ManualResetEvent allDone = new System.Threading.ManualResetEvent(false); + + /// <summary> + /// 鍙戦�佷簡鏁版嵁鍚庯紝绾跨▼灏辨槸绛夊緟鐘舵�侊紝鐩村埌鎺ユ敹鍒板弽棣堟垨鑰呰秴鏃跺悗閫�鍑� + /// </summary> + void wait() + { + allDone.Reset(); + allDone.WaitOne(); + } + + + /// <summary> + /// 璁╁綋鍓嶇嚎绋嬬户缁墽琛� + /// </summary> + void run() + { + allDone.Set(); + Packet.HaveSendCount = 4; + } + + + //鏁版嵁閲嶅彂澶勭悊 + void managerSendCount(object o) + { + add(); + if (CommonPage.IsRemote) + { + MqttCommon.MqttRemoteSend(Packet.Bytes); + Packet.FlagDateTime = DateTime.Now; + Packet.HaveSendCount--; + //杩欓噷鏄噸鍙戜袱娆� + while (Packet.HaveSendCount < 3) + { + if (Packet.FlagDateTime.AddMilliseconds(1000).Ticks <= System.DateTime.Now.Ticks) + { + MqttCommon.MqttRemoteSend(Packet.Bytes); + Packet.FlagDateTime = DateTime.Now; + Packet.HaveSendCount++; + } + System.Threading.Thread.Sleep(100); + }鈥� allDone.Set();鈥� } + else + { + try + { + MainPage.Log("鍙戦�佹暟鎹�:" + SendFlag); + BusSocket.AsyncBeginSend(Packet); + Packet.HaveSendCount--; + + //杩欓噷鏄噸鍙戜袱娆� + while (Packet.HaveSendCount < 3) + { + if (Packet.FlagDateTime.AddMilliseconds(1000).Ticks <= System.DateTime.Now.Ticks) + { + //System.MainPage.WriteLog ("閲嶅彂鏁版嵁:" + SendFlag); + BusSocket.AsyncBeginSend(Packet); + } + System.Threading.Thread.Sleep(100); + } + + } + catch (Exception ex) + { + MainPage.Log("managerSendCount:" + ex.ToString()); + } + finally + { + allDone.Set(); + if (Packet.HaveSendCount == 3 && IsCanShowTip) + { + //MainPage.AddTip (Language.StringByID (SimpleControl.R.MyInternationalizationString.OperationFailed)); + } + } + } + } + + /// <summary> + /// 褰撳墠鏁版嵁鍖� + /// </summary> + Packet Packet; + + private void ini(Target target, bool send = true) + { + this.SendFlag = string.Format("{0},{1},{2},", target.SubnetID, target.DeviceID, (int)target.Command + 1); + + switch (target.Command) + { + case Command.YIPanelDeviceInof: + for (int i = 0; i < 4; i++) + { + this.sendFlag += string.Format("{0}", target.AddData[i]); + } + break; + case Command.ReadDoorLockSceneObj: + this.SendFlag += string.Format("{0},{1},{2},{3},{4}", target.AddData[0], target.AddData[1], target.AddData[2], target.AddData[3], target.AddData[4]); + break; + case Command.ReadDoorLockClock: + case Command.CreatConnection: + this.SendFlag += string.Format("{0}", target.AddData[0]); + break; + case Command.ReadDoorLockUseRemark: + case Command.ReadSensorPushMessage: + case Command.SetSensorPushMessage: + case Command.SetSensorScence: + case Command.ReadAnalog: + this.sendFlag += string.Format("{0},{1},{2}", target.AddData[0], target.AddData[1], target.AddData[2]); + break; + case Command.ReadSensorScence: + this.sendFlag += string.Format("{0},{1},{2}", target.AddData[0], target.AddData[1], target.AddData[2]); + break; + case Command.SendRemoteInfoToServer: + for (int i = 40; i < 48; i++) + { + this.sendFlag += string.Format("{0}", target.AddData[i]); + } + break; + case Command.SetCommonSwitch: + case Command.InfraredChannelControl: + case Command.ReadACMode: + case Command.SetACMode: + case Command.ReadFoolHeat: + case Command.SetFoolHeat: + case Command.Serverx_FH_CMD: + case Command.SetArm: + case Command.ReadArm: + case Command.ReadSensorHistory: + case Command.SetSensorAutomationTargetLevelEnable: + case Command.ReadSensorAutomationLevelTargetEnable: + this.SendFlag += string.Format("{0}", target.AddData[0]); + break; + case Command.ReadDeviceModul: + case Command.ReadGateway: + case Command.ReadSecurityStatus: + case Command.ReadHornTargetState: + this.SendFlag = string.Format("{0},{1}", target.AddData[0], target.AddData[1]); + break; + case Command.SetScene: + case Command.SetSeries: + case Command.SetHotelCurtain: + case Command.ReadAnalogValue: + case Command.SetSensorPushValues: + case Command.ReadSensorPushValues: + this.SendFlag += string.Format("{0},{1}", target.AddData[0], target.AddData[1]); + break; + //case Command.ReadOnePortWirelessFROtherInfo: + case Command.UpdataRemake: + case Command.WriteManageWirelessNet: + case Command.UpdataLightDimmingTheLargestLevel: + case Command.UpdataLightDimmingMaximumOrMinimum: + case Command.ReadGateWayModelInfo: + case Command.ReadGatewayServerIP: + case Command.SetGateWayModelInfo: + case Command.SetGateWayModelInternetInfo: + case Command.ReadDeviceMac: + case Command.SetDeviceSubnetID: + case Command.PositioningEquipment: + case Command.PositioningPanel: + case Command.CheckConfigSuccess: + case Command.GotoConfigMode: + case Command.ReadACPanel: + case Command.SetACPanel: + case Command.ReadTerrestriaHeatRemark: + case Command.UpdateGatewayIp: + case Command.ReadWirelessPanelMode: + case Command.ReadDrycontactMode: + case Command.ReadACFloorHeatingSettingEquipment: + case Command.SetACFloorHeatingSettingEquipment: + case Command.Read43FloorHeatingSettingEquipment: + case Command.Set43FloorHeatingSettingEquipment: + case Command.READ_AIR_ALL_Parameter: + case Command.Set_AIR_ALL_Parameter: + case Command.ReadFloorHeatProbe: + case Command.ControlMusicModel: + case Command.ReadButtonKeyEnable: + case Command.UpdateEquipmentLoopRemake: + case Command.SetGateway: + case Command.ReadMusicPanelSetting: + case Command.ReadMusicPanelEnable: + case Command.SetMusicPanelEnable: + case Command.SetMusicPanelSetting: + case Command.ReadGatewayProgrammingMode: + case Command.RED_HSFH_TOTAL: + case Command.RED_HSFH_INFORMATION: + case Command.RED_HSRM_TOTAL: + case Command.RED_HSRM_INFORMATION: + case Command.CLEAR_SYSTEM_HISTORY: + case Command.SetSensorTargetRemark: + case Command.ReadSensorAutomationEnableList: + case Command.SetSensorAutomationEnableList: + case Command.SetSensorAutomationListID: + case Command.ReadSensorAutomationListID: + case Command.SetSensorAutomationName: + case Command.ReadSensorAutomationName: + case Command.Set_Floor_Heat_State: + case Command.Read_Floor_Heat_State: + case Command.Read_Air_Condition_Set: + case Command.UpdateHornLoopRemake: + case Command.ReadHornLoopCount: + case Command.ReadPanelTempType: + this.SendFlag += ""; + break; + case Command.ControlMusicModel2: + for (int i = 1; i < target.AddData.Length; i++) + { + if (target.AddData[i + 1] == 0x0D) + { + break; + } + this.sendFlag += string.Format("{0},", target.AddData[i]); + } + break; + case Command.Remote3th: + this.SendFlag = string.Format("{0},", (int)target.Command + 1); + break; + case Command.ReadDeviceLoopInfo: + if (target.AddData[0] == 1)//鐗规畩澶勭悊鐏厜绫伙紝DMX妯″潡姣忎竴涓洖璺笉鍥哄畾灏忕被锛屾牴鎹叿浣撹缃潵鍥炲 + this.sendFlag += string.Format("{0},{1}", target.AddData[0], target.AddData[2]); + else + this.sendFlag += string.Format("{0},{1},{2}", target.AddData[0], target.AddData[1], target.AddData[2]); + break; + case Command.SetDeviceLoopInfo: + case Command.InfraredControl: + case Command.SetLogicLoopColor: + case Command.SetSecurityByPass: + case Command.SetSensorAutomationDateTimeCycle: + case Command.ReadSensorAutomationDateTimeCycle: + this.sendFlag += string.Format("{0},{1},{2}", target.AddData[0], target.AddData[1], target.AddData[2]); + break; + case Command.ReadWirelessPanelButtonKey: + case Command.WriteWirelessPanelButtonKey: + case Command.ReadDryContactStatus: + case Command.UpdataCurtainModelStutas: + case Command.SetSingleLight: + case Command.DownloadInfrared: + case Command.UpLoadInfrared: + case Command.InstructionPanelKey: + case Command.ReadInstructionPanelKey: + case Command.ReadSensorTargetRemark: + case Command.SetHornTargetState: + this.sendFlag += string.Format("{0},{1}", target.AddData[0], target.AddData[1]); + break; + case Command.AssignedAddress: + case Command.UpdataCurtainModelRunTime: + case Command.ReadCurtainStatus: + case Command.ReadLogicLoopColor: + case Command.ReadPanleTemp: + case Command.FreshAirRead: + case Command.FreshAirControl: + case Command.Set_Air_State_New: + case Command.ReadHornTargetEnable: + case Command.SetHornTargetEnable: + case Command.ReadHornLoopAlarm: + case Command.SetHornPush: + case Command.ReadHornPush: + case Command.ReadHornHistory: + case Command.ReadHornLoopsStatus: + this.sendFlag += string.Format("{0}", target.AddData[0]); + break; + case Command.RemoteFirst: + for (int i = 0; i < 28; i++) + { + this.sendFlag += string.Format("{0}", target.AddData[i]); + } + break; + case Command.RemoteSecoud: + for (int i = 0; i < 7; i++) + { + this.sendFlag += string.Format("{0}", target.AddData[i]); + } + break; + default: + //return; + break; + } + if (send) + { + System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(managerSendCount)); + thread.IsBackground = true; + thread.Start(Packet); + } + } + + /// <summary> + /// 鍙戦�丅us鏁版嵁锛屽彂閫佷簡涓嶉渶瑕佺瓑寰� + /// </summary> + /// <param name="target">鍙戦�佸璞�</param> + /// <param name="sendCount">閲嶅彂娆℃暟</param> + public void Send(Target target, SendCount sendCount, bool isWait) + { + Packet = new Packet(target.SendBytes, target.IPEndPoint); + Packet.HaveSendCount = 3 - (int)sendCount; + + ini(target); + + if (isWait) + { + this.wait(); + } + } + } +} \ No newline at end of file diff --git a/HDL_ON/HDL/Operation/Device/Common.cs b/HDL_ON/HDL/Operation/Device/Common.cs new file mode 100644 index 0000000..1800953 --- /dev/null +++ b/HDL_ON/HDL/Operation/Device/Common.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace HDL_ON +{ + [System.Serializable] + public class Common + { + /// <summary> + /// 褰撳墠璁惧绫诲瀷 + /// </summary> + public DeviceType Type = DeviceType.UnKown; + + public int DeviceTextID = -1; + + /// <summary> + /// 澶囨敞 + /// </summary> + public string Name; + + public static readonly int Time = 1; + /// <summary> + /// 鏈�杩戞洿鏂扮殑鏃堕棿 + /// </summary> + public DateTime LastUpdateTime = System.DateTime.Now.AddMinutes (-Time); + + public string GatewayMAC = ""; + /// <summary> + /// 瀛愮綉鍙� + /// </summary> + public byte SubnetID; + + /// <summary> + /// 璁惧鍙� + /// </summary> + public byte DeviceID; + + /// <summary> + /// 鍥炶矾鍙� + /// </summary> + public byte LoopID; + + + [Newtonsoft.Json.JsonIgnore] + public virtual string CommonLoopID { + get { + return SubnetID.ToString () + "_" + DeviceID.ToString () + "_" + LoopID.ToString (); + } + } + + /// <summary> + /// 妯″潡鍥炴潵鎬绘暟 + /// </summary> + public byte LoopCount = 1; + + /// <summary> + /// 涓存椂鍙傛暟 + /// 榛樿涓�0锛宐us浼犺繃鏉ユ椂榛樿涓�1 + /// </summary> + public byte obj1 = 0; + public byte obj2; + public byte obj3; + public byte obj4; + public byte obj5; + /// <summary> + /// 璁惧澶х被 + /// </summary> + [Newtonsoft.Json.JsonIgnore] + public byte BigClass { + get { + return (byte)(((int)this.Type) / 256); + } + } + /// <summary> + /// 璁惧灏忕被 + /// </summary> + [Newtonsoft.Json.JsonIgnore] + public virtual byte MinClass { + get { + return (byte)(((int)this.Type) % 256); + } + } + + /// <summary> + /// 鏄惁涓烘贩鍚堟ā鍧� + /// </summary> + public bool isMixBox = false; + + public DeviceType MixType = DeviceType.UnKown; + + /// <summary> + /// 淇濆瓨鏁版嵁鏃剁殑鏂囦欢鍚� + /// </summary> + public string SavePath = ""; + + /// <summary> + /// 璁惧MAC + /// </summary> + public string MAC = string.Empty; + + } +} \ No newline at end of file diff --git a/HDL_ON/HDL/Operation/DeviceModular/CommonModular.cs b/HDL_ON/HDL/Operation/DeviceModular/CommonModular.cs new file mode 100644 index 0000000..2471ddc --- /dev/null +++ b/HDL_ON/HDL/Operation/DeviceModular/CommonModular.cs @@ -0,0 +1,52 @@ +锘縰sing System; +using System.Collections.Generic; + +namespace HDL_ON +{ + [System.Serializable] + public class CommonModular + { + /// <summary> + /// 褰撳墠璁惧绫诲瀷 + /// </summary> + public ModuleType Type = ModuleType.UnKown; + + /// <summary> + /// 澶囨敞 + /// </summary> + public string ModularName; + + public string GatewayMAC = ""; + /// <summary> + /// 瀛愮綉鍙� + /// </summary> + public byte SubnetID; + + /// <summary> + /// 璁惧鍙� + /// </summary> + public byte DeviceID; + + [Newtonsoft.Json.JsonIgnore] + public virtual string CommonModularID { + get { + return SubnetID.ToString () + "_" + DeviceID.ToString (); + } + } + + /// <summary> + /// 淇濆瓨鏁版嵁鏃剁殑鏂囦欢鍚� + /// </summary> + public string SavePath = ""; + + public string MAC = string.Empty; + + /// <summary> + /// 妯″潡鍖呭惈鐨勫姛鑳藉垪琛� + /// byte[0] 澶х被 + /// byte[1] 灏忕被 + /// byte[2] 鍔熻兘/鍥炶矾鎬绘暟 + /// </summary> + public List<byte []> FunctionList = new List<byte []> (); + } +} diff --git a/HDL_ON/HDL/Operation/DeviceModular/PanelModular.cs b/HDL_ON/HDL/Operation/DeviceModular/PanelModular.cs new file mode 100644 index 0000000..c5e072d --- /dev/null +++ b/HDL_ON/HDL/Operation/DeviceModular/PanelModular.cs @@ -0,0 +1,11 @@ +锘縰sing System; +namespace HDL_ON +{ + public class PanelModular : Common + { + public PanelModular () + { + //this.Type = DeviceType.YIPanel; + } + } +} diff --git a/HDL_ON/HDL/Operation/MyEnum.cs b/HDL_ON/HDL/Operation/MyEnum.cs new file mode 100644 index 0000000..a8da25f --- /dev/null +++ b/HDL_ON/HDL/Operation/MyEnum.cs @@ -0,0 +1,3462 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace HDL_ON +{ + /// <summary> + /// 璁惧妯″潡绫诲瀷 + /// </summary> + public enum ModuleType + { + UnKown = int.MaxValue, + + /// <summary> + /// 闈㈡澘璁惧 + /// </summary> + YIPanel = 0x0001, + } + /// <summary> + /// 璁惧绫诲瀷 + /// </summary> + public enum DeviceType + { + //鏂板姞 + SonosMusic = 0x1111, + + + MechanicalSwitch = 0x1200, + AutomaticSwitch = 0x1201, + DoorLockID = 0x1202, + + /// <summary> + /// 涓嶆竻妤� + /// </summary> + UnKown = int.MaxValue, + /// <summary> + /// The device common. + /// </summary> + DeviceCommon = 0x0000, + /// <summary> + /// 鐢佃 + /// </summary> + TV = 0x0001, + /// <summary> + /// 鍦烘櫙 + /// </summary> + Scene = 0x0002, + /// <summary> + /// 绯诲垪 + /// </summary> + Series = 0x0003, + /// <summary> + /// 閫氱敤寮�鍏� + /// </summary> + CommonSwitch = 0x0004, + /// <summary> + /// 鎽勫儚鏈� + /// </summary> + Monitor = 0x0005, + + /// <summary> + /// 绐楀笜妯″潡 + /// </summary> + CurtainModel = 0x0202, + /// <summary> + /// 寮�鍚堝笜鐢垫満 + /// </summary> + CurtainTrietex = 0x0200, + /// <summary> + /// 鍗峰笜 + /// </summary> + CurtainRoller = 0x0201, + /// <summary> + /// 璋冨厜鐏� + /// </summary> + LightDimming = 0x0100, + /// <summary> + /// 寮�鍏崇伅 + /// </summary> + LightSwitch = 0x0101, + LightCCT = 0x0102, + LightRGB = 0x0103, + LightRGBW = 0x0104, + LightRGBandCCT = 0x0105, + LightDALI = 0x0107, + LightLogic = 0x0108, + LightMixDimming = 0x0109, + LightMixSwitch = 0x010A, + LightEnergySwitch = 0x010B,//鑳芥簮寮�鍏筹紝甯﹀姛鐜囩殑缁х數鍣� + LightSwitchSocket = 0x0188,//鑷畾涔夌壒娈婄殑缁х數鍣紝浣滄彃搴т娇鐢� + /// <summary> + /// 绐楀笜 + /// </summary> + //Curtain = 0x0200, + /// <summary> + /// The AC device. + /// </summary> + ACDevice = 0x07FF, + /// <summary> + /// AC妯″潡 + /// </summary> + HVAC = 0x0700, + /// <summary> + /// 棣栧煄鐝戠幒瀹氬埗鐨勭┖璋冩ā鍧� + /// </summary> + LongXiAC = 0x07F9, + /// <summary> + /// 閫氱敤绌鸿皟闈㈡澘 + /// </summary> + ACPanel = 0x0703, + /// <summary> + /// 绾㈠绌鸿皟 + /// </summary> + ACInfrared = 0x0702, + /// <summary> + /// The AC coolmaster鎺у埗妯″潡 + /// </summary> + ACCoolmaster = 0x0701, + /// <summary> + /// 鑷畾涔夊涔犵孩澶栫爜鐨勯�氱敤寮�鍏崇┖璋冩帶鍒� + /// </summary> + CustomAC =0x0764, + /// <summary> + /// 鍦扮儹 + /// </summary> + FoolHeat = 0x0800, + /// <summary> + /// 甯歌鍦扮儹闈㈡澘 + /// </summary> + FoolHeatPanel = 0x0801, + /// <summary> + /// 鏂伴绯荤粺 + /// </summary> + FreshAir = 0x1300, + + + /// <summary> + /// 鏃犵嚎缃戝叧 + /// </summary> + OnePortWirelessFR = 0xFE01, + OnePortBus = 0xFE00, + RCU = 0xFE04, + SuperWireless = 0xFE05, + DMX48 = 0xFD04, + /// <summary> + /// 鎸夐敭闈㈡澘 + /// </summary> + ButtonPanel = 0x0401, + + /// <summary> + /// 骞叉帴鐐� + /// </summary> + DryContact = 0x0400, + + /// <summary> + /// 姣涚粏琛�绠$┖璋� + /// </summary> + Thermostat = 0x0705, + + //WirelessNetManage = 0x1D34, + MusicModel = 0x0900, + MusicPanel = 0x0902, + MusicA31 = 0x0903, + + InfraredMode = 0x0300, + A31MusicModel = 0x0901, + + InfraredTV = 0x0305, + InfraredSTB = 0x0303, + InfraredProjetor = 0x0301, + + /// <summary> + /// 瀹夐槻妯″潡 + /// </summary> + SecurityModule = 0x0A00, + /// <summary> + /// 瀹夐槻闈㈡澘 + /// </summary> + SecurityPanel = 0x0A02, + + /// <summary> + /// 椋庢墖妯″潡 + /// </summary> + FanModule = 0x1000, + + /// <summary> + /// 閫昏緫鎺у埗妯″潡 + /// </summary> + LogicModule = 0x0C00, + + /// <summary> + /// 閫氱敤寮�鍏� + /// </summary> + UniversalDevice = 0x6400, + + + DoorLock = 0x1203, + + /// <summary> + /// The sensor. + /// </summary> + Sensor = 0x0500, + /// <summary> + /// 绉诲姩鎺㈡祴锛�01锛� + /// </summary> + SensorMobileDetection = 0x0501, + /// <summary> + /// 娓╁害 + /// </summary> + SensorTemperature = 0x0502, + /// <summary> + /// 婀垮害 + /// </summary> + SensorHumidity = 0x0503, + /// <summary> + /// 鍏夌収 + /// </summary> + SensorIllumination =0x0504, + /// <summary> + /// VOC锛�05锛� + /// </summary> + SensorTVOC = 0x0505, + /// <summary> + /// The sensor PM 25. + /// </summary> + SensorPM25 = 0x0506, + /// <summary> + /// The sensor CO2. + /// </summary> + SensorCO2 = 0x0507, + /// <summary> + /// 娑插寲鐭虫补姘旓紙LPG锛夛紙08锛� + /// </summary> + SensorLPG = 0x0508, + /// <summary> + /// 浜哄伐鐓ゆ皵锛圕O锛孒2锛夛紙09锛� + /// </summary> + SensorCOH2 = 0x0509, + /// <summary> + /// 澶╃劧姘旓紙CH4锛夛紙10锛� + /// </summary> + SensorCH4 = 0x0510, + /// <summary> + /// 鐑熼浘锛�11锛� + /// </summary> + SensorSmoke = 0x0511, + /// <summary> + /// 椋庨�燂紙12锛� + /// </summary> + SensorWindSpeed = 0x0512, + /// <summary> + /// 椋庡帇锛�13锛� + /// </summary> + SensorWindPressure = 0x0513, + /// <summary> + /// 娑蹭綋娴侀噺锛�14锛� + /// </summary> + SensorLiquidFlow = 0x0514, + /// <summary> + /// 娑蹭綋鍘嬪姏锛�15锛� + /// </summary> + SensorLiquidPressure = 0x0515, + /// <summary> + /// 娑蹭綋娣卞害锛�16锛� + /// </summary> + SensorLiquidDepth = 0x0516, + /// <summary> + /// 闆ㄩ噺锛�17锛� + /// </summary> + SensorRainfall = 0x0517, + /// <summary> + /// 閲嶉噺 + /// </summary> + SensorWeight = 0x0518, + /// <summary> + /// 楂樺害/闀垮害 + /// </summary> + SensorHeightLength = 0x0519, + /// <summary> + /// 鐗╀綋閫熷害锛�20锛� + /// </summary> + SensorVelocity = 0x0520, + /// <summary> + /// 闇囧姩锛�21锛� + /// </summary> + SensorVibration = 0x0521, + /// <summary> + /// 鐢靛帇 + /// </summary> + SensorVoltage = 0x0522, + /// <summary> + /// 鐢垫祦 + /// </summary> + SensorCurrent = 0x0523, + /// <summary> + /// 鍔熺巼 + /// </summary> + SensorPower = 0x0524, + /// <summary> + /// 姘存蹈锛�25锛� + /// </summary> + SensorWater = 0x0525, + /// <summary> + /// 闂ㄧ銆佺獥纾侊紙26锛� + /// </summary> + SensorMenciAndwindowMagnetic = 0x0526, + + } + + /// <summary> + /// 鎿嶄綔鐮� + /// </summary> + public enum Command + { + /// <summary> + /// 璇诲彇妯℃嫙閲忓�� + /// </summary> + ReadAnalog = 0xE50A, + ReadAnalogACK = 0xE50B, + + #region 缁垮缓娓╂帶鍣ㄥ崗璁� + /// <summary> + /// 璇诲彇娓╂帶鍣ㄤ富鏈烘寚浠� + /// 鍙戦�� + /// 1 閫氶亾鍙� 1-255 + /// 鍥炲 + /// 1 閫氶亾鍙� + /// 2 寮�/鍏虫満 0--鍏� 1--寮� + /// 3 杩愯妯″紡 1-鍒跺喎锛�2-鍒剁儹锛�3-閫氶锛�4-闄ゆ箍锛�5-鍒剁儹闄ゆ箍 + /// 4 杩愯鍦烘櫙 1-鍦ㄥ锛�2-绂诲锛�3-鐫$湢 + /// 5 婀垮害妗d綅 1-浣庯紝2-涓紝3-楂橈紙鍙湪鍒剁儹妯″紡涓嬪彲浠ヨ缃級 + /// 6 婊ょ綉鐧惧垎姣� % + /// 7 娓╂帶鍣ㄥ垎鏈烘暟閲� 1-32 + /// 8-9 鏁呴殰淇℃伅1 + /// 10-11 鏁呴殰淇℃伅2 + /// 12-13 鏁呴殰淇℃伅3 + /// 14-15 鏁呴殰淇℃伅4 + /// 16-17 鏁呴殰淇℃伅5 + /// 18-19 鏁呴殰淇℃伅6 + /// 20-21 妯℃嫙閲忔縺娲讳綅 浠庝綆浣嶅紑濮嬶紝濡俥nable[0] 鐨刡it0--->瀹ゅ唴娓╁害 + /// 22-25 妯℃嫙閲�1锛坆it0锛夊鍐呮俯搴� 娴偣鍨嬫暟鎹� IEEE 754娴偣鏁� + /// 26-29 妯℃嫙閲�2锛坆it1锛夊鍐呮箍搴� 娴偣鍨嬫暟鎹� 0-100 % IEEE 754娴偣鏁� + /// 30-33 妯℃嫙閲�3锛坆it2锛夊鍐匔O2 娴偣鍨嬫暟鎹� PPM IEEE 754娴偣鏁� + /// 34-37 妯℃嫙閲�4锛坆it3锛夊鍐匱VOC 娴偣鍨嬫暟鎹� 绾� IEEE 754娴偣鏁� + /// 38-41 妯℃嫙閲�5锛坆it4锛夊鍐匬M2.5 娴偣鍨嬫暟鎹� PPM IEEE 754娴偣鏁� + /// 42-45 妯℃嫙閲�6锛坆it5锛夊澶栨俯搴� 娴偣鍨嬫暟鎹� IEEE 754娴偣鏁� + /// 46-49 妯℃嫙閲�7锛坆it6锛夊澶栨箍搴� 娴偣鍨嬫暟鎹� 0-100 % IEEE 754娴偣鏁� + /// 50-53 妯℃嫙閲�8锛坆it7锛夊澶朠M2.5 娴偣鍨嬫暟鎹� PPM IEEE 754娴偣鏁� + /// </summary> + ReadThermostatHost = 0x8099, + ReadThermostatHostACK = 0x809A, + + /// <summary> + /// 鎺у埗娓╂帶鍣ㄤ富鏈烘寚浠� + /// 鍙戦�� + /// 1 閫氶亾鍙� + /// 2 寮�/鍏虫満 0--鍏� 1--寮� + /// 3 杩愯妯″紡 1-鍒跺喎锛�2-鍒剁儹锛�3-閫氶锛�4-闄ゆ箍锛�5-鍒剁儹闄ゆ箍 + /// 4 杩愯鍦烘櫙 1-鍦ㄥ锛�2-绂诲锛�3-鐫$湢 + /// 5 婀垮害妗d綅 1-浣庯紝2-涓紝3-楂橈紙鍙湪鍒剁儹妯″紡涓嬪彲浠ヨ缃級 + /// 鍥炲 + /// 1 閫氶亾鍙� + /// 2 寮�/鍏虫満 0--鍏� 1--寮� + /// 3 杩愯妯″紡 1-鍒跺喎锛�2-鍒剁儹锛�3-閫氶锛�4-闄ゆ箍锛�5-鍒剁儹闄ゆ箍 + /// 4 杩愯鍦烘櫙 1-鍦ㄥ锛�2-绂诲锛�3-鐫$湢 + /// 5 婀垮害妗d綅 1-浣庯紝2-涓紝3-楂橈紙鍙湪鍒剁儹妯″紡涓嬪彲浠ヨ缃級 + /// 6 婊ょ綉鐧惧垎姣� % + /// 7 娓╂帶鍣ㄥ垎鏈烘暟閲� 1-32 + /// 8-9 鏁呴殰淇℃伅1 + /// 10-11 鏁呴殰淇℃伅2 + /// 12-13 鏁呴殰淇℃伅3 + /// 14-15 鏁呴殰淇℃伅4 + /// 16-17 鏁呴殰淇℃伅5 + /// 18-19 鏁呴殰淇℃伅6 + /// 20-21 妯℃嫙閲忔縺娲讳綅 浠庝綆浣嶅紑濮嬶紝濡俥nable[0] 鐨刡it0--->瀹ゅ唴娓╁害 + /// 22-25 妯℃嫙閲�1锛坆it0锛夊鍐呮俯搴� 娴偣鍨嬫暟鎹� IEEE 754娴偣鏁� + /// 26-29 妯℃嫙閲�2锛坆it1锛夊鍐呮箍搴� 娴偣鍨嬫暟鎹� 0-100 % IEEE 754娴偣鏁� + /// 30-33 妯℃嫙閲�3锛坆it2锛夊鍐匔O2 娴偣鍨嬫暟鎹� PPM IEEE 754娴偣鏁� + /// 34-37 妯℃嫙閲�4锛坆it3锛夊鍐匱VOC 娴偣鍨嬫暟鎹� 绾� IEEE 754娴偣鏁� + /// 38-41 妯℃嫙閲�5锛坆it4锛夊鍐匬M2.5 娴偣鍨嬫暟鎹� PPM IEEE 754娴偣鏁� + /// 42-45 妯℃嫙閲�6锛坆it5锛夊澶栨俯搴� 娴偣鍨嬫暟鎹� IEEE 754娴偣鏁� + /// 46-49 妯℃嫙閲�7锛坆it6锛夊澶栨箍搴� 娴偣鍨嬫暟鎹� 0-100 % IEEE 754娴偣鏁� + /// 50-53 妯℃嫙閲�8锛坆it7锛夊澶朠M2.5 娴偣鍨嬫暟鎹� PPM IEEE 754娴偣鏁� + /// </summary> + SetThermostatHost = 0x809B, + SetThermostatHostACK = 0x809C, + + + /// <summary> + /// 璇诲彇娓╂帶鍣ㄥ垎鏈烘寚浠� + /// 鍙戦�� + /// 1 閫氶亾鍙� 1-255 + /// 鍥炲 + /// 1 閫氶亾鍙� 1-255 + /// 2 娓╂帶鍣ㄥ紑/鍏虫満 0-鍏虫満锛�1-寮�鏈� + /// 3 妯℃嫙閲忔縺娲讳綅 浠庝綆浣嶅紑濮� 濡俠it0瀵瑰簲娓╂帶鍣ㄧ幆澧冩俯搴﹀�� + /// 4-7 娓╂帶鍣ㄧ幆澧冩俯搴﹀�� 娴偣鍨嬫暟鎹� 鈩� IEEE 754娴偣鏁� + /// 8-11 娓╂帶鍣ㄨ缃俯搴﹀�� 娴偣鍨嬫暟鎹� 鈩� IEEE 754娴偣鏁� + /// 12-15 娓╂帶鍣ㄧ幆澧冩箍搴﹀�� 娴偣鍨嬫暟鎹� % IEEE 754娴偣鏁� + /// 16-19 娓╂帶鍣ㄨ缃箍搴﹀�� 娴偣鍨嬫暟鎹� % IEEE 754娴偣鏁� + /// </summary> + ReadThermostatExtension = 0x809D, + ReadThermostatExtensionACK = 0x809E, + + + /// <summary> + /// 鎺у埗娓╂帶鍣ㄥ垎鏈烘寚浠� + /// 鍙戦�� + /// 1 閫氶亾鍙� 1-255 + /// 2 娓╂帶鍣ㄥ垎鏈哄紑/鍏虫満 0-鍏虫満锛�1-寮�鏈� + /// 3 妯℃嫙閲忔縺娲讳綅 浠庝綆浣嶅紑濮� 濡俠it0瀵瑰簲娓╂帶鍣ㄧ幆澧冩俯搴﹀�� + /// 4-7 娓╂帶鍣ㄥ垎鏈鸿缃俯搴﹀�� 娴偣鍨嬫暟鎹� 鈩� IEEE 754娴偣鏁� + /// 8-11 娓╂帶鍣ㄥ垎鏈烘箍搴﹀�� 娴偣鍨嬫暟鎹� % IEEE 754娴偣鏁� + /// 鍥炲 + /// 1 閫氶亾鍙� 1-255 + /// 2 娓╂帶鍣ㄥ紑/鍏虫満 0-鍏虫満锛�1-寮�鏈� + /// 3 妯℃嫙閲忔縺娲讳綅 浠庝綆浣嶅紑濮� 濡俠it0瀵瑰簲娓╂帶鍣ㄧ幆澧冩俯搴﹀�� + /// 4-7 娓╂帶鍣ㄧ幆澧冩俯搴﹀�� 娴偣鍨嬫暟鎹� 鈩� IEEE 754娴偣鏁� + /// 8-11 娓╂帶鍣ㄨ缃俯搴﹀�� 娴偣鍨嬫暟鎹� 鈩� IEEE 754娴偣鏁� + /// 12-15 娓╂帶鍣ㄧ幆澧冩箍搴﹀�� 娴偣鍨嬫暟鎹� % IEEE 754娴偣鏁� + /// 16-19 娓╂帶鍣ㄨ缃箍搴﹀�� 娴偣鍨嬫暟鎹� % IEEE 754娴偣鏁� + /// </summary> + SetThermostatExtension = 0x809F, + SetThermostatExtensionACK = 0x80A0, + + #endregion + /// <summary> + /// 璇诲彇闈㈡澘娓╁害绫诲瀷 + /// </summary> + ReadPanelTempType = 0xE120, + ReadPanelTempTypeACK = 0xE121, + + #region 姣呴潰鏉垮崗璁� + YIPanelName = 0x0010, + YIPanelDevice = 0x2F06, + YIPanelDeviceProperty = 0x2F00, + YIPanelDeviceInof = 0x2F02, + YIPanelDeviceInofACK = 0x2F03, + + YIPanelDeviceModify = 0x2F04, + YIPanelDeviceModifyACK = 0x2F05, + #endregion + + #region DALI CCT 鎺у埗 + //==================鍗曡矾鑹叉俯璋冭妭=========================//20190307 + Adjust_lamp_color_Temperature = 0x19DE, + //[0]//鐏彿 1-64 1BYTE + //[1]1鑹叉俯璋冨喎锛�2鑹叉俯璋冩殩锛� 1BYTE + Adjust_lamp_color_Temperature_ack = 0x19DF, //骞挎挱 + //[0]//鐏彿 1-64 1BYTE + //[1]1鑹叉俯璋冨喎锛�2鑹叉俯璋冩殩锛� 1BYTE + //==================鍗曡矾鑹叉俯鎺у埗=========================//20190307 + read_lamp_color_Temperature = 0x19E0 , + //[0]//鐏彿 1-64 1BYTE + read_lamp_color_Temperature_ack = 0x19E1 , + //[0]//鐏彿 1-64 1BYTE + //[1][2]//鑹叉俯鍊奸珮BYTE+鑹叉俯鍊间綆BYTE 0-0xFFFF 2BYTE + control_lamp_color_Temperature = 0x19E2, + //[0]//鐏彿 1-64 1BYTE + //[1][2]//鑹叉俯鍊奸珮BYTE+鑹叉俯鍊间綆BYTE 0-0xFFFF 2BYTE + control_lamp_color_Temperature_ack = 0x19E3, //骞挎挱 + //[0]//鐏彿 1-64 1BYTE + //[1][2]//鑹叉俯鍊奸珮BYTE+鑹叉俯鍊间綆BYTE 0-0xFFFF 2BYTE + #endregion + + #region 璞仼浼犳劅鍣ㄥ崗璁� + + /// <summary> + /// 淇敼閫氶亾澶� + /// 1 鐗╃悊閫氶亾鍙� 1-32锛堝叾浠栫墿鐞嗛�氶亾鍙锋棤鏁堬級 + /// 2 鐗╃悊閫氶亾鍙峰娉ㄧ1涓猙yte 0-255 + /// 3-20 ... 0-255 + /// 21 鐗╃悊閫氶亾鍙峰娉ㄧ20涓猙yte 0-255 + /// </summary> + UpdateHornLoopRemake = 0x1F6C, + /// <summary> + /// 1 鎴愬姛鎴栧け璐� 0xF8鎴�0xF5 + /// 2 鐗╃悊閫氶亾鍙� 1-32锛堝叾浠栫墿鐞嗛�氶亾鍙锋棤鏁堬級 + /// </summary> + UpdateHornLoopRemakeACK = 0x1F6D, + + /// <summary> + /// 璇诲彇寮�銆佸叧銆佹媶浣庣數閲忓搴旂殑鍙楁帶鐩爣閰嶇疆 + /// 1 鍔ㄤ綔绫诲瀷 1-128锛岃澶�1-32姣忎釜鏈�4绉嶅叧0銆佸紑1銆佹媶2銆佷綆鐢甸噺3鍒嗗埆瀵圭敤20涓彈鎺х洰鏍� + /// 渚嬪浼犳劅鍣ㄧ墿鐞嗛�氶亾鏄�1-32锛屼絾鏄墿鐞嗛�氶亾1鐨勪紶鎰熷櫒鍏崇殑鐩爣缂栧彿鏄�1锛屽紑鐨勬槸2锛屾媶鐨勬槸3锛岀墿鐞嗛�氶亾2鐨勪紶鎰熷櫒鍏崇殑鐩爣缂栧彿鏄�4锛屽紑鐨勬槸5锛屾媶鐨勬槸6 + /// 2 鐩爣搴忓彿 1-20 + /// </summary> + ReadHornTargetState = 0xE414, + /// <summary> + /// 1 鍥炲鎴愬姛,鎴栧け璐� 0xF8鎴�0xF5 + /// 2 鍔ㄤ綔绫诲瀷 1-128锛岃澶�1-32姣忎釜鏈�4绉嶅紑銆佸叧銆佹媶銆佷綆鐢甸噺鍒嗗埆瀵圭敤20涓彈鎺х洰鏍� + /// 3 鐩爣搴忓彿 1-20 + /// 4 绫诲瀷 鏃犳晥0銆� + /// 5 瀛愮綉ID + /// 6 璁惧ID + /// 7 鍙傛暟涓� + /// 8 鍙傛暟浜� + /// 9 鍙傛暟涓� + /// 10 鍙傛暟鍥� + /// </summary> + ReadHornTargetStateACK = 0xE415, + /// <summary> + /// 淇敼寮�銆佸叧銆佹媶銆佷綆鐢甸噺瀵瑰簲鐨勫彈鎺х洰鏍囬厤缃紙0xE416锛� + /// 鎿嶄綔鐮�: 0x E416 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:9 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 鍔ㄤ綔绫诲瀷 1-128锛岃澶�1-32姣忎釜鏈�4绉嶅紑銆佸叧銆佹媶銆佷綆鐢甸噺鍒嗗埆瀵圭敤20涓彈鎺х洰鏍� + /// 2 鐩爣搴忓彿 1-20 + /// 3 绫诲瀷 鏃犳晥0銆� + /// 4 瀛愮綉ID + /// 5 璁惧ID + /// 6 鍙傛暟涓� + /// 7 鍙傛暟浜� + /// 8 鍙傛暟涓� + /// 9 鍙傛暟鍥� + /// </summary> + SetHornTargetState = 0xE416, + /// <summary> + /// ACK淇敼寮�銆佸叧銆佹媶銆佷綆鐢甸噺瀵瑰簲鐨勫彈鎺х洰鏍囬厤缃紙0xE417锛� + /// 鎿嶄綔鐮�: 0x E417 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:3 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 鍥炲鎴愬姛, 鎴栧け璐� 0xF8鎴�0xF5 + /// 2 鍔ㄤ綔绫诲瀷 1-128锛岃澶�1-32姣忎釜鏈�4绉嶅紑銆佸叧銆佹媶銆佷綆鐢甸噺鍒嗗埆瀵圭敤20涓彈鎺х洰鏍� + /// 3 鐩爣搴忓彿 1-20 + /// </summary> + SetHornTargetStateACK = 0xE416, + + /// <summary> + /// 璇荤洰鏍囦娇鑳介厤缃� + /// 鎿嶄綔鐮�: 0x3571 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:2 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 鍔ㄤ綔绫诲瀷 璁惧0-31 / 255 杩斿洖鍏ㄩ儴 32 鍥炶矾鐨勪娇鑳借缃紝鍏�32 瀛楄妭 + /// </summary> + ReadHornTargetEnable = 0x3571, + /// <summary> + /// 璇荤洰鏍囦娇鑳介厤缃繑鍥� + /// 鎿嶄綔鐮�: 0x3572 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:2 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 鍔ㄤ綔绫诲瀷 璁惧0-31 / 255 杩斿洖鍏ㄩ儴 32 鍥炶矾鐨勪娇鑳借缃紝鍏�32 瀛楄妭 + /// 2 浣胯兘 0锛歞isabled 1锛歟nable + /// </summary> + ReadHornTargetEnableACK = 0x3572, + + /// <summary> + /// 鍐欑洰鏍囦娇鑳介厤缃� + /// 鎿嶄綔鐮�: 0x356f + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:2 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 鍔ㄤ綔绫诲瀷 璁惧0-31 + /// 2 浣胯兘 0锛歞isabled 1锛歟nable + /// </summary> + SetHornTargetEnable = 0x356f, + /// <summary> + /// 鍐欑洰鏍囦娇鑳介厤缃繑鍥� + /// 鎿嶄綔鐮�: 0x3570 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:2 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 鍔ㄤ綔绫诲瀷 璁惧0-31 + /// 2 鍥炲鎴愬姛, 鎴栧け璐� 0xF8鎴�0xF5 + /// </summary> + SetHornTargetEnableACK = 0x3570, + + /// <summary> + /// 璁惧鐘舵�佸箍鎾紙0x15D0锛� + /// 鎿嶄綔鐮�: 0x15D0 + /// 閫氳鏂瑰紡: 骞挎挱 + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:6 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 鍖哄彿 0-254 + /// 2 鐗╃悊閫氶亾鍙� 1-32锛堝叾浠栫墿鐞嗛�氶亾鍙锋棤鏁堬級 + /// 3 浼犳劅鍣ㄧ姸鎬� 鍏�0锛屽紑1锛屾媶2 锛屼綆鐢甸噺3锛屽績璺�4(4灏忔椂鍐呮病蹇冭烦灏辩绾夸簡) + /// 4 澶х被鍒� 0-255 + /// 5 灏忕被鍒� 0-255 + /// 6 閫昏緫閫氶亾鍙� 1-32锛堝叾浠栭�氶亾鍙锋棤鏁堬級锛屾寜鐗╃悊閫氶亾鍙锋帓搴忥紝姣忔娉ㄥ唽銆佸垹闄ら兘浼氶噸鏂版帓搴� + /// </summary> + //HornStateBroadcast = 0x15D0, + + /// <summary> + /// 璁惧鎶ヨ骞挎挱锛�0xF606锛� + /// 鎿嶄綔鐮�: 0xF606 + /// 閫氳鏂瑰紡: 骞挎挱 + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:7 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 鍖哄彿 0-254 + /// 2 鐗╃悊閫氶亾鍙� 1-32锛堝叾浠栫墿鐞嗛�氶亾鍙锋棤鏁堬級 + /// 3 鎶ヨ绫诲瀷楂樺瓧鑺� 0-255 + /// 4 鎶ヨ绫诲瀷浣庡瓧鑺� 0-255 + /// 5 澶х被鍒� 0-255 + /// 6 灏忕被鍒� 0-255 + /// 7 閫昏緫閫氶亾鍙� 1-32锛堝叾浠栭�氶亾鍙锋棤鏁堬級锛屾寜鐗╃悊閫氶亾鍙锋帓搴忥紝姣忔娉ㄥ唽銆佸垹闄ら兘浼氶噸鏂版帓搴� + /// ---------------------- + /// 鎶ヨ绫诲瀷琛� + /// 缂栧彿 鎶ヨ鍒嗙被 璇存槑 澶囨敞 + /// 1 寮�鍏虫姤璀� 闂ㄣ�佺獥銆佹煖瀛愩�佹娊灞夈�佷繚闄╂煖 銆� + /// 2 闂叆鎶ヨ 浜轰綋绉诲姩銆佺數瀛愭爡鏍� 浜轰綋绉诲姩绠椾竴涓姸鎬侊紝瀵逛簬鏄惁鎶ヨ瑕佺湅搴旂敤鍦烘櫙 + /// 3 娓╁害杩囬珮鎶ヨ 銆� 銆� + /// 4 娓╁害杩囦綆鎶ヨ 銆� 銆� + /// 5 婀垮害杩囦綆鎶ヨ 銆� 銆� + /// 6 婀垮害杩囬珮鎶ヨ 銆� 銆� + /// 7 楂樺帇鎶ヨ锛堢數鍘嬶級 銆� 銆� + /// 8 浣庡帇鎶ヨ锛堢數鍘嬶級 銆� 銆� + /// 9 杩囪浇鎶ヨ锛堢數娴侊級 鏆傚畾杩囪浇涓昏鏄數娴佽繃杞� 銆� + /// 10 姘村帇杩囬珮 銆� 銆� + /// 11 姘村帇杩囦綆 銆� 銆� + /// 12 娑蹭綅瓒呴檺 銆� 銆� + /// 13 娑蹭綅杩囦綆 銆� 銆� + /// 14 婕忔按鎶ヨ 銆� 銆� + /// 15 PM2.5瓒呴檺 銆� 銆� + /// 16 PM10瓒呴檺 銆� 銆� + /// 17 绱ф�ユ姤璀� 绱ф�ユ眰鍔╃瓑 銆� + /// 18 鐜荤拑鐮寸鎶ヨ 銆� 銆� + /// 19 CO鎶ヨ 銆� 銆� + /// 20 鐕冩皵鎶ヨ 鐭虫补娑插寲姘斻�佸ぉ鐒舵皵銆佺叅姘旂瓑閮藉彲浠ヤ娇鐢ㄧ噧姘旀姤璀� 銆� + /// 21 鐏伨鎶ヨ 銆� 銆� + /// 22 鐑熼浘鎶ヨ 銆� 銆� + /// 23 鍔寔鎶ヨ 銆� 銆� + /// 24 瀵嗙爜閿欒璀﹀憡 闂ㄩ攣銆丄PK绛� 銆� + /// 25 闃叉媶銆侀槻鎾姤璀� 閮ㄥ垎浼犳劅鍣ㄣ�侀棬閿佺瓑 銆� + /// 26 鎸囩汗閿欒鎶ヨ 銆� + /// 27 闂ㄦ湭閿佸ソ 鐘舵��/鎶ヨ鎺ㄩ�� + /// 28 鐢甸噺涓嶈冻鐘舵�� 鐢垫睜璁惧鐢甸噺杩囦綆 鐢甸噺涓嶈冻鐘舵��/鎶ヨ鎺ㄩ�� + /// </summary> + HornAlarmBroadcast = 0xF606, + + /// <summary> + /// 浣胯兘閫氶亾鎶ヨ + /// 鎿嶄綔鐮�: 0xE01C + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:2 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 鐗╃悊閫氶亾鍙� 1-32锛堝叾浠栫墿鐞嗛�氶亾鍙锋棤鏁堬級 + /// 2 鏄惁浣胯兘 255涓轰娇鑳斤紝0涓虹姝� + /// </summary> + //SetHornLoopAlarm = 0xE01C, + /// <summary> + /// ACK浣胯兘閫氶亾鎶ヨ锛�0xE01D锛� + /// 鎿嶄綔鐮�: 0xE01D + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:2 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 鐗╃悊閫氶亾鍙� 1-32锛堝叾浠栫墿鐞嗛�氶亾鍙锋棤鏁堬級 + /// 2 鏄惁浣胯兘 255涓轰娇鑳斤紝0涓虹姝� + /// </summary> + //SetHornLoopAlarmACK = 0xE01D, + + /// <summary> + /// 璇诲彇姝ら�氶亾鏄惁浣胯兘鎶ヨ锛�0xE018锛� + /// 鎿嶄綔鐮�: 0xE018 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 SetHornLoopAlarm + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:1 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 鐗╃悊閫氶亾鍙� 1-32锛堝叾浠栫墿鐞嗛�氶亾鍙锋棤鏁堬級 + /// </summary> + ReadHornLoopAlarm = 0xE018, + /// <summary> + /// ACK璇诲彇姝ら�氶亾鏄惁浣胯兘鎶ヨ锛�0xE019锛� + /// 鎿嶄綔鐮�: 0xE019 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:2 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 鐗╃悊閫氶亾鍙� 1-32锛堝叾浠栫墿鐞嗛�氶亾鍙锋棤鏁堬級 + /// 2 鏄惁浣胯兘 255涓轰娇鑳斤紝0涓虹姝� + /// </summary> + ReadHornLoopAlarmACK = 0xE019, + + /// <summary> + /// 5.1 鎺ㄩ�佷俊鎭缃� + /// 鎿嶄綔鐮�: 0x3569 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:6 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 鐗╃悊閫氶亾鍙� 0~31 + /// 2 棰勭暀 棰勭暀 + /// 3 浣胯兘璁剧疆 1锛歟nable 0:disable + /// 4 瀛愮綉ID 1 byte + /// 5 璁惧ID 1 byte + /// </summary> + SetHornPush = 0x3569, + /// <summary> + /// 5.2 鎺ㄩ�佷俊鎭缃繑鍥� + /// 鎿嶄綔鐮�: 0x356a + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:3 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 鐗╃悊閫氶亾鍙� 0~31 + /// 2 棰勭暀 棰勭暀 + /// 3 Status F8 / F5 + /// </summary> + SetHornPushACK = 0x356A, + + /// <summary> + /// 5.3 璇绘帹閫佷俊鎭缃� + /// 鎿嶄綔鐮�: 0x356b + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:2 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 鐗╃悊閫氶亾鍙� 0~31 + /// 2 棰勭暀 棰勭暀 + /// </summary> + ReadHornPush = 0x356b, + /// <summary> + /// 5.4 璇绘帹閫佷俊鎭缃繑鍥� + /// 鎿嶄綔鐮�: 0x356c + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:5 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 鐗╃悊閫氶亾鍙� 0~31 + /// 2 棰勭暀 棰勭暀 + /// 3 浣胯兘璁剧疆 1锛歟nable 0:disable + /// 4 瀛愮綉ID 1 byte + /// 5 璁惧ID 1 byte + /// </summary> + ReadHornPushACK = 0x356C, + + /// <summary> + /// 6.1 璇诲彇鍔ㄤ綔鍘嗗彶 + /// 鎿嶄綔鐮�: 0x356d + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:2 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 璁板綍搴忓彿 0~99鍏辩櫨鏉� / 255锛氳繑鍥炲叏閮� + /// </summary> + ReadHornHistory = 0x356d, + /// <summary> + /// 6.2璇诲彇鍔ㄤ綔鍘嗗彶杩斿洖 + /// 鎿嶄綔鐮�: 0x356e + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:8 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 璁板綍搴忓彿 0~99鍏辩櫨鏉� + /// 2 鐗╃悊閫氶亾鍙� 0~31 + /// 3 鍔ㄤ綔绫诲埆 鍏�0锛屽紑1锛屾媶2 锛屼綆鐢甸噺3 + /// 4 骞� 鑼冨洿锛氬叕鍏冨勾涓�2000鐨勫樊 + /// 5 鏈� 0 - 11 + /// 6 鏃� 0 - 30 + /// 7 鏃� 0 - 23 + /// 8 鍒� 0 - 59 + /// </summary> + ReadHornHistoryACK = 0x356e, + + /// <summary> + /// The read horn loop count. + /// </summary> + ReadHornLoopCount = 0xE510, + /// <summary> + /// 鍥炲璁惧鎬绘暟 + /// </summary> + ReadHornLoopCountACK = 0xE511, + + /// <summary> + /// 璇诲彇璁惧鐘舵�佹儏鍐� + /// 鎿嶄綔鐮�:0xE512 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 :3 + /// 闄勫姞鏁版嵁闀垮害: + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 璁惧鎬绘暟 1-N + /// 2 寮�濮嬭鍙栬澶囧湴鍧� 1-N + /// 3 璇诲彇澶氬皯涓� 1-16 + /// </summary> + ReadHornLoopsStatus = 0xE512, + /// <summary> + /// 渚濇璇诲彇璁惧鐘舵�佹儏鍐佃繑鍥� + /// 鎿嶄綔鐮�:0xE513 + /// 閫氳鏂瑰紡: 骞挎挱 + /// 瀛愮綉ID鑼冨洿:255 璁惧ID鑼冨洿: 255 + /// 闄勫姞鏁版嵁鍐呭 :3 + N * 4锛圢璁惧鎬绘暟锛� + /// 闄勫姞鏁版嵁闀垮害: + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 璁惧鎬绘暟 1-N + /// 2 寮�濮嬭鍙栬澶囧湴鍧� 1-N + /// 3 璇诲彇澶氬皯涓� 1-16 + /// 4 绗竴涓澶囧ぇ绫� + /// 5 绗竴涓澶囧皬绫� + /// 6 绗竴涓澶囬�氶亾鍙� + /// 7 绗竴涓澶囩姸鎬� 0锛氱绾匡紝鍏朵粬棰勭暀 1锛氬湪绾� + /// 8 绗簩涓澶囧ぇ绫� + /// 9 绗簩涓澶囧皬绫� + /// 10 绗簩涓澶囬�氶亾鍙� + /// ... 绗簩涓澶囩姸鎬� 0锛氱绾匡紝鍏朵粬棰勭暀 1锛氬湪绾� + /// </summary> + ReadHornLoopsStatusACK = 0xE513, + #endregion + + #region 娴峰浼犳劅鍣ㄥ崗璁� + /// <summary> + /// 2.1璁剧疆鐩爣缁勫娉� + /// 鎿嶄綔鐮�: 0x3532 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:22 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 绫诲瀷 + /// 1.PM2.5 0 + /// 2.CO2娴撳害 1 + /// 3.TVOC娴撳害 2 + /// 4. 娓╁害 3 + /// 5. 婀垮害 4 + /// 2 Level Level: 0 ~ 7 姣忎竴绾у埆瀵瑰簲涓嬮潰鐨勭粍澶囨敞 + /// 3 浼犳劅鍣ㄧ洰鏍囩粍澶囨敞0 0 ~ 255 + /// 22 浼犳劅鍣ㄧ洰鏍囩粍澶囨敞19 0 ~ 255 + /// </summary> + SetSensorTargetRemark = 0x3532, + /// <summary> + /// 1 瀛樺偍鐘舵�� 0xf8 / 0xf5 /0xf1 瀛樺偍澶辫触 + /// </summary> + SetSensorTargetRemarkACK = 0x3533, + + /// <summary> + /// 2.3璇诲彇鐩爣缁勫娉� + /// 鎿嶄綔鐮�: 0x3534 + /// 闄勫姞鏁版嵁闀垮害:2 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 绫诲瀷 + /// 1.PM2.5 0 + /// 2.CO2娴撳害 1 + /// 3.TVOC娴撳害 2 + /// 4. 娓╁害 3 + /// 5. 婀垮害 4 + /// 2 Level Level: 0 ~ 7 姣忎竴绾у埆瀵瑰簲涓嬮潰鐨勭粍澶囨敞 + /// </summary> + ReadSensorTargetRemark = 0x3534, + /// <summary> + /// 2.4璇诲彇鐩爣缁勫娉� + /// 鎿嶄綔鐮�: 0x3535 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 绫诲瀷 + /// 1.PM2.5 0 + /// 2.CO2娴撳害 1 + /// 3.TVOC娴撳害 2 + /// 4. 娓╁害 3 + /// 5. 婀垮害 4 + /// 2 Level Level: 0 ~ 7 姣忎竴绾у埆瀵瑰簲涓嬮潰鐨勭粍澶囨敞 + /// 3 浼犳劅鍣ㄧ洰鏍囩粍澶囨敞0 0 ~ 255 + /// 22 浼犳劅鍣ㄧ洰鏍囩粍澶囨敞19 0 ~ 255 + /// </summary> + ReadSensorTargetRemarkACK = 0x3535, + /// <summary> + /// 6.3 璇诲彇鐩爣璁剧疆 + /// 鎿嶄綔鐮�: 0x3543 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:3 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 绫诲瀷 + /// 1.PM2.5 0 + /// 2.CO2娴撳害 1 + /// 3.TVOC娴撳害 2 + /// 4.娓╁害 3 + /// 5.婀垮害 4 + /// 2 鐩爣绾у埆 Level: 0 ~ 7 姣忎竴绾у埆瀵逛笉鍚岀殑缁勮寖鍥� + /// 3 鐩爣搴忓彿 number 0~19 + /// </summary> + ReadSensorScence = 0x3543, + /// <summary> + /// 6.4 璇诲彇鐩爣璁剧疆杩斿洖 + /// 鎿嶄綔鐮�: 0x3544 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:10 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 绫诲瀷 + /// 1 PM2.5 0 + /// 2 CO2娴撳害 1 + /// 3 TVOC娴撳害 2 + /// 4 娓╁害 3 + /// 5 婀垮害 4 + /// 2 鐩爣绾у埆 Level: 0 ~ 7 姣忎竴绾у埆瀵逛笉鍚岀殑缁勮寖鍥� + /// 3 鐩爣搴忓彿 number 0~19 + /// 4 銆� Control_kind 鎺у埗绫诲瀷 + /// 5 銆� Control_sub_net 瀛愮綉鍙� + /// 6 銆� Control_dev 璁惧鍙� + /// 7 銆� Control_fenqu 鍥炶矾鍙� + /// 8 銆� Control_changjing + /// 9 銆� Control_minute鈥攕ingal_adj + /// 10 銆� Control_second鈥攕ingal_adj + /// </summary> + ReadSensorScenceACK = 0x3544, + /// <summary> + /// 6.4 璇诲彇鐩爣璁剧疆杩斿洖 + /// 鎿嶄綔鐮�: 0x3541 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:10 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 绫诲瀷 + /// 1 PM2.5 0 + /// 2 CO2娴撳害 1 + /// 3 TVOC娴撳害 2 + /// 4 娓╁害 3 + /// 5 婀垮害 4 + /// 2 鐩爣绾у埆 Level: 0 ~ 7 姣忎竴绾у埆瀵逛笉鍚岀殑缁勮寖鍥� + /// 3 鐩爣搴忓彿 number 0~19 + /// 4 銆� Control_kind + /// 5 銆� Control_sub_net + /// 6 銆� Control_dev + /// 7 銆� Control_fenqu + /// 8 銆� Control_changjing + /// 9 銆� Control_minute鈥攕ingal_adj + /// 10 銆� Control_second鈥攕ingal_adj + /// </summary> + SetSensorScence = 0x3541, + /// <summary> + /// 6.3 璇诲彇鐩爣璁剧疆 + /// 鎿嶄綔鐮�: 0x3542 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:3 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 绫诲瀷 + /// 1.PM2.5 0 + /// 2.CO2娴撳害 1 + /// 3.TVOC娴撳害 2 + /// 4.娓╁害 3 + /// 5.婀垮害 4 + /// 2 鐩爣绾у埆 Level: 0 ~ 7 姣忎竴绾у埆瀵逛笉鍚岀殑缁勮寖鍥� + /// 3 鐩爣搴忓彿 number 0~19 + /// </summary> + SetSensorScenceACK = 0x3542, + + + + /// <summary> + /// 璁剧疆鐩爣鑼冨洿 + /// 闄勫姞鏁版嵁闀垮害:6 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 绫诲瀷 + /// 1.PM2.5 0 ug/m3 鑼冨洿 0锝�999ug/m3 + /// 2.CO2娴撳害 1 ppm 400锝�5000ppm + /// 3.TVOC娴撳害 2 0.01mg/m3 0.22锝�9.99mg/m3 + /// 4.娓╁害 3 0.1鈩� 鑼冨洿 -40鈩冿綖125鈩冿紙璐熸暟涓烘渶楂樹綅缃�1锛� + /// 5.婀垮害 4 0.1%RH 鑼冨洿 0锝�100%RH + /// 2 绾у埆 Level: 0 ~ 7 姣忎竴绾у埆瀵瑰簲涓嬮潰鐨勭粍鑼冨洿 + /// 3 宸﹁竟鐣岄珮浣� + /// 4 宸﹁竟鐣屼綆浣� 宸﹁寖鍥磋灏忎簬鍙宠竟鐣� + /// 5 鍙宠竟鐣岄珮浣� + /// 6 鍙宠竟鐣屼綆浣� + /// </summary> + SetSensorPushValues = 0x3536, + /// <summary> + /// 璁剧疆鐩爣鑼冨洿杩斿洖 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:2 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 绫诲瀷 + /// 1.PM2.5 0 ug/m3 鑼冨洿 0锝�999ug/m3 + /// 2.CO2娴撳害 1 ppm 400锝�5000ppm + /// 3.TVOC娴撳害 2 0.01mg/m3 0.22锝�9.99mg/m3 + /// 4. 娓╁害 3 0.1鈩� 鑼冨洿 -40鈩冿綖125鈩冿紙璐熸暟涓烘渶楂樹綅缃�1锛� + /// 5. 婀垮害 4 0.1%RH 鑼冨洿 0锝�100%RH + /// 0xf5 澶辫触 + /// 2 绾у埆 Level: 0 ~ 7 + /// </summary> + SetSensorPushValuesACK = 0x3537, + /// <summary> + /// 璇诲彇鐩爣鑼冨洿 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:2 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 绫诲瀷 + /// 1.PM2.5 0 ug/m3 鑼冨洿 0锝�999ug/m3 + /// 2.CO2娴撳害 1 ppm 400锝�5000ppm + /// 3.TVOC娴撳害 2 0.01mg/m3 0.22锝�9.99mg/m3 + /// 4. 娓╁害 3 0.1鈩� 鑼冨洿 -40鈩冿綖125鈩冿紙璐熸暟涓烘渶楂樹綅缃�1锛� + /// 5. 婀垮害 4 0.1%RH 鑼冨洿 0锝�100%RH + /// 2 绾у埆 Level: 0 ~ 7 + /// </summary> + ReadSensorPushValues = 0x3538, + /// <summary> + /// 璇诲彇鐩爣鑼冨洿杩斿洖 + /// 闄勫姞鏁版嵁闀垮害:6 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 绫诲瀷 + /// 1.PM2.5 0 ug/m3 鑼冨洿 0锝�999ug/m3 + /// 2.CO2娴撳害 1 ppm 400锝�5000ppm + /// 3.TVOC娴撳害 2 0.01mg/m3 0.22锝�9.99mg/m3 + /// 4. 娓╁害 3 0.1鈩� 鑼冨洿 -40鈩冿綖125鈩冿紙璐熸暟涓烘渶楂樹綅缃�1锛� + /// 5. 婀垮害 4 0.1%RH 鑼冨洿 0锝�100%RH + /// 0xf5 澶辫触 + /// 2 绾у埆 Level: 0 ~ 7 姣忎竴绾у埆瀵瑰簲涓嬮潰鐨勭粍鑼冨洿 + /// 3 宸﹁竟鐣岄珮浣� + /// 4 宸﹁竟鐣屼綆浣� 宸﹁寖鍥磋灏忎簬鍙宠竟鐣� + /// 5 鍙宠竟鐣岄珮浣� + /// 6 鍙宠竟鐣屼綆浣� + /// </summary> + ReadSensorPushValuesACK = 0x3539, + + /// <summary> + /// 璇诲彇浼犳劅鍣ㄥ巻鍙叉洸绾跨偣 + /// 1 搴忓彿 浼犳劅鍣ㄦ暟鎹褰曞簭鍙� + /// 1. 0~239 姣� 3 灏忔椂涓�娆★紝姣忓ぉ 8 娆★紝30澶╁叡240涓偣 + /// 2. 搴忓彿瓒婂皬鏁版嵁瓒婃柊 + /// </summary> + ReadSensorHistory = 0x353f, + /// <summary> + /// 璇诲彇浼犳劅鍣ㄥ巻鍙叉洸绾跨偣杩斿洖 + /// 闄勫姞鏁版嵁闀垮害:12 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 搴忓彿 浼犳劅鍣ㄦ暟鎹褰曞簭鍙� + /// 1. 0~239 姣� 3 灏忔椂涓�娆★紝姣忓ぉ 8 娆★紝30澶╁叡240涓偣 + /// 2. 搴忓彿瓒婂皬鏁版嵁瓒婃柊 + /// 3. / 0xf5 + /// 2 PM2.5楂樹綅 ug/m3 + /// 3 PM2.5浣庝綅 ug/m3 + /// 4 CO2娴撳害楂樹綅 ppm + /// 5 CO2娴撳害浣庝綅 ppm + /// 6 TVOC娴撳害楂樹綅 0.01mg/m3 + /// 7 TVOC娴撳害浣庝綅 0.01mg/m3 + /// 8 娓╁害 0.1鈩� + /// 9 婀垮害 0.1%RH + /// 10 鏈� 0~11 + /// 11 鏃� 0~30 + /// 12 鏃� 0~23 + /// </summary> + ReadSensorHistoryACK = 0x3540, + + /// <summary> + /// 8.1 鎺ㄩ�佷俊鎭缃� + /// 鎿嶄綔鐮�: 0x3565 + /// 闄勫姞鏁版嵁闀垮害:6 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 绫诲瀷 + /// 1.PM2.5 0 + /// 2.CO2娴撳害 1 + /// 3.TVOC娴撳害 2 + /// 4.娓╁害 3 + /// 5.婀垮害 4 + /// 2 閫氶亾鍙� 棰勭暀锛岃繖閲屽彧鏈変竴涓�氶亾 + /// 3 鐩爣绾у埆 Level: 0 ~ 7 姣忎竴绾у埆瀵逛笉鍚岀殑缁勮寖鍥� + /// 4 浣胯兘璁剧疆 1锛歟nable 0:disable + /// 5 瀛愮綉ID 1 byte + /// 6 璁惧ID 1 byte + /// </summary> + SetSensorPushMessage = 0x3565, + /// <summary> + /// 8.2 鎺ㄩ�佷俊鎭缃繑鍥� + /// 鎿嶄綔鐮�: 0x3566 + /// 闄勫姞鏁版嵁闀垮害:4 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 绫诲瀷 + /// 1.PM2.5 0 + /// 2.CO2娴撳害 1 + /// 3.TVOC娴撳害 2 + /// 4.娓╁害 3 + /// 5.婀垮害 4 + /// 2 閫氶亾鍙� 棰勭暀锛岃繖閲屽彧鏈変竴涓�氶亾 + /// 3 鐩爣绾у埆 Level: 0 ~ 7 姣忎竴绾у埆瀵逛笉鍚岀殑缁勮寖鍥� + /// 4 Status F8(success) / F5 + /// </summary> + SetSensorPushMessageACK = 0x3566, + /// <summary> + /// 璇绘帹閫佷俊鎭� + /// 闄勫姞鏁版嵁闀垮害:3 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 绫诲瀷 + /// 1.PM2.5 0 + /// 2.CO2娴撳害 1 + /// 3.TVOC娴撳害 2 + /// 4.娓╁害 3 + /// 5.婀垮害 4 + /// 2 閫氶亾鍙� 棰勭暀锛岃繖閲屽彧鏈変竴涓�氶亾 + /// 3 鐩爣绾у埆 + /// Level: 0 ~ 7 姣忎竴绾у埆瀵逛笉鍚岀殑缁勮寖鍥� + /// 娉細褰撳�间负255鏃讹紝杩斿洖8涓瓑绾х殑鏁版嵁 + /// </summary> + ReadSensorPushMessage = 0x3567, + /// <summary> + /// 8.4 璇绘帹閫佷俊鎭繑鍥� + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 绫诲瀷 + /// 1.PM2.5 0 + /// 2.CO2娴撳害 1 + /// 3.TVOC娴撳害 2 + /// 4.娓╁害 3 + /// 5.婀垮害 4 + /// 2 閫氶亾鍙� 棰勭暀锛岃繖閲屽彧鏈変竴涓�氶亾 + /// 3 鐩爣绾у埆 Level: 0 ~ 7 姣忎竴绾у埆瀵逛笉鍚岀殑缁勮寖鍥� + /// 娉細褰撳�间负255鏃讹紝杩斿洖8涓瓑绾х殑鏁版嵁 + /// 鏁版嵁绱姞 + /// 浣胯兘浣嶇疆锛屽瓙缃慖D锛岃澶嘔D + /// 4 浣胯兘璁剧疆 1锛歟nable 0:disable + /// 5 瀛愮綉ID 1 byte + /// 6 璁惧ID 1 byte + /// </summary> + ReadSensorPushMessageACK = 0x3568, + + /// <summary> + /// 9.3璇诲彇閫昏緫鍙蜂娇鑳借缃� + /// 鎿嶄綔鐮�: 0x3575 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:0 + /// </summary> + ReadSensorAutomationEnableList = 0x3575, + /// <summary> + /// 9.4璇诲彇閫昏緫鍙蜂娇鑳借缃繑鍥� + /// 鎿嶄綔鐮�: 0x3576 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:40 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 浣胯兘涓庡惎鐢� + /// 0锛歞elete锛� + /// 1锛歟nable锛� + /// 2锛歶nused + /// ... ... ... + /// 40 浣胯兘涓庡惎鐢� + /// 0锛歞elete锛� + /// 1锛歟nable锛� + /// 2锛歶nused + /// </summary> + ReadSensorAutomationEnableListACK = 0x3576, + + /// <summary> + /// 9.1鍐欓�昏緫鍙蜂娇鑳借缃� + /// 鎿嶄綔鐮�: 0x3573 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:40 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 浣胯兘涓庡惎鐢� + /// 0锛歞elete锛� + /// 1锛歟nable锛� + /// 2锛歶nused + /// ... ... ... + /// 40 浣胯兘涓庡惎鐢� + /// 0锛歞elete锛� + /// 1锛歟nable锛� + /// 2锛歶nused + /// </summary> + SetSensorAutomationEnableList = 0x3573, + /// <summary> + /// 闄勫姞鏁版嵁闀垮害: 1 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 Status 0xf8 / 0xf5 + /// </summary> + SetSensorAutomationEnableListACK = 0x3574, + + /// <summary> + /// 10. 1鍐� ID璁剧疆 + /// 鎿嶄綔鐮�: 0x3577 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:40 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 ID + /// ... ... ... + /// 40 ID + /// </summary> + SetSensorAutomationListID = 0x3577, + /// <summary> + /// 10.2鍐� ID璁剧疆杩斿洖 + /// 鎿嶄綔鐮�: 0x3578 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害: 1 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 Status 0xf8 / 0xf5 + /// </summary> + SetSensorAutomationListIDACK = 0x3578, + + /// <summary> + /// 10.3璇诲彇ID璁剧疆 + /// 鎿嶄綔鐮�: 0x3579 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:0 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// </summary> + ReadSensorAutomationListID = 0x3579, + /// <summary> + /// 10.4璇诲彇ID璁剧疆杩斿洖 + /// 鎿嶄綔鐮�: 0x357a + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:40 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 ID + /// ... ... ... + /// 40 ID + /// </summary> + ReadSensorAutomationListIDACK = 0x357a, + + /// <summary> + /// 11. 1鍐� 浼犳劅鍣ㄧ被鍨嬫潯浠朵娇鑳� 璁剧疆 + /// 鎿嶄綔鐮�: 0x357b + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:4 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 浼犳劅鍣ㄧ被鍨� + /// 1.PM2.5 0 + /// 2.CO2娴撳害 1 + /// 3.TVOC娴撳害 2 + /// 4.娓╁害 3 + /// 5.婀垮害 4 + /// 2 绗竴绾ч珮浣� Bit0:~Bit7 1:enable 0:disable + /// 3 绗竴绾т腑浣� Bit0:~Bit7 1:enable 0:disable + /// 4 绗竴绾т綆浣� Bit0:~Bit7 1:enable 0:disable + /// ... ... ... + /// 23 绗叓绾ч珮浣� Bit0:~Bit7 1:enable 0:disable + /// 24 绗叓绾т腑浣� Bit0:~Bit7 1:enable 0:disable + /// 25 绗叓绾т綆浣� Bit0:~Bit7 1:enable 0:disable + /// </summary> + SetSensorAutomationTargetLevelEnable = 0x357b, + /// <summary> + /// 11.2鍐欎紶鎰熷櫒绫诲瀷鏉′欢浣胯兘 璁剧疆杩斿洖 + /// 鎿嶄綔鐮�: 0x357c + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害: 2 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 浼犳劅鍣ㄧ被鍨� + /// 1.PM2.5 0 + /// 2.CO2娴撳害 1 + /// 3.TVOC娴撳害 2 + /// 4.娓╁害 3 + /// 5.婀垮害 4 + /// 2 Status 0xf8 / 0xf5 + /// </summary> + SetSensorAutomationTargetLevelEnableACK = 0x357c, + + + /// <summary> + /// 11.3璇诲彇鍗曟潯鐩爣鍛戒护浣胯兘 璁剧疆 + /// 鎿嶄綔鐮�: 0x357d + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:0 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 浼犳劅鍣ㄧ被鍨� + /// 1.PM2.5 0 + /// 2.CO2娴撳害 1 + /// 3.TVOC娴撳害 2 + /// 4.娓╁害 3 + /// 5.婀垮害 4 + /// </summary> + ReadSensorAutomationLevelTargetEnable = 0x357d, + /// <summary> + /// 11.4璇诲彇鍗曟潯鐩爣鍛戒护浣胯兘 璁剧疆杩斿洖 + /// 鎿嶄綔鐮�: 0x357e + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:40 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 浼犳劅鍣ㄧ被鍨� 1.PM2.5 0 + /// 2.CO2娴撳害 1 + /// 3.TVOC娴撳害 2 + /// 4.娓╁害 3 + /// 5.婀垮害 4 + /// 2 绗竴绾ч珮浣� Bit0:~Bit7 1:enable 0:disable + /// 3 绗竴绾т腑浣� Bit0:~Bit7 1:enable 0:disable + /// 4 绗竴绾т綆浣� Bit0:~Bit7 1:enable 0:disable + /// ... ... ... + /// 23 绗叓绾ч珮浣� Bit0:~Bit7 1:enable 0:disable + /// 24 绗叓绾т腑浣� Bit0:~Bit7 1:enable 0:disable + /// 25 绗叓绾т綆浣� Bit0:~Bit7 1:enable 0:disable + /// </summary> + ReadSensorAutomationLevelTargetEnableACK = 0x357e, + + + /// <summary> + /// 12. 1鍐欓珮绾ч�昏緫澶囨敞璁剧疆 + /// 鎿嶄綔鐮�: 0x357f + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:21 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 搴忓彿 0 ~ 39 + /// 2 澶囨敞 1 + /// 3 澶囨敞 2 + /// ... ... ... + /// 21 澶囨敞 20 + /// </summary> + SetSensorAutomationName = 0x357F, + /// <summary> + /// 12.2鍐欓珮绾ч�昏緫澶囨敞璁剧疆杩斿洖 + /// 鎿嶄綔鐮�: 0x3580 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害: 2 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 搴忓彿 0 ~ 39 + /// 2 Status 0xf8 / 0xf5 + /// </summary> + SetSensorAutomationNameACK = 0x3580, + + /// <summary> + /// 12.3璇婚珮绾ч�昏緫澶囨敞 璁剧疆 + /// 鎿嶄綔鐮�: 0x3581 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:1 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 搴忓彿 0 ~ 39 + /// </summary> + ReadSensorAutomationName = 0x3581, + /// <summary> + /// 12.4璇婚珮绾ч�昏緫澶囨敞璁剧疆杩斿洖 + /// 鎿嶄綔鐮�: 0x3582 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:21 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 搴忓彿 0 ~ 39 + /// 2 澶囨敞 1 + /// 3 澶囨敞 2 + /// ... ... ... + /// 21 澶囨敞 20 + /// </summary> + ReadSensorAutomationNameACK = 0x3582, + + + /// <summary> + /// 7.1鏃ュ巻閫昏緫璁剧疆 + /// 鎿嶄綔鐮�: 0x3561 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:16 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 绫诲瀷 + /// 1.PM2.5 0 + /// 2.CO2娴撳害 1 + /// 3.TVOC娴撳害 2 + /// 4.娓╁害 3 + /// 5.婀垮害 4 + /// 2 閫氶亾鍙� 棰勭暀锛岃繖閲屽彧鏈変竴涓�氶亾 + /// 3 鐩爣绾у埆 Level: 0 ~ 7 姣忎竴绾у埆瀵逛笉鍚岀殑缁勮寖鍥� + /// 娉細0绾т负宸� + /// 1.绾т负鑹� + /// 2 绾т负浼� + /// 4 閲嶅鍛ㄦ湡绫诲瀷 0锛氱郴缁� + /// 1锛氳嚜瀹氫箟 + /// 5 閲嶅鍛ㄦ湡璁剧疆 绯荤粺锛� + /// 0锛氬彧鎵ц涓�娆� + /// 1锛氭瘡澶╀竴娆� + /// 2锛氬伐浣滄棩 + /// 3锛氬懆鏈�, 闈炲伐浣滄棩 + /// 0xff 锛� 閲嶅鏃犳晥 + /// 鑷畾涔夛細 + /// 鍚敤绗� 6 涓猙yte 鏉ヨ嚜瀹氫箟涓�鍛ㄩ噷闈㈢殑閲嶅鏃堕棿 + /// 6 鑷畾涔夐噸澶嶅懆鏈� Bit0 - bit6 浠h〃鍛ㄦ棩鍒板懆鍏�( 1:涓洪�夊畾 0锛氫负鍙栨秷) 绗� 4 byte 涓� 1 鏃舵湁鏁� + /// 7 骞� 鑼冨洿锛氬叕鍏冨勾涓�2000鐨勫樊 + /// 8 鏈� 0 - 11 + /// 9 鏃� 0 - 30 + /// 10 鏃� 0 - 23 + /// 11 鍒� 0 - 59 + /// 12 骞� 鑼冨洿锛氬叕鍏冨勾涓�2000鐨勫樊 + /// 13 鏈� 0 - 11 + /// 14 鏃� 0 - 30 + /// 15 鏃� 0 - 23 + /// 16 鍒� 0 - 59 + /// </summary> + SetSensorAutomationDateTimeCycle = 0x3561, + /// <summary> + /// 7.2鏃ュ巻閫昏緫璁剧疆杩斿洖 + /// 鎿嶄綔鐮�: 0x3562 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:4 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 绫诲瀷 + /// 1.PM2.5 0 + /// 2.CO2娴撳害 1 + /// 3.TVOC娴撳害 2 + /// 4.娓╁害 3 + /// 5.婀垮害 4 + /// 2 閫氶亾鍙� 棰勭暀锛岃繖閲屽彧鏈変竴涓�氶亾 + /// 3 鐩爣绾у埆 Level: 0 ~ 7 姣忎竴绾у埆瀵逛笉鍚岀殑缁勮寖鍥� + /// 娉細0绾т负宸� + /// 1.绾т负鑹� + /// 2 绾т负浼� + /// 4 Status F8 / F5 + /// </summary> + SetSensorAutomationDateTimeCycleACK = 0x3562, + + /// <summary> + /// 7.3璇绘棩鍘嗛�昏緫 + /// 鎿嶄綔鐮�: 0x3563 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:3 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 绫诲瀷 + /// 1.PM2.5 0 + /// 2.CO2娴撳害 1 + /// 3.TVOC娴撳害 2 + /// 4.娓╁害 3 + /// 5.婀垮害 4 + /// 2 閫氶亾鍙� 棰勭暀锛岃繖閲屽彧鏈変竴涓�氶亾 + /// 3 鐩爣绾у埆 Level: 0 ~ 7 姣忎竴绾у埆瀵逛笉鍚岀殑缁勮寖鍥� + /// 娉細0绾т负宸� + /// 1.绾т负鑹� + /// 2 绾т负浼� + /// </summary> + ReadSensorAutomationDateTimeCycle = 0x3563, + /// <summary> + /// 7.4璇绘棩鍘嗛�昏緫杩斿洖 + /// 鎿嶄綔鐮�: 0x3564 + /// 閫氳鏂瑰紡: 鐐瑰鐐� + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害:16 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 绫诲瀷 + /// 1.PM2.5 0 + /// 2.CO2娴撳害 1 + /// 3.TVOC娴撳害 2 + /// 4.娓╁害 3 + /// 5.婀垮害 4 + /// 2 閫氶亾鍙� 棰勭暀锛岃繖閲屽彧鏈変竴涓�氶亾 + /// 3 鐩爣绾у埆 Level: 0 ~ 7 姣忎竴绾у埆瀵逛笉鍚岀殑缁勮寖鍥� + /// 娉細0绾т负宸� + /// 1.绾т负鑹� + /// 2 绾т负浼� + /// 4 閲嶅鍛ㄦ湡绫诲瀷 0锛氱郴缁� + /// 1锛氳嚜瀹氫箟 + /// 5 閲嶅鍛ㄦ湡璁剧疆 绯荤粺锛� + /// 0锛氬彧鎵ц涓�娆� + /// 1锛氭瘡澶╀竴娆� + /// 2锛氬伐浣滄棩 + /// 3锛氬懆鏈�, 闈炲伐浣滄棩 + /// 鑷畾涔夛細 + /// 鍚敤绗� 6 涓猙yte 鏉ヨ嚜瀹氫箟涓�鍛ㄩ噷闈㈢殑閲嶅鏃堕棿 + /// 6 鑷畾涔夐噸澶嶅懆鏈� Bit0 - bit6 浠h〃鍛ㄦ棩鍒板懆鍏�( 1:涓洪�夊畾 0锛氫负鍙栨秷) 绗� 4 byte 涓� 1 鏃舵湁鏁� + /// 7 骞� 鑼冨洿锛氬叕鍏冨勾涓�2000鐨勫樊 + /// 8 鏈� 0 - 11 + /// 9 鏃� 0 - 30 + /// 10 鏃� 0 - 23 + /// 11 鍒� 0 - 59 + /// 12 骞� 鑼冨洿锛氬叕鍏冨勾涓�2000鐨勫樊 + /// 13 鏈� 0 - 11 + /// 14 鏃� 0 - 30 + /// 15 鏃� 0 - 23 + /// 16 鍒� 0 - 59 + /// </summary> + ReadSensorAutomationDateTimeCycleACK = 0x3564, + + + + #endregion + + /// <summary> + /// 楂樼骇缃戝叧浜ゆ崲鏁版嵁浣跨敤 + /// </summary> + SuperGatewayAgent = 0xAEAE, + SuperGatewayAgentACK = 0xAEAF, + + + SonosControl = 0xAEB0, + SonosControlACK = 0xAEB1, + + LogicstateControl = 0xE014, + LogicstateControlACK = 0xE015, + + #region 鏂伴鍗忚 + //鏂伴鍗忚鎺у埗 + //闄勫姞鏁版嵁锛� 鏂伴閫氶亾鍙凤紙1 - 200锛� + 寮�鍏筹紙0锛�1锛� + 椋庨�燂紙0 鍏筹紝1浣庯紝2涓紝3楂橈級 + 妯″紡锛�0鎵嬪姩锛�1 鑷姩,2 鏅鸿兘锛�3 瀹氭椂锛� + FreshAirControl = 0x144A, + //杩斿洖锛氭柊椋庨�氶亾鍙凤紙1 - 200锛� + 寮�鍏筹紙0锛�1锛� + 椋庨�燂紙0 鍏筹紝1浣庯紝2涓紝3楂橈級 + 妯″紡锛�0鎵嬪姩锛�1 鑷姩,2 鏅鸿兘锛�3 瀹氭椂锛�+妯℃嫙閲忥紙2byte==16bit锛�+ + //瀹ゅ唴娓╁害(4byte) + 瀹ゅ娓╁害(4byte) + 瀹ゅ唴婀垮害(4byte)+ PM2.5(4byte) + TVOC(4byte) + CO2(4byte) + FreshAirControlACK = 0x144B, + + + //2.鏂伴鍗忚璇荤姸鎬� + //闄勫姞鏁版嵁锛� 鏂伴閫氶亾鍙凤紙1 - 200锛� + FreshAirRead = 0x144C, + //杩斿洖锛氭柊椋庨�氶亾鍙凤紙1 - 200锛� + 寮�鍏筹紙0锛�1锛� + 椋庨�燂紙0 鍏筹紝1浣庯紝2涓紝3楂橈級 + 妯″紡锛�0鎵嬪姩锛�1 鑷姩,2 鏅鸿兘锛�3 瀹氭椂锛� +妯℃嫙閲忥紙2byte==16bit锛�+ + //瀹ゅ唴娓╁害(4byte) + 瀹ゅ娓╁害(4byte) + 瀹ゅ唴婀垮害(4byte)+ PM2.5(4byte) + TVOC(4byte) + CO2(4byte) + FreshAirReadACK = 0x144D, + + + #endregion + + /// <summary> + /// 甯冮槻璁剧疆 + /// 闄勫姞鏁版嵁 + /// area 鍖哄煙鍙� + /// Armtype 甯冮槻绫诲瀷 + /// </summary> + SetArm = 0x0104, + /// <summary> + /// 甯冮槻璁剧疆ACK + /// 闄勫姞鏁版嵁 + /// area 鍖哄煙鍙� + /// Armtype 甯冮槻绫诲瀷 + /// </summary> + SetArmACK = 0x0105, + + /// <summary> + /// 璇诲彇甯冮槻鐘舵�� + /// 闄勫姞鏁版嵁 + /// area 鍖哄煙鍙� + /// </summary> + ReadArm = 0x011E, + /// <summary> + /// 甯冮槻璁剧疆ACK + /// 闄勫姞鏁版嵁 + /// area 鍖哄煙鍙� + /// Armtype 甯冮槻绫诲瀷 + /// </summary> + ReadArmACK = 0x011F, + + + /// <summary> + /// 0x0000 + /// 鏃犳晥鎸囦护 + /// </summary> + Invoid = 0x0000, + /// <summary> + /// 0x000E + /// 璇诲彇澶囨敞淇℃伅 + /// </summary> + ReadRemark = 0x000E, + /// <summary> + /// 0x000F + /// 璇诲彇澶囨敞淇℃伅鍙嶉 + /// </summary> + ReadRemarkACK = 0x000F, + /// <summary> + /// 0x0002 + /// 鍦烘櫙鎺ф淳 /// 鍖哄煙鍙凤紙1B锛夛紝銆愭槀鐗�?锛� + /// </summary> + SetScene = 0x0002, + /// <summary> + /// 0x0003 + /// 鍦烘櫙鎺у埗鍥炲 + /// 鍖哄煙鍙凤紙1B锛夛紝鍦烘櫙鍙凤紙1B锛夛紝鍥炶矾鏁帮紙1B锛�?鑺堟埧?鍒堝埡?薪鐢� n bit 浣嶈〃绀猴級n: 鍥炶矾涓暟 锛� + /// </summary> + SetSceneACK = 0x0003, + /// <summary> + /// 0x001A + /// 搴忓垪鎺у埗 + /// 鍖哄煙鍙凤紙1B锛夛紝搴忓垪鍙凤紙1B锛� + /// </summary> + SetSeries = 0x001A, + /// <summary> + /// 0x001B + /// 搴忓垪鎺у埗鍥炲 + /// 鍖哄煙鍙凤紙1B锛夛紝搴忓垪鍙凤紙1B锛� + /// </summary> + SetSeriesACK = 0x001B, + /// <summary> + /// 0xE01C + /// 閫氱敤寮�鍏虫帶鍒� + /// 寮�鍏冲彿锛�1B锛夛紝寮�鍏崇姸鎬侊紙1B锛夛紙0XFF锛氬紑锛�0锛氬叧锛� + /// </summary> + SetCommonSwitch = 0xE01C, + /// <summary> + /// 0xE01D + /// 閫氱敤寮�鍏虫帶鍒跺洖澶� + /// 寮�鍏冲彿锛�1B??鐘跺?锛夛紙1锛氬紑锛�0锛氬叧锛� + /// </summary> + SetCommonACK = 0xE01D, + + /// <summary> + /// 0xE3E4 + /// 骞�? /// 鍚勭獥甯樺埡?薪n B锛夛紙0:鍋滄锛�1锛氬紑锛�2锛氶棴n锛氫负绐楀笜涓暟 + /// </summary> + BroadcastCurtainStatus = 0xE3E4, + /// <summary> + /// 0x0031 + /// 璋冭妭鎺у埗 + /// 鍥炶矾鍙凤紙1B锛夛紝寮�鍏抽噺锛�1B锛�,0(鏃堕棿1),0(濂�? + /// </summary> + SetSingleLight = 0x0031, + /// <summary> + /// 0x0032 + /// 璋冭妭鎺у埗鍥炴垚 + /// 鍥炶矾鍙凤紙1B锛夛紝0XF8/0XF5(1B) 寮�鍏抽噺锛�1B锛�, + /// 鍥炶矾鏁帮紙1B锛夛紝鍥炶矾寮�鍏崇姸鎬侊紙 鐢� n bit 浣嶈〃绀猴級 + /// n: 鍥炶矾涓暟 锛�0XF8:鎴愬姛锛�0XF5锛氬け璐� + /// </summary> + SetSingleLightACK = 0x0032, + /// <summary> + /// 0x0033 + /// 鍗曡矾璋冭妭璇诲彇鐘舵�� + /// 鍥炶矾鏁帮紙1B锛夛紝鍚勫洖璺紑鍏抽噺锛� n B锛� + /// </summary> + ReadLightEquipmentAllLoopBrightness = 0x0033, + /// <summary> + /// 0x0034 + /// 鍗曡矾璋冭妭璇诲彇鐘舵�佸洖澶� + /// 1byte锛堝洖璺�绘暟锛塶byte(姣忎釜瀛楄妭琛ㄧず瀵瑰簲鍥炶矾鐨勪寒搴�0-100) + /// </summary> + ReadLightEquipmentAllLoopBrightnessACK = 0x0034, + + /// <summary> + /// 璇诲彇鑳芥簮寮�鍏冲姛鐜� + /// [0](bit0-bit5) 2: 鐢靛帇 3: 鐢垫祦 10锛氬姛鐜� 11锛氱數鑳� (BIT 6-7 0:2bytes 1:1bytes 2:4bytes) + /// [1] 閫氶亾 + /// </summary> + ReadAnalogValue = 0xE440, + /// <summary> + /// [0](bit0-bit5) 2: 鐢靛帇 3: 鐢垫祦 10锛氬姛鐜� (2byte) === 11锛氱數鑳� (4byte) + /// [1] 閫氶亾 + /// [2] 妯℃嫙閲廐1 鐢靛帇鍊� 0.1V,鐢垫祦0.001,鍔熺巼1W + /// [3] 妯℃嫙閲廐2 + /// [4] 妯℃嫙閲廐3 + /// [5] 妯℃嫙閲廐4 鐢甸噺0.1搴︾數 + /// </summary> + ReadAnalogValueACK = 0xE441, + + + /// <summary> + /// 0x2142 + /// 瀵嗙爜璁よ瘉 + /// </summary> + SetHotelPassword = 0x2142, + /// <summary> + /// 0x2143 + /// 瀵嗙爜璁よ瘉杩斿洖 + /// </summary> + SetHotelPasswordACK = 0x2143, + /// <summary> + /// 0x2077 + /// 璇诲彇閰掑簵闂ㄩ搩鐘舵�� + /// 鏃犻檮鍔犳暟鎹� + /// </summary> + ReadHotelDoorState = 0x2077, + /// <summary> + /// 0x2078 + /// 鍙栭厭搴楅棬閾冪姸濉旈鎴� + /// _ROOM_DOORBELL_STATUS_READ_ACK 0x2078 //ACK Read doorbell status + /// doorbell status(1byte)--1/0(on/off)--bit0(wait)-bit1(disturb)-bit2(clean)-bit3(number)-bit4(bell),bit5(RF) + /// Total: 1byte + /// </summary> + ReadHotelDoorStateACK = 0x2078, + /// <summary> + /// 0x209B + /// 闂ㄩ搩鐘舵�佸箍鎾� + /// _ROOM_TOUCH_CONTROL_DATA_CMD 0x2142 //CMD Touch Control + /// hdlmac(8bytes) + /// Control_flag(1byte)---1(Enable)-2(Disable) + /// Password(2byte)---(Disable no need these bytes) + /// Total: 11bytes + /// </summary> + BroadcastHotelDoorState = 0x209B, + /// <summary> + /// 0x2079 + /// 闂ㄩ搩鐘舵�佹帶鍒� + /// _ROOM_DOORBELL_STATUS_SET_CMD 0x2079 //Set doorbell status + /// doorbell status(1byte) + /// Total: 1byte + /// </summary> + SetHotelDoorState = 0x2079, + /// <summary> + /// 0x207A + /// 闂ㄩ亜鍒�?鍒傚搧锠㈢姅 + /// _ROOM_DOORBELL_STATUS_SET_ACK 0x207A //ACK Set doorbell status + /// 0xf8/0xf5(1byte) + /// same_send_data(1byte) + /// Total: 2bytes + /// </summary> + SetHotelDoorStateACK = 0x207A, + /// <summary> + /// 0x2057 + /// 璇诲彇閰掑簵鎵�鏈夌姸鎬� + /// hdlma(8bytes) + /// </summary> + ReadHotelAllState = 0x2057, + /// <summary> + /// 0x2058 + /// 璇诲彇閰掑簵鎵�鏈夌姸鎬佸洖澶� + /// + /// _ROOM_STATUS_READ_ACK 0x2058 //ACK Read room_states + /// hdlmac(8bytes) + ///***Cancel***// Room_states(1byte)--bit0(check)-bit1(reserved),bit2-5(card type),bit6(stolen alarm)-bit7(help alarm) + /// Room_states(1byte)----0(empty),1(On Service),2(reserve),3(chickin),4(Out of Service)---(*new add 2012-10-15*) + /// Card_Type(1byte)---6 card type---(*new add 2012-10-15*) + /// Current_que_no(1byte)--0-34(set_que)-0xFF(user custom) + /// Doorbell_status(1byte)--bit0(wait)-bit1(disturb)-bit2(clean)-bit3(number)-bit4(bell),bit5(RF) + /// Alarm_flag(1byte)--bit0(checkout)-bit1(stolen)-bit2(sos)-bit3(door)-bit4(server01)-bit5(server02)-bit6(server03) + /// 48loop_level(48bytes)--(0-100) + /// Total: 61bytes + /// </summary> + ReadHotelAllStateACK = 0x2058, + /// <summary> + /// 0x20D2 + /// 閰掑簵涓绘満鎵�鏈夌姸鎬佸箍鎾� + /// </summary> + BroadcaseHotelAllState = 0x20D2, + /// <summary> + /// 0x2069 + /// 绐楀笜鎺у埗 + /// _ROOM_CURTAIN_STATUS_SET_ACK 0x206A //ACK Set curtain status + /// 0xf8/0xf5(1byte) + /// curtain_num(1byte) + /// curtain_staus(1byte) + /// curtain_Now_staus(1byte) + /// Total: 4bytes + /// </summary> + SetHotelCurtain = 0x2069, + /// <summary> + /// 0x206A + /// 鍌叉帶鍒跺洖璧嬪啑 /// _ROOM_CURTAIN_STATUS_SET_ACK 0x206A //ACK Set curtain status + /// 0xf8/0xf5(1byte) + /// curtain_num(1byte) + /// curtain_staus(1byte) + /// curtain_Now_staus(1byte) + /// Total: 4bytes + /// </summary> + SetHotelCurtainACK = 0x206A, + /// <summary> + /// 0x2063 + /// 璇诲彇绌鸿皟鐘舵�� + /// _ROOM_AIR_STATUS_READ_CMD 0x2063 //Read air staus + /// air No(1byte)--(1-4) + /// total: 1byte + /// </summary> + ReadHotelAC = 0x2063, + /// <summary> + /// 0x2064 + /// 璇诲彇閰掑簵涓绘満绌鸿皟鐘舵�佸洖澶� + /// HOTEL_ROOM_AIR_STATUS_READ_ACK 0x2064 //ACK Read air staus + ///*air No(1byte)--(1-4) + /// air on/off(1byte)--0(off)-1(on) + /// air cold temp(1byte)--(0~30"C)/(32~86"H) + /// air_control_mode(1byte)--(high 4bit)0(cold)-1(hot)-2(close)-3(auto)---(low 4bit)0(auto)-1(high)-2(middle)-3(low) + /// air panel lock flag(1byte)--0(unlock)-1(lock)---## + /// air temp(1byte)--(0~40"C)/(32~104"H) + /// air hot temp(1byte)--(0~30"C)/(32~86"H) + /// air_run_mode(1byte)--same_air_control_mode + /// air auto temp(1byte)--(0~30"C)/(32~86"H) + /// air_dry_temp(1byte)--(0~30"C)/(32~86"H) + /// air_wind_sweep(1byte)--(0~close)/(1~open) + /// Total: 11bytes + /// </summary> + ReadHotelACACK = 0x2064, + /// <summary> + /// 0x2065 + /// 鎺у埗閰掑簵涓绘満绌鸿皟 + /// * HOTEL_ROOM_AIR_STATUS_SET_CMD 0x2065 //Set air staus + /// air No(1byte)--(1-4) + /// air on/off(1byte)--0(off)-1(on) + /// air cold temp(1byte)--(0~30"C)/(32~86"H) + /// air_control_mode(1byte)--(high 4bit)-0(cold)-1(hot)-2(close)-3(auto)---(low 4bit)-0(auto)-1(high)-2(middle)-3(low) + /// air panel lock flag(1byte)--0(unlock)-1(lock)---## + /// air hot temp(1byte)--(0~30"C)/(32~86"H) + /// air auto temp(1byte)--(0~30"C)/(32~86"H) + /// air_dry_temp(1byte)--(0~30"C)/(32~86"H) + /// air_wind_sweep(1byte)--(0~close)/(1~open) + /// Total: 9bytes + /// </summary> + SetHotelAC = 0x2065, + /// <summary> + /// 0x2066 + /// 鎺у埗閰掑簵涓绘満绌鸿皟鍥炲 + /// HOTEL_ROOM_AIR_STATUS_SET_ACK 0x2066 //ACK Set air staus + /// 0xf8/0xf5(1byte) + /// same_send_data(9bytes) + /// Total: 10bytes + /// </summary> + SetHotelACACK = 0x2066, + /// <summary> + /// 璇诲彇绌鸿皟妯″潡鍛戒护 + /// 1绌鸿皟鍙�(1-128) + /// 0x1938 + /// </summary> + ReadACMode = 0x1938, + /// <summary> + /// 璇诲彇绌鸿皟妯″潡鍥炲 + /// 1绌鸿皟鍙�(1-128) + ///2娓╁害妯″紡(鎽勬皬Celsius:0锛屽崕姘廎ahrenheit:1) + ///3鐜娓╁害 (鎽勬皬0-40锛屽崕姘�32-99) + ///4鍒跺喎鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) + ///5鍒剁儹鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) + ///6杩�?鍒惰檻缂熼椀?锛屽崕姘�32-86) + ///7闄ゆ箍鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) + ///8妯″紡椋庨�熷疄闄呭伐浣滅姸鎬�, 楂�4bit妯″紡(0 鍒跺喎锛�1鍒剁儹锛�2閫氶锛�3鑷姩锛�4闄ゆ箍) 0xF1>>4 浣�4bit椋庨��(0 鑷姩锛�1楂�?椋庯紝3浣庨)0xF1&0x0F + ///9绌鸿皟寮�鍏� (1寮�0鍏�) + ///10璁剧疆妯″紡 0 璇�?鐑紝2閫氶锛�3鑷姩锛�4闄ゆ箍 + ///11璁剧疆椋庨�� 0 鑷姩锛�1楂橀锛�2涓?椋� + ///12宸ヤ綔妯″紡鎺у埗娓╁害 (鎽勬皬0-30锛屽崕姘�32-86) + ///13鎵妯″紡锛氶珮4bit(瀹為檯鎵鐘舵�侊細0涓嶆壂椋庯紝1鎵)锛屼綆4bit(璁剧疆鎵妯″墤?鎵锛�1鎵) + /// 0x1939 + /// </summary> + ReadACModeACK = 0x1939, + /// <summary> + /// 璁剧疆绌鸿皟妯″潡鍛戒护 + /// 1绌鸿皟鍙�(1-128) + ///2娓╁害妯″紡(鎽勬皬Celsius:0锛屽崕姘廎ahrenheit:1) + ///3鐜娓╁害 (鎽勬皬0-40锛屽崕姘�32-99) + ///4鍒跺喎鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) + ///5鍒剁儹鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) + ///6鑷姩鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) + ///7闄ゆ箍鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) + ///8妞掔饥鍋堝浣裤伔楂? 楂�4bit妯″紡(0 鍒跺喎锛�1鍒剁儹锛�2閫氶) 浣�4bit椋庨��(0 鑷姩锛�1楂橀?椋庯紝3浣庨) + ///9绌鸿皟寮�鍏� (1寮�0鍏�) + ///10璁剧疆妯″紡 0 鍒跺喎1鍒剁儹锛�2閫氶锛�3鑷姩锛�4闄ゆ箍 + ///11璁剧疆椋庨�� 0 鑷姩锛�1楂橀2涓锛�3浣庨 + ///12宸ヤ綔妯℃帶鍒舵俯鑲氭幃鎽勬皬0-30锛屽崕姘�32-86) + ///13鎵妯″紡锛氶珮4bit(瀹為檯鎵鐘舵�侊細0涓嶆壂椋庯紝1鎵)锛屼綆4bit(璁剧疆鎵妯″紡锛�0涓嶆壂椋庯紝1鎵) + /// 0x193A + /// </summary> + SetACMode = 0x193A, + /// <summary> + /// 璁剧疆绌鸿皟妯″潡鍛戒护鍥炲 + /// 1绌鸿皟鍙�(1-128) + ///2娓╁害妯″紡(鎽勬皬Celsius:0锛屽崕姘廎ahrenheit:1) + ///3鐜娓╁害 (鎽勬皬0-40锛屽崕姘�32-99) + ///4鍒跺喎鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) + ///5鍒剁儹鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) + ///6鑷姩鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) + ///7闄ゆ箍鎺у埗闇叉櫞鎽勬皬0-30锛屽崕姘�32-86) + ///8妯″紡椋庨�熷疄浣夸綔澹�? 楂�4bit妯″紡(0 ?榫�?椋庯紝3鑷姩锛�4闄ゆ箍) 浣�4bit椋庨��(0 鑷姩锛�1楂橀锛�2锜�?椋�) + ///9绌鸿皟寮�鍏� (1寮�0鍏�) + ///10璁剧疆妯″紡 0 鍒跺喎锛�1杩緥?椋庯紝3鑷姩锛�4闄ゆ箍 + ///11璁剧疆椋庨�� 0 鑷姩锛�1楂橀锛�2涓壕?椋� + ///12宸ヤ綔妯″紡鎺у埗娓╁害 (鎽勬皬0-30锛屽崕姘�32-86) + ///13鎵妯″紡锛�?it(瀹炲櫖菤缂卞埡?鎵锛�1鎵)锛屼綆4bit(璁剧疆鎵妯″紡锛�0绨氱壕?椋�) + /// 0x193B + /// </summary> + SetACModeACK = 0x193B, + + /// <summary> + /// 鍒嗛厤鍦板潃锛屼笉娓呯┖涔嬪墠鍒楄〃 + /// 鎿嶄綔鐮�: 0x13F4 + /// 閫氳鏂瑰紡: 骞挎挱 + /// 瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + /// 闄勫姞鏁版嵁鍐呭 + /// 闄勫姞鏁版嵁闀垮害: 7 + /// 缂栧彿 澶囨敞 鍊煎煙 + /// 1 鍙戦�佹暟鎹爣璇� 1=绗竴娆¤姹傚垎閰嶅湴鍧�锛�2 = 绗簩娆¤姹� || 0x11 鍒锋柊鍦板潃鍒楄〃 || 0x81 鍒犻櫎鍦板潃鍒楄〃 || 0xA1 璇诲彇鍦板潃鍒楄〃 + /// 2 闅忔満鏁帮紙棰勭暀锛� 0 - 255 + /// 3 闅忔満鏁帮紙棰勭暀锛� 0 鈥� 255 + /// 4 闅忔満鏁帮紙棰勭暀锛� 0 鈥� 255 + /// 5 闅忔満鏁帮紙棰勭暀锛� 0- 255 + /// 6 闅忔満鏁帮紙棰勭暀锛� 0- 255 + /// 7 闅忔満鏁帮紙棰勭暀锛� 0- 255 + /// 娉ㄦ剰锛氫笂浣嶆満闇�鍦�10s鍐呭彂閫佷袱娆¤姹傚懡浠わ紝绗竴娆″拰绗簩娆℃爣璇嗗垎娓咃紝浜ゆ崲鏈烘墠浼氭墽琛� + /// </summary> + AssignedAddress = 0x13F4, + AssignedAddressACK = 0x13F5, + + /// <summary> + /// 瀹氫綅璁惧 + /// E442,1D40瀹氫綅闈㈡澘 + /// </summary> + PositioningEquipment = 0xE442, + PositioningEquipmentACK = 0xE443, + PositioningPanel = 0x1D40, + PositioningPanelACK = 0X1D41, + + + /// <summary> + /// 鎼滅储鏃犵嚎缃戝叧鍜屼竴绔彛浜ゆ崲鏈� + /// </summary> + ReadGateway = 0xE54A, + ReadGatewayACK = 0xE54B, + + ReadGatewayProgrammingMode = 0x1400, + ReadGatewayProgrammingModeACK = 0x1401, + + + SetGateway = 0xE54C, + SetGatewayACK = 0xE54C, + /// <summary> + /// 绗竴娆℃悳绱㈡寚浠� + /// 鎿嶄綔鐮�: 0xE548 + /// </summary> + ReadDeviceModul = 0xE548, + /// <summary> + /// 绗竴娆℃悳鎸囦护鍥炲 + /// 鎿嶄綔鐮�: 0xE549 + ///閫氳鏂瑰紡: 鐐瑰鐐� + /// </summary> + ReadDeviceModulACK = 0xE549, + /// <summary> + /// 鎼滅储涔嬪悗鐩存帴璇诲彇璁惧 + /// 鎿嶄綔鐮�: 0xE44A + ///閫氳鏂瑰紡: 鐐瑰鐐� + ///瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + ///闄勫姞鏁版嵁鍐呭 + ///闄勫姞鏁版嵁闀垮害: 3 + ///缂栧彿 澶囨敞 娑よ + ///1 澶х被鍒� 0 鈥� 255 + ///2 灏忕被鍒� 0 - 255 + ///3 鍥炶矾鍙锋垨鑰呴�氶亾鍙� 0- 255 + /// </summary> + ReadDeviceLoopInfo = 0xE44A, + /// <summary> + /// 鎼滅储涔嬪悗鐩存帴璇诲彇璁惧鍙嶉 + /// 鎿嶄綔鐮�: 0xE44B + ///銊戞枟缁炶返 鐐圭紭棣� ///瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + ///闄勫姞鏁版嵁鍐呭 + ///闄勫姞鏁版嵁闀垮害: N + ///缂栧彿 澶囨敞 鍊煎煙 + ///1 澶х被鍒� 0 鈥� 255 + ///2 灏忕被閿�0 - 255 + ///3 鍥炶矾鎴栧拕菛鏈�?0- 255 + ///4 澶囨敞绗�1涓猙yte 0 - 255 + ///5 澶囨敞绗�2涓猙yte 0- 255 + ///鈥� + ///23 澶囨敞绗�20榀緔te 0- 255 + /// 鍏蜂綋鍙傛暟瑙佷笅琛�(鍏朵腑鍥炶矾鎴栬�呴�氶亾鏁帮紝澶囨敞涓洪噸澶嶉儴鍒嗭紝鏃犻渶閲嶅杩斿洖锛屽綋鍓嶇姸鎬佷笉鐢ㄤ慨鏀�) + /// </summary> + ReadDeviceLoopInfoACK = 0xE44B, + /// <summary> + /// 璁剧疆绠�鏄撶紪绋嬭澶囧熀鏈俊鎭� + /// 鎿嶄綔鐮�: 0xE44C + ///閫氳鏂瑰紡: 鐐瑰鐐� + ///瀛愮綉ID鑼冨洿: 0-254 璁惧ID鑼冨洿: 0-254 + ///闄勫姞鏁版嵁鍐呭 + ///闄勫姞鏁版嵁闀垮害: 4 + 2 N + ///缂栧彿 澶囨敞 鍊煎煙 + ///1 澶х被鍒� 0 鈥� 255 + ///2 灏忕被鍒� 0 - 255 + ///3 鍥炶矾鎴栬�呴�氶亾鏁� 1- 255 + ///4 澶囨敞绗�1涓猙yte 0 - 255 + ///5 澶囨敞绗�2涓猙yte 0- 255 + ///鈥� + ///23 澶囨敞绗�20涓猙yte 0- 255 + ///鍏蜂綋鍙傛暟瑙佷笅琛�(鍏朵腑鍥炶矾鎴栧拕菛鏈�??缂糕懡?棣楀簥绯�?鎵屾煔棣楁嵍绁峰厐?榧绘寜濉旀尌鐪柗鎻� + /// </summary> + SetDeviceLoopInfo = 0xE44C, + /// <summary> + /// 鎿嶄綔鐮�: 0xE44D + ///閫氳鏂瑰紡: 鐐瑰鐐� + ///瀛愰超D鑼冨洿: 0-254 璁綢D鑼冨洿: 0-254 + ///闄勫姞鏁版嵁鍐呭 + ///闄勫姞鏁版嵁闀垮害: 3 + ///缂栧彿 澶囨敞 鍊煎煙 + ///1 澶х被鍒� 0 鈥� 255 + ///2 灏忕被鍒� 0 - 255 + ///3 鍥炶矾鎴栬�呴�氶亾鏁� 0 - 255 + /// </summary> + SetDeviceLoopInfoACK = 0xE44D, + ///// <summary> + ///// 绠�鏄撶紪绋嬭鍙栫涓�娆¤銆旂厡鐢戝灏村懕鐠炴劅鐣斺埄 /// //[0]gateway netID 0~254 255鏄箍鎾悳绱� 鏂扮増鏈笂鍔狅紝 + ///// </summary> + //ReadOnePortWirelessFROtherInfo = 0x1D34, + ///// <summary> + ///// 绠�鏄撶紪绋嬭鍙栫涓�娆¤鍙栦笉瀹岀殑鏃犵嚎璁惧淇℃伅鍙嶉,浠庣浜斾釜瀛楄妭绱㈠紩寮�濮� + ///// //[0]mode : 0:normal 1:config_mode + /////[1]control byte bit0 1:GateNet 0:general note + /////[2] + /////[3] + /////[4] + /////[5] RSSI(-dbm) + /////[5]瀵瑰簲棰戞 + /////0((Chinese WPAN Band)) 1(-European SRD Band) 2-(North_American ISM Band) + /////[6]channel(Center Frequency) + /////((Chinese WPAN Band)): 0~12 + /////鏍囧噯0-780MHz,782,784,3-786MHz, + /////锛坣onstandard锛�,鐢ㄩ潪鏍囧噯璇锋厧閲�4-770MHz 5-772MHz,6-774MHz,7-776MHz,8-778Mz,9-788MHz,10-790MHz,11-792MHz,12-794MHz + /////(European SRD Band)(0~12) + /////鏍囧噯0-864MHz,1-866MHz,2-868MHz.3-870MHz + /////锛坣onstandard锛�4-858MHz,5-860MHz,6-862MHz锛�7-872MHz,8-874MHz,9-876MHz,10-878MHz,11-880MHz,12-882MHz, + /////(North_American ISM Band):锛�0~12锛� + /////鏍囧噯鍖楃編棰戞锛� 0-904MHz,906,908,910,912,914,916,918,920,922,924,926,12-928MHz + /////[8]~[23] SECURITY_KEY + /////[24]~[43] Device_Remark_Buf + ///// </summary> + //ReadOnePortWirelessFROtherInfoACK = 0x1D35, + + + ///淇敼璁惧妯″潡Remake閫氱敤鎸囦护 + UpdataRemake = 0x0010, + UpdataRemakeACK = 0x0011, + + /// <summary> + /// F010 + /// The update loop remake. + /// </summary> + UpdateEquipmentLoopRemake = 0xF010, + UpdateLightDimmingLoopRemakeACK = 0xF011, + + /// <summary> + /// The update wireless panel button key remark. + /// </summary> + UpdateWirelessPanelButtonKeyRemark = 0xE006, + UpdateWirelessPanelButtonKeyRemarkACK = 0xE007, + + /// <summary> + /// 璇诲彇鎸夐敭淇℃伅 + /// E000 + /// </summary> + ReadWirelessPanelButtonKey = 0xE000, + ReadWirelessPanelButtonKeyACK = 0xE001, + + /// <summary> + /// e002 + /// </summary> + WriteWirelessPanelButtonKey = 0xE002, + WriteWirelessPanelButtonKeyACK = 0xE003, + + ReadWirelessPanelButtonKeyRemark = 0xE004, + ReadWirelessPanelButtonKeyRemarkACK = 0xE005, + + /// <summary> + /// 璇诲彇鎸夐敭鐩爣浣胯兘/ + /// 鎸夐敭閰嶇疆浜嗗灏戞帶鍒剁洰鏍囷紝鍦ㄥ摢涓簭鍒椾笂锛� + /// send 锛�1 byte 锛堝洖璺彿锛� + /// Receive 锛� 1锛堝洖璺彿锛�2锛堢洰鏍囨�绘暟锛�+ 浣胯兘锛坆yte鎬绘暟涓嶇‘瀹氾紝杞寲鎴愪簩杩涘埗锛�1浠h〃鏈夋晥锛�0浠h〃鏃犳晥锛� + /// </summary> + ReadButtonKeyEnable = 0xE474, + ReadButtonKeyEnableACK = 0xE475, + + ReadDrycontactMode = 0xD205, + ReadDrycontactModeACK = 0xD206, + ReadWirelessPanelMode = 0xE008, + ReadWirelessPanelModeACK = 0xE009, + /// <summary> + /// 淇敼鎸夐敭妯″紡 + /// </summary> + UpdataDrycontactMode = 0xD207, + UpdataDrycontactModeACK = 0xD208, + UpdataWirelessPanelModel = 0xE00A, + UpdataWirelessPanelModelACK = 0xE00B, + /// <summary> + /// 鎺у埗闈㈡澘 + /// 3byte + /// 鍥哄畾 17 + /// 鐘舵�� 0鍏� 1寮� + /// 鍥炶矾鍙� + /// </summary> + InstructionPanelKey = 0xE3D8, + InstructionPanelKeyACK = 0xE3D9, + //============================娓╁害========================================// + //闈㈡澘 骞挎挱娓╁害 + //閫氶亾鍙�, 0-255 1btye//闈㈡澘榛樿涓�1 + //鎽勬皬娓╁害鍊硷紝 1btye //娉ㄦ剰锛歵emperature涓鸿礋鏁扮殑鏃跺�欙紝鏈�楂樹綅缃�1 + //鎽勬皬娓╁害娴偣鍊�1 1byte //20110328鍔�//鎶婃诞鐐瑰�兼寜瀛樺偍鐨�4涓猙yte鍙戦�� + //鎽勬皬娓╁害娴偣鍊�2 1byte //20110328鍔�//鎶婃诞鐐瑰�兼寜瀛樺偍鐨�4涓猙yte鍙戦�� + //鎽勬皬娓╁害娴偣鍊�3 1byte //20110328鍔�//鎶婃诞鐐瑰�兼寜瀛樺偍鐨�4涓猙yte鍙戦�� + //鎽勬皬娓╁害娴偣鍊�4 1byte //20110328鍔�//鎶婃诞鐐瑰�兼寜瀛樺偍鐨�4涓猙yte鍙戦�� + PanleBroadcastTemp = 0xE3E5, + ////鏈敤 + //PanleBroadcastTempACK = 0xE3E6, + //璇绘俯搴� + //閫氶亾鍙�, 0-255 1btye//闈㈡澘榛樿涓�1 + //璇绘俯搴﹁繑鍥� + ReadPanleTemp = 0xE3E7 , + //閫氶亾鍙�, 0-255 1btye//闈㈡澘榛樿涓�1 + //鎽勬皬娓╁害鍊硷紝 1btye //娉ㄦ剰锛歵emperature涓鸿礋鏁扮殑鏃跺�欙紝鏈�楂樹綅缃�1 + //20151013 + //鎽勬皬娓╁害娴偣鍊�1 1byte //20110328鍔�//鎶婃诞鐐瑰�兼寜瀛樺偍鐨�4涓猙yte鍙戦�� + //鎽勬皬娓╁害娴偣鍊�2 1byte //20110328鍔�//鎶婃诞鐐瑰�兼寜瀛樺偍鐨�4涓猙yte鍙戦�� + //鎽勬皬娓╁害娴偣鍊�3 1byte //20110328鍔�//鎶婃诞鐐瑰�兼寜瀛樺偍鐨�4涓猙yte鍙戦�� + //鎽勬皬娓╁害娴偣鍊�4 1byte //20110328鍔�//鎶婃诞鐐瑰�兼寜瀛樺偍鐨�4涓猙yte鍙戦�� + ReadPanleTempACK = 0xE3E8, + /// <summary> + /// 璇诲彇闈㈡澘鐘舵�� + /// </summary> + ReadInstructionPanelKey = 0xE3DA, + ReadInstructionPanelKeyACK = 0xE3DB, + + + /// <summary> + /// The updata light dimming maximum. + /// </summary> + UpdataLightDimmingMaximumOrMinimum = 0xF018, + UpdataLightDimmingMaximumOrMinimumACK = 0xF019, + + /// <summary> + /// The updata light dimming the largest level. + /// </summary> + UpdataLightDimmingTheLargestLevel = 0xF022, + UpdataLightDimmingTheLargestLevelACK = 0xF023, + + /// <summary> + /// 杩涘叆鏃犵嚎閰嶇疆妯″紡. + /// </summary> + GotoConfigMode = 0X1D38, + GotoConfigModeACK = 0X1D39,//20170524鏇存崲鎿嶄綔鐮� : 20171215g鏀瑰洖 + //GotoConfigMode = 0X1D52, + //GotoConfigModeACK = 0X1D53, + /// <summary> + /// 閫�鍑烘棤绾块厤缃ā寮� + /// </summary> + CheckConfigSuccess = 0x1D3A, + CheckConfigSuccessACK = 0x1D3B, + + /// <summary> + /// 淇敼绐楀笜妯″潡杩愯鏃堕棿 + /// </summary> + UpdataCurtainModelRunTime = 0xE802, + UpdataCurtainModelRunTimeACK = 0xE803, + + /// <summary> + /// 淇敼绐楀笜妯″潡鐘舵��//瀹夎璋冭瘯 + /// 娴嬭瘯绐楀笜 + /// E3E0 闄勫姞鏁版嵁2涓猙yte + /// 缁х數鍣ㄧ獥甯樼殑璇濈涓�涓猙yte鐨勫氨浠h〃鍥炶矾鍙� 绗簩涓唬琛�0/1/2浠h〃鍋滄/寮�/鍏� + /// 鐢垫満绐楀笜鐨勮瘽绗竴涓猙yte鍥哄畾17, 绗簩涓猙yte浠h〃鐧惧垎姣旓紙0-100锛� + /// 寮�鍚堝笜娴嬭窛鏃堕檮鍔犳暟鎹负17锛�238 + /// + /// + /// + /// + /// 杩涘叆瀹夎璋冭瘯:鍛戒护E3E0 闄勫姞鏁版嵁3涓猙yte 绗竴涓�17 绗簩涓� 238 绗笁涓�1 鍙嶉E3E1 鍙嶉鐨勯檮鍔犳暟鎹涓�涓猙yte涓�17 绗簩涓猙yte涓�238 绗笁涓猙yte涓�1鏃惰〃绀鸿繘鍏ュ畨瑁呰皟璇曟垚鍔� + /// 纭畾璧峰浣嶇疆 鍛戒护E3E0闄勫姞鏁版嵁2涓猙yte, 绗竴涓猙yte1锛岀浜屼釜byte1 鍙嶉鍛戒护E3E1 鍙嶉鐨勯檮鍔犳暟鎹涓�涓猙yte涓�1 绗簩涓猙yte涓�1琛ㄧず寮�濮嬬‘瀹炵‘瀹氳捣濮嬩綅缃� 鐢垫満杞姩 + /// 璧峰浣嶇疆纭畾瀹屾垚 鍛戒护 1F0C 闄勫姞鏁版嵁1涓猙yte 绗竴涓猙yte涓�3 鍙嶉鍛戒护1F0D 鍙嶉鐨勯檮鍔犳暟鎹涓�涓猙yte涓�3鏃惰〃绀虹‘瀹氳捣濮嬩綅缃畬鎴� + /// 纭畾缁撴潫浣嶇疆 鍛戒护E3E0闄勫姞鏁版嵁2涓猙yte, 绗竴涓猙yte1锛岀浜屼釜byte2 鍙嶉鍛戒护E3E1 鍙嶉鐨勯檮鍔犳暟鎹涓�涓猙yte涓�1 绗簩涓猙yte涓�2琛ㄧず寮�濮嬬‘瀹氱粨鏉熶綅缃� 鐢垫満杞姩 + /// 缁撴潫浣嶇疆纭畾瀹屾垚 鍛戒护 1F0C 闄勫姞鏁版嵁1涓猙yte 绗竴涓猙yte涓�2 鍙嶉鍛戒护1F0D 鍙嶉鐨勯檮鍔犳暟鎹涓�涓猙yte涓�2鏃惰〃绀虹‘瀹氱粨鏉熶綅缃畬鎴� + /// 閫�鍑哄畨瑁呰皟璇� 鍛戒护E3E0 闄勫姞鏁版嵁3涓猙yte 绗竴涓�17 绗簩涓� 238 绗笁涓�2 鍙嶉E3E1 鍙嶉鐨勯檮鍔犳暟鎹涓�涓猙yte涓�17 绗簩涓猙yte涓�238 绗笁涓猙yte涓�2鏃惰〃绀洪��鍑哄畨瑁呰皟璇曟垚鍔� + /// 鐐瑰姩 鍛戒护E3E0 闄勫姞鏁版嵁2涓猙yte 绗竴涓�33 绗簩涓細鐐瑰姩寮�涓�1锛岀偣鍔ㄥ叧2 + /// </summary> + UpdataCurtainModelStutas = 0xE3E0, + UpdataCurtainModelStutasACK = 0xE3E1, + + /// <summary> + /// 绐楀笜妯″潡鐘舵�佸箍鎾洖澶� + /// </summary> + CurtainModelStutasACK = 0xE3E4, + + /// <summary> + /// 纭畾绐楀笜浣嶇疆瀹屾垚 + /// 娴嬭瘯绐楀笜 + /// </summary> + UpdataCurtainLocalFinish = 0x1F0C, + UpdataCurtainLocalFinishAck = 0x1F0D, + + /// <summary> + /// 璇诲彇绐楀笜鐢垫満鏂瑰悜 + /// </summary> + ReadCommandCurtainUserseting = 0x1F02, + ReadCommandCurtainUsersetingAck = 0x1F03, + + /// <summary> + /// 寮�鍏崇姸鎬侀�夋嫨鏍囪 + /// 1琛ㄧず鍚戝墠锛�0琛ㄧず鍚戝悗 + /// </summary> + CommandCurtainUserseting = 0x1F00, + CommandCurtainUsersetingAck = 0x1F01, + + /// <summary> + /// E3E2鏄鍙栫獥甯樼姸鎬佺殑 + /// 闄勫姞鏁版嵁涓�涓猙yte + /// 缁х數鍣ㄧ獥甯樺氨鏄洖璺彿 + /// 鐢垫満绐楀笜鍥哄畾17 + /// 杩斿洖鍥炶矾鍙�+绐楀笜鐘舵�� + /// 鐢垫満绐楀笜0-100鐨勮瘽琛ㄧず褰撳墠鐧惧垎姣旓紝0XDD鐨勮瘽浠h〃涓嶈兘鑾峰彇鐧惧垎姣旈渶瑕佸浣� 0XEE浠h〃绐楀笜澶勪簬瀹夎璋冭瘯鐘舵�� + /// </summary> + ReadCurtainStatus = 0xE3E2, + ReadCurtainStutasACK = 0xE3E3, + + /// <summary> + /// 3007 + /// 璇诲彇涓�绔彛浜ゆ崲鏈恒�佹棤绾跨綉鍏崇殑閰嶇疆淇℃伅 + /// </summary> + ReadGateWayModelInfo = 0x3007, + ReadGateWayModelInfoACK = 0x3008, + + /// <summary> + /// 璇诲彇缃戝叧璁惧鐨勬湇鍔″櫒ip淇℃伅 + /// </summary> + ReadGatewayServerIP = 0x3009, + ReadGatewayServerIPACK = 0x300A, + + /// <summary> + /// 娴嬭瘯鍙戦�佽繙绋嬫暟鎹埌鏈嶅姟鍣ㄦ槸鍚﹀瓨鍦ㄧ浉鍚岀殑缁勫悕鐢ㄦ埛鍚� + /// 闄勫姞鏁版嵁鍐呭锛� 宸ョ▼澶囨敞 20 bytes + /// 缇ょ粍澶囨敞 20 bytes + /// 杩滅▼璁块棶鐨勭敤鎴峰悕 8 bytes + /// 璁惧鏈韩鐨凪AC鐮�(淇濊瘉姝ゆ暟鎹敮涓�) 8 bytes + /// ---- + /// 闄勫姞鏁版嵁闀垮害锛�9bytes + /// 闄勫姞鏁版嵁鍐呭锛�1byte 0澶辫触 1鎴愬姛 2宸茬粡瀛樺湪 + /// </summary> + SendRemoteInfoToServer = 0x300B, + SendRemoteInfoToServerACK = 0x300C, + + /// <summary> + /// 璁剧疆浜ゆ崲鏈烘ā鍧楃粍鍚嶅伐绋嬪悕 + /// </summary> + SetGateWayModelInfo = 0x3003, + SetGateWayModelInfoACK = 0x3004, + + /// <summary> + /// 3005 + /// 璁剧疆浜ゆ崲鏈虹綉缁滃姛鑳戒俊鎭� + /// </summary> + SetGateWayModelInternetInfo = 0x3005, + SetGateWayModelInternetInfoACK = 0x3006, + + /// <summary> + /// 0xF003 + /// 璇诲彇璁惧mac鍦板潃 + /// </summary> + ReadDeviceMac = 0xF003, + ReadDeviceMacACK = 0xF004, + + /// <summary> + /// 0xF005 + /// 璁剧疆璁惧瀛愮綉鍙枫�佽澶囧彿 + /// </summary> + SetDeviceSubnetID = 0xF005, + SetDeviceSubnetIDACK = 0xF006, + + /// <summary> + /// 璇诲彇鍦扮儹淇℃伅 + /// [0]number(1-6) + /// 鍥炲 + /// [0]number(1-6) 鍦扮儹鍙� (1byte) + /// [1]妯″紡&寮�鍏筹細楂�4bit(0鍦扮儹妯″紡銆�1鍦板喎妯″紡銆�2鍦扮儹鍔熺巼鎺у埗銆�3鍦板喎鍔熺巼鎺у埗)锛屼綆4bit(0鍏炽��1寮�锛屽湴鐑ā鍧楅噷闈笉鏀寔锛屼綆4浣嶆墿灞�) (1byte) + /// [2]娓╁害鍗曚綅(鎽勬皬Celsius:0锛屽崕姘廎ahrenheit:1) (1byte) + /// [3]宸ヤ綔妯″紡锛�1:鏅��,2:鐧藉ぉ,3:澶滄櫄,4:绂诲紑,5:鏃堕棿 (1-5) (1byte) + /// [4]鏅�氾細璁剧疆娓╁害(鎽勬皬0-100锛屽崕姘�32-212)/鍔熺巼鍊�(0-10) (1byte) + /// [5]鐧藉ぉ锛氳缃俯搴�(鎽勬皬0-100锛屽崕姘�32-212)/鍔熺巼鍊�(0-10) (1byte) + /// [6]澶滄櫄锛氳缃俯搴�(鎽勬皬0-100锛屽崕姘�32-212)/鍔熺巼鍊�(0-10) (1byte) + /// [7]绂诲紑锛氳缃俯搴�(鎽勬皬0-100锛屽崕姘�32-212)/鍔熺巼鍊�(0-10) (1byte) + /// [8]鏃堕棿妯″紡鐨勬椂闂存鏍囧織 (0锛氱櫧澶╋紝1锛氬鏅�) (1byte) //20110112鍔犳椂闂存鏍囧織 + /// [9]娓╁害婧愭俯搴�(鏈�楂樹綅0:姝�,1:璐�.鍚�7bit涓哄��) (1byte) + /// [10]闃�鐨勫紑鍏崇姸鎬�(0--鍏� 1--寮�) + /// [11]闃�鐨勫ぇ灏� (0~100) + /// [12]鍐叉礂鏍囪 楂�4浣嶏細1鎸夐敭鎵ц鍐叉礂銆�0闈炴寜閿墽琛�(妯″潡瀹氭椂鍐叉礂)鍐叉礂锛屼綆4浣嶏細 0锛氫笉鍐叉礂銆�1鍐叉礂 (1byte) + /// [13]鍐叉礂鏃堕棿 1~30(min) (1byte) + /// </summary> + ReadFoolHeat = 0x1C5E, + ReadFoolHeatACK = 0x1C5F, + /// <summary> + /// 鍦扮儹鎺у埗鎸囦护 + /// [0]number(1-6) (1byte) + /// [1]妯″紡&寮�鍏筹細楂�4bit(0鍦扮儹妯″紡銆�1鍦板喎妯″紡銆�2鍦扮儹鍔熺巼鎺у埗銆�3鍦板喎鍔熺巼鎺у埗)锛屼綆4bit(0鍏炽��1寮�锛屽湴鐑ā鍧楅噷闈笉鏀寔锛屼綆4浣嶆墿灞�) (1byte) + /// [2]娓╁害鍗曚綅(鎽勬皬Celsius:0锛屽崕姘廎ahrenheit:1) (1byte) + /// [3]宸ヤ綔妯″紡锛�1:鏅��,2:鐧藉ぉ,3:澶滄櫄,4:绂诲紑,5:鏃堕棿 (1-5) (1byte) + /// [4]鏅�氾細璁剧疆娓╁害(鎽勬皬0-100锛屽崕姘�32-212)/鍔熺巼鍊�(0-10) (1byte) + /// [5]鐧藉ぉ锛氳缃俯搴�(鎽勬皬0-100锛屽崕姘�32-212)/鍔熺巼鍊�(0-10) (1byte) + /// [6]澶滄櫄锛氳缃俯搴�(鎽勬皬0-100锛屽崕姘�32-212)/鍔熺巼鍊�(0-10) (1byte) + /// [7]绂诲紑锛氳缃俯搴�(鎽勬皬0-100锛屽崕姘�32-212)/鍔熺巼鍊�(0-10) (1byte) + /// [8](鍥哄畾0)鍐叉礂鏍囪 楂�4浣嶏細1鎸夐敭鎵ц鍐叉礂銆�0闈炴寜閿墽琛�(妯″潡瀹氭椂鍐叉礂)鍐叉礂锛屼綆4浣嶏細 0锛氫笉鍐叉礂銆�1鍐叉礂 (1byte) + /// [9](鍥哄畾0)鍐叉礂鏃堕棿 1~30(min) + /// 鍥炲 + /// [0]number(1-6) 鍦扮儹鍙� (1byte) + /// [1]妯″紡&寮�鍏筹細楂�4bit(0鍦扮儹妯″紡銆�1鍦板喎妯″紡銆�2鍦扮儹鍔熺巼鎺у埗銆�3鍦板喎鍔熺巼鎺у埗)锛屼綆4bit(0鍏炽��1寮�锛屽湴鐑ā鍧楅噷闈笉鏀寔锛屼綆4浣嶆墿灞�) (1byte) + /// [2]娓╁害鍗曚綅(鎽勬皬Celsius:0锛屽崕姘廎ahrenheit:1) (1byte) + /// [3]宸ヤ綔妯″紡锛�1:鏅��,2:鐧藉ぉ,3:澶滄櫄,4:绂诲紑,5:鏃堕棿 (1-5) (1byte) + /// [4]鏅�氾細璁剧疆娓╁害(鎽勬皬0-100锛屽崕姘�32-212)/鍔熺巼鍊�(0-10) (1byte) + /// [5]鐧藉ぉ锛氳缃俯搴�(鎽勬皬0-100锛屽崕姘�32-212)/鍔熺巼鍊�(0-10) (1byte) + /// [6]澶滄櫄锛氳缃俯搴�(鎽勬皬0-100锛屽崕姘�32-212)/鍔熺巼鍊�(0-10) (1byte) + /// [7]绂诲紑锛氳缃俯搴�(鎽勬皬0-100锛屽崕姘�32-212)/鍔熺巼鍊�(0-10) (1byte) + /// [8]鏃堕棿妯″紡鐨勬椂闂存鏍囧織 (0锛氱櫧澶╋紝1锛氬鏅�) (1byte) //20110112鍔犳椂闂存鏍囧織 + /// [9]娓╁害婧愭俯搴�(鏈�楂樹綅0:姝�,1:璐�.鍚�7bit涓哄��) (1byte) + /// [10]闃�鐨勫紑鍏崇姸鎬�(0--鍏� 1--寮�) + /// [11]闃�鐨勫ぇ灏� (0~100) + /// [12]鍐叉礂鏍囪 楂�4浣嶏細1鎸夐敭鎵ц鍐叉礂銆�0瀹氭椂鍐叉礂)鍐叉礂锛屼綆4浣嶏細 0锛氫笉鍐叉礂銆�1鍐叉礂 (1byte) + /// [13]鍐叉礂鏃堕棿 1~30(min) (1byte) + /// </summary> + SetFoolHeat = 0x1C5C, + SetFoolHeatACK = 0x1C5D, + ///Serverx_FH_CMD E45A + ///0 鍦扮儹鍙� 1-N + ///1 宸ヤ綔妯″紡 0鍦扮儹妯″紡銆�1鍦板喎妯″紡銆�2鍦扮儹鍔熺巼鎺у埗銆�3鍦板喎鍔熺巼鎺у埗銆�4鑷姩 + ///2 寮�鍏虫椂 0=OFF锛�1=ON + ///3 宸ヤ綔妯″紡 1:鏅��,2:鐧藉ぉ,3:澶滄櫄,4:绂诲紑,5:鏃堕棿 + ///4 娓╁害鐐� 5-35 + ///5 鍐叉礂鏍囧織 缂栫爜 璇存槑 + /// 4锛�5锛�6锛�7bit Server鏆傛椂涓嶇敤 + /// 0锛�1锛�2锛�3bit 0=涓嶅啿娲楋紝1=鍐叉礂 + ///6 鍐叉礂鏃堕棿 1-30Min + ///7 鍔熻兘鍙� 0 = 鏃犵姸鎬� (璇�) + /// 1銆�2=寮�鍏� + /// 3=鍚戜笅璁惧畾娓╁害鐐� + /// 4=鍚戜笂璁惧畾娓╁害鐐� + /// 5=瀹ゅ唴娓╁害 + /// 6=瀹ら闇插阀 /// 7=鍚戜笅宸ヤ綔娓╁害妯″紡 + /// 8=鍚戜笂宸ヤ綔娓╁害妯℃ā寮� + Serverx_FH_CMD = 0xE45A, + Serverx_FH_CMD_ACK = 0xE45B, + /// <summary> + /// The read terrestria heat remark. + /// </summary> + ReadTerrestriaHeatRemark = 0x1D02, + ReadTerrestriaHeatRemarkACK = 0x1D03, + + SetTerrestriaHeatRemark = 0x1D00, + SetTerrestriaHeatRemarkACK = 0x1D01, + + #region 闈㈡澘鍦扮儹鐘舵�� + /// <summary> + /// 鍦扮儹椤靛彿0-8 (1byte)//褰╁睆鍔犲叆20150714 + /// </summary> + Read_Floor_Heat_State = 0x1944, + /// <summary> + /// 1娓╁害妯″紡(鎽勬皬Celsius:0锛屽崕姘廎ahrenheit:1) (1byte) + /// 2娓╁害婧愭俯搴�(鏈�楂樹綅0:姝�,1:璐�.鍚�7bit涓哄��) (1byte) + /// 3鍦扮儹鍦板喎寮�鍏筹細锛�0鍏炽��1寮� (1byte) + /// 4宸ヤ綔娓╁害妯″紡锛�1:鏅��,2:鐧藉ぉ,3:澶滄櫄,4:绂诲紑,5:鏃堕棿 (1-5) (1byte) + /// 5鏅�氭俯搴� (鎽勬皬0-99锛屽崕姘�32-210) (1byte) + /// 6鐧藉ぉ娓╁害 (鎽勬皬0-99锛屽崕姘�32-210) (1byte) + /// 7澶滄櫄娓╁害 (鎽勬皬0-99锛屽崕姘�32-210) (1byte) + /// 8绂诲紑娓╁害 (鎽勬皬0-99锛屽崕姘�32-210) (1byte) + /// 9鏃堕棿妯″紡鐨勬椂闂存鏍囧織 (0锛氱櫧澶╋紝1锛氬鏅�) (1byte) //20110112鍔犳椂闂存鏍囧織 + /// 10妯″紡锛�0鍦扮儹妯″紡銆�1鍦板喎妯″紡銆�2鑷姩 (1byte) //20120802鍔�//20140805鍔犺嚜鍔� + /// 11鍦扮儹椤靛彿0-8 (1byte)//褰╁睆鍔犲叆20150714 + /// </summary> + Read_Floor_Heat_State_ack = 0x1945, + + /// <summary> + /// 1娓╁害妯″紡(鎽勬皬Celsius:0锛屽崕姘廎ahrenheit:1) (1byte) + /// 2鍦扮儹鍦板喎寮�鍏筹細锛�0鍏炽��1寮� (1byte) + /// 3宸ヤ綔娓╁害妯″紡锛�1:鏅��,2:鐧藉ぉ,3:澶滄櫄,4:绂诲紑,5:鏃堕棿 (1-5) (1byte) + /// 4鏅�氭俯搴� (鎽勬皬0-99锛屽崕姘�32-210) (1byte) + /// 5鐧藉ぉ娓╁害 (鎽勬皬0-99锛屽崕姘�32-210) (1byte) + /// 6澶滄櫄娓╁害 (鎽勬皬0-99锛屽崕姘�32-210) (1byte) + /// 7绂诲紑娓╁害 (鎽勬皬0-99锛屽崕姘�32-210) (1byte) + /// 8鍦扮儹椤靛彿0-8 (1byte)//褰╁睆鍔犲叆20150714 + /// </summary> + Set_Floor_Heat_State = 0x1946, + /// <summary> + /// 1MODIFY_FAULT 1 byte + /// 2鍦扮儹椤靛彿0-8 (1byte)//褰╁睆鍔犲叆20150714 + /// 鎴�---------------------------------------------- + /// 1 MODIFY_SUCCESS 1 byte + /// 2娓╁害妯″紡(鎽勬皬Celsius:0锛屽崕姘廎ahrenheit:1) (1byte) + /// 3鍦扮儹鍦板喎寮�鍏筹細锛�0鍏炽��1寮� (1byte) + /// 4宸ヤ綔娓╁害妯″紡锛�1:鏅��,2:鐧藉ぉ,3:澶滄櫄,4:绂诲紑,5:鏃堕棿 (1-5) (1byte) + /// 5鏅�氭俯搴� (鎽勬皬0-99锛屽崕姘�32-210) (1byte) + /// 6鐧藉ぉ娓╁害 (鎽勬皬0-99锛屽崕姘�32-210) (1byte) + /// 7澶滄櫄娓╁害 (鎽勬皬0-99锛屽崕姘�32-210) (1byte) + /// 8绂诲紑娓╁害 (鎽勬皬0-99锛屽崕姘�32-210) (1byte) + /// 9鏃堕棿妯″紡鐨勬椂闂存鏍囧織 (0锛氱櫧澶╋紝1锛氬鏅�) (1byte) //20120802鍔� + /// 10宸ヤ綔妯″紡锛�0鍦扮儹銆�1鍦板喎銆�2鑷姩 (1byte) //20120802鍔�//20140805鍔犺嚜鍔� + /// 11鍦扮儹鍦板喎鍚屾鏍囧織锛�0涓嶅悓姝ャ��1鍚屾 (1byte) //20121226鍔� + /// 12鍦扮儹椤靛彿0-8 (1byte)//褰╁睆鍔犲叆20150714 + /// </summary> + Set_Floor_Heat_State_ack = 0x1947, //骞挎挱杩斿洖 + #endregion + #region 4.3瀵搁潰鏉� 绌鸿皟鐘舵�� 鏂板崗璁� + /// <summary> + /// [0]//绌鸿皟椤靛彿(0-8) 1byte + /// </summary> + Read_Air_State_New = 0x19AE, + /// <summary> + /// [0]//绌鸿皟椤靛彿(0-8) 1byte + /// [1]//绌鸿皟寮�鍏�(1寮�0鍏�) 1byte + /// [2]//鍒跺喎鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) 1byte + /// [3]//鍒剁儹鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) 1byte + /// [4]//鑷姩鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) 1byte + /// [5]//闄ゆ箍鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) 1byte + /// [6]//璁剧疆妯″紡(0鍒跺喎锛�1鍒剁儹锛�2閫氶锛�3鑷姩锛�4闄ゆ箍) 1byte + /// [7]//璁剧疆椋庨��(0鑷姩锛�1楂橀锛�2涓锛�3浣庨) 1byte //娉ㄦ剰:褰撴ā寮忎负闄ゆ箍鎴栨ā寮忎负閫氶鍙婇閫熶负鑷姩鏃讹紝椋庨�熻涓哄皬椋庝负鍑� + /// [8]//璁剧疆鎵(0涓嶆壂椋庯紝1鎵) 1byte + /// [9]//娓╁害妯″紡(鎽勬皬Celsius:0锛屽崕姘廎ahrenheit:1) 1byte + /// [10]//妯″紡瀹為檯宸ヤ綔鐘舵��(0鍒跺喎锛�1鍒剁儹锛�2閫氶锛�3鑷姩锛�4闄ゆ箍) 1byte + /// [11]//椋庨�熷疄闄呭伐浣滅姸鎬�(0鍏抽棴锛�1楂橀锛�2涓锛�3浣庨) 1byte + /// [12]//鎵瀹為檯宸ヤ綔鐘舵��(0涓嶆壂椋庯紝1鎵) 1byte + /// [13]//鐜娓╁害(鎽勬皬0-40锛屽崕姘�32-99) 1byte + /// </summary> + Read_Air_State_New_ack = 0x19AF, + /// <summary> + /// [0]//绌鸿皟椤靛彿(0-8) 1byte + /// [1]//绌鸿皟寮�鍏�(1寮�0鍏�) 1byte + /// [2]//鍒跺喎鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) 1byte + /// [3]//鍒剁儹鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) 1byte + /// [4]//鑷姩鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) 1byte + /// [5]//闄ゆ箍鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) 1byte + /// [6]//璁剧疆妯″紡(0鍒跺喎锛�1鍒剁儹锛�2閫氶锛�3鑷姩锛�4闄ゆ箍) 1byte + /// [7]//璁剧疆椋庨��(0鑷姩锛�1楂橀锛�2涓锛�3浣庨) 1byte //娉ㄦ剰:褰撴ā寮忎负闄ゆ箍鎴栨ā寮忎负閫氶鍙婇閫熶负鑷姩鏃讹紝椋庨�熻涓哄皬椋庝负鍑� + /// [8]//璁剧疆鎵(0涓嶆壂椋庯紝1鎵) 1byte + /// [9]//娓╁害妯″紡(鎽勬皬Celsius:0锛屽崕姘廎ahrenheit:1) 1byte + /// </summary> + Set_Air_State_New = 0x19B0, //pyx,6byte + /// <summary> + /// MODIFY_FAULT 1 byte + /// 鎴�---------------------------------------------- + /// [0]//MODIFY_SUCCESS 1byte + /// [1]//绌鸿皟椤靛彿(0-8) 1byte + /// [2]//绌鸿皟寮�鍏�(1寮�0鍏�) 1byte + /// [3]//鍒跺喎鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) 1byte + /// [4]//鍒剁儹鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) 1byte + /// [5]//鑷姩鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) 1byte + /// [6]//闄ゆ箍鎺у埗娓╁害(鎽勬皬0-30锛屽崕姘�32-86) 1byte + /// [7]//璁剧疆妯″紡(0鍒跺喎锛�1鍒剁儹锛�2閫氶锛�3鑷姩锛�4闄ゆ箍) 1byte + /// [8]//璁剧疆椋庨��(0鑷姩锛�1楂橀锛�2涓锛�3浣庨) 1byte //娉ㄦ剰:褰撴ā寮忎负闄ゆ箍鎴栨ā寮忎负閫氶鍙婇閫熶负鑷姩鏃讹紝椋庨�熻涓哄皬椋庝负鍑� + /// [9]//璁剧疆鎵(0涓嶆壂椋庯紝1鎵) 1byte + /// [10]//娓╁害妯″紡(鎽勬皬Celsius:0锛屽崕姘廎ahrenheit:1) 1byte + /// [11]//妯″紡瀹為檯宸ヤ綔鐘舵��(0鍒跺喎锛�1鍒剁儹锛�2閫氶锛�3鑷姩锛�4闄ゆ箍) 1byte + /// [12]//椋庨�熷疄闄呭伐浣滅姸鎬�(0鍏抽棴锛�1楂橀锛�2涓锛�3浣庨) 1byte + /// [13]//鎵瀹為檯宸ヤ綔鐘舵��(0涓嶆壂椋庯紝1鎵) 1byte + /// [14]//鐜娓╁害(鎽勬皬0-40锛屽崕姘�32-99) 1byte + /// </summary> + Set_Air_State_New_ack = 0x19B1, //鏄惁骞挎挱寰呭畾锛侊紒锛� + #endregion + #region 闈㈡澘绌鸿皟鐘舵�� 鏃у崗璁� + //------------------------------------------------------//璁剧疆绌鸿皟宸ヤ綔鐘舵�� + /// <summary> + /// nop + /// </summary> + Read_Air_Condition_Set = 0xE0EC, + /// <summary> + /// [0]//On_off(1byte)(FALSE,TRUE) + /// [1]//Set_cooling_temperatrue 锛�0-30锛� + /// [2]//Set_Mode (1byte) //娉ㄦ剰:褰撴ā寮忎负闄ゆ箍鎴栨ā寮忎负閫氶鍙婇閫熶负鑷姩鏃讹紝椋庨�熻涓哄皬椋庝负鍑� + /// [3]//LOcal_Flag (1byte) + /// [4]//Now_temprature(1byte) 锛�0-40锛� + /// [5]//set_heating temperature锛�0-30锛� + /// [6]//Actual_Mode + /// [7]//set_Autoing temperature锛�0-30锛� + /// [8]//set_DRYing temperature 锛�0-30锛� + /// [9]//set_WIND_MOVE_MODE //楂�4bit(瀹為檯鎵鐘舵�侊細0涓嶆壂椋庯紝1鎵)锛屼綆4bit(璁剧疆鎵妯″紡锛�0涓嶆壂椋庯紝1鎵)(20100505) + /// </summary> + Read_Air_Condition_Set_ack = 0xE0ED, + + ///// <summary> + ///// 璇诲彇闈㈡澘绌鸿皟鐨勭姸鎬� + ///// 寮�鍏冲彿 + ///// </summary> + //ReadACPanelStatus = 0xE0EC, + ///// <summary> + ///// 寮�鍏崇姸鎬� + ///// 鍒跺喎娓╁害 + ///// 妯″紡鍜岄閫� + ///// 绌鸿皟閿� + ///// 褰撳墠娓╁害 + ///// 鍒剁儹娓╁害 + ///// 绌鸿皟瀹為檯杩愯妯″紡鍜岄閫� + ///// 鑷姩娓╁害 + ///// 鎶芥箍娓╁害 + ///// 绌鸿皟鏄惁鎵(浣庡洓浣�) + ///// 鍥炶矾鍙凤紙鍥涚偣涓夊闈㈡澘鎵嶄細鏈夊洖澶嶈繖涓猙yte锛� + ///// </summary> + //ReadACPanelStatusACK = 0xE0ED, + + + #endregion + + /// <summary> + /// 杩滅▼璁块棶鐨勮繛缁笁涓楠� + /// 鎺у埗绔繛鎺ユ湇鍔″櫒鑾峰彇涓�绔彛鐨勪俊鎭� + /// 杩滅▼璁块棶鐨勭敤鎴峰悕 8 bytes + /// 宸ョ▼澶囨敞 20 bytes + /// 鎺у埗绔繛鎺ユ湇鍔″櫒鑾峰彇涓�绔彛鐨勪俊鎭� + /// 0x300D + /// </summary> + RemoteFirst = 0x300D, + RemoteFirstACK = 0x300E, + /// <summary> + /// 瑕佹眰鏈嶅姟鍣ㄦ槸鍚﹁杞彂鏁版嵁. + /// 鎿嶄綔鐮侊細$301F + ///闄勫姞鏁版嵁闀垮害锛�7byte + ///鐩殑IP锛� (4bytes)鍙戦�佺瑕佹ⅵ瀹炲摢搴疯挋 + ///鐩殑绔彛鍙� (2bytes) + ///鏄惁杞彂 1鏄�0鍚� + /// </summary> + RemoteSecoud = 0x301F, + RemoteSecoudACK = 0x3020, + /// <summary> + /// 杩炴帴楠岃瘉瀵嗙爜. + /// </summary> + Remote3th = 0x300F,//杩炴帴楠岃瘉瀵嗘櫉 + Remote3thACK = 0x3010, + + /// <summary> + /// 璁剧疆缁戝畾闈㈡澘绌鸿皟鐩爣 + /// </summary> + SetACPanel = 0xE0E6, + SetACPanelACK = 0xE0E7, + + /// <summary> + /// 璇诲彇闈㈡澘缁戝畾鐨勭┖璋冪洰鏍� + /// </summary> + ReadACPanel = 0xE0E4, + ReadACPanelACK = 0xE0E5, + + /// <summary> + /// 璇诲彇闈㈡澘闊充箰鐘舵�� + /// 鍙戦�佹棤闄勫姞鏁版嵁 + /// 鍥炲3byte + /// 浣胯兘0锛氱鐢紱1鍚敤 + /// 闊充箰妯″紡锛堜袱绉嶏級杩欓噷鍥哄畾1 + /// 鍖哄彿锛屼竴涓彲浠ュ瓨鍌�12涓粦瀹氱洰鏍囦粠0寮�濮嬶紝ON杩欓噷鍥哄畾鍙仛涓�涓尯鍙凤細0 + /// </summary> + ReadMusicPanelEnable = 0x1930, + ReadMusicPanelEnableACK = 0x1931, + + /// <summary> + /// 閰嶇疆闊充箰闈㈡澘鐘舵�� + /// 鍙戦�� 3byte + /// 浣胯兘0锛氱鐢紱1鍚敤 + /// 闊充箰妯″紡锛堜袱绉嶏級杩欓噷鍥哄畾1 /// 鍖哄彿锛屼竴涓彲浠ュ瓨鍌�12涓粦瀹氱洰鏍囦粠0寮�濮嬶紝ON杩欓噷鍥哄畾鍙仛涓�涓尯鍙凤細0 + /// 鍥炲1byte F8鎴愬姛 F5澶辫触 + /// </summary> + SetMusicPanelEnable = 0x1932, + SetMusicPanelEnableACK = 0x1933, + + /// <summary> + /// 璇诲彇闊充箰闈㈡澘閰嶇疆鐩爣 + /// 鍙戦�� 鍒嗕袱娆★細0锛�1 ON鍙仛涓�涓尯鍩燂紝鍙彂涓�娆� + /// 鍥炲26byte 锛堝洖澶嶇姸鎬侊紝搴忓彿锛�12涓洰鏍囷級 F8/F5 0/1 瀛愮綉鍙凤紝璁惧鍙枫�傚瓙缃戝彿锛岃澶囧彿銆傚瓙缃戝彿锛岃澶囧彿銆傘�傘�� + /// </summary> + ReadMusicPanelSetting = 0x1934, + ReadMusicPanelSettingACK = 0x1935, + + /// <summary> + /// 閰嶇疆闊充箰闈㈡澘閰嶇疆鐩爣 + /// 鍙戦�� 25byte 搴忓彿 + 12涓洰鏍囷紙瀛愮綉鍙凤紝璁惧鍙凤級 + /// 鍥炲 F8/F5 + /// </summary> + SetMusicPanelSetting = 0x1936, + SetMusicPanelSettingACK = 0x1937, + + /// <summary> + /// 璇诲彇骞叉帴鐐圭姸鎬� + /// 0x15CE + /// byte[2] =0 ==OFF锛堝叧銆侀棴鍚堬級 骞叉帴鐐硅繛鎺� + /// byte[2] =1 ==ON锛堝紑銆佹柇寮�锛� 骞叉帴鐐规柇寮� + /// </summary> + ReadDryContactStatus = 0x15CE, + ReadDryContactStatusACK = 0x15CF, + /// <summary> + /// 骞挎挱骞叉帴鐐圭姸鎬� + /// byte銆�2銆�=0 寮� + /// byte銆�2銆�=1 鍏� + /// </summary> + BroadcastDryContactStatus = 0x15D0, + BroadcastDryContactStatusACK = 0x15D1, + /// <summary> + /// 淇敼骞叉帴鐐瑰娉� + /// D220 + /// 22涓猙yte 绗竴涓猙yte骞叉帴鐐瑰彿,绗簩byte鏈烘寮�鍏虫爣蹇� 0鏈烘寮�鍏虫ā寮忓叧鐘舵�� 1琛ㄧず鏈烘寮�鍏虫ā寮忓紑妯″紡 锛岄潪鏈烘寮�鍏宠繖閲岄粯璁�1 鍓╀笅20涓猙yte鏄娉� 鎿嶄綔鐮� D220 + /// </summary> + SetDryContactRemark = 0xD220, + SetDryContactRemarkACK = 0xD221, + + /// <summary> + /// 绾㈠鎺у埗鍛戒护 + /// DB90 + /// 1 閫氶亾鍙凤紙鍙戝皠鍙g紪鍙凤級 + /// 2 璁惧鍙凤紙鍥炶矾鍙凤紝瀛樻斁绾㈠鐮佺殑鍖哄煙缂栧彿锛� + /// 3 鍔熻兘鍙� + /// 4 寮�鍏崇姸鎬佹娴� 1 = 妫�娴� + /// 5 鍥哄畾 0 + /// 6 闅忔満鏁� + /// </summary> + InfraredControl = 0xDB90, + InfraredControlACK = 0xDB91, + /// <summary> + /// 涓婁紶绾㈠鐮� + /// 137A + /// </summary> + UpLoadInfrared = 0x137A, + UpLoadInfraredACK = 0x137B, + + /// <summary> + /// 0x137C 涓嬭浇绾㈠妯″潡鍥炶矾鏁版嵁0x + /// 绗竴姝ワ細搴忓彿(1-25)锛嬪寘鍙�(鍖呭彿涓�0)锛堝皬鍖咃級 + /// ACK: 搴忓彿(1-25)锛嬪寘鍙�(鍖呭彿涓�0) + 璁惧鐮侊紙1byte锛�+ 缁勭爜锛�2 byte锛�+ 绾㈠鏁版嵁鎬婚暱搴�(1byte) + + /// 浼犻�佸獟浣擄紙0锛欻DL-BUS锛�1锛歍CP/IP UDP锛�2锛欿NX锛�(鍖呭彿涓�0) + name[20]锛堝皬鍖咃級 + /// 绗簩姝ワ細搴忓彿(1-25)锛嬪寘鍙� (鍖呭彿涓�1寮�濮嬪鍔�) 锛堝皬鍖咃級 + /// ACK: 搴忓彿(1-25)锛嬪寘鍙�(鍖呭彿涓�1寮�濮嬪鍔�) + + 绾㈠鏁版嵁(nBYTE) + /// 閲嶅绗簩姝ワ紝鐩磋嚦绾㈠鏁版嵁涓嬭浇瀹屾瘯! + /// </summary> + DownloadInfrared = 0x137C, + DownloadInfraredACK = 0x137D, + + //ControlMusicModel1 = 0x192E, + //ControlMusicModel1ACK = 0x192F, + + //ControlMusicModel2 = 0x1970, + //ControlMusicModel2ACK = 0x1971, + /// <summary> + /// 0xE504 + /// 1 鍔熻兘鍙� 0 = 璇诲彇绾㈠鍙戝皠閫氶亾鎬绘暟锛�1 = 璇诲彇閫氶亾澶囨敞锛�2=淇敼閫氶亾澶囨敞 + /// 2 閫氶亾鍙� 1-N锛汧8琛ㄧず璇诲彇閫氶亾鎬绘暟 + /// 褰撳姛鑳藉彿涓�0 鎴栬��1 鏃讹紝璇峰拷鐣ヤ笅闈㈢浉鍏虫暟鎹紱鍙湁褰撳姛鑳藉彿涓�2鏃讹紝鍚庨潰鏁版嵁鏈夋剰涔夛紝涓哄娉� + /// 3 澶囨敞鏁版嵁1byte 0 鈥� FF + /// 4 澶囨敞鏁版嵁2byte 0 鈥� FF + /// 5 澶囨敞鏁版嵁3byte 0 鈥� FF + /// 6 澶囨敞鏁版嵁4byte 0 鈥� FF + /// 7 澶囨敞鏁版嵁5byte 0 鈥� FF + /// 8 澶囨敞鏁版嵁6byte 0 鈥� FF + /// 9 澶囨敞鏁版嵁7byte 0 鈥� FF + /// 10 澶囨敞鏁版嵁8byte 0 鈥� FF + /// 11 澶囨敞鏁版嵁9byte 0 鈥� FF + /// 12 澶囨敞鏁版嵁10byte 0 鈥� FF + /// 13 澶囨敞鏁版嵁11byte 0 鈥� FF + /// 14 澶囨敞鏁版嵁12byte 0 鈥� FF + /// 15 澶囨敞鏁版嵁13byte 0 鈥� FF + /// 16 澶囨敞鏁版嵁14byte 0 鈥� FF + /// 17 澶囨敞鏁版嵁15byte 0 鈥� FF + /// 18 澶囨敞鏁版嵁16byte 0 鈥� FF + /// 19 澶囨敞鏁版嵁17byte 0 鈥� FF + /// 20 澶囨敞鏁版嵁18byte 0 鈥� FF + /// 21 澶囨敞鏁版嵁19byte 0 鈥� FF + /// 22 澶囨敞鏁版嵁20byte 0 鈥� FF + /// </summary> + InfraredChannelControl = 0xE504, + InfraredChannelControlACK = 0xE505, + + /// <summary> + /// 淇敼缃戝叧ip鍦板潃鐩稿叧鍙傛暟 + /// </summary> + UpdateGatewayIp = 0xF039, + UpdateGatewayIpACK = 0xF03A, + + /// <summary> + /// 淇敼鏃犵嚎閰嶇疆 + /// [0]control byte + /// + ///bit0 255:GateNet鏈韩 0锝�254 general note 涔� GateNet + ///[1] + ///[2] + ///[3] + ///[4] + ///[5] 瀵瑰簲棰戞 + ///0((Chinese WPAN Band)) 1(-European SRD Band) 2-(North_American ISM Band) + ///[6]channel(Center Frequency) + ///((Chinese WPAN Band)): 0~12 + ///鏇�?780MHz,782,784,3-786MHz, + ///锛坣onstandard锛�,鐢ㄩ潪鏍囧噯璇锋厧閲�4-770MHz 5-772MHz,6-774MHz,7-776MHz,8-778Mz,9-788MHz,10-790MHz,11-792MHz,12-794MHz + ///(European SRD Band)(0~12) + ///鏇�?864MHz,1-866MHz,2-868MHz.3-870MHz + ///锛坣onstandard锛�4-858MHz,5-860MHz,6-862MHz锛�7-872MHz,8-874MHz,9-876MHz,10-878MHz,11-880MHz,12-882MHz, + ///(North_American ISM Band):锛�0~12锛� + ///鏍囧噯鍖楃編棰戞?0-904MHz,906,908,910,912,914,916,918,920,922,924,926,12-928MHz + ///[7]~[22] SECURITY_KEY + /// </summary> + WriteManageWirelessNet = 0x1D36, + WriteManageWirelessNetACK = 0x1D37, + /// <summary> + /// 灏濊瘯淇敼鏃犵嚎閰嶇疆锛屽鏋滄垚鍔熷垯鍙戜笂涓�鏉″懡浠ゆ潵杩涜淇敼 + /// </summary> + TestWriteManageWirelessNet = 0x1d38, + TestWriteManageWirelessNetACK = 0x1d39, + + /// <summary> + /// 0x1976 + /// 璇诲彇闈㈡澘閰嶇疆鍦扮儹淇℃伅 + /// </summary> + ReadACFloorHeatingSettingEquipment = 0x1976, + ReadACFloorHeatingSettingEquipmentACK = 0x1977, + + /// <summary> + /// 1bytes loopid + /// </summary> + Read43FloorHeatingSettingEquipment = 0x1940, + /// <summary> + /// 4.3 + /// 1鍦扮儹鍦板喎寮�鍚叧闂細0鍏�,1寮�, (0 - 1) (1byte) + ///2鍦扮儹鍦板喎娓╁害婧怱OURCE: 0鏈�,1澶�,2涓よ�呭钩鍧� (0 - 2) (1byte) + ///3鍦扮儹鍦板喎澶栨俯搴︽簮1浣胯兘: (0鍏�,1鏀跺箍鎾�,2璇�)20120928鏀� (0 - 2) (1byte) //鐢ㄤ簬姝e父澶栨俯搴︽帶鍒� + ///4鍦扮儹鍦板喎澶栨俯搴︽簮1瀛愮綉鍦板潃 (0-255) (1byte) + ///5鍦扮儹鍦板喎澶栨俯搴︽簮1璁惧鍦板潃 (0-255) (1byte) + ///6鍦扮儹鍦板喎澶栨俯搴︽簮1閫氶亾鍙� (0-255) (1byte) + ///7鍦扮儹鍦板喎澶栨俯搴︽簮2浣胯兘: (0鍏�,1鏀跺箍鎾�,2璇�)20120928鏀� (0 - 2) (1byte) //鐢ㄤ簬姝e父澶栨俯搴︽帶鍒� + ///8鍦扮儹鍦板喎澶栨俯搴︽簮2瀛愮綉鍦板潃 (0-255) (1byte) + ///9鍦扮儹鍦板喎澶栨俯搴︽簮2璁惧鍦板潃 (0-255) (1byte) + ///10鍦扮儹鍦板喎澶栨俯搴︽簮2閫氶亾鍙� (0-255) (1byte) + ///11鍦扮儹鏈�楂樻俯搴︽簮浣胯兘: (0鍏�,1鏀跺箍鎾�,2璇�)20120928鏀� (0 - 2) (1byte) //娴嬮噺鏈�楂橀檺娓╁害锛岀敤浜庨檺瀹氭帶鍒� + ///12鍦扮儹鏈�楂樻俯搴︽簮瀛愮綉鍦板潃 (0-255) (1byte) + ///13鍦扮儹鏈�楂樻俯搴︽簮璁惧鍦板潃 (0-255) (1byte) + ///14鍦扮儹鏈�楂樻俯搴﹂�氶亾鍙� (0-255) (1byte) + ///15鍦扮儹鍦板喎瀹ゅ娓╁害浣胯兘: (0鍏�,1鏀跺箍鎾�,2璇�)20120928鏀� (0 - 2) (1byte) //娴嬮噺瀹ゅ娓╁害锛屼粎鏄剧ず鐢� + ///16鍦扮儹鍦板喎瀹ゅ娓╁害瀛愮綉鍦板潃 (0-255) (1byte) + ///17鍦扮儹鍦板喎瀹ゅ娓╁害璁惧鍦板潃 (0-255) (1byte) + ///18鍦扮儹鍦板喎瀹ゅ娓╁害閫氶亾鍙� (0-255) (1byte) + ///19鍦扮儹鍦板喎PID浣胯兘锛�0:闈濸ID, 1:PID(榛樿) (0 - 1) (1byte) + ///20鍦扮儹鍦板喎淇″彿绫诲瀷锛�0:Relay(榛樿),1:PWM Lavel (0-1) (1byte) + ///21鍦扮儹鍦板喎鏈�灏廝WM:0%(榛樿), 0-100%(娉ㄦ剰锛氭渶澶WM>=鏈�灏廝WM) (1byte) + ///22鍦扮儹鍦板喎鏈�澶WM:100%(榛樿),0-100%(娉ㄦ剰锛氭渶澶WM>=鏈�灏廝WM) (1byte) //20121206 + ///23鍦扮儹鍦板喎閫熷害SPEED:lower,low,M(榛樿),high,higher (0-4) (1byte) + ///24鍦扮儹鍦板喎鍛ㄦ湡CYCLE:1,2,3,5(榛樿),7,10,15,20鍒嗛挓min (0-7) (1byte) + ///25鍦扮儹鍦板喎宸ヤ綔娓╁害妯″紡绉嶇被璁剧疆 bit7:,6:,5:,4:鏃堕棿,3:绂诲紑,2:澶滄櫄,1:鐧藉ぉ,0:鏅��--(0鍏�1寮�) (1byte) + ///26鍦扮儹鍦板喎閿佸畾杩愯浣胯兘 0:鍏�(榛樿),1:寮� (0 - 1) (1byte) + ///27鍦扮儹鍦板喎鏃堕棿1(鐧藉ぉ)鏃� (0-23) (1byte) + ///28鍦扮儹鍦板喎鏃堕棿1(鐧藉ぉ)鍒� (0-59) (1byte) + ///29鍦扮儹鍦板喎鏃堕棿2(澶滄櫄)鏃� (0-23) (1byte) + ///30鍦扮儹鍦板喎鏃堕棿2(澶滄櫄)鍒� (0-59) (1byte) + ///31鍦扮儹鏈�楂樻俯搴﹁瀹氬��:(鎽勬皬5-80锛屽崕姘�41-176) (1byte) + ///32绌� (1byte) + ///33鍦扮儹鍦板喎鎺у埗妯″紡:0:鍛戒护鎺у埗(榛樿), 1:杩愮畻鎺у埗 (1byte) + ///34鍦扮儹鍦板喎鏍囧織: 0鍦扮儹锛�1鍦板喎锛�2鑷姩 (1byte) + ///35鍦扮儹鍦板喎鍚屾鍙戦��: 0涓嶅悓姝ワ紝1鍚屾 (1byte) + ///36鍦扮儹鍦板喎鍚屾鎺ユ敹: bit0寮�鍏炽�乥it1妯″紡銆乥it2娓╁害(bit鍊�0涓嶅悓姝ャ�乥it鍊�1鍚屾) (1byte) + ///37鍦扮儹鍦板喎鑷姩妯″紡瑙﹀彂娓╁害鍋忕Щ鍊硷細1-5 (1byte) //167銆�168銆�5001闈㈡澘 + ///褰╁睆鍔犲叆20150714 + ///38 鍦扮儹鍦板喎1瀛愮綉ID(鍛戒护鎺у埗鐩爣)锛�0-255 (1byte) + ///39 鍦扮儹鍦板喎1璁惧ID(鍛戒护鎺у埗鐩爣)锛�0-255 (1byte) + ///40 鍦扮儹鍦板喎1閫氶亾鍙�(鍛戒护鎺у埗鐩爣): 1-6(榛樿1) (1byte) + ///41 鍦扮儹鍦板喎璁剧疆娓╁害鑼冨洿浣庨檺锛� 1byte (鎽勬皬5-35锛屽崕姘�41-95) + ///42 鍦扮儹鍦板喎璁剧疆娓╁害鑼冨洿楂橀檺, 1byte (鎽勬皬5-35锛屽崕姘�41-95) + ///43 娓╁害妯″紡(鎽勬皬Celsius:0(榛樿)锛屽崕姘廎ahrenheit:1), 1byte //姝ゅ弬鏁颁笉淇濆瓨锛屼粎浣滀负澶勭悊娓╁害鍙傛暟鐨勪緷鎹� + ///44 鍦扮儹椤靛彿0-8 (1byte /// </summary> + Read43FloorHeatingSettingEquipmentACK = 0x1941, + + SetACFloorHeatingSettingEquipment = 0x1978, + SetACFloorHeatingSettingEquipmentACK = 0x1979, + /// <summary> + /// 4.3 + /// 1鍦扮儹鍦板喎寮�鍚叧闂細0鍏�,1寮�, (0 - 1) (1byte) + ///2鍦扮儹鍦板喎娓╁害婧怱OURCE: 0鏈�,1澶�,2涓よ�呭钩鍧� (0 - 2) (1byte) + ///3鍦扮儹鍦板喎澶栨俯搴︽簮1浣胯兘: (0鍏�,1鏀跺箍鎾�,2璇�)20120928鏀� (0 - 2) (1byte) //鐢ㄤ簬姝e父澶栨俯搴︽帶鍒� + ///4鍦扮儹鍦板喎澶栨俯搴︽簮1瀛愮綉鍦板潃 (0-255) (1byte) + ///5鍦扮儹鍦板喎澶栨俯搴︽簮1璁惧鍦板潃 (0-255) (1byte) + ///6鍦扮儹鍦板喎澶栨俯搴︽簮1閫氶亾鍙� (0-255) (1byte) + ///7鍦扮儹鍦板喎澶栨俯搴︽簮2浣胯兘: (0鍏�,1鏀跺箍鎾�,2璇�)20120928鏀� (0 - 2) (1byte) //鐢ㄤ簬姝e父澶栨俯搴︽帶鍒� + ///8鍦扮儹鍦板喎澶栨俯搴︽簮2瀛愮綉鍦板潃 (0-255) (1byte) + ///9鍦扮儹鍦板喎澶栨俯搴︽簮2璁惧鍦板潃 (0-255) (1byte) + ///10鍦扮儹鍦板喎澶栨俯搴︽簮2閫氶亾鍙� (0-255) (1byte) + ///11鍦扮儹鏈�楂樻俯搴︽簮浣胯兘: (0鍏�,1鏀跺箍鎾�,2璇�)20120928鏀� (0 - 2) (1byte) //娴嬮噺鏈�楂橀檺娓╁害锛岀敤浜庨檺瀹氭帶鍒� + ///12鍦扮儹鏈�楂樻俯搴︽簮瀛愮綉鍦板潃 (0-255) (1byte) + ///13鍦扮儹鏈�楂樻俯搴︽簮璁惧鍦板潃 (0-255) (1byte) + ///14鍦扮儹鏈�楂樻俯搴﹂�氶亾鍙� (0-255) (1byte) + ///15鍦扮儹鍦板喎瀹ゅ娓╁害浣胯兘: (0鍏�,1鏀跺箍鎾�,2璇�)20120928鏀� (0 - 2) (1byte) //娴嬮噺瀹ゅ娓╁害锛屼粎鏄剧ず鐢� + ///16鍦扮儹鍦板喎瀹ゅ娓╁害瀛愮綉鍦板潃 (0-255) (1byte) + ///17鍦扮儹鍦板喎瀹ゅ娓╁害璁惧鍦板潃 (0-255) (1byte) + ///18鍦扮儹鍦板喎瀹ゅ娓╁害閫氶亾鍙� (0-255) (1byte) + ///19鍦扮儹鍦板喎PID浣胯兘锛�0:闈濸ID, 1:PID(榛樿) (0 - 1) (1byte) + ///20鍦扮儹鍦板喎淇″彿绫诲瀷锛�0:Relay(榛樿),1:PWM Lavel (0-1) (1byte) + ///21鍦扮儹鍦板喎鏈�灏廝WM:0%(榛樿), 0-100%(娉ㄦ剰锛氭渶澶WM>=鏈�灏廝WM) (1byte) + ///22鍦扮儹鍦板喎鏈�澶WM:100%(榛樿),0-100%(娉ㄦ剰锛氭渶澶WM>=鏈�灏廝WM) (1byte) //20121206 + ///23鍦扮儹鍦板喎閫熷害SPEED:lower,low,M(榛樿),high,higher (0-4) (1byte) + ///24鍦扮儹鍦板喎鍛ㄦ湡CYCLE:1,2,3,5(榛樿),7,10,15,20鍒嗛挓min (0-7) (1byte) + ///25鍦扮儹鍦板喎宸ヤ綔娓╁害妯″紡绉嶇被璁剧疆 bit7:,6:,5:,4:鏃堕棿,3:绂诲紑,2:澶滄櫄,1:鐧藉ぉ,0:鏅��--(0鍏�1寮�) (1byte) + ///26鍦扮儹鍦板喎閿佸畾杩愯浣胯兘 0:鍏�(榛樿),1:寮� (0 - 1) (1byte) + ///27鍦扮儹鍦板喎鏃堕棿1(鐧藉ぉ)鏃� (0-23) (1byte) + ///28鍦扮儹鍦板喎鏃堕棿1(鐧藉ぉ)鍒� (0-59) (1byte) + ///29鍦扮儹鍦板喎鏃堕棿2(澶滄櫄)鏃� (0-23) (1byte) + ///30鍦扮儹鍦板喎鏃堕棿2(澶滄櫄)鍒� (0-59) (1byte) + ///31鍦扮儹鏈�楂樻俯搴﹁瀹氬��:(鎽勬皬5-80锛屽崕姘�41-176) (1byte) + ///32绌� (1byte) + ///33鍦扮儹鍦板喎鎺у埗妯″紡:0:鍛戒护鎺у埗(榛樿), 1:杩愮畻鎺у埗 (1byte) + ///34鍦扮儹鍦板喎鏍囧織: 0鍦扮儹锛�1鍦板喎锛�2鑷姩 (1byte) + ///35鍦扮儹鍦板喎鍚屾鍙戦��: 0涓嶅悓姝ワ紝1鍚屾 (1byte) + ///36鍦扮儹鍦板喎鍚屾鎺ユ敹: bit0寮�鍏炽�乥it1妯″紡銆乥it2娓╁害(bit鍊�0涓嶅悓姝ャ�乥it鍊�1鍚屾) (1byte) + ///37鍦扮儹鍦板喎鑷姩妯″紡瑙﹀彂娓╁害鍋忕Щ鍊硷細1-5 (1byte) //167銆�168銆�5001闈㈡澘 + ///褰╁睆鍔犲叆20150714 + ///38 鍦扮儹鍦板喎1瀛愮綉ID(鍛戒护鎺у埗鐩爣)锛�0-255 (1byte) + ///39 鍦扮儹鍦板喎1璁惧ID(鍛戒护鎺у埗鐩爣)锛�0-255 (1byte) + ///40 鍦扮儹鍦板喎1閫氶亾鍙�(鍛戒护鎺у埗鐩爣): 1-6(榛樿1) (1byte) + ///41 鍦扮儹鍦板喎璁剧疆娓╁害鑼冨洿浣庨檺锛� 1byte (鎽勬皬5-35锛屽崕姘�41-95) + ///42 鍦扮儹鍦板喎璁剧疆娓╁害鑼冨洿楂橀檺, 1byte (鎽勬皬5-35锛屽崕姘�41-95) + ///43 娓╁害妯″紡(鎽勬皬Celsius:0(榛樿)锛屽崕姘廎ahrenheit:1), 1byte //姝ゅ弬鏁颁笉淇濆瓨锛屼粎浣滀负澶勭悊娓╁害鍙傛暟鐨勪緷鎹� + ///44 鍦扮儹椤靛彿0-8 (1byte /// </summary> + Set43FloorHeatingSettingEquipment = 0x1942, + /// <summary> + /// 1bytes loopid + /// </summary> + Set43FloorHeatingSettingEquipmentACK = 0x1943, + + + #region ============================闈㈡澘绌鸿皟缁煎悎鍙傛暟璁剧疆鍛戒护=======================================//褰╁睆 + /// <summary> + ///[0]//绌鸿皟椤靛彿(0-8) + /// </summary> + READ_AIR_ALL_Parameter = 0x19AA, + ///[0]//绌鸿皟椤靛彿(0-8) 1byte + ///[1]//绌鸿皟鍔熻兘(0鍏抽棴,1寮�鍚�(榛樿)) 1byte + ///[2]//鐩爣瀛愮綉ID(0-255) 1byte + ///[3]//鐩爣璁惧ID(0-255) 1byte + ///[4]//绌鸿皟鍙�(1(榛樿)-128) 1byte + ///[5]//绌鸿皟鎺у埗鍛戒护閫夋嫨(0鏃�(榛樿),1鏂�) 1byte + ///[6]//绌鸿皟杩愮畻鎺у埗浣胯兘(0绂佹-1鍏佽(榛樿)) 1byte + ///[7]//绌鸿皟涓婄數寮�鍏崇姸鎬�(0鍏筹紝1(榛樿)淇濇寔涓婃鐘舵��) 1byte + ///[8]//绾㈠杩愮畻鎺у埗浣胯兘(0绂佹(榛樿)-1鍏佽) 1byte 寮冪敤 + ///[9]//绌鸿皟绾㈠鎺у埗浣胯兘 (0绂佹(榛樿)-1鍏佽) 1byte 寮冪敤 + ///[10]//绌鸿皟绾㈠涓婄數鎺у埗浣胯兘 (0绂佹-1鍏佽(榛樿)) 1byte 寮冪敤 + ///[11]//鎵鍔熻兘(0鍏抽棴(榛樿),1寮�鍚�) 1byte + ///[12]//椋庢満鑺傝兘鏍囧織(0涓嶇渷鐢�(榛樿),1鐪佺數) 1byte + ///椋庨�熸ā寮忕绫� + ///[13]//椋庨�熺绫诲ぇ灏�-speed_size, 1byte (椋庨�熺绫�:0 鑷姩锛�1楂橀锛�2涓锛�3浣庨) + ///[14]//椋庨�熺绫诲瓨鍌ㄥ櫒1-speed1, 1byte + ///[15]//椋庨�熺绫诲瓨鍌ㄥ櫒2-speed2, 1byte + ///[16]//椋庨�熺绫诲瓨鍌ㄥ櫒3-speed3, 1byte + ///[17]//椋庨�熺绫诲瓨鍌ㄥ櫒4-speed4, 1byte + ///[18]//妯″紡绉嶇被澶у皬-Mode_size, 1byte (妯″紡绉嶇被:0 鍒跺喎锛�1鍒剁儹锛�2閫氶锛�3鑷姩锛�4闄ゆ箍) + ///[19]//妯″紡绉嶇被瀛樺偍鍣�1-Mode1, 1byte + ///[20]//妯″紡绉嶇被瀛樺偍鍣�2-Mode2, 1byte + ///[21]//妯″紡绉嶇被瀛樺偍鍣�3-Mode3, 1byte + ///[22]//妯″紡绉嶇被瀛樺偍鍣�4-Mode4, 1byte + ///[23]//妯″紡绉嶇被瀛樺偍鍣�5-Mode5, 1byte + ///璁剧疆娓╁害鑼冨洿 + ///[24]//鍒跺喎璁剧疆娓╁害鑼冨洿浣庨檺set cool low锛� 1byte (鎽勬皬0-30锛屽崕姘�32-86) + ///[25]//鍒跺喎璁剧疆娓╁害鑼冨洿楂橀檺set cool high, 1byte + ///[26]//鍒剁儹璁剧疆娓╁害鑼冨洿浣庨檺set heat low锛� 1byte (鎽勬皬0-30锛屽崕姘�32-86) + ///[27]//鍒剁儹璁剧疆娓╁害鑼冨洿楂橀檺set heat high, 1byte + ///[28]//鑷姩璁剧疆娓╁害鑼冨洿浣庨檺set auto low锛� 1byte (鎽勬皬0-30锛屽崕姘�32-86) + ///[29]//鑷姩璁剧疆娓╁害鑼冨洿楂橀檺set auto high, 1byte + ///[30]//闄ゆ箍璁剧疆娓╁害鑼冨洿浣庨檺set dry low锛� 1byte (鎽勬皬0-30锛屽崕姘�32-86) + ///[31]//闄ゆ箍璁剧疆娓╁害鑼冨洿楂橀檺set dry high, 1byte + ///[32]//绌鸿皟娓╁害婧�: 0鏈満,1澶栭儴,2涓よ�呭钩鍧� (1byte) + ///[33]//绌鸿皟澶栨俯搴︽簮1浣胯兘: (0鍏�,1鏀跺箍鎾�,2璇�) (1byte) + ///[34]//绌鸿皟澶栨俯搴︽簮1瀛愮綉鍦板潃 (0-255) (1byte) + ///[35]//绌鸿皟澶栨俯搴︽簮1璁惧鍦板潃 (0-255) (1byte) + ///[36]//绌鸿皟澶栨俯搴︽簮1閫氶亾鍙� (0-255) (1byte) + ///[37]//绌鸿皟澶栨俯搴︽簮2浣胯兘: (0鍏�,1鏀跺箍鎾�,2璇�) + ///[38]//绌鸿皟澶栨俯搴︽簮2瀛愮綉鍦板潃 (0-255) (1byte) + ///[39]//绌鸿皟澶栨俯搴︽簮2璁惧鍦板潃 (0-255) (1byte) + ///[40]//绌鸿皟澶栨俯搴︽簮2閫氶亾鍙� (0-255) (1byte) + ///[41]//娓╁害妯″紡(鎽勬皬Celsius:0(榛樿)锛屽崕姘廎ahrenheit:1), 1byte //姝ゅ弬鏁颁笉淇濆瓨锛屼粎浣滀负澶勭悊娓╁害鍙傛暟鐨勪緷鎹� + READ_AIR_ALL_Parameter_ack = 0x19AB, + + /// <summary> + /// [0]//绌鸿皟椤靛彿(0-8) 1byte + ///[1]//绌鸿皟鍔熻兘(0鍏抽棴,1寮�鍚�(榛樿)) 1byte + ///[2]//鐩爣瀛愮綉ID(0-255) 1byte + ///[3]//鐩爣璁惧ID(0-255) 1byte + ///[4]//绌鸿皟鍙�(1(榛樿)-128) 1byte + ///[5]//绌鸿皟鎺у埗鍛戒护閫夋嫨(0鏃�(榛樿),1鏂�) 1byte + ///[6]//绌鸿皟杩愮畻鎺у埗浣胯兘(0绂佹-1鍏佽(榛樿)) 1byte + ///[7]//绌鸿皟涓婄數寮�鍏崇姸鎬�(0鍏筹紝1(榛樿)淇濇寔涓婃鐘舵��) 1byte + ///[8]//绾㈠杩愮畻鎺у埗浣胯兘(0绂佹(榛樿)-1鍏佽) 1byte 寮冪敤 + ///[9]//绌鸿皟绾㈠鎺у埗浣胯兘 (0绂佹(榛樿)-1鍏佽) 1byte 寮冪敤 + ///[10]//绌鸿皟绾㈠涓婄數鎺у埗浣胯兘 (0绂佹-1鍏佽(榛樿)) 1byte 寮冪敤 + ///[11]//鎵鍔熻兘(0鍏抽棴(榛樿),1寮�鍚�) 1byte + ///[12]//椋庢満鑺傝兘鏍囧織(0涓嶇渷鐢�(榛樿),1鐪佺數) 1byte + ///椋庨�熸ā寮忕绫� + ///[13]//椋庨�熺绫诲ぇ灏�-speed_size, 1byte (椋庨�熺绫�:0 鑷姩锛�1楂橀锛�2涓锛�3浣庨) + ///[14]//椋庨�熺绫诲瓨鍌ㄥ櫒1-speed1, 1byte + ///[15]//椋庨�熺绫诲瓨鍌ㄥ櫒2-speed2, 1byte + ///[16]//椋庨�熺绫诲瓨鍌ㄥ櫒3-speed3, 1byte + ///[17]//椋庨�熺绫诲瓨鍌ㄥ櫒4-speed4, 1byte + ///[18]//妯″紡绉嶇被澶у皬-Mode_size, 1byte (妯″紡绉嶇被:0 鍒跺喎锛�1鍒剁儹锛�2閫氶锛�3鑷姩锛�4闄ゆ箍) + ///[19]//妯″紡绉嶇被瀛樺偍鍣�1-Mode1, 1byte + ///[20]//妯″紡绉嶇被瀛樺偍鍣�2-Mode2, 1byte + ///[21]//妯″紡绉嶇被瀛樺偍鍣�3-Mode3, 1byte + ///[22]//妯″紡绉嶇被瀛樺偍鍣�4-Mode4, 1byte + ///[23]//妯″紡绉嶇被瀛樺偍鍣�5-Mode5, 1byte + ///璁剧疆娓╁害鑼冨洿 + ///[24]//鍒跺喎璁剧疆娓╁害鑼冨洿浣庨檺set cool low锛� 1byte (鎽勬皬0-30锛屽崕姘�32-86) + ///[25]//鍒跺喎璁剧疆娓╁害鑼冨洿楂橀檺set cool high, 1byte + ///[26]//鍒剁儹璁剧疆娓╁害鑼冨洿浣庨檺set heat low锛� 1byte (鎽勬皬0-30锛屽崕姘�32-86) + ///[27]//鍒剁儹璁剧疆娓╁害鑼冨洿楂橀檺set heat high, 1byte + ///[28]//鑷姩璁剧疆娓╁害鑼冨洿浣庨檺set auto low锛� 1byte (鎽勬皬0-30锛屽崕姘�32-86) + ///[29]//鑷姩璁剧疆娓╁害鑼冨洿楂橀檺set auto high, 1byte + ///[30]//闄ゆ箍璁剧疆娓╁害鑼冨洿浣庨檺set dry low锛� 1byte (鎽勬皬0-30锛屽崕姘�32-86) + ///[31]//闄ゆ箍璁剧疆娓╁害鑼冨洿楂橀檺set dry high, 1byte + ///[32]//绌鸿皟娓╁害婧�: 0鏈満,1澶栭儴,2涓よ�呭钩鍧� (1byte) + ///[33]//绌鸿皟澶栨俯搴︽簮1浣胯兘: (0鍏�,1鏀跺箍鎾�,2璇�) (1byte) + ///[34]//绌鸿皟澶栨俯搴︽簮1瀛愮綉鍦板潃 (0-255) (1byte) + ///[35]//绌鸿皟澶栨俯搴︽簮1璁惧鍦板潃 (0-255) (1byte) + ///[36]//绌鸿皟澶栨俯搴︽簮1閫氶亾鍙� (0-255) (1byte) + ///[37]//绌鸿皟澶栨俯搴︽簮2浣胯兘: (0鍏�,1鏀跺箍鎾�,2璇�) + ///[38]//绌鸿皟澶栨俯搴︽簮2瀛愮綉鍦板潃 (0-255) (1byte) + ///[39]//绌鸿皟澶栨俯搴︽簮2璁惧鍦板潃 (0-255) (1byte) + ///[40]//绌鸿皟澶栨俯搴︽簮2閫氶亾鍙� (0-255) (1byte) + ///[41]//娓╁害妯″紡(鎽勬皬Celsius:0(榛樿)锛屽崕姘廎ahrenheit:1), 1byte //姝ゅ弬鏁颁笉淇濆瓨锛屼粎浣滀负澶勭悊娓╁害鍙傛暟鐨勪緷鎹� + /// </summary> + Set_AIR_ALL_Parameter = 0x19AC, + + ///[0]//绌鸿皟椤靛彿(0-8) 1byte + Set_AIR_ALL_Parameter_ack = 0x19AD, + #endregion + + + /// <summary> + /// 0X1d12 + /// 璇诲彇鍦扮儹娓╁害鎺㈠ご + /// 鏃犻檮鍔犳暟鎹� + /// 鍥炲 + /// [0]unit 鍗曚綅0锛氭憚姘� 1锛氬崕姘� + /// [1]鎬荤嚎涓�18B20鎬绘牴鏁� + /// [2]鎬荤嚎涓婃甯稿伐浣�18B20鐨勬牴鏁� + /// [3]鎬荤嚎涓婁笉姝e父宸ヤ綔18B20鐨勬牴鏁� + /// </summary> + ReadFloorHeatProbe = 0x1D12, + ReadFloorHeatProbeACK = 0x1D13, + + /// <summary> + /// 0x1C54 + /// 閰嶇疆鍦扮儹娓╁害浼犳劅鍣� + /// 闄勫姞鏁版嵁锛� + /// [0]number(1-6) 鍦扮儹鍙� + /// [1]operation model 0 -- self_op 1 -- panel_op //杩欎釜瀛楄妭涓嶅厑璁告墿灞� + /// [2]temperature_source 0 -- 鑷甫18B20 1--鎬荤嚎娓╁害(1璺�) 2--涓よ�呭彇骞冲潎鍊� + /// [3]淇濈暀 + /// [4]sensor1 subid + /// [5]sensor1 device id + /// [6]sensor1 channel (1~10) + /// [7]MaxT_Type BIT:0-- 閫氳繃鑷甫18B20 1--閫氳繃缃戠粶娓╁害(1璺�) BIT7:0--闄よ兘鏈�楂樻俯搴︽娴� 1:浣胯兘鏈�楂樻俯搴︽娴� + /// [8]MaxT_SensorNumber 姝ゅ湴鐑彿瀵瑰簲浼犳劅鍣ㄧ殑缂栧彿 0~杩樻病缂栧彿 1~250宸茬粡缂栧彿鐨勫彿鐮� + /// [9]MaxT_sub_ID + /// [10]MaxT_device_ID + /// [11]sensor2 channel (1~10) + /// [12]Max_Temperarture 鏍规嵁閫氶亾娓╁害绫诲瀷鍒ゅ埆鏄憚姘忚繕鏄崕姘� BIT7:1-娓╁害骞挎挱锛�0-no + /// [13]澶氫釜浼犳劅鍣ㄥ彇骞冲潎鍊� 浣胯兘 bit0:1st18b20 bit1:2st18b20 bit2:3st18b20 bit3:4st18b20 + /// [14]杩愮畻鐢⊿ensor_Number1 + /// [15]杩愮畻鐢⊿ensor_Number2 + /// [16]杩愮畻鐢⊿ensor_Number3 + /// [17]杩愮畻鐢⊿ensor_Number4 + /// 鍥炲 2byte + /// 鎴愬姛鎴栬�呭け璐� + /// 鍥炶矾鍙� + /// </summary> + WriteFloorHeatSensor = 0x1C54, + WriteFloorHeatSensorACK = 0x1C54, + + /// <summary> + /// 0x1D56 + /// 璇诲彇鍦扮儹娓╁害浼犳劅鍣� + /// 闄勫姞鏁版嵁锛氬洖璺彿 + /// 鍥炲 + /// [0]number(1-6) 鍦扮儹鍙� + /// [1]operation model 0 -- self_op 1 -- panel_op //杩欎釜瀛楄妭涓嶅厑璁告墿灞� + /// [2]temperature_source 0 -- 鑷甫18B20 1--鎬荤嚎娓╁害(1璺�) 2--涓よ�呭彇骞冲潎鍊� + /// [3]淇濈暀 + /// [4]sensor1 subid + /// [5]sensor1 device id + /// [6]sensor1 channel (1~10) + /// [7]MaxT_Type BIT:0-- 閫氳繃鑷甫18B20 1--閫氳繃缃戠粶娓╁害(1璺�) BIT7:0--闄よ兘鏈�楂樻俯搴︽娴� 1:浣胯兘鏈�楂樻俯搴︽娴� + /// [8]MaxT_SensorNumber 姝ゅ湴鐑彿瀵瑰簲浼犳劅鍣ㄧ殑缂栧彿 0~杩樻病缂栧彿 1~250宸茬粡缂栧彿鐨勫彿鐮� + /// [9]MaxT_sub_ID + /// [10]MaxT_device_ID + /// [11]sensor2 channel (1~10) + /// [12]Max_Temperarture 鏍规嵁閫氶亾娓╁害绫诲瀷鍒ゅ埆鏄憚姘忚繕鏄崕姘� BIT7:1-娓╁害骞挎挱锛�0-no + /// [13]澶氫釜浼犳劅鍣ㄥ彇骞冲潎鍊� 浣胯兘 bit0:1st18b20 bit1:2st18b20 bit2:3st18b20 bit3:4st18b20 + /// [14]杩愮畻鐢⊿ensor_Number1 + /// [15]杩愮畻鐢⊿ensor_Number2 + /// [16]杩愮畻鐢⊿ensor_Number3 + /// [17]杩愮畻鐢⊿ensor_Number4 + /// </summary> + ReadFloorHeatSensor = 0x1C56, + ReadFloorHeatSensorACK = 0x1C57, + + /// <summary> + /// 0x1D16 + /// 璇诲彇鍦扮儹娓╁害浼犳劅鍣ㄦ暟鎹� + /// 闄勫姞鏁版嵁锛氱紪鍙凤紙1-13锛�1D12璇诲彇鎬绘暟锛屾渶澶�13璺� + /// 鍥炲 + /// [0]num缂栧彿 1~13 + /// [1~8]ROM,鐗╃悊鍦板潃 + /// [9]鐘舵�佸�� 0锛氭甯� 1锛氫笉姝e父 2锛氭柊澧炲姞 + /// [10]Compensation (5~15)娓╁害琛ュ伩 瀵圭収锛�(5,10,15)= -5,0,5 + /// [11]~[30]DS18B20Remark + /// [31]ID缂栧彿 锛堝彧闇�瑕佽繖涓猙yte锛� + /// [32]娓╁害鍊� BIT7琛ㄧず绗﹀彿 0锛氳〃绀烘鏁� 1锛氳〃绀鸿礋鏁� + /// </summary> + ReadFloorHeatProbeNumber = 0x1D16, + ReadFloorHeatProbeNumberACK = 0x1D17, + + ControlMusicModel = 0x192E, + ControlMusicModel1ACK = 0x192F, + + ControlMusicModel2 = 0x1970, + ControlMusicModel2ACK = 0x1971, + + ///0xE45C 璁剧疆閫昏緫妯″潡锛圧GB锛夐鑹� + ///1 閫昏緫鍥炶矾鍙� + ///2 鏁翠綋浜害 + ///3 棰滆壊鍙� 鍥哄畾涓� 254 + ///4 杩愯鏃堕棿 楂樹綅 + ///5 杩愯鏃堕棿 浣庝綅 + ///6 閫昏緫鐏被鍨� 1-5//1鍗曡矾 2CCT 3RGB 4RGBW 5RGBWY + ///7 閫昏緫鍥炶矾 閫氶亾1鐨勫�� //RGB鏈�澶у�兼槸255 鍏跺畠绫讳负鏈�澶т负100 + ///8 閫昏緫鍥炶矾 閫氶亾2鐨勫�� //RGB鏈�澶у�兼槸255 鍏跺畠绫讳负鏈�澶т负100 + ///9 閫昏緫鍥炶矾 閫氶亾3鐨勫�� //RGB鏈�澶у�兼槸255 鍏跺畠绫讳负鏈�澶т负100 + ///10 閫昏緫鍥炶矾 閫氶亾4鐨勫�� //RGB鏈�澶у�兼槸255 鍏跺畠绫讳负鏈�澶т负100 + ///11 閫昏緫鍥炶矾 閫氶亾5鐨勫�� //RGB鏈�澶у�兼槸255 鍏跺畠绫讳负鏈�澶т负100 + SetLogicLoopColor = 0xE45C, + ///1 閫昏緫鍥炶矾鍙� + ///2 鏁翠綋浜害 + ///3 棰滆壊鍙� 鍥哄畾涓� 254 + ///4 杩愯鏃舵暗楂樹綅 + ///5 杩愯鏃堕棿 浣庝綅 + ///6 閫昏緫鐏被鍨� 1-5//1鍗曡矾 2CCT 3RGB 4RGBW 5RGBWY + ///7 閫昏緫鍥炶矾 閫氶亾1鐨勫�� //RGB鏈�澶у�兼槸255 鍏跺畠绫讳负鏈�澶т负100 + ///8 閫昏緫鍥炶矾 閫氶亾2鐨勫�� //RGB鏈�澶у�兼槸255 鍏跺畠绫讳负鏈�澶т负100 + ///9 閫昏緫鍥炶矾 閫氶亾3鐨勫�� //RGB鏈�澶у�兼槸255 + ///10 閫昏緫鍥炶矾 閫氶亾4鐨勫�� //RGB鏈�澶у�兼槸255 鍏跺畠绫讳负鏈�澶т负100 + ///11 閫昏緫鍥炶矾 閫氶亾5鐨勫�� //RGB鏈�澶у�兼槸255 鍏跺畠绫讳负鏈�澶т负100 + SetLogicLoopColorACK = 0xE45D, + + ///0xE472 璇诲彇閫昏緫妯″潡锛圧GB锛夐鑹蹭俊鎭� + ///1 閫昏緫鍥炶矾鍙� + ReadLogicLoopColor = 0xE472, + ///1 閫昏緫鍥炶矾鍙� + ///2 鏁翠綋浜害 + ///3 棰滆壊鍙� 鍥哄畾涓� 254 + ///4 杩愯鏃堕棿 楂樹綅 + ///5 杩愯鏃堕棿 浣庝綅 + ///6 閫昏緫鐏被鍨� 1-5//1鍗曡矾 2CCT 3RGB 4RGBW 5RGBWY + ///7 閫昏緫鍥炶矾 閫氶亾1鐨勫�� //RGB鏈�澶у�兼槸255 鍏跺畠绫讳负鏈�澶т负100 + ///8 閫昏緫鍥炶矾 閫氶亾2鐨勫�� //RGB鏈�澶у�兼槸255 鍏跺畠绫讳负鏈�澶т负100 + ///9 閫昏緫鍥炶矾 閫氶亾3鐨勫�� //RGB鏈�澶у�兼槸255 鍏跺畠绫讳负鏈�澶т负100 + ///10 閫昏緫鍥炶矾 閫氶亾4鐨勫�� //RGB鏈�澶у�兼槸255 鍏跺畠绫讳负鏈�澶т负100 + ///11 閫昏緫鍥炶矾 閫氶亾5鐨勫�� //RGB鏈�澶у�兼槸255 鍏跺畠绫讳负鏈�澶т负100 + ReadLogicLoopColorACK = 0xE473, + + + + /// <summary> + /// 璇诲彇闂ㄩ攣鏃堕挓鍛戒护 0x1F48 + /// 璇诲彇闂ㄩ攣鏃堕挓鍛戒护鍥炲 0x1F49 + /// 1闂ㄩ攣缂栧彿 + ///2骞达紝鍏厓骞翠唤涓�2000鐨勫樊锛�0-100 / 澶辫触 0xF5锛� + ///3鏈� (1-12) + ///4鏃�(1-31) + ///5鏃�(0-23) + ///6鍒嗭紙0-59) + ///7绉�(0-59) + /// </summary> + ReadDoorLockClock = 0xDA00, + ReadDoorLockClockACK = 0xDA01, + + /// <summary> + /// 璁剧疆闂ㄩ攣鏃堕棿 0xDA02 + ///1骞达紝鍏厓骞翠唤涓�2000鐨勫樊锛�0-100 / 澶辫触 0xF5锛� + ///2鏈� (1-12) + ///3鏃�(1-31) + ///4鏃�(0-23) + ///5鍒嗭紙0-59) + ///6绉�(0-59) + /// 鏄熸湡(0-6锛�0鏄槦鏈熸棩) + /// 璁剧疆闂ㄩ攣鏃堕棿鍥炲 0xDA03 + /// 1鎴愬姛鎴栬�呭け璐� 锛團8= 鎴愬姛锛� F5 = 澶辫触锛� + /// </summary> + SetDoorLockTime = 0xDA02, + SetDoorLockTimeACK = 0xDA03, + + /// <summary> + /// 璇诲彇闂ㄩ攣鐘舵�佸拰鎶ヨ 0x1F4B + /// 1闂ㄩ攣缂栧彿 + /// 2 淇℃伅搴忓彿锛屾暟瀛楄秺灏忚秺鏂�(0 ~ 99 / 100 : 鍏ㄨ) + /// 璇诲彇闂ㄩ攣鐘舵�佸拰鎶ヨ鍥炲 0x1F4C + /// 1闂ㄩ攣缂栧彿 + /// 2 淇℃伅搴忓彿锛屾暟瀛楄秺灏忚秺鏂�(0 ~ 99 / 0xf5 : 澶辫触) + ///3 绫诲瀷 锛堝紑閿�: 0x01 鎸囩汗寮�閿侊紱0x02 瀵嗙爜寮�閿�; 0x03 鎰熷簲鍗″紑閿�;0x04 鏈烘閽ュ寵寮�閿�;0x05 杩滅▼鎺堟潈寮�閿�;0x06 涓存椂瀵嗙爜寮�閿�; + /// 鎶ヨ:0x07 浣跨敤鏈烘閽ュ寵寮�閿�;0x08 瀵嗙爜楠岃瘉閿欒鎶ヨ锛堝瘑鐮佽繛缁�3娆℃閿欒锛�;0x09 锛氶棬鏈攣濂芥姤璀︼紙闂ㄩ攣鏈叧濂斤紝 褰撻棬閿佸ソ鏃朵笂鎶ヨВ闄ゆ姤璀︼級;0x0a:鍔寔鎶ヨ锛堣緭鍏ラ槻鍔寔瀵嗙爜鎴栬�呴槻鍔寔鎸囩汗寮�閿佹椂鎶ヨ锛�;0x0b 闃叉挰鎶ヨ锛堥棬閿佽鎾紑鏃舵姤璀︼級;0x0c 鐢甸噺涓嶈冻鎶ヨ锛堢數閲忎笉瓒虫椂鎶ヨ锛�;0x0d 锛氭寚绾归獙璇侀敊璇姤璀︼紙寮�闂ㄩ獙璇佽緭鍏ユ寚绾硅繛缁敊璇鏁拌揪鍒伴棬閿佽瀹�3娆℃椂鎶ヨ); 0x0e 鍗$墖楠岃瘉閿欒鎶ヨ锛堝紑闂ㄩ獙璇佽緭鍏ュ崱鐗囪繛缁敊璇鏁拌揪鍒伴棬閿佽瀹�3娆℃姤璀︼級 + ///4鐢ㄦ埛ID(0 ~ 99 / 瀵嗙爜 0 ~ 9 / 涓存椂瀵嗙爜鍥哄畾涓� 10) + ///5 骞达紝鍏厓骞翠唤涓�2000鐨勫樊锛�0-100 / 澶辫触 0xF5锛� + ///6 鏈� (1-12) + ///7 鏃�(1-31) + ///8 鏃�(0-23) + ///9 鍒嗭紙0-59) + ///10 绉�(0-59) + /// </summary> + ReadDoorLockStateAndAlarm = 0x1F4B, + ReadDoorLockStateAndAlarmACK = 0x1F4C, + + /// <summary> + /// 骞挎挱闂ㄩ攣鐘舵�佸拰鎶ヨ 0x1F4D + /// 1 闂ㄩ攣缂栧彿 + /// 2 淇℃伅搴忓彿锛屾暟瀛楄秺灏忚秺鏂�(0 ~ 99 / 0xf5 : 澶辫触) + /// 3 绫诲瀷 锛堝紑閿�: + /// 0x01 鎸囩汗寮�閿侊紱 + /// 0x02 瀵嗙爜寮�閿� + /// 0x03 鎰熷簲鍗″紑閿� + /// 0x04 鏈烘閽ュ寵寮�閿� + /// 0x05 杩滅▼鎺堟潈寮�閿� + /// 0x06 涓存椂瀵嗙爜寮�閿� + ///鎶ヨ: + /// 0x07 锛氫娇鐢ㄦ満姊伴挜鍖欏紑閿� + ///0x08 锛氬瘑鐮侀獙璇侀敊璇姤璀︼紙瀵嗙爜杩炵画3娆℃閿欒锛� + ///0x09 锛氶棬鏈攣濂芥姤璀︼紙闂ㄩ攣鏈叧濂斤紝 褰撻棬閿佸ソ鏃朵笂鎶ヨВ闄ゆ姤璀︼級 + ///0x0a 锛氬姭鎸佹姤璀︼紙杈撳叆闃插姭鎸佸瘑鐮佹垨鑰呴槻鍔寔鎸囩汗寮�閿佹椂鎶ヨ锛� + ///0x0b 锛氶槻鎾姤璀︼紙闂ㄩ攣琚挰寮�鏃舵姤璀︼級 + ///0x0c 锛氱數閲忎笉瓒虫姤璀︼紙鐢甸噺涓嶈冻鏃舵姤璀︼級 + ///0x0d 锛氭寚绾归獙璇侀敊璇姤璀︼紙寮�闂ㄩ獙璇佽緭鍏ユ寚绾硅繛缁敊璇鏁拌揪鍒伴棬閿佽瀹�3娆℃椂鎶ヨ锛� + ///0x0e 锛氬崱鐗囬獙璇侀敊璇姤璀︼紙寮�闂ㄩ獙璇佽緭鍏ュ崱鐗囪繛缁敊璇鏁拌揪鍒伴棬閿佽瀹�3娆℃姤璀︼級 + ///4 鐢ㄦ埛ID(0 ~ 99 / 瀵嗙爜 0 ~ 9 / 涓存椂瀵嗙爜鍥哄畾涓� 10) + ///5 骞达紝鍏厓骞翠唤涓�2000鐨勫樊锛�0-100 / 澶辫触 0xF5锛� + ///6 鏈� (1-12) + ///7 鏃�(1-31) + ///8 鏃�(0-23) + ///9 鍒嗭紙0-59) + ///10 绉�(0-59) + /// </summary> + BroadcastDoorLockStateAndAlarm = 0x1F4D, + + /// <summary> + /// 璇诲彇闂ㄩ攣鐢ㄦ埛澶囨敞 0x1F4E + /// 1 闂ㄩ攣缂栧彿 + /// 2 寮�閿佺被鍨� (0x01 :鎸囩汗锛�0x02:瀵嗙爜;0x03:鎰熷簲鍗�;0x04:鎰熷簲鍗�) + /// 3 鐢ㄦ埛ID(0 ~ 99 / 瀵嗙爜 0 ~ 9 / 涓存椂瀵嗙爜鍥哄畾涓� 10) + /// 璇诲彇闂ㄩ攣鐢ㄦ埛澶囨敞鍥炲 0x1F4F + /// 1 闂ㄩ攣缂栧彿 + /// 2 瀵嗛挜绫诲瀷 (0x01 :鎸囩汗锛�0x02:瀵嗙爜;0x03:鎰熷簲鍗�;0x04:鎰熷簲鍗★紱0x05:澶辫触 ) + ///3 鐢ㄦ埛ID(0 ~ 99 / 瀵嗙爜 0 ~ 9 / 涓存椂瀵嗙爜鍥哄畾涓� 10) + ///4锝�23 锛堢敤鎴峰娉�0锝�19锛岀敤鎴峰娉ㄧ殑鍊奸兘鏄�0锝�255锛� + /// </summary> + ReadDoorLockUseRemark = 0x1F4E, + ReadDoorLockUseRemarkACK = 0x1F4F, + + + /// <summary> + /// 璁剧疆闂ㄩ攣鐢ㄦ埛澶囨敞 0x1F50 + /// 1 闂ㄩ攣缂栧彿 + /// 2 寮�閿佺被鍨� (0x01 :鎸囩汗锛�0x02:瀵嗙爜;0x03:鎰熷簲鍗�;0x04:鎰熷簲鍗★紱) + /// 3 鐢ㄦ埛ID(0 ~ 99 / 瀵嗙爜 0 ~ 9 / 涓存椂瀵嗙爜鍥哄畾涓� 10) + /// 4锝�23 锛堢敤鎴峰娉�0锝�19锛岀敤鎴峰娉ㄧ殑鍊奸兘鏄�0锝�255锛� + /// 璁剧疆闂ㄩ攣鐢ㄦ埛澶囨敞鍥炲 0x1F51 + /// 1 鎴愬姛鎴栬�呭け璐ワ紙F8 = 鎴愬姛锛汧5 锛� 澶辫触锛� + /// </summary> + SetDoorLockUseRemark = 0x1F50, + SetDoorLockUseRemarkACK = 0x1F51, + + /// <summary> + /// 璇诲彇涓存椂瀵嗙爜閰嶇疆 0x1F52 + /// 1 闂ㄩ攣缂栧彿 + /// 璇诲彇涓存椂瀵嗙爜閰嶇疆鍥炲 0x1F53 + /// 1 闂ㄩ攣缂栧彿 + /// 2 enable (0:unable/1:enable /澶辫触 0xF5) + /// 3 鍙敤娆℃暟 锛�0锝�15锛� + /// 5 Bit15-Bit0 瀵嗙爜鏈夋晥鏃堕棿锛堝垎閽燂級 锛堝�间负65532锛� + /// 6锝�11 瀵嗙爜1锝炲瘑鐮�6 锛堝�间负锛�0锝�9锛� + /// </summary> + ReadTemporaryPasswordConfigure = 0x1F52, + ReadTemporaryPasswordConfigureACK = 0x1F53, + + /// <summary> + /// 璁剧疆涓存椂瀵嗙爜 0x1F54 + /// 1 闂ㄩ攣缂栧彿 + /// 2 enable (0:unable/1:enable /澶辫触 0xF5) + /// 3 鍙敤娆℃暟 锛�0锝�15锛� + /// 5 Bit15-Bit0 瀵嗙爜鏈夋晥鏃堕棿锛堝垎閽燂級 锛堝�间负65532锛� + /// 6锝�11 瀵嗙爜1锝炲瘑鐮�6 锛堝�间负锛�0锝�9锛� + /// 璁剧疆涓存椂瀵嗙爜鍥炲 0x1F53 + /// 1 鎴愬姛鎴栬�呭け璐ワ紙F8 = 鎴愬姛锛汧5 锛� 澶辫触锛� + /// </summary> + SetTemporaryPassword = 0x1F54, + SetTemporaryPasswordACK = 0x1F55, + + /// <summary> + /// 杩滅▼寮�鍏抽攣 0x1F56 + /// 1 闂ㄩ攣缂栧彿 + /// 2 寮�鍏崇姸鎬� (1:寮�/2:鍏� ) + /// 杩滅▼寮�鍏抽攣鍥炲 0x1F57 + /// 1 鎴愬姛鎴栬�呭け璐ワ紙F8 = 鎴愬姛锛汧5 锛� 澶辫触锛� + /// </summary> + RemoteOpenOrCloseDoorLock = 0x1F56, + RemoteOpenOrCloseDoorLockACK = 0x1F57, + + RemoteReadDoorLockPassword = 0x1FE0, + RemoteReadDoorLockPasswordACK = 0x1FE1, + + /// <summary> + /// 璇诲彇寮�閿佸満鏅仈鍔ㄦ潯浠剁洰鏍� 0x1F58 + /// 1 闂ㄩ攣缂栧彿 + /// 2 鍦烘櫙绫诲瀷 (1:寮�閿�/2:鎶ヨ ) + ///3 鍦烘櫙 鎶ヨ鍜屽紑閿佸彧鏈変竴鏈夋晥 + /// 锛堝紑閿�: 0x01 鎸囩汗寮�閿侊紱0x02 瀵嗙爜寮�閿�; 0x03 鎰熷簲鍗″紑閿�;0x04 杩滅▼鎺堟潈寮�閿�;0x05 涓存椂瀵嗙爜寮�閿�; + /// 鎶ヨ:0x01 鎸熸寔鎶ヨ; 0x02 锛氶棬鏈攣濂芥姤璀�;0x03:鐢甸噺浣庢姤璀�;0x04锛堟劅搴斿崱锛屾寚绾癸紝瀵嗙爜锛夐敊璇姤璀�;0x05 鏈烘閽ュ寵寮�闂� 鎶ヨ;0x06 锛氶槻鎾姤璀� + ///4鐢ㄦ埛ID(0 ~ 99 / 瀵嗙爜 0 ~ 10锛堝彧鏈夊紑閿佸満鏅湁鏁堬級) + /// 5鐩爣搴忓彿 (number0~19) + /// 璇诲彇寮�閿佸満鏅仈鍔ㄦ潯浠剁洰鏍囧洖澶� 0x1F59 + /// 1 闂ㄩ攣缂栧彿 + /// 2 鍦烘櫙绫诲瀷 (1:寮�閿�/2:鎶ヨ / 0 鏃犳晥 / 0xf5 澶辫触) + ///3 鍦烘櫙 鎶ヨ鍜屽紑閿佸彧鏈変竴鏈夋晥 + /// 锛堝紑閿�: 0x01 鎸囩汗寮�閿侊紱0x02 瀵嗙爜寮�閿�; 0x03 鎰熷簲鍗″紑閿�;0x04 杩滅▼鎺堟潈寮�閿�;0x05 涓存椂瀵嗙爜寮�閿�; + /// 鎶ヨ:0x01 鎸熸寔鎶ヨ; 0x02 锛氶棬鏈攣濂芥姤璀�;0x03:鐢甸噺浣庢姤璀�;0x04锛堟劅搴斿崱锛屾寚绾癸紝瀵嗙爜锛夐敊璇姤璀�;0x05 鏈烘閽ュ寵寮�闂� 鎶ヨ;0x06 锛氶槻鎾姤璀� + ///4鐢ㄦ埛ID(0 ~ 99 / 瀵嗙爜 0 ~ 10(鍙湁寮�閿佸満鏅湁鏁�)) + /// 5鐩爣搴忓彿 (number0~19) + /// 6 Control_kind + /// 7 Control_sub_net + /// 8 Control_dev + /// 9 Control_fenqu + /// 10 Control_changjing + /// 11 Control_minute鈥攕ingal_adj + /// 12 Control_second鈥攕ingal_adj + /// </summary> + ReadDoorLockSceneObj = 0x1F58, + ReadDoorLockSceneObjACK = 0x1F59, + + /// <summary> + /// 璁剧疆寮�閿佸満鏅仈鍔ㄦ潯浠剁洰鏍� 0x1F5A + /// 1 闂ㄩ攣缂栧彿 + /// 2 鍦烘櫙绫诲瀷 (1:寮�閿�/2:鎶ヨ /:0鏃犳晥) + ///3 鍦烘櫙 鎶ヨ鍜屽紑閿佸彧鏈変竴鏈夋晥 + /// 锛堝紑閿�: 0x01 鎸囩汗寮�閿侊紱0x02 瀵嗙爜寮�閿�; 0x03 鎰熷簲鍗″紑閿�;0x04 杩滅▼鎺堟潈寮�閿�;0x05 涓存椂瀵嗙爜寮�閿�; + /// 鎶ヨ:0x01 鎸熸寔鎶ヨ; 0x02 锛氶棬鏈攣濂芥姤璀�;0x03:鐢甸噺浣庢姤璀�;0x04锛堟劅搴斿崱锛屾寚绾癸紝瀵嗙爜锛夐敊璇姤璀�;0x05 鏈烘閽ュ寵寮�闂� 鎶ヨ;0x06 锛氶槻鎾姤璀� + ///4鐢ㄦ埛ID(0 ~ 99 / 瀵嗙爜 0 ~ 9锛堝彧鏈夊紑閿佸満鏅湁鏁堬級) + /// 5鐩爣搴忓彿 (number0~19) + /// /// 6 Control_kind + /// 7 Control_sub_net + /// 8 Control_dev + /// 9 Control_fenqu + /// 10 Control_changjing + /// 11 Control_minute鈥攕ingal_adj + /// 12 Control_second鈥攕ingal_adj + /// 璁剧疆寮�閿佸満鏅仈鍔ㄦ潯浠剁洰鏍囧洖澶� 0x1F5B + /// 1 鎴愬姛鎴栬�呭け璐ワ紙F8 = 鎴愬姛锛汧5 锛� 澶辫触锛� + /// 2 闂ㄩ攣缂栧彿 + /// 3 鍦烘櫙绫诲瀷 (1:寮�閿�/2:鎶ヨ /:0鏃犳晥) + ///4 鍦烘櫙 鎶ヨ鍜屽紑閿佸彧鏈変竴鏈夋晥 + /// 锛堝紑閿�: 0x01 鎸囩汗寮�閿侊紱0x02 瀵嗙爜寮�閿�; 0x03 鎰熷簲鍗″紑閿�;0x04 杩滅▼鎺堟潈寮�閿�;0x05 涓存椂瀵嗙爜寮�閿�; + /// 鎶ヨ:0x01 鎸熸寔鎶ヨ; 0x02 锛氶棬鏈攣濂芥姤璀�;0x03:鐢甸噺浣庢姤璀�;0x04锛堟劅搴斿崱锛屾寚绾癸紝瀵嗙爜锛夐敊璇姤璀�;0x05 鏈烘閽ュ寵寮�闂� 鎶ヨ;0x06 锛氶槻鎾姤璀� + ///5鐢ㄦ埛ID(0 ~ 99 / 瀵嗙爜 0 ~ 10(鍙湁寮�閿佸満鏅湁鏁�)) + /// </summary> + SetDoorLockSceneObj = 0x1F5A, + SetDoorLockSceneObjACK = 0x1F5B, + + /// <summary> + /// 鍒涘缓杩炴帴 + /// </summary> + CreatConnection = 0xE4EE, + /// <summary> + /// 鍒涘缓杩炴帴杩斿洖(鏀跺埌鍛戒护绔嬪埢杩斿洖) + /// </summary> + CreatConnectionACK = 0xE4EF, + + /// <summary> + /// 杩炴帴鎴愬姛鍚庡彂閫佸懡浠ゅ彂閫佸姞瀵嗘寚浠�(鏀跺埌鍛戒护绔嬪埢杩斿洖) + /// </summary> + SendEncryptionAfterConnected = 0xE4F0, + + /// <summary> + /// 杩炴帴鎴愬姛鍚庡彂閫佸懡浠よ姹傚姞瀵嗘寚浠�((鏀跺埌鍛戒护绔嬪埢杩斿洖) + /// </summary> + SendEncryptionAfterConnectedACK = 0xE4F1, + + /// <summary> + /// GPRS鎺у埗 + /// </summary> + GPRSControl = 0xE3D4, + /// <summary> + /// 娑堥槻妯″潡 Security Module 011E + /// </summary> + SecurityModule = 0x011E, + + /// <summary> + /// 闊充箰鎾斁 Music Control 0218 + /// </summary> + MusicControl = 0x0218, + /// <summary> + /// 閫昏緫鐏皟鑺� Logic Light Adjust + /// </summary> + LogicLightAdjust = 0xE45E, + + + /// <summary> + /// 璇诲凡缁忓瓨鍌ㄨ繘flash閲岄潰鐨勮褰� + /// 寮�濮嬪勾 1 btye + /// 寮�濮嬫湀 1 btye + /// 寮�濮嬫棩 1 btye + /// 缁撴潫骞� 1 btye + /// 缁撴潫鏈� 1 btye + /// 缁撴潫鏃� 1 btye + /// </summary> + RED_HSFH_TOTAL = 0x0138, + /// <summary> + /// 璁板綍鎬绘暟 2 btyes + /// 寮�濮嬪湴鍧� 2 btyes + /// </summary> + RED_HSFH_TOTAL_ACK = 0x0139, + + /// <summary> + /// 璁板綍鍦板潃 (10 Bytes) + /// Sart_Year锛孲art_Mounch锛孲art_Day锛孍nd_Year锛孍nd_Mounch锛孍nd_Day,History_Sart_Addr_H, History_Sart_Addr_L锛孒istory_Num_H, History_Num_L + /// </summary> + RED_HSFH_INFORMATION = 0x013a, + /// <summary> + /// 鎴愬姛鏍囧織0xf8 1 btye + /// 31 btyes + /// 绗�0瀛楄妭涓鸿璀�/鎶ヨ鍖哄煙锛� + /// 绗�1瀛楄妭涓哄彂鐢熷勾锛� + /// 绗�2瀛楄妭涓哄彂鐢熸湀锛� + /// 绗�3瀛楄妭涓哄彂鐢熸棩锛� + /// 绗�4瀛楄妭涓哄彂鐢熷皬鏃讹紝 + /// 绗�5瀛楄妭涓哄彂鐢熷垎閽燂紝 + /// 绗�6瀛楄妭涓哄彂鐢熺閽燂紝 + /// 绗�7瀛楄妭涓鸿Е鍙戝瓙缃戝湴鍧�锛� + /// 绗�8瀛楄妭涓鸿Е鍙戣澶囧湴鍧�锛� + /// 绗�9瀛楄妭涓鸿闃叉ā寮�/鎶ヨ绫诲瀷楂樹綅锛� + /// 绗�10瀛楄妭涓�0/鎶ヨ绫诲瀷浣庝綅锛�1锝�19锛夛紝 + /// 绗�11锝�31瀛楄妭涓鸿Е鍙戣澶囧娉� + /// </summary> + RED_HSFH_INFORMATION_ACK = 0x013b, + + /// <summary> + /// 鏆傛椂杩樻病鏈夊瓨鍌ㄨ繘flash锛屼絾宸茬粡鏈夋姤璀﹁褰曠殑锛岃RAM鐨勮褰� + /// 寮�濮嬪勾 1 btye + /// 寮�濮嬫湀 1 btye + /// 寮�濮嬫棩 1 btye + /// 缁撴潫骞� 1 btye + /// 缁撴潫鏈� 1 btye + /// 缁撴潫鏃� 1 btye + /// </summary> + RED_HSRM_TOTAL = 0x0174, + /// <summary> + /// T璁板綍鎬绘暟 2 btyes + /// 寮�濮嬪湴鍧� 2 btyes + /// 缁撴潫鍦板潃 2 btyes + /// </summary> + RED_HSRM_TOTAL_ACK = 0x0175, + + /// <summary> + /// 璁板綍鍦板潃 2 btyes + /// </summary> + RED_HSRM_INFORMATION = 0x0176, + + /// <summary> + /// 鎴愬姛鏍囧織0xf8 1 btye + /// 璁板綍鍦板潃 2 btyes + /// 璁板綍淇℃伅 31 btyes + /// </summary> + RED_HSRM_INFORMATION_ACK = 0x0177, + + //璁板綍淇℃伅娉ㄩ噴锛氬尯鍙凤紙1锝�8锛夛紝骞达紝鏈堬紝鏃ワ紝灏忔椂锛屽垎閽燂紝绉掗挓锛屽瓙缃慽d锛岃澶噄d锛屾姤璀︾被鍨嬶紝閫氶亾鍙凤紝20 bytes澶囨敞淇℃伅 + /// <summary> + /// 娓呭巻鍙茬邯褰� + /// 鏍囧織锛�0xf8锛� 1 btye + /// </summary> + CLEAR_SYSTEM_HISTORY = 0x014a, + /// <summary> + /// 杩斿洖鏍囧織锛�0xf8/0xf5锛� 1 btye + /// </summary> + CLEAR_SYSTEM_HISTORY_ACK = 0x014b, + + /// <summary> + /// 璇诲彇瀹夐槻浼犳劅鍣ㄧ姸鎬� + /// 鍖哄彿 + 閫氶亾鍙� + 澶囨敞鏈夋晥锛�1锛氬娉� 锛屽叾浠栧�兼棤澶囨敞锛� + /// </summary> + ReadSecurityStatus = 0x15E4, + /// <summary> + /// 鍖哄彿 閫氶亾鍙� 鐘舵��(0:闂悎 1:鏂紑 2:涓嶅湪绾�) Bypass(0:涓嶄娇鑳� 1:浣胯兘) 澶囨敞 + /// </summary> + ReadSecurityStatusACK = 0x15E5, + + /// <summary> + /// 璁剧疆瀹夐槻 BYPASS + /// 鍖哄彿 閫氶亾鍙� Bypass + /// </summary> + SetSecurityByPass = 0x15E0, + SetSecurityByPassACK = 0x15E1, + + } + + /// <summary> + /// 鍙戦�佺怀 + /// </summary> + public enum SendCount + { + Zero = 0, + /// <summary> + /// 涓�娆� + /// </summary> + One = 1, + /// <summary> + /// 浜屾 + /// </summary> + Two = 2, + /// <summary> + /// 涓夋 + /// </summary> + Three = 3 + } + + + public enum InfraredCode_TV + { + VolDown = 1, + ChannelUp,//00002=棰戦亾+ + Menu,//00003=鑿滃崟 + ChannelDown,//00004=棰戦亾- + VolUp,//00005=闊抽噺+ + Power,//00006=鐢垫簮閿� + Mute,//00007=闈欓煶 + One,//00008=1 + Two,//00009=2 + Three,//00010=3 + Four,//00011=4 + Five,//00012=5 + Six,//00013=6 + Seven,//00014=7 + Eight,//00015=8 + Nine,//00016=9 + Change,//00017=-/-- + Zero,//00018=0 + AV_TV,//00019=AV/TV + Back,//00020=杩斿洖 + Confrim,//00021=纭畾 + Up,//00022=涓� + Left,//00023=宸� + Right,//00024=鍙� + Down,//00025=涓� + } + + public enum InfraredCode_STB + { + Standby = 1, + One, + Two, + Three, + Four, + Five, + Six, + Seven, + Eight, + Nine, + //Change, + HomePage, + Zero, + Back, + Up, + Left, + Confrim, + Right, + Down, + VolUp, + VolDown, + ChannelUp, + ChannelDown, + Menu, + } +} \ No newline at end of file diff --git a/HDL_ON/HDL/Operation/Packet.cs b/HDL_ON/HDL/Operation/Packet.cs new file mode 100644 index 0000000..9b3fbf0 --- /dev/null +++ b/HDL_ON/HDL/Operation/Packet.cs @@ -0,0 +1,103 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace HDL_ON +{ + public class Packet + { + /// <summary> + /// 缂撳啿鍖哄ぇ灏� + /// </summary> + public const int Size = 1024 + 200; + + /// <summary> + /// 鎺ユ敹鍒扮殑鏁版嵁 + /// </summary> + public byte [] Bytes; + + /// <summary> + /// 杩滅▼鐨勫鎺ュ瓧 + /// </summary> + public System.Net.EndPoint RemoteEndPoint; + + public Packet () + { + this.Bytes = new byte [Size]; + RemoteEndPoint = (System.Net.EndPoint)new System.Net.IPEndPoint (System.Net.IPAddress.Any, 0); + } + public Packet (byte [] data, System.Net.EndPoint remoteEndPoint) + { + this.Bytes = data; + this.RemoteEndPoint = remoteEndPoint; + } + + /// <summary> + /// 璁板綍宸茬粡鍙戦�佹暟鎹嚭鍘荤殑鏃堕棿 + /// </summary> + public System.DateTime FlagDateTime; + + /// <summary> + /// 宸茬粡鍙戦�佷簡澶氬皯鏁� + /// </summary> + public int HaveSendCount; + + public delegate void DelegateReceive (byte subnetID, byte deviceID, Command command, byte [] usefullBytes, string revGatewayIP); + public static event DelegateReceive ReceiveEvent; + /// <summary> + /// 鎺ユ敹鍒扮殑鎵�鏈夋暟鎹� + /// </summary> + public static Action<byte, byte, int, Command, byte, byte, byte [], System.Net.IPEndPoint> ReceviceAllDadaAction; + /// <summary> + /// 澶勭悊鎺ユ敹鍒扮殑鏁版嵁 + /// </summary> + public virtual void Manager () + { + //瀵逛簬鎿嶄綔鏁版嵁搴撶殑鏃堕棿姣旇緝闀跨殑锛屽彲浠ュ垱寤哄彟涓�涓嚎绋嬪鐞� + if (!"HDLMIRACLE".Equals (System.Text.Encoding.ASCII.GetString (Bytes, 4, 10))) { + return; + } + + byte subnetID = this.Bytes [17]; //婧愬瓙缃戝彿 + byte deviceID = this.Bytes [18]; //婧愯澶囧彿 + + //婧愯澶囩被鍨� + int deviceType = this.Bytes [19] * 256 + this.Bytes [20]; + + Command command = (Command)(Bytes [21] * 256 + Bytes [22]); //鎿嶄綔鐮佹帶鍒跺懡浠� + + byte targetSubnetID = this.Bytes [23]; + byte targetDeviceID = this.Bytes [24]; + + //涓嶆槸瑕佹帴鏀剁殑鎸囦护灏辫繑鍥� + if (!((targetSubnetID == 252 && targetDeviceID == 252) || (targetSubnetID == 0xff && targetDeviceID == 0xff))) { + return; + } + byte [] usefulBytes = null; + if (this.Bytes [16] == 0xFF) { + usefulBytes = new byte [Bytes.Length - 16 - 11]; + System.Array.Copy (Bytes, 27, usefulBytes, 0, usefulBytes.Length); + } else { + //鏈夌敤鐨勯檮鍔犳暟鎹� + usefulBytes = new byte [this.Bytes [16] - 11]; + Array.Copy (Bytes, 25, usefulBytes, 0, usefulBytes.Length); + } + + if (ReceiveEvent != null) { + ReceiveEvent (subnetID, deviceID, command, usefulBytes, $"{Bytes [0]}.{Bytes [1]}.{Bytes [2]}.{Bytes [3]}"); + } + + //if (command == Command.SuperGatewayAgentACK) { + // SuperGateWay.SendAndReceiveDatas.Recevice (subnetID, deviceID, usefulBytes); + //} + if (ReceviceAllDadaAction != null) { + ReceviceAllDadaAction (subnetID, deviceID, deviceType, command, targetSubnetID, targetDeviceID, usefulBytes, (System.Net.IPEndPoint)RemoteEndPoint); + } + //澶勭悊鏄惁瑕侀噸鍙戞暟鎹� + Control.ManagerReceive (subnetID, deviceID, command, targetSubnetID, targetDeviceID, usefulBytes, RemoteEndPoint); + + } + } +} \ No newline at end of file diff --git a/HDL_ON/HDL/Operation/RemoteInfo.cs b/HDL_ON/HDL/Operation/RemoteInfo.cs new file mode 100644 index 0000000..2f5a513 --- /dev/null +++ b/HDL_ON/HDL/Operation/RemoteInfo.cs @@ -0,0 +1,56 @@ +锘縰sing System; +using System.Collections.Generic; +using HDL_ON.DAL; + +namespace HDL_ON +{ + [System.Serializable] + public class RemoteInfo + { + static RemoteInfo () + { + Current = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoteInfo> (CommonPage.MyEncodingUTF8.GetString (MyIO.FileUtils.ReadFile ("RemoteInfoMsgList"))); + if (Current == null) + Current = new RemoteInfo (); + } + + public static RemoteInfo Current { + get; + private set; + } + + public List<RemoteInfoMsg> RemoteInfoList = new List<RemoteInfoMsg> (); + + + public void Del (RemoteInfoMsg msg) + { + RemoteInfoList.Remove (msg); + Save (); + } + + public void CleanAll () + { + Current.RemoteInfoList.Clear (); + Save (); + } + + public void Save () + { + var saveBytes = CommonPage.MyEncodingUTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (Current)); + MyIO.FileUtils.WriteFileByBytes ("RemoteInfoMsgList", saveBytes); + } + } + + [System.Serializable] + public class RemoteInfoMsg + { + public long MsgID; + + public string Msg; + + public string MsgType; + + public DateTime MsgTime; + + } +} \ No newline at end of file diff --git a/HDL_ON/HDL/Operation/Target.cs b/HDL_ON/HDL/Operation/Target.cs new file mode 100644 index 0000000..a36c7fd --- /dev/null +++ b/HDL_ON/HDL/Operation/Target.cs @@ -0,0 +1,150 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace HDL_ON +{ + /// <summary> + /// 控制目标数据 + /// </summary> + public class Target + { + /// <summary> + /// 发送的目标 + /// </summary> + public System.Net.IPEndPoint IPEndPoint; + + public Target() + { } + + public Target(System.Net.IPEndPoint ipEndPoint) + { + this.IPEndPoint = ipEndPoint; + } + + /// <summary> + /// 附加数据 + /// </summary> + public byte[] AddData; + + /// <summary> + /// 目标子网号 + /// </summary> + public byte SubnetID; + + /// <summary> + /// 目标设备号 + /// </summary> + public byte DeviceID; + + /// <summary> + /// 发送数据缓冲区 + /// </summary> + public byte [] SendBytes { + get { + + if (2 + 9 + AddData.Length + 2 <= 81&&Command!=Command.SuperGatewayAgent) { + byte [] bytes = new byte [16 + 9 + AddData.Length + 2]; + + string [] ipAddress = "192.168.1.20".Split ('.');//new Net.NetWiFi().IpAddress.ToString().Split('.'); + + bytes [0] = byte.Parse (ipAddress [0]); + bytes [1] = byte.Parse (ipAddress [1]); + bytes [2] = byte.Parse (ipAddress [2]); + bytes [3] = byte.Parse (ipAddress [3]); + + bytes [4] = (byte)'H';//H + bytes [5] = (byte)'D';//D + bytes [6] = (byte)'L';//L + bytes [7] = (byte)'M';//M + bytes [8] = (byte)'I';//I + bytes [9] = (byte)'R';//R + bytes [10] = (byte)'A';//A + bytes [11] = (byte)'C';//C + bytes [12] = (byte)'L';//L + bytes [13] = (byte)'E';//E + //引导码2位,0xAAAA固定 + bytes [14] = 0xAA; + bytes [15] = 0xAA; + + bytes [16] = (byte)(11 + AddData.Length);//数据包长度 + bytes [17] = 252; //源子网地址 0-254 + bytes [18] = 252;//源设备地址 0-254 + //源设备类型2位 + bytes [19] = (byte)(0xFF); + bytes [20] = (byte)(0xFC); + //操作码 + bytes [21] = (byte)((int)this.Command / 256); + bytes [22] = (byte)((int)this.Command % 256); + //目标子网地址 0-254 + bytes [23] = this.SubnetID; + //目标设备地址 0-254 + bytes [24] = this.DeviceID; + + Array.Copy (AddData, 0, bytes, 25, AddData.Length); + + //CRC校验位 + bytes [bytes.Length - 2] = 0; + bytes [bytes.Length - 1] = 0; + + + CRC.ConCRC (ref bytes, 16, bytes.Length - 2); + + return bytes; + } else { + byte [] bytes = new byte [16 + 9 + 2 + AddData.Length]; + + string [] ipAddress = "192.168.1.20".Split ('.');//new Net.NetWiFi().IpAddress.ToString().Split('.'); + + bytes [0] = byte.Parse (ipAddress [0]); + bytes [1] = byte.Parse (ipAddress [1]); + bytes [2] = byte.Parse (ipAddress [2]); + bytes [3] = byte.Parse (ipAddress [3]); + + bytes [4] = (byte)'H';//H + bytes [5] = (byte)'D';//D + bytes [6] = (byte)'L';//L + bytes [7] = (byte)'M';//M + bytes [8] = (byte)'I';//I + bytes [9] = (byte)'R';//R + bytes [10] = (byte)'A';//A + bytes [11] = (byte)'C';//C + bytes [12] = (byte)'L';//L + bytes [13] = (byte)'E';//E + //引导码2位,0xAAAA固定 + bytes [14] = 0xAA; + bytes [15] = 0xAA; + + bytes [16] = 0xFF;//数据包长度 + bytes [17] = 252; //源子网地址 0-254 + bytes [18] = 252;//源设备地址 0-254 + //源设备类型2位 + bytes [19] = (byte)(0xFF); + bytes [20] = (byte)(0xFC); + //操作码 + bytes [21] = (byte)((int)this.Command / 256); + bytes [22] = (byte)((int)this.Command % 256); + //目标子网地址 0-254 + bytes [23] = this.SubnetID; + //目标设备地址 0-254 + bytes [24] = this.DeviceID; + + // + bytes [25] = (byte)(AddData.Length / 256); + // + bytes [26] = (byte)(AddData.Length % 256); + + Array.Copy (AddData, 0, bytes, 27, AddData.Length); + + return bytes; + } + } + } + + /// <summary> + /// 操作码 + /// </summary> + public Command Command; + + } +} \ No newline at end of file diff --git a/HDL_ON/HDL/Operation/UserConfig.cs b/HDL_ON/HDL/Operation/UserConfig.cs new file mode 100644 index 0000000..9af80c9 --- /dev/null +++ b/HDL_ON/HDL/Operation/UserConfig.cs @@ -0,0 +1,217 @@ +锘縰sing System; +using System.Collections.Generic; +using HDL_ON.DAL; +using HDL_ON.R; + +namespace HDL_ON +{ + [System.Serializable] + public class UserConfig + { + static string configFile = "UserConfig"; + + static UserConfig instance; + public static UserConfig Instance { + get { + if (instance == null) { + try { + var userConfigBytes = MyIO.FileUtils.ReadFile (configFile); + var userConfigString = CommonPage.MyEncodingUTF8.GetString (userConfigBytes); + UserConfig temp = null; + if (userConfigString != null) { + temp = Newtonsoft.Json.JsonConvert.DeserializeObject<UserConfig> (userConfigString); + } + if (temp == null) { + instance = new UserConfig { }; + instance.HideDeviceTypes.Add (InternationalizationString.VideoIntercom); + instance.HideDeviceTypes.Add (InternationalizationString.Thermostat); + } else { + instance = temp; + } + } catch { } + } + instance.DeviceTypes = new List<int> (){ + InternationalizationString.AC, + InternationalizationString.Lights, + InternationalizationString.Curtain, + InternationalizationString.Scenes, + InternationalizationString.FoolHeat, + InternationalizationString.Monitor, + InternationalizationString.Security, + InternationalizationString.TV, + InternationalizationString.Music, + InternationalizationString.ElectricalControl, + InternationalizationString.Fan, + InternationalizationString.DoorLock, + InternationalizationString.UniversalDevice, + InternationalizationString.Environmental, + InternationalizationString.VideoIntercom, + InternationalizationString.Thermostat, + + //------------------------------------- + }; + return instance; + } + } + + byte [] GetUserConfigBytes () + { + return CommonPage.MyEncodingUTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (this)); + } + + public void RefreshUserConfig () + { + instance = null; + SaveUserConfig (); + } + + public void SaveUserConfig () + { + MyIO.FileUtils.WriteFileByBytes (configFile, GetUserConfigBytes ()); + } + + public int internetStatus = 2; + + /// <summary> + /// 瀛樻斁涓嶇敤璋冨厜鍔熻兘鐨勮皟鍏夎澶� + /// </summary> + public List<string> UnEnableDimmingLight = new List<string> (); + + /// <summary> + /// 鎻掑骇寮�鍏冲垪琛� + /// </summary> + public List<string> SocketList = new List<string> (); + + /// <summary> + /// 鎵嬫満appID + /// </summary> + public string tokenID = string.Empty; + + /// <summary> + /// 鎵嬫満鍒悕 + /// </summary> + public string phoneName = string.Empty; + + /// <summary> + /// 鐢ㄦ埛鐣岄潰杩涘叆鏃舵槸鍚︽樉绀虹殑鏄叏灞�鍦烘櫙鐣岄潰 + /// </summary> + public bool SceneOfGloba = false; + + /// <summary> + /// 淇濆瓨杩滅▼杩炴帴鐨勭綉缁滆澶囨枃浠跺悕 + /// </summary> + public string RemoteModeFile = string.Empty; + + /// <summary> + /// 鏄惁灞曞紑鎴块棿鐏厜鍒楄〃 + /// </summary> + public bool ShowRoomLightList = true; + + /// <summary> + /// 鏄惁灞曞紑鎴块棿绐楀笜鍒楄〃 + /// </summary> + public bool ShowRoomCurtainList = true; + + /// <summary> + /// 闅愯棌娌℃湁鍦烘櫙鐨勬埧闂� + /// </summary> + public bool HideInvalidRoomScene = false; + + public bool ShowFunctionBackground = true; + + //瑕佹樉绀虹殑璁惧绫诲瀷鍏堝湪杩欓噷鍔犺繘鏂囨湰閫夋嫨 + public List<int> DeviceTypes = null; + + public List<int> HideDeviceTypes = new List<int> (); + + public Dictionary<string, int> SkinVision = new Dictionary<string, int> (); + public Dictionary<string, int> DowlaodSkinVision = new Dictionary<string, int> (); + /// <summary> + /// 褰撳墠浣跨敤鐨勭毊鑲� + /// </summary> + public string CurrentSkinName { + get { + string skinPath = "Phone"; + if (SkinCode == 0) { + skinPath = "Phone"; + } else if (SkinCode == 1) { + skinPath = "Phone2"; + } + return skinPath; + } + } + + /// <summary> + /// 瀹夐槻瀵嗙爜 + /// </summary> + public string ArmPW = "85521566"; + + + /// <summary> + /// 鏄惁鏄剧ず鍦烘櫙鍒楄〃 + /// </summary> + public bool ShowAlternativeScene = true; + + //闂ㄩ攣瀵嗙爜淇濆瓨 + public Dictionary<string, string> RemoteDoorLockPasswordList = new Dictionary<string, string> (); + + public string CountryCode = "CN"; + + public int SkinCode = 0; + + public string SetLanguage = ""; + + /// <summary> + /// 鍟嗗簵褰撳墠鐨勭増鏈� + /// </summary> + public string StoreVersion = ""; + + /// <summary> + /// 鏄惁涓哄晢搴楁渶鏂扮増鏈� + /// </summary> + public bool IsAppStoreVersionNewer = true; + /// <summary> + /// 鏄惁闇�瑕佹洿鏂帮紝鏇存柊鐨勭被鍨嬫槸浠�涔� + /// </summary> + //public SimpleControl.Phone.UpdateVersionType UpdateVersionType = 0; + + public List<RegionInfoRes> HomeLists = new List<RegionInfoRes> (); + + public RegionInfoRes CurrentRegion = new RegionInfoRes (); + [Newtonsoft.Json.JsonIgnore] + public string GatewayMAC { + get { + return CurrentRegion.MAC; + } + } + + public List<string> RometoUserInfoKeys = new List<string> (); + + //public static List<string> LocalFiles = IO.FileUtils.ReadFiles (); + + /// <summary> + /// 璁板綍鏈�鍚庝竴娆¤Е鍙戠殑鍦烘櫙 + /// </summary> + public string CurScene = string.Empty; + + /// <summary> + /// 涓婚〉鏄惁璁剧疆浜嗕紶鎰熷櫒 + /// </summary> + public bool IsSetHomePageSensor = false; + public HomePageSensor temp = null;// new HomePageSensor () { DeviceID = 11, LoopID = 1, Name = "temp.", SubnetID = 1 }; + public HomePageSensor pm25 = null;// new HomePageSensor () { DeviceID = 1, LoopID = 1, Name = "pm25", SubnetID = 1 }; + public HomePageSensor humidity = null;//new HomePageSensor () { DeviceID = 1, LoopID =2, Name = "humidity", SubnetID = 1 }; + public HomePageSensor co2 = null;//new HomePageSensor () { DeviceID = 1, LoopID = 3, Name = "co2", SubnetID = 1 }; + public HomePageSensor tvoc = null;//new HomePageSensor () { DeviceID = 1, LoopID = 4, Name = "tvoc", SubnetID = 1 }; + public HomePageSensor formaldehyde = null;// new HomePageSensor () { DeviceID = 1, LoopID = 5, Name = "formaldehyde", SubnetID = 1 }; + } + + public class HomePageSensor + { + public byte SubnetID; + public byte DeviceID; + public byte LoopID; + public string Name; + public double values; + } +} \ No newline at end of file diff --git a/HDL_ON/HDL/Operation/UserInfo.cs b/HDL_ON/HDL/Operation/UserInfo.cs new file mode 100644 index 0000000..569a97a --- /dev/null +++ b/HDL_ON/HDL/Operation/UserInfo.cs @@ -0,0 +1,88 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using HDL_ON.UI; + +namespace HDL_ON +{ + [System.Serializable] + public class UserInfo + { + /// <summary> + /// 瀛樺偍鏂囦欢 + /// </summary> + public static string GlobalRegisterFile = "Register_File"; + /// <summary> + /// 鐢ㄦ埛鍚嶇О + /// </summary> + public string UserName = ""; + + /// <summary> + /// 鐢ㄦ埛 + /// </summary> + public string AccountString=""; + /// <summary> + /// 鐢ㄦ埛瀵嗙爜 + /// </summary> + public string Password = ""; + + /// <summary> + /// 鐢ㄦ埛ID + /// </summary> + public int ID; + + /// <summary> + /// 鍘熷瘑鐮� + /// </summary> + //public string OriginalPassword; + + /// <summary> + /// 涓婁竴娆$櫥褰曟椂闂� + /// </summary> + public DateTime LastTime = System.DateTime.MinValue; + + /// <summary> + /// 鏄惁鏄櫥褰曠姸鎬� + /// </summary> + public bool IsLogin { + get { + return (System.DateTime.Now - LastTime).TotalDays < 7; + } + } + + //public bool TipShowed = false; + + public int AccountType = 0; + + public int MasterID = 0; + + public string LoginTokenString{ + get { + var result = System.Text.Encoding.UTF8.GetBytes (Password); + var md5 = new System.Security.Cryptography.MD5CryptoServiceProvider (); + var output = md5.ComputeHash (result); + var md5Password = BitConverter.ToString (output).Replace ("-", ""); + var account_md5Pssword = AccountString + ":" + md5Password; + var tokenBytes = System.Text.Encoding.UTF8.GetBytes (account_md5Pssword); + return Convert.ToBase64String (tokenBytes).Replace ("=", "%3D"); + } + } + + /// <summary> + /// <!--SIP 甯愬彿--> + /// 鍙瀵硅浣跨敤鐨勭櫥褰曡处鍙� + /// </summary> + public string SIP_Account; + + public void SaveUserInfo () + { + MyIO.FileUtils.WriteFileByBytes (UserInfo.GlobalRegisterFile, Encoding.UTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (this))); + } + + public void ReInitUserInfo() + { + MainPage.LoginUser = Newtonsoft.Json.JsonConvert.DeserializeObject<UserInfo> (System.Text.Encoding.UTF8.GetString (HDL_ON.MyIO.FileUtils.ReadFile (UserInfo.GlobalRegisterFile))); + } + } +} \ No newline at end of file diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems new file mode 100644 index 0000000..1de6e36 --- /dev/null +++ b/HDL_ON/HDL_ON.projitems @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects> + <HasSharedItems>true</HasSharedItems> + <SharedGUID>{A5C296B4-CF9A-4205-ACF0-3A6FEA786F12}</SharedGUID> + </PropertyGroup> + <PropertyGroup Label="Configuration"> + <Import_RootNamespace>HDL_ON</Import_RootNamespace> + </PropertyGroup> + <ItemGroup> + <Compile Include="$(MSBuildThisFileDirectory)HDL\Operation\Control.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)HDL\Operation\MyEnum.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)HDL\Operation\CRC.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)HDL\Operation\BusSocket.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)HDL\Operation\RemoteInfo.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)HDL\Operation\UserConfig.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)HDL\Operation\UserInfo.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)HDL\Operation\Packet.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)HDL\Operation\Target.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)HDL\Operation\DeviceModular\PanelModular.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)HDL\Operation\DeviceModular\CommonModular.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)HDL\Operation\Device\Common.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\MainPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)DAL\Net\CommonPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)DAL\Net\HttpListener.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)DAL\FileUtils.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Common\R.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)DAL\Net\MyWebClient.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)DAL\Net\MqttCommon.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI1-Login\LoginPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI1-Login\LoginPageBLL.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\CSS\CSS.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)DAL\Server\HttpServerRequest.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI1-Login\ResetPassword_VerificationCode.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Public\PublicAssmebly.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI1-Login\RegisterPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI1-Login\LoginBaseView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Public\PublicMothed.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Entity\ResponseEntity\BackupInfoRes.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Entity\ResponseEntity\DeviceInfoRes.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Entity\ResponseEntity\FolderRes.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Entity\ResponseEntity\GatewayRes.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Entity\ResponseEntity\MessageInfoRes.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Entity\ResponseEntity\RegionInfoRes.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Entity\ResponseEntity\ResponsePack.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Entity\ResponseEntity\ResultStatus.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Entity\ResponseEntity\ResultSubaccount.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Entity\ResponseEntity\RoomInfoRes.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Entity\ResponseEntity\RoomObjectiveRes.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Entity\ResponseEntity\SceneObjectiveRes.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Entity\ResponseEntity\SceneRes.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Entity\ResponseEntity\SendJson.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Entity\ResponseEntity\SensorHistory.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Entity\ResponseEntity\SubAccountRes.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Entity\ResponseEntity\Timer.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Entity\ResponseEntity\UserLoginRes.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Entity\Enumerative\EmptyHttpReques.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)DAL\Server\HttpServerRequestBase.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI1-Login\RegisterPageBLL.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI1-Login\ForgetPasswordPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI1-Login\ForgetPasswordPageBLL.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2-4-PersonalCenter\PersonalCenterPage.cs" /> + </ItemGroup> + <ItemGroup> + <Folder Include="$(MSBuildThisFileDirectory)UI\" /> + <Folder Include="$(MSBuildThisFileDirectory)UI\UI1-Login\" /> + <Folder Include="$(MSBuildThisFileDirectory)DAL\" /> + <Folder Include="$(MSBuildThisFileDirectory)DAL\Net\" /> + <Folder Include="$(MSBuildThisFileDirectory)Common\" /> + <Folder Include="$(MSBuildThisFileDirectory)UI\CSS\" /> + <Folder Include="$(MSBuildThisFileDirectory)UI\Common\" /> + <Folder Include="$(MSBuildThisFileDirectory)DAL\Server\" /> + <Folder Include="$(MSBuildThisFileDirectory)UI\UI0-Public\" /> + <Folder Include="$(MSBuildThisFileDirectory)Entity\" /> + <Folder Include="$(MSBuildThisFileDirectory)Entity\ResponseEntity\" /> + <Folder Include="$(MSBuildThisFileDirectory)Entity\Enumerative\" /> + <Folder Include="$(MSBuildThisFileDirectory)UI\UI2-4-PersonalCenter\" /> + </ItemGroup> +</Project> \ No newline at end of file diff --git a/HDL_ON/HDL_ON.shproj b/HDL_ON/HDL_ON.shproj new file mode 100644 index 0000000..beb0662 --- /dev/null +++ b/HDL_ON/HDL_ON.shproj @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <ProjectGuid>{A5C296B4-CF9A-4205-ACF0-3A6FEA786F12}</ProjectGuid> + </PropertyGroup> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" /> + <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" /> + <Import Project="HDL_ON.projitems" Label="Shared" /> + <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" /> +</Project> \ No newline at end of file diff --git a/HDL_ON/UI/CSS/CSS.cs b/HDL_ON/UI/CSS/CSS.cs new file mode 100644 index 0000000..2d63e0d --- /dev/null +++ b/HDL_ON/UI/CSS/CSS.cs @@ -0,0 +1,118 @@ +锘縰sing System; +namespace HDL_ON.UI.CSS +{ + public static class CSS_Color + { + #region 棰滆壊 + /// <summary> + /// 涓昏壊璋� + /// #4484F4 + /// </summary> + public static uint MainColor = 0xFF4484F4; + /// <summary> + /// 杈呭姪鑹�1 + /// #FC9C04 + /// </summary> + public static uint AuxiliaryColor1 = 0xFFFC9C04; + /// <summary> + /// 杈呭姪鑹�2 + /// #FF4747 + /// </summary> + public static uint AuxiliaryColor2 = 0xFFFF4747; + /// <summary> + /// 澶ф爣棰樸�佹鏂� + /// #1B2D4D + /// </summary> + public static uint FirstLevelTitleColor = 0xFF1B2D4D; + /// <summary> + /// 浜岀骇鏍囬 + /// #4E586A + /// </summary> + public static uint SecondLevelTitleColor = 0xFF4E586A; + /// <summary> + /// 姝f枃 + /// #798394 + /// </summary> + public static uint TextualColor = 0xFF798394 ; + /// <summary> + /// 鎻愮ず鎬ф枃瀛�1 + /// #C0C7D4 + /// </summary> + public static uint PromptingColor1 = 0xFFC0C7D4; + /// <summary> + /// 鎻愮ず鎬ф枃瀛�1 + /// #DFE1E6 + /// </summary> + public static uint PromptingColor2 = 0xFFDFE1E6; + /// <summary> + /// 鍒嗗壊绾� + /// #ECEDEE + /// </summary> + public static uint DividingLineColor = 0xFFECEDEE; + /// <summary> + /// 鑳屾櫙棰滆壊 + /// #F2F3F7 + /// </summary> + public static uint BackgroundColor = 0xFFF2F3F7; + + /// <summary> + /// 涓昏壊璋冨瓧浣撻鑹� + /// 0xFFFFFFFF + /// </summary> + public static uint MainBackgroundColor = 0XFFFFFFFF; + + /// <summary> + /// 椤堕儴鍖哄煙鑳屾櫙棰滆壊 + /// 0xFFF7F7F7 + /// </summary> + public static uint TopViewColor = 0xFFF7F7F7; + + #endregion + + + } + + + public static class CSS_FontSize + { + + #region 瀛椾綋澶у皬 + /// <summary> + /// 涓�绾у己璋冨瓧鍙� + /// 24 + /// </summary> + public static int EmphasisFontSize_FirstLevel = 24; + /// <summary> + /// 浜岀骇寮鸿皟瀛楀彿 + /// 20 + /// </summary> + public static int EmphasisFontSize_Secondary = 20; + /// <summary> + /// 澶� 鏍囬瀛椾綋 + /// </summary> + public static int HeadlineFontSize = 18; + /// <summary> + /// 灏忔爣棰樺瓧鍙� + /// 16 + /// </summary> + public static int SubheadingFontSize = 16; + /// <summary> + /// 姝f枃瀛楀彿 + /// 14 + /// </summary> + public static int TextFontSize = 14; + /// <summary> + /// 涓�绾ф彁绀烘�у瓧鍙� + /// 12 + /// </summary> + public static int PromptFontSize_FirstLevel = 12; + /// <summary> + /// 浜岀骇鎻愮ず鎬у瓧鍙� + /// 10 + /// </summary> + public static int PromptFontSize_SecondaryLevel = 10; + #endregion + + } + +} diff --git a/HDL_ON/UI/MainPage.cs b/HDL_ON/UI/MainPage.cs new file mode 100644 index 0000000..9c9f14e --- /dev/null +++ b/HDL_ON/UI/MainPage.cs @@ -0,0 +1,75 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Net; +using System.Text; +using HDL_ON.DAL; +using HDL_ON.UI.CSS; +using Shared; + +namespace HDL_ON.UI +{ + public static class MainPage + { + public static FrameLayout BaseView { get; internal set; } + + //public static PageLayout MainPageView { get; internal set; } + + public static bool DisplayCompleted = false; + + public static UserInfo LoginUser; + + public static List<string> LocationFiles; + + /// <summary> + /// 鍏徃浠g爜 + /// 棰勭暀绗笁鏂瑰畾鍒舵爣璁� + /// 0:HDL + /// </summary> + public static int Company = 0; + + + public static void Show() + { + try + { + Application.DesignWidth = 375; + Application.DesignHeight = 667; + + //BusSocket.Start(6000); + //CommonPage.InitHttpListener(); + + BaseView = Application.MainPage; + Application.MainPage.BackgroundColor = CSS_Color.MainBackgroundColor; + + //MainPageView = new PageLayout() { + // IsShowPoint = false, + //}; + //BaseView.AddChidren(MainPageView); + + var loginBaseView = new UI1Login.LoginBaseView(); + BaseView.AddChidren(loginBaseView); + var fisrtView = new UI1Login.LoginPage(); + + fisrtView.BackgroundColor = CSS_Color.MainBackgroundColor; + loginBaseView.AddChidren(fisrtView); + fisrtView.LoadView(); + + //HDL_ON + } + catch + { + + } + } + + /// <summary> + /// 鑷畾涔夋棩蹇楄緭鍑� + /// </summary> + public static void Log(string msg) + { +#if DEBUG + Console.WriteLine(msg); +#endif + } + } +} diff --git a/HDL_ON/UI/UI0-Public/PublicAssmebly.cs b/HDL_ON/UI/UI0-Public/PublicAssmebly.cs new file mode 100644 index 0000000..753b43b --- /dev/null +++ b/HDL_ON/UI/UI0-Public/PublicAssmebly.cs @@ -0,0 +1,85 @@ +锘縰sing System; +using HDL_ON.UI.CSS; +using Shared; + +namespace HDL_ON.UI +{ + public class PublicAssmebly + { + public void LoadTopView(FrameLayout frame, string tilte) + { + FrameLayout view = new FrameLayout() + { + Height = Application.GetRealHeight(64), + BackgroundColor = CSS_Color.TopViewColor, + }; + frame.AddChidren(view); + + Button btnBack = new Button() + { + X = Application.GetRealWidth(10), + Y = Application.GetRealHeight(30), + Width = Application.GetRealWidth(24), + Height = Application.GetRealHeight(24), + UnSelectedImagePath = "Public/BackIcon.png", + }; + frame.AddChidren(btnBack); + btnBack.MouseUpEventHandler += (sender, e) => + { + frame.RemoveFromParent(); + }; + + Button btnTilte = new Button() + { + X = Application.GetRealWidth(10), + Y = Application.GetRealHeight(30), + Width = Application.GetRealWidth(150), + Height = Application.GetRealHeight(34), + TextAlignment = TextAlignment.Center, + TextSize = CSS_FontSize.HeadlineFontSize, + TextColor = CSS_Color.FirstLevelTitleColor, + Text = tilte + }; + frame.AddChidren(btnTilte); + } + + public void LoadTopView(Dialog dialog, FrameLayout frame, string tilte) + { + FrameLayout view = new FrameLayout() + { + Height = Application.GetRealHeight(64), + BackgroundColor = CSS_Color.TopViewColor, + }; + frame.AddChidren(view); + + Button btnBack = new Button() + { + X = Application.GetRealWidth(10), + Y = Application.GetRealHeight(29), + Width = Application.GetRealWidth(40), + Height = Application.GetRealHeight(25),//24 + UnSelectedImagePath = "Public/BackIcon.png", + }; + frame.AddChidren(btnBack); + btnBack.MouseUpEventHandler += (sender, e) => + { + dialog.Close(); + }; + + Button btnTilte = new Button() + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(30), + Width = Application.GetRealWidth(150), + Height = Application.GetRealHeight(25), + TextAlignment = TextAlignment.Center, + TextSize = CSS_FontSize.HeadlineFontSize, + TextColor = CSS_Color.FirstLevelTitleColor, + Text = tilte + }; + frame.AddChidren(btnTilte); + } + + + } +} \ No newline at end of file diff --git a/HDL_ON/UI/UI0-Public/PublicMothed.cs b/HDL_ON/UI/UI0-Public/PublicMothed.cs new file mode 100644 index 0000000..e58be4b --- /dev/null +++ b/HDL_ON/UI/UI0-Public/PublicMothed.cs @@ -0,0 +1,16 @@ +锘縰sing System; +using System.Text.RegularExpressions; +using HDL_ON.DAL.Server; +namespace HDL_ON.UI +{ + public class PublicMothed + { + public PublicMothed() + { + } + + //Regex reg = new Regex("^\\d+$"); + + + } +} diff --git a/HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs b/HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs new file mode 100644 index 0000000..33ed547 --- /dev/null +++ b/HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs @@ -0,0 +1,503 @@ +锘縰sing System; +using HDL_ON.DAL.Server; +using HDL_ON.UI.CSS; +using Shared; + +namespace HDL_ON.UI.UI1Login +{ + public partial class ForgetPasswordPage : Dialog + { + #region 鎺т欢鍒楄〃 + /// <summary> + /// 褰撳墠鐣岄潰 + /// </summary> + FrameLayout bodyView; + /// <summary> + /// 閫夋嫨鎵嬫満鐧诲綍鎸夐挳 + /// </summary> + Button btnPhoneLogin; + /// <summary> + /// 鐧诲綍绫诲瀷閫変腑鎻愮ず绾� + /// </summary> + Button btnChooseBottomLine; + /// <summary> + /// 閫夋嫨閭鐧诲綍鎸夐挳 + /// </summary> + Button btnEmailLogin; + /// <summary> + /// 璐﹀彿瀛愬尯鍩� + /// </summary> + FrameLayout accountView; + /// <summary> + /// 鍥介檯鍖哄彿鎸夐挳 + /// </summary> + Button btnGlobalRoaming; + /// <summary> + /// 璐﹀彿瀛愬尯鍩熼噷闈㈢殑鍒嗗壊绾� + /// </summary> + Button btnDividingLineVertical_AccountView; + /// <summary> + /// 璐﹀彿鏂囨湰妗� + /// </summary> + EditText etAccount; + /// <summary> + /// 璐﹀彿Icon鎸夐挳 + /// </summary> + Button btnAccountIcon; + /// <summary> + /// 璐﹀彿瀛愬尯鍩熷簳閮ㄦí绾� + /// </summary> + Button btnAccountViewBottomLine; + /// <summary> + /// 瀵嗙爜瀛愬尯鍩� + /// </summary> + FrameLayout passwordView; + /// <summary> + /// 瀵嗙爜Icon鎸夐挳 + /// </summary> + Button btnPasswordIcon; + /// <summary> + /// 瀵嗙爜鏂囨湰妗� + /// </summary> + EditText etPassword; + /// <summary> + /// 瀵嗙爜瀛愬尯鍩熼噷闈㈢殑鍒嗗壊绾�1 + /// </summary> + Button btnDividingLineVertical_PasswordView1; + /// <summary> + /// 瀵嗙爜鏄惁鍙鎸夐挳 + /// </summary> + Button btnVisiblePassword; + /// <summary> + /// 瀵嗙爜瀛愬尯鍩熷簳閮ㄦí绾� + /// </summary> + Button btnPasswordViewBottomLine; + + /// <summary> + /// 纭瀵嗙爜瀛愬尯鍩� + /// </summary> + FrameLayout repeatPasswordView; + /// <summary> + /// 纭瀵嗙爜Icon鎸夐挳 + /// </summary> + Button btnRepeatPasswordIcon; + /// <summary> + /// 纭瀵嗙爜鏂囨湰妗� + /// </summary> + EditText etRepeatPassword; + /// <summary> + /// 纭瀵嗙爜瀛愬尯鍩熼噷闈㈢殑鍒嗗壊绾�1 + /// </summary> + Button btnRepeatDividingLineVertical_PasswordView1; + /// <summary> + /// 纭瀵嗙爜鏄惁鍙鎸夐挳 + /// </summary> + Button btnRepeatVisiblePassword; + /// <summary> + /// 纭瀵嗙爜瀛愬尯鍩熷簳閮ㄦí绾� + /// </summary> + Button btnRepeatPasswordViewBottomLine; + /// <summary> + /// 楠岃瘉鐮佸瓙鍖哄煙 + /// </summary> + FrameLayout verificationCodeView; + /// <summary> + /// 楠岃瘉鐮佸浘鏍� + /// </summary> + Button btnVerificationCodeIcon; + /// <summary> + /// 楠岃瘉鐮佸瓙鍖哄煙鍒嗗壊绾� + /// </summary> + Button btnDividingLineVertical_VerificationCodeView1; + /// <summary> + /// 楠岃瘉鐮佹枃鏈緭鍏ユ + /// </summary> + EditText etVerificationCode; + /// <summary> + /// 鑾峰彇楠岃瘉鐮佹寜閽� + /// </summary> + Button btnGetVerificationCode; + /// <summary> + /// 楠岃瘉鐮佸瓙鍖哄煙搴曢儴鍒嗗壊绾� + /// </summary> + Button btnVerificationCodeViewBottomLine; + /// <summary> + /// 淇敼鎸夐挳 + /// </summary> + Button btnRegister; + + #endregion + + #region 灞�閮ㄥ彉閲忓垪琛� + /// <summary> + /// 璐﹀彿绫诲瀷 + /// 0:鎵嬫満 + /// 1:閭 + /// </summary> + int accountType = 0; + /// <summary> + /// 鎵嬫満鍙风爜鏄惁鏈夋晥 + /// </summary> + bool ValidMobileNumber = false; + /// <summary> + /// 瀵嗙爜鏄惁鏈夋晥 + /// </summary> + bool ValidPassword = false; + /// <summary> + /// 鏈嶅姟鍣ㄨ姹傚璞� + /// </summary> + HttpServerRequest pm; + /// <summary> + /// 鍥炶皟浜嬩欢 + /// </summary> + Action<string> callbackAction; + /// <summary> + /// 淇敼绫诲瀷 + /// 0:鎵嬫満 + /// 1:閭 + /// </summary> + int registerType; + #endregion + public ForgetPasswordPage() + { + bodyView = new FrameLayout() + { + BackgroundColor = CSS_Color.BackgroundColor, + }; + AddChidren(bodyView); + + pm = new HttpServerRequest(); + } + + public void ShowDialog() + { + new PublicAssmebly().LoadTopView(this, bodyView, Language.StringByID(R.InternationalizationString.Register)); + + #region 淇敼鏂瑰紡閫夋嫨 + btnPhoneLogin = new Button() + { + X = Application.GetRealWidth(28), + Y = Application.GetRealHeight(112), + Width = Application.GetRealWidth(120), + Height = Application.GetRealHeight(40), + TextID = R.InternationalizationString.LoginByPhone, + TextColor = CSS_Color.MainColor, + TextAlignment = TextAlignment.CenterLeft, + TextSize = CSS_FontSize.EmphasisFontSize_Secondary, + }; + bodyView.AddChidren(btnPhoneLogin); + + btnChooseBottomLine = new Button() + { + Width = Application.GetRealWidth(46), + Height = Application.GetRealHeight(4), + X = btnPhoneLogin.X + Application.GetRealWidth(27), + Y = btnPhoneLogin.Bottom, + Radius = (uint)Application.GetRealHeight(2), + BorderWidth = 0, + BackgroundColor = CSS_Color.MainColor, + }; + bodyView.AddChidren(btnChooseBottomLine); + + btnEmailLogin = new Button() + { + X = btnPhoneLogin.Right, + Y = Application.GetRealHeight(112), + Width = Application.GetRealWidth(100), + Height = Application.GetRealHeight(40), + TextID = R.InternationalizationString.LoginByEmail, + TextColor = CSS_Color.PromptingColor1, + TextAlignment = TextAlignment.Center, + TextSize = CSS_FontSize.TextFontSize, + }; + bodyView.AddChidren(btnEmailLogin); + #endregion + + #region 璐﹀彿濉啓 + accountView = new FrameLayout() + { + X = Application.GetRealWidth(28), + Y = Application.GetRealHeight(167), + Width = Application.GetRealWidth(319), + Height = Application.GetRealHeight(44), + }; + bodyView.AddChidren(accountView); + + btnGlobalRoaming = new Button() + { + Width = Application.GetRealWidth(57), + X = Application.GetRealWidth(9), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + Text = "+86", + TextSize = CSS_FontSize.TextFontSize, + }; + if (accountType == 0) + { + accountView.AddChidren(btnGlobalRoaming); + } + + //btnDividingLineVertical_AccountView = new Button() + //{ + // X = Application.GetRealWidth(65), + // Gravity = Gravity.CenterVertical, + // Width = 1, + // Height = Application.GetRealHeight(20), + // BackgroundColor = CSS_Color.DividingLineColor, + //}; + //accountView.AddChidren(btnDividingLineVertical_AccountView); + + etAccount = new EditText() + { + X = Application.GetRealWidth(49), + Width = Application.GetRealWidth(319 - 78), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + PlaceholderTextColor = CSS_Color.PromptingColor1, + PlaceholderText = Language.StringByID(R.InternationalizationString.PlsEntryPhoneNumber), + }; + accountView.AddChidren(etAccount); + + btnAccountViewBottomLine = new Button() + { + Y = Application.GetRealHeight(42), + BackgroundColor = CSS_Color.DividingLineColor, + Height = Application.GetRealHeight(1), + }; + accountView.AddChidren(btnAccountViewBottomLine); + + btnAccountIcon = new Button() + { + X = Application.GetRealWidth(9), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(20), + Height = Application.GetMinRealAverage(20), + UnSelectedImagePath = "LoginIcon/AccountIcon.png", + }; + if (accountType == 1) + { + accountView.AddChidren(btnAccountIcon); + } + #endregion + + + #region 楠岃瘉鐮佸~鍐� + verificationCodeView = new FrameLayout() + { + X = Application.GetRealWidth(28), + Y = Application.GetRealHeight(223), + Width = Application.GetRealWidth(319), + Height = Application.GetRealHeight(44), + }; + bodyView.AddChidren(verificationCodeView); + + btnVerificationCodeIcon = new Button() + { + X = Application.GetRealWidth(9), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(20), + Height = Application.GetMinRealAverage(20), + UnSelectedImagePath = "LoginIcon/VerificationCodeIcon.png", + }; + verificationCodeView.AddChidren(btnVerificationCodeIcon); + + //btnDividingLineVertical_VerificationCodeView1 = new Button() + //{ + // X = Application.GetRealWidth(65), + // Gravity = Gravity.CenterVertical, + // Width = 1, + // Height = Application.GetRealHeight(20), + // BackgroundColor = CSS_Color.DividingLineColor, + //}; + //verificationCodeView.AddChidren(btnDividingLineVertical_VerificationCodeView1); + + etVerificationCode = new EditText() + { + X = Application.GetRealWidth(49), + Width = Application.GetRealWidth(61 + 84), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + PlaceholderTextColor = CSS_Color.PromptingColor1, + PlaceholderText = Language.StringByID(R.InternationalizationString.PlsEntryVerificationCode), + }; + verificationCodeView.AddChidren(etVerificationCode); + + btnGetVerificationCode = new Button() + { + X = Application.GetRealWidth(219), + Width = Application.GetRealWidth(100), + TextID = R.InternationalizationString.GetVerificationCode, + SelectedTextColor = CSS_Color.MainColor, + TextColor = CSS_Color.PromptingColor1, + TextAlignment = TextAlignment.CenterRight, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + }; + verificationCodeView.AddChidren(btnGetVerificationCode); + + btnVerificationCodeViewBottomLine = new Button() + { + Y = Application.GetRealHeight(42), + BackgroundColor = CSS_Color.DividingLineColor, + SelectedBackgroundColor = CSS_Color.MainColor, + Height = Application.GetRealHeight(1), + }; + verificationCodeView.AddChidren(btnVerificationCodeViewBottomLine); + + #endregion + + #region 瀵嗙爜濉啓 + passwordView = new FrameLayout() + { + X = Application.GetRealWidth(28), + Y = Application.GetRealHeight(279), + Width = Application.GetRealWidth(319), + Height = Application.GetRealHeight(44), + }; + bodyView.AddChidren(passwordView); + + btnPasswordIcon = new Button() + { + X = Application.GetRealWidth(9), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(20), + Height = Application.GetMinRealAverage(20), + UnSelectedImagePath = "LoginIcon/PasswordIcon.png", + + }; + passwordView.AddChidren(btnPasswordIcon); + //btnDividingLineVertical_PasswordView1 = new Button() + //{ + // X = Application.GetRealWidth(65), + // Gravity = Gravity.CenterVertical, + // Width = 1, + // Height = Application.GetRealHeight(20), + // BackgroundColor = CSS_Color.DividingLineColor, + //}; + //passwordView.AddChidren(btnDividingLineVertical_PasswordView1); + + etPassword = new EditText() + { + X = Application.GetRealWidth(49), + Width = Application.GetRealWidth(319 - 78), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + PlaceholderTextColor = CSS_Color.PromptingColor1, + PlaceholderText = Language.StringByID(R.InternationalizationString.PlsRegisterPassword), + SecureTextEntry = true, + }; + passwordView.AddChidren(etPassword); + + #region 瀵嗙爜鐧诲綍-鎺т欢鍔犺浇 + btnVisiblePassword = new Button() + { + X = Application.GetRealWidth(295), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(20), + Height = Application.GetMinRealAverage(20), + UnSelectedImagePath = "LoginIcon/HidePasswordIcon.png", + SelectedImagePath = "LoginIcon/ShowPasswordIcon.png", + }; + passwordView.AddChidren(btnVisiblePassword); + + #endregion + btnPasswordViewBottomLine = new Button() + { + Y = Application.GetRealHeight(42), + BackgroundColor = CSS_Color.DividingLineColor, + SelectedBackgroundColor = CSS_Color.MainColor, + Height = Application.GetRealHeight(1), + }; + passwordView.AddChidren(btnPasswordViewBottomLine); + #endregion + + #region 纭瀵嗙爜濉啓 + repeatPasswordView = new FrameLayout() + { + X = Application.GetRealWidth(28), + Y = Application.GetRealHeight(279), + Width = Application.GetRealWidth(335), + Height = Application.GetRealHeight(44), + }; + bodyView.AddChidren(repeatPasswordView); + + btnRepeatPasswordIcon = new Button() + { + X = Application.GetRealWidth(9), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(20), + Height = Application.GetMinRealAverage(20), + UnSelectedImagePath = "LoginIcon/PasswordIcon.png", + + }; + repeatPasswordView.AddChidren(btnRepeatPasswordIcon); + //btnRepeatDividingLineVertical_PasswordView1 = new Button() + //{ + // X = Application.GetRealWidth(65), + // Gravity = Gravity.CenterVertical, + // Width = 1, + // Height = Application.GetRealHeight(20), + // BackgroundColor = CSS_Color.DividingLineColor, + //}; + //repeatPasswordView.AddChidren(btnRepeatDividingLineVertical_PasswordView1); + + etRepeatPassword = new EditText() + { + X = Application.GetRealWidth(49), + Width = Application.GetRealWidth(319 - 78), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + PlaceholderTextColor = CSS_Color.PromptingColor1, + PlaceholderText = Language.StringByID(R.InternationalizationString.PlsRegisterRepeatPassword), + SecureTextEntry = true, + }; + repeatPasswordView.AddChidren(etRepeatPassword); + + #region 瀵嗙爜鐧诲綍-鎺т欢鍔犺浇 + btnRepeatVisiblePassword = new Button() + { + X = Application.GetRealWidth(295), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(20), + Height = Application.GetMinRealAverage(20), + UnSelectedImagePath = "LoginIcon/HidePasswordIcon.png", + SelectedImagePath = "LoginIcon/ShowPasswordIcon.png", + }; + repeatPasswordView.AddChidren(btnRepeatVisiblePassword); + + #endregion + + btnRepeatPasswordViewBottomLine = new Button() + { + Y = Application.GetRealHeight(42), + BackgroundColor = CSS_Color.DividingLineColor, + SelectedBackgroundColor = CSS_Color.MainColor, + Height = Application.GetRealHeight(1), + }; + repeatPasswordView.AddChidren(btnRepeatPasswordViewBottomLine); + + #endregion + + btnRegister = new Button() + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(421), + Width = Application.GetRealWidth(220), + Height = Application.GetRealHeight(44), + Radius = (uint)Application.GetRealHeight(22), + SelectedBackgroundColor = CSS_Color.MainColor, + BackgroundColor = CSS_Color.PromptingColor1, + TextID = R.InternationalizationString.Register, + TextSize = CSS_FontSize.SubheadingFontSize, + TextColor = CSS_Color.MainBackgroundColor, + TextAlignment = TextAlignment.Center, + }; + bodyView.AddChidren(btnRegister); + + //LoadEventList(); + } + } +} \ No newline at end of file diff --git a/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs b/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs new file mode 100644 index 0000000..98fbf25 --- /dev/null +++ b/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs @@ -0,0 +1,388 @@ +锘縰sing System; +using System.Text.RegularExpressions; +using System.Threading; +using HDL_ON.DAL.Server; +using HDL_ON.UI.CSS; +using Shared; + +namespace HDL_ON.UI.UI1Login +{ + public partial class ForgetPasswordPage + { + /// <summary> + /// 鍔犺浇浜嬩欢鍒楄〃 + /// </summary> + void LoadEventList() + { + LoadPage_SwitchResetMode(); + LoadEvent_EditTextFcousChange(); + LoadEvent_ChangeTextVisble(); + LoadEvent_GetVerificationCode(); + LoadEvent_Register(); + } + + /// <summary> + /// 鍒囨崲淇敼鏂瑰紡 + /// </summary> + void LoadPage_SwitchResetMode() + { + //閫夋嫨鎵嬫満鏂瑰紡 + btnPhoneLogin.MouseUpEventHandler += (sender, e) => + { + #region 鍒囨崲閫変腑鎸夐挳 + btnEmailLogin.TextColor = CSS_Color.PromptingColor1; + btnEmailLogin.TextSize = CSS_FontSize.TextFontSize; + btnPhoneLogin.TextColor = CSS_Color.MainColor; + btnPhoneLogin.TextSize = CSS_FontSize.EmphasisFontSize_Secondary; + btnChooseBottomLine.X = btnPhoneLogin.X + Application.GetRealWidth(27); + etAccount.PlaceholderText = Language.StringByID(R.InternationalizationString.PlsEntryCorrectMobilNeumber); + #endregion + + #region 鍒囨崲鏂瑰紡鏂瑰紡鍙婂浘鏍� + registerType = 0; + if (btnAccountIcon.Parent != null) + { + btnAccountIcon.RemoveFromParent(); + } + accountView.AddChidren(btnGlobalRoaming); + #endregion + }; + + //閫夋嫨閭鏂瑰紡 + btnEmailLogin.MouseUpEventHandler += (sender, e) => + { + #region 鍒囨崲閫変腑鎸夐挳 + btnPhoneLogin.TextColor = CSS_Color.PromptingColor1; + btnPhoneLogin.TextSize = CSS_FontSize.TextFontSize; + btnEmailLogin.TextColor = CSS_Color.MainColor; + btnEmailLogin.TextSize = CSS_FontSize.EmphasisFontSize_Secondary; + btnChooseBottomLine.X = btnEmailLogin.X + Application.GetRealWidth(27); + etAccount.PlaceholderText = Language.StringByID(R.InternationalizationString.PlsEntryEmailAddress); + #endregion + + #region 鍒囨崲淇敼鏂瑰紡鍙婂浘鏍� + registerType = 1; + if (btnGlobalRoaming.Parent != null) + { + btnGlobalRoaming.RemoveFromParent(); + } + accountView.AddChidren(btnAccountIcon); + #endregion + + }; + } + + /// <summary> + /// 鍔犺浇鏂囨湰妗嗙劍鐐瑰彉鍖栦簨浠� + /// </summary> + void LoadEvent_EditTextFcousChange() + { + //璐﹀彿鏂囨湰妗嗙劍鐐瑰彉鍖栦簨浠� + etAccount.FoucsChanged += (sender, e) => + { + if (etAccount.Foucs) + { + btnAccountViewBottomLine.BackgroundColor = CSS_Color.MainColor; + btnAccountViewBottomLine.Height = Application.GetRealHeight(2); + } + else + { + //鏍囪鎵嬫満鍙风爜鏃犳晥 + btnGetVerificationCode.IsSelected = false; + btnAccountViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor; + btnAccountViewBottomLine.Height = Application.GetRealHeight(1); + //鎵嬫満鏂瑰紡-楠岃瘉鎵嬫満鍙风爜鏄惁姝g‘ + if (registerType == 0) + { + Regex reg = new Regex("^\\d+$"); + var mFalg = reg.Match(etAccount.Text.Trim()); + if (!mFalg.Success || (btnGlobalRoaming.Text == "+86" && etAccount.Text.Trim().Length != 11)) + { + btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; + btnAccountViewBottomLine.Height = Application.GetRealHeight(2); + new Tip() + { + CloseTime = 3, + Text = Language.StringByID(R.InternationalizationString.PlsEntryCorrectMobilNeumber), + Direction = AMPopTipDirection.None, + }.Show(bodyView); + } + else + { + //鏍囪鎵嬫満鍙风爜鏈夋晥 + btnGetVerificationCode.IsSelected = true; + //璐﹀彿鏈夋晥銆佸瘑鐮佹湁鏁堛�侀獙璇佺爜杈撳叆浜嗭紝鎵嶈兘鐐瑰嚮鏂瑰紡 + if (btnGetVerificationCode.IsSelected && ValidPassword && string.IsNullOrEmpty(etVerificationCode.Text.Trim())) + { + btnRegister.IsSelected = true; + } + } + } + else if (registerType == 1) + { + //閭鏂瑰紡-楠岃瘉閭鏄惁姝g‘ + var reg = new Regex("^\\s*([A-Za-z0-9_-]+(\\.\\w+)*@(\\w+\\.)+\\w{2,5})\\s*$"); + var mFalg = reg.Match(etAccount.Text.Trim()); + if (!mFalg.Success || (btnGlobalRoaming.Text == "+86" && etAccount.Text.Trim().Length != 11)) + { + btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; + btnAccountViewBottomLine.Height = Application.GetRealHeight(2); + new Tip() + { + CloseTime = 3, + Text = Language.StringByID(R.InternationalizationString.PlsEntryCorrectEmailAddress), + Direction = AMPopTipDirection.None, + }.Show(bodyView); + } + else + { + //鏍囪鎵嬫満鍙风爜鏈夋晥 + btnGetVerificationCode.IsSelected = true; + //璐﹀彿鏈夋晥銆佸瘑鐮佹湁鏁堛�侀獙璇佺爜杈撳叆浜嗭紝鎵嶈兘鐐瑰嚮鏂瑰紡 + if (btnGetVerificationCode.IsSelected && ValidPassword && string.IsNullOrEmpty(etVerificationCode.Text.Trim())) + { + btnRegister.IsSelected = true; + } + } + } + } + }; + + //瀵嗙爜鏂囨湰妗嗙劍鐐瑰彉鍖栦簨浠� + etPassword.FoucsChanged += (sender, e) => { + if (etPassword.Foucs) + { + btnPasswordViewBottomLine.BackgroundColor = CSS_Color.MainColor; + btnPasswordViewBottomLine.Height = Application.GetRealHeight(2); + } + else + { + btnPasswordViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor; + btnPasswordViewBottomLine.Height = Application.GetRealHeight(1); + //鏍¢獙瀵嗙爜鏄惁绗﹀悎瑕佹眰 + if (etPassword.Text.Trim().Length < 6) + { + new Tip() + { + CloseTime = 3, + Direction = AMPopTipDirection.None, + Text = Language.StringByID(R.InternationalizationString.IncorrectRepeatPassword) + }.Show(bodyView); + } + } + }; + + //纭瀵嗙爜鏂囨湰妗嗙劍鐐瑰彉鍖栦簨浠� + etRepeatPassword.FoucsChanged += (sender, e) => { + if (etRepeatPassword.Foucs) + { + btnRepeatPasswordViewBottomLine.BackgroundColor = CSS_Color.MainColor; + btnRepeatPasswordViewBottomLine.Height = Application.GetRealHeight(2); + } + else + { + btnRepeatPasswordViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor; + btnRepeatPasswordViewBottomLine.Height = Application.GetRealHeight(1); + //鏍¢獙涓ゆ杈撳叆鐨勫瘑鐮佹槸鍚︿竴鑷� + if (etPassword.Text.Trim() != etRepeatPassword.Text.Trim()) + { + btnRepeatPasswordViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; + btnRepeatPasswordViewBottomLine.Height = Application.GetRealHeight(2); + new Tip() + { + CloseTime = 3, + Direction = AMPopTipDirection.None, + Text = Language.StringByID(R.InternationalizationString.IncorrectRepeatPassword) + }.Show(bodyView); + } + else + { + ValidPassword = true; + //璐﹀彿鏈夋晥銆佸瘑鐮佹湁鏁堛�侀獙璇佺爜杈撳叆浜嗭紝鎵嶈兘鐐瑰嚮鏂瑰紡 + if (btnGetVerificationCode.IsSelected && ValidPassword && string.IsNullOrEmpty(etVerificationCode.Text.Trim())) + { + btnRegister.IsSelected = true; + } + } + } + }; + + //楠岃瘉鐮佹枃鏈鐒︾偣鍙樺寲浜嬩欢 + etVerificationCode.FoucsChanged += (sender, e) => { + if (etVerificationCode.Foucs) + { + btnVerificationCodeViewBottomLine.BackgroundColor = CSS_Color.MainColor; + btnVerificationCodeViewBottomLine.Height = Application.GetRealHeight(2); + } + else + { + btnVerificationCodeViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor; + btnVerificationCodeViewBottomLine.Height = Application.GetRealHeight(1); + if (etVerificationCode.Text.Length > 4) + { + //璐﹀彿鏈夋晥銆佸瘑鐮佹湁鏁堛�侀獙璇佺爜杈撳叆浜嗭紝鎵嶈兘鐐瑰嚮鏂瑰紡 + if (btnGetVerificationCode.IsSelected && ValidPassword && string.IsNullOrEmpty(etVerificationCode.Text.Trim())) + { + btnRegister.IsSelected = true; + } + } + } + }; + } + + /// <summary> + /// 鏇存敼瀵嗙爜鍙鎬� + /// </summary> + void LoadEvent_ChangeTextVisble() + { + //瀵嗙爜鏂囨湰鍙鎬у彉鍖� + btnVisiblePassword.MouseUpEventHandler += (sender, e) => { + btnVisiblePassword.IsSelected = !btnVisiblePassword.IsSelected; + etPassword.SecureTextEntry = !btnVisiblePassword.IsSelected; + }; + //閲嶅瀵嗙爜鏂囨湰鍙鎬у彉鍖� + btnRepeatVisiblePassword.MouseUpEventHandler += (sender, e) => { + btnRepeatVisiblePassword.IsSelected = !btnRepeatVisiblePassword.IsSelected; + etRepeatPassword.SecureTextEntry = !btnRepeatVisiblePassword.IsSelected; + }; + } + + /// <summary> + /// 鑾峰彇楠岃瘉鐮� + /// </summary> + void LoadEvent_GetVerificationCode() + { + btnGetVerificationCode.MouseUpEventHandler += (sender, e) => { + if (btnGetVerificationCode.IsSelected) + { + //鐭俊鍙戦�侀棿闅�60s + btnGetVerificationCode.IsSelected = false; + int time = 60; + new Thread(() => + { + while (time == 0) + { + time--; + Application.RunOnMainThread(() => + { + btnGetVerificationCode.Text = time.ToString() + "s"; + }); + Thread.Sleep(1000); + } + Application.RunOnMainThread(() => + { + //鍥炲鑾峰彇鐭俊鎸夐挳浜嬩欢 + btnGetVerificationCode.IsSelected = true; + }); + }) + { IsBackground = true }.Start(); + //妫�鏌ユ墜鏈烘槸鍚﹀凡缁忚鏂瑰紡 + var checkPhoneResult = pm.IsExistingAccount(etAccount.Text.Trim()); + //鎵嬫満鏈鏂瑰紡 + if (checkPhoneResult.StateCode != HttpRequesResult.SUCCESS.ToString()) + { + //鑾峰彇楠岃瘉鐮� + pm.GetPhoneVerificationCode(etAccount.Text.Trim(), MainPage.Company); + } + else + { + //鎻愮ず鎵嬫満鍙风爜宸茬粡鏂瑰紡 + new Tip() + { + CloseTime = 3, + Direction = AMPopTipDirection.None, + Text = Language.StringByID(R.InternationalizationString.AccountAlreadyExists) + }.Show(bodyView); + } + } + }; + } + + /// <summary> + /// 鍔犺浇鏂瑰紡鎸夐挳浜嬩欢 + /// </summary> + void LoadEvent_Register() + { + btnRegister.MouseUpEventHandler += (sender, e) => + { + //鎵嬫満鏂瑰紡 + if (registerType == 0) + { + //鏍¢獙楠岃瘉鐮� + var validateSmsResult = pm.ValidateSmsCode(etAccount.Text.Trim(), etVerificationCode.Text.Trim()); + //楠岃瘉鐮佹牎楠屾垚鍔� + if (validateSmsResult.StateCode == HttpRequesResult.SUCCESS.ToString()) + { + //楠岃瘉璐﹀彿 + var registerPhoneResult = pm.RegisterPhone(etAccount.Text.Trim(), etPassword.Text.Trim(), Language.CurrentLanguage); + if (registerPhoneResult.StateCode == HttpRequesResult.SUCCESS.ToString()) + { + //楠岃瘉鎴愬姛 + //鎵ц鍥炶皟浜嬩欢 + callbackAction?.Invoke(etAccount.Text.Trim()); + } + else + { + //楠岃瘉澶辫触 + new Tip() + { + CloseTime = 3, + Text = registerPhoneResult.ErrorInfo, + Direction = AMPopTipDirection.None, + }.Show(bodyView); + } + } + else + { + //楠岃瘉鐮佹牎楠屽け璐� + new Tip() + { + CloseTime = 3, + Direction = AMPopTipDirection.None, + Text = Language.StringByID(R.InternationalizationString.VerificationCodeWrong) + }.Show(bodyView); + } + } + else if (registerType == 1) + { + //閭鏂瑰紡 + //鏍¢獙楠岃瘉鐮� + var validateSmsResult = pm.ValidateSmsCode(etAccount.Text.Trim(), etVerificationCode.Text.Trim()); + //楠岃瘉鐮佹牎楠屾垚鍔� + if (validateSmsResult.StateCode == HttpRequesResult.SUCCESS.ToString()) + { + //鏂瑰紡璐﹀彿 + var registerPhoneResult = pm.RegisterPhone(etAccount.Text.Trim(), etPassword.Text.Trim(), Language.CurrentLanguage); + if (registerPhoneResult.StateCode == HttpRequesResult.SUCCESS.ToString()) + { + //鏂瑰紡鎴愬姛 + //鎵ц鍥炶皟浜嬩欢 + callbackAction?.Invoke(etAccount.Text.Trim()); + } + else + { + //鏂瑰紡澶辫触 + new Tip() + { + CloseTime = 3, + Text = registerPhoneResult.ErrorInfo, + Direction = AMPopTipDirection.None, + }.Show(bodyView); + } + } + else + { + //楠岃瘉鐮佹牎楠屽け璐� + new Tip() + { + CloseTime = 3, + Direction = AMPopTipDirection.None, + Text = Language.StringByID(R.InternationalizationString.VerificationCodeWrong) + }.Show(bodyView); + } + } + }; + } + + } +} diff --git a/HDL_ON/UI/UI1-Login/LoginBaseView.cs b/HDL_ON/UI/UI1-Login/LoginBaseView.cs new file mode 100644 index 0000000..f6efdcd --- /dev/null +++ b/HDL_ON/UI/UI1-Login/LoginBaseView.cs @@ -0,0 +1,13 @@ +锘縰sing System; +using Shared; + +namespace HDL_ON.UI.UI1Login +{ + public class LoginBaseView : PageLayout + { + public LoginBaseView() + { + this.IsShowPoint = false; + } + } +} diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs new file mode 100644 index 0000000..e24e26d --- /dev/null +++ b/HDL_ON/UI/UI1-Login/LoginPage.cs @@ -0,0 +1,427 @@ +锘縰sing System; +using System.Threading; +using HDL_ON.DAL.Server; +using HDL_ON.UI.CSS; +using Shared; + +namespace HDL_ON.UI.UI1Login +{ + public partial class LoginPage : FrameLayout + { + public LoginPage() + { + //bodyView = new FrameLayout(); + //AddChidren(bodyView); + bodyView = this; + pm = new HttpServerRequest(); + } + + public override void RemoveFromParent() + { + //濡傛灉褰撳墠鐣岄潰瀛樺湪姝e湪绛夊緟鏁版嵁鐨勬儏鍐碉紝鍏堝皢璇ュ姩浣滃叧鎺� + if (waitPage != null) + { + waitPage.RemoveFromParent(); + waitPage = null; + } + else + { + base.RemoveFromParent(); + } + } + + #region 灞�閮ㄥ彉閲� + /// <summary> + /// 鐧诲綍绫诲瀷 + /// 0:鎵嬫満 + /// 1:閭 + /// </summary> + int logintType = 0; + /// <summary> + /// 鐧诲綍鏂瑰紡 + /// 0:瀵嗙爜 + /// 1:楠岃瘉鐮� + /// </summary> + int logintMode = 0; + string account; + string password; + #endregion + + #region 鎺т欢鍒楄〃 + /// <summary> + /// 绛夊緟鎻愮ず + /// </summary> + Loading waitPage; + /// <summary> + /// 褰撳墠鐣岄潰 + /// </summary> + FrameLayout bodyView; + /// <summary> + /// 閫夋嫨鎵嬫満鐧诲綍鎸夐挳 + /// </summary> + Button btnPhoneLogin; + /// <summary> + /// 閫夋嫨閭鐧诲綍鎸夐挳 + /// </summary> + Button btnEmailLogin; + /// <summary> + /// 璐﹀彿瀛愬尯鍩� + /// </summary> + FrameLayout accountView; + /// <summary> + /// 鍥介檯鍖哄彿鎸夐挳 + /// </summary> + Button btnGlobalRoaming; + /// <summary> + /// 璐﹀彿瀛愬尯鍩熼噷闈㈢殑鍒嗗壊绾� + /// </summary> + Button btnDividingLineVertical_AccountView; + /// <summary> + /// 璐﹀彿鏂囨湰妗� + /// </summary> + EditText etAccount; + /// <summary> + /// 璐﹀彿Icon鎸夐挳 + /// </summary> + Button btnAccountIcon; + /// <summary> + /// 瀵嗙爜瀛愬尯鍩� + /// </summary> + FrameLayout passwordView; + /// <summary> + /// 瀵嗙爜Icon鎸夐挳 + /// </summary> + Button btnPasswordIcon; + /// <summary> + /// 瀵嗙爜鏂囨湰妗� + /// </summary> + EditText etPassword; + /// <summary> + /// 瀵嗙爜瀛愬尯鍩熼噷闈㈢殑鍒嗗壊绾�1 + /// </summary> + Button btnDividingLineVertical_PasswordView1; + /// <summary> + /// 瀵嗙爜瀛愬尯鍩熼噷闈㈢殑鍒嗗壊绾�2 + /// </summary> + Button btnDividingLineVertical_PasswordView2; + /// <summary> + /// 蹇樿瀵嗙爜鎸夐挳 + /// </summary> + Button btnForgetPassword; + /// <summary> + /// 鑾峰彇鎵嬫満楠岃瘉鐮佹寜閽� + /// </summary> + Button btnGetVerificationCode; + /// <summary> + /// 瀵嗙爜鏄惁鍙鎸夐挳 + /// </summary> + Button btnVisiblePassword; + /// <summary> + /// 璐﹀彿瀛愬尯鍩熷簳閮ㄦí绾� + /// </summary> + Button btnAccountViewBottomLine; + /// <summary> + /// 瀵嗙爜瀛愬尯鍩熷簳閮ㄦí绾� + /// </summary> + Button btnPasswordViewBottomLine; + /// <summary> + /// 娉ㄥ唽鎸夐挳 + /// </summary> + Button btnRegister; + /// <summary> + /// 楠岃瘉鐮佺櫥褰曟寜閽� + /// </summary> + Button btnSwitchLoginMode; + /// <summary> + /// 鐧诲綍鎸夐挳 + /// </summary> + Button btnLogin; + /// <summary> + /// 鏈嶅姟鍣ㄨ姹傚璞� + /// </summary> + HttpServerRequest pm; + #endregion + + /// <summary> + /// 鍔犺浇瑙嗗浘 + /// </summary> + public void LoadView() + { + var btnIcon = new Button() + { + X = Application.GetRealWidth(28), + Y = Application.GetRealHeight(73), + Width = Application.GetMinRealAverage(62), + Height = Application.GetMinRealAverage(62), + UnSelectedImagePath = "Public/Logo.png", + }; + bodyView.AddChidren(btnIcon); + + var btnIcon_bg = new Button() { + X = Application.GetRealWidth(171), + Y = Application.GetRealHeight(69), + Width = Application.GetMinRealAverage(254), + Height = Application.GetMinRealAverage(156), + UnSelectedImagePath = "Public/Logo-bg.png" + }; + bodyView.AddChidren(btnIcon_bg); + + btnIcon.MouseUpEventHandler += (sender, e) => + { +#if DEBUG + UserConfig.Instance.SkinCode = UserConfig.Instance.SkinCode > 1 ? 0 : 1; + SharedMethod.SharedMethod.ChangeSkin(); + MainPage.Log($"UserConfig.skincode{UserConfig.Instance.SkinCode}"); + etAccount.Text = "464027401@qq.com"; + etPassword.Text = "qqqqqq"; +#endif + }; + + #region 鐧诲綍鏂瑰紡閫夋嫨 + btnPhoneLogin = new Button() + { + X = Application.GetRealWidth(28), + Y = Application.GetRealHeight(177), + Width = Application.GetRealWidth(120), + Height = Application.GetRealHeight(40), + TextID = R.InternationalizationString.LoginByPhone, + TextColor = CSS_Color.MainColor, + TextAlignment = TextAlignment.CenterLeft, + TextSize = CSS_FontSize.EmphasisFontSize_Secondary, + }; + bodyView.AddChidren(btnPhoneLogin); + + btnEmailLogin = new Button() + { + X = btnPhoneLogin.Right, + Y = Application.GetRealHeight(177), + Width = Application.GetRealWidth(100), + Height = Application.GetRealHeight(40), + TextID = R.InternationalizationString.LoginByEmail, + TextColor = CSS_Color.PromptingColor1, + TextAlignment = TextAlignment.Center, + TextSize = CSS_FontSize.TextFontSize, + }; + bodyView.AddChidren(btnEmailLogin); + #endregion + + #region 璐﹀彿濉啓 + accountView = new FrameLayout() + { + X = Application.GetRealWidth(28), + Y = Application.GetRealHeight(232), + Width = Application.GetRealWidth(319), + Height = Application.GetRealHeight(44), + }; + bodyView.AddChidren(accountView); + + btnGlobalRoaming = new Button() + { + Width = Application.GetRealWidth(65), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.FirstLevelTitleColor, + Text = "+86", + TextSize = CSS_FontSize.TextFontSize, + }; + if (logintType == 0) + accountView.AddChidren(btnGlobalRoaming); + + btnDividingLineVertical_AccountView = new Button() + { + X = Application.GetRealWidth(65), + Gravity = Gravity.CenterVertical, + Width = 1, + Height = Application.GetRealHeight(20), + BackgroundColor = CSS_Color.DividingLineColor, + }; + accountView.AddChidren(btnDividingLineVertical_AccountView); + + etAccount = new EditText() + { + X = Application.GetRealWidth(78), + Width = Application.GetRealWidth(319 - 78), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + PlaceholderTextColor = CSS_Color.PromptingColor1, + PlaceholderText = Language.StringByID(R.InternationalizationString.PlsEntryAccount), + }; + accountView.AddChidren(etAccount); + + + btnAccountViewBottomLine = new Button() + { + Y = Application.GetRealHeight(42), + BackgroundColor = CSS_Color.DividingLineColor, + Height = Application.GetRealHeight(1), + }; + accountView.AddChidren(btnAccountViewBottomLine); + + + btnAccountIcon = new Button() + { + X = Application.GetRealWidth(21), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(20), + Height = Application.GetMinRealAverage(20), + UnSelectedImagePath = "LoginIcon/AccountIcon.png", + }; + if (logintType == 1) + { + accountView.AddChidren(btnAccountIcon); + } + + #endregion + + #region 瀵嗙爜濉啓 + passwordView = new FrameLayout() + { + X = Application.GetRealWidth(28), + Y = Application.GetRealHeight(288), + Width = Application.GetRealWidth(319), + Height = Application.GetRealHeight(44), + }; + bodyView.AddChidren(passwordView); + + + btnPasswordIcon = new Button() + { + X = Application.GetRealWidth(21), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(20), + Height = Application.GetMinRealAverage(20), + UnSelectedImagePath = "LoginIcon/PasswordIcon.png", + SelectedImagePath = "LoginIcon/VerificationCodeIcon.png", + }; + passwordView.AddChidren(btnPasswordIcon); + btnDividingLineVertical_PasswordView1 = new Button() + { + X = Application.GetRealWidth(65), + Gravity = Gravity.CenterVertical, + Width = 1, + Height = Application.GetRealHeight(20), + BackgroundColor = CSS_Color.DividingLineColor, + }; + passwordView.AddChidren(btnDividingLineVertical_PasswordView1); + + etPassword = new EditText() + { + X = Application.GetRealWidth(78), + Width = Application.GetRealWidth(61 + 84), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + PlaceholderTextColor = CSS_Color.PromptingColor1, + PlaceholderText = Language.StringByID(R.InternationalizationString.PlsEntryPassword), + SecureTextEntry = true, + }; + passwordView.AddChidren(etPassword); + + #region 瀵嗙爜鐧诲綍-鎺т欢鍔犺浇 + btnVisiblePassword = new Button() + { + X = Application.GetRealWidth(223), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(20), + Height = Application.GetMinRealAverage(20), + UnSelectedImagePath = "LoginIcon/HidePasswordIcon.png", + SelectedImagePath = "LoginIcon/ShowPasswordIcon.png", + }; + passwordView.AddChidren(btnVisiblePassword); + + btnDividingLineVertical_PasswordView2 = new Button() + { + X = Application.GetRealWidth(253), + Gravity = Gravity.CenterVertical, + Width = 1, + Height = Application.GetRealHeight(20), + BackgroundColor = CSS_Color.DividingLineColor, + }; + passwordView.AddChidren(btnDividingLineVertical_PasswordView2); + + btnForgetPassword = new Button() + { + X = Application.GetRealWidth(263), + Width = Application.GetRealWidth(56), + TextColor = CSS_Color.FirstLevelTitleColor, + TextAlignment = TextAlignment.CenterLeft, + TextID = R.InternationalizationString.ForgetPassword, + TextSize = 12, + }; + passwordView.AddChidren(btnForgetPassword); + #endregion + + #region 楠岃瘉鐮佺櫥褰�-鎺т欢鍔犺浇 + btnGetVerificationCode = new Button() + { + X = Application.GetRealWidth(219), + Width = Application.GetRealWidth(100), + TextID = R.InternationalizationString.GetVerificationCode, + TextColor = CSS_Color.MainColor, + TextAlignment = TextAlignment.CenterRight, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + }; + #endregion + + btnPasswordViewBottomLine = new Button() + { + Y = Application.GetRealHeight(42), + BackgroundColor = CSS_Color.DividingLineColor, + SelectedBackgroundColor = CSS_Color.MainColor, + Height = Application.GetRealHeight(1), + }; + passwordView.AddChidren(btnPasswordViewBottomLine); + + #endregion + + + #region 娉ㄥ唽涓庡揩鎹风櫥褰� + btnRegister = new Button() + { + X = Application.GetRealWidth(28), + Y = passwordView.Bottom, + Width = Application.GetRealWidth(60), + Height = Application.GetRealHeight(17 + 12 + 12), + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextID = R.InternationalizationString.SingUp, + TextAlignment = TextAlignment.CenterLeft, + }; + bodyView.AddChidren(btnRegister); + + btnSwitchLoginMode = new Button() + { + X = Application.GetRealWidth(223 + 28), + Y = passwordView.Bottom, + Width = Application.GetRealWidth(96), + Height = Application.GetRealHeight(51), + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextID = R.InternationalizationString.VerificationCodeLogin, + TextAlignment = TextAlignment.CenterRight, + }; + bodyView.AddChidren(btnSwitchLoginMode); + + #endregion + + btnLogin = new Button() + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(403), + Width = Application.GetRealWidth(220), + Height = Application.GetRealHeight(44), + Radius = (uint)Application.GetRealHeight(22), + SelectedBackgroundColor = CSS_Color.MainColor, + BackgroundColor = CSS_Color.PromptingColor1, + TextID = R.InternationalizationString.Login, + TextSize = CSS_FontSize.SubheadingFontSize, + TextColor = CSS_Color.MainBackgroundColor, + TextAlignment = TextAlignment.Center, + }; + bodyView.AddChidren(btnLogin); + + + LoadEventList(); + } + } +} \ No newline at end of file diff --git a/HDL_ON/UI/UI1-Login/LoginPageBLL.cs b/HDL_ON/UI/UI1-Login/LoginPageBLL.cs new file mode 100644 index 0000000..d788099 --- /dev/null +++ b/HDL_ON/UI/UI1-Login/LoginPageBLL.cs @@ -0,0 +1,408 @@ +锘縰sing System; +using System.Threading; +using HDL_ON.DAL.Server; +using HDL_ON.UI.CSS; +using Shared; + +namespace HDL_ON.UI.UI1Login +{ + public partial class LoginPage + { + + /// <summary> + /// 鍔犺浇浜嬩欢 + /// </summary> + void LoadEventList() + { + LoadPage_SwitchLoginType(); + LoadMethod_VisiblePassword(); + LoadPage_SwitchLoginMode(); + LoadMethod_LoginMethod(); + LoadPage_SelectionEditText(); + LoadPage_RegisterPage(); + GetVerificationCode(); + + } + + /// <summary> + /// 鐐瑰嚮鎸夐挳鑾峰彇楠岃瘉鐮� + /// </summary> + void GetVerificationCode() + { + btnGetVerificationCode.MouseUpEventHandler += (sender, e) => + { +#if DEBUG + etAccount.Text = "17576024298"; +#endif + string phoneNumber = etAccount.Text.Trim(); + btnGetVerificationCode.Enable = false; + btnGetVerificationCode.TextColor = CSS_Color.PromptingColor1; + int time = 60; + new Thread(() => + { + while (time != 0) + { + time--; + Application.RunOnMainThread(() => + { + btnGetVerificationCode.Text = time.ToString() + "s"; + }); + Thread.Sleep(1000); + } + }) + { IsBackground = true }.Start(); + //妫�鏌ユ墜鏈烘槸鍚﹀凡缁忚娉ㄥ唽 + var checkPhoneResult = pm.IsExistingAccount(etAccount.Text.Trim()); + //鎵嬫満宸茬粡琚敞鍐� + if (checkPhoneResult.StateCode == HttpRequesResult.SUCCESS.ToString()) + { + //鑾峰彇楠岃瘉鐮� + pm.GetPhoneVerificationCode(phoneNumber,MainPage.Company); + } + }; + } + + /// <summary> + /// 鍒囨崲鐧诲綍绫诲瀷 + /// </summary> + void LoadPage_SwitchLoginType() + { + //閫夋嫨鎵嬫満鐧诲綍 + btnPhoneLogin.MouseUpEventHandler += (sender, e) => + { + #region 鍒囨崲閫変腑鎸夐挳 + btnEmailLogin.TextColor = CSS_Color.PromptingColor1; + btnEmailLogin.TextSize = CSS_FontSize.TextFontSize; + btnPhoneLogin.TextColor = CSS_Color.MainColor; + btnPhoneLogin.TextSize = CSS_FontSize.EmphasisFontSize_Secondary; + etAccount.PlaceholderText = Language.StringByID(R.InternationalizationString.PlsEntryCorrectMobilNeumber); + #endregion + + #region 鍒囨崲鐧诲綍鏂瑰紡鍙婂浘鏍� + logintType = 0; + if (btnAccountIcon.Parent != null) + { + btnAccountIcon.RemoveFromParent(); + } + accountView.AddChidren(btnGlobalRoaming); + //鏄剧ず楠岃瘉鐮佺櫥褰曟柟寮忥紝鎵嬫満鐧诲綍鏈夐獙璇佺爜鐧诲綍 + btnSwitchLoginMode.Visible = true; + #endregion + }; + + //閫夋嫨閭鐧诲綍 + btnEmailLogin.MouseUpEventHandler += (sender, e) => + { + #region 鍒囨崲閫変腑鎸夐挳 + btnPhoneLogin.TextColor = CSS_Color.PromptingColor1; + btnPhoneLogin.TextSize = CSS_FontSize.TextFontSize; + btnEmailLogin.TextColor = CSS_Color.MainColor; + btnEmailLogin.TextSize = CSS_FontSize.EmphasisFontSize_Secondary; + etAccount.PlaceholderText = Language.StringByID(R.InternationalizationString.PlsEntryEmailAddress); + #endregion + + #region 鍒囨崲鐧诲綍绫诲瀷鍙婂浘鏍� + logintType = 1; + if (btnGlobalRoaming.Parent != null) + { + btnGlobalRoaming.RemoveFromParent(); + } + accountView.AddChidren(btnAccountIcon); + #endregion + + //閭鍙湁瀵嗙爜鐧诲綍妯″紡 + logintMode = 0; + //瀵嗙爜鐧诲綍 + btnSwitchLoginMode.TextID = R.InternationalizationString.VerificationCodeLogin; + passwordView.AddChidren(btnVisiblePassword); + passwordView.AddChidren(btnDividingLineVertical_PasswordView2); + passwordView.AddChidren(btnForgetPassword); + btnPasswordIcon.IsSelected = false; + + if (btnGetVerificationCode.Parent != null) + { + btnGetVerificationCode.RemoveFromParent(); + } + //闅愯棌瀵嗙爜 + etPassword.SecureTextEntry = true; + //闅愯棌楠岃瘉鐮佺櫥褰曟柟寮忥紝閭鐧诲綍娌℃湁楠岃瘉鐮佺櫥褰� + btnSwitchLoginMode.Visible = false; + }; + } + + /// <summary> + /// 鍒囨崲鐧诲綍鏂瑰紡 + /// 楠岃瘉鐮�/瀵嗙爜 + /// </summary> + void LoadPage_SwitchLoginMode() + { + btnSwitchLoginMode.MouseUpEventHandler += (sender, e) => + { + logintMode = logintMode == 0 ? 1 : 0; + //娓呴櫎瀵嗙爜妗嗘枃鏈暟鎹� + etPassword.Text = ""; + //瀵嗙爜鐧诲綍 + if (logintMode == 0) + { + btnSwitchLoginMode.TextID = R.InternationalizationString.VerificationCodeLogin; + passwordView.AddChidren(btnVisiblePassword); + passwordView.AddChidren(btnDividingLineVertical_PasswordView2); + passwordView.AddChidren(btnForgetPassword); + btnPasswordIcon.IsSelected = false; + if (btnGetVerificationCode.Parent != null) + { + btnGetVerificationCode.RemoveFromParent(); + } + //闅愯棌瀵嗙爜 + etPassword.SecureTextEntry = true; + } + //楠岃瘉鐮佺櫥褰� + else if (logintMode == 1) + { + btnSwitchLoginMode.TextID = R.InternationalizationString.PasswordLogin; + passwordView.AddChidren(btnGetVerificationCode); + btnPasswordIcon.IsSelected = true; + if (btnVisiblePassword.Parent != null) + { + btnVisiblePassword.RemoveFromParent(); + } + if (btnDividingLineVertical_PasswordView2.Parent != null) + { + btnDividingLineVertical_PasswordView2.RemoveFromParent(); + } + if (btnForgetPassword.Parent != null) + { + btnForgetPassword.RemoveFromParent(); + } + //楠岃瘉鐮佷笉闇�瑕侀殣钘� + etPassword.SecureTextEntry = false; + } + }; + } + + /// <summary> + /// 鏂囨湰妗嗛�変腑浜嬩欢 + /// </summary> + void LoadPage_SelectionEditText() + { + //褰撶劍鐐瑰湪璐﹀彿鏂囨湰妗嗘椂锛屾枃鏈搴曠嚎鐐逛寒 + etAccount.FoucsChanged += (sender, e) => + { + if (etAccount.Foucs) + { + btnAccountViewBottomLine.BackgroundColor = CSS_Color.MainColor; + btnAccountViewBottomLine.Height = Application.GetRealHeight(2); + } + else + { + btnAccountViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor; + btnAccountViewBottomLine.Height = Application.GetRealHeight(1); + } + }; + //褰撶劍鐐瑰湪瀵嗙爜鏂囨湰妗嗘椂锛屾枃鏈搴曠嚎鐐逛寒 + etPassword.FoucsChanged += (sender, e) => + { + if (etPassword.Foucs) + { + btnPasswordViewBottomLine.BackgroundColor = CSS_Color.MainColor; + btnPasswordViewBottomLine.Height = Application.GetRealHeight(2); + } + else + { + btnPasswordViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor; + btnPasswordViewBottomLine.Height = Application.GetRealHeight(1); + } + }; + + //褰撶劍鐐瑰湪璐﹀彿鏂囨湰妗嗘椂锛岀偣鍑婚敭鐩樺洖鎾ゆ寜閿紝瑙﹀彂鐨勪簨浠� + etAccount.EditorEnterAction += (obj) => + { + etPassword.Foucs = true; + }; + //褰撶劍鐐瑰湪瀵嗙爜鏂囨湰妗嗘椂锛岀偣鍑婚敭鐩樺洖鎾ゆ寜閿紝瑙﹀彂鐨勪簨浠� + etPassword.EditorEnterAction += (obj) => + { + etPassword.Foucs = false; + }; + } + + /// <summary> + /// 闅愯棌/鏄剧ず瀵嗙爜 + /// </summary> + void LoadMethod_VisiblePassword() + { + btnVisiblePassword.MouseUpEventHandler += (sender, e) => + { + btnVisiblePassword.IsSelected = !btnVisiblePassword.IsSelected; + if (btnVisiblePassword.IsSelected) + { + etPassword.SecureTextEntry = false; + } + else + { + etPassword.SecureTextEntry = true; + } + }; + } + + /// <summary> + /// 鐧诲綍鎸夐挳鐐瑰嚮浜嬩欢 + /// </summary> + void LoadMethod_LoginMethod() + { + btnLogin.MouseUpEventHandler += (sender, e) => + { + if (btnLogin.IsSelected) + { + account = etAccount.Text.Trim(); + password = etPassword.Text.Trim(); + //鍒涘缓鐧诲綍绾跨▼ + var loginThread = LoadMethod_LoginThread(); + LoadPage_WaitPage(loginThread); + } + }; + #region 褰撹处鍙峰瘑鐮侀兘杈撳叆鏃讹紝鎵嶈兘鐐瑰嚮鐧诲綍鎸夐挳 + etAccount.TextChangeEventHandler += (sender, e) => + { + if (etAccount.Text.Trim().Length > 0 && etPassword.Text.Trim().Length > 0) + { + btnLogin.IsSelected = true; + } + else + { + btnLogin.IsSelected = false; + } + }; + etPassword.TextChangeEventHandler += (sender, e) => + { + if (etAccount.Text.Trim().Length > 0 && etPassword.Text.Trim().Length > 0) + { + btnLogin.IsSelected = true; + } + else + { + btnLogin.IsSelected = false; + } + }; + #endregion + } + + /// <summary> + /// 鍔犺浇绛夊緟鐣岄潰 + /// </summary> + void LoadPage_WaitPage(Thread thread) + { + waitPage = new Loading(); + bodyView.AddChidren(waitPage); + waitPage.Start(Language.StringByID(R.InternationalizationString.PleaseWait)); + var showedTime = DateTime.Now; + //濡傛灉绛夊緟浜嬩欢杩囬暱锛屽彲浠ュ厑璁哥敤鎴峰彇娑堝綋鍓嶆搷浣� + waitPage.MouseUpEventHandler += (sender, e) => + { + if (showedTime.AddSeconds(30) > DateTime.Now) + { + waitPage.RemoveFromParent(); + waitPage = null; + thread.Abort(); + } + }; + thread.Start(); + } + + /// <summary> + /// 鍔犺浇鐧诲綍绾跨▼ + /// </summary> + Thread LoadMethod_LoginThread() + { + var loginThread = new Thread(() => + { + try + { + var loginResult = pm.LoginByPassword(account,password,MainPage.Company); + Application.RunOnMainThread(() => + { + waitPage.RemoveFromParent(); + waitPage = null; + }); + //鐧诲綍鎴愬姛 + if (loginResult.StateCode == HttpRequesResult.SUCCESS.ToString()) + { + var loginResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes>(loginResult.ResponseData.ToString()); + //璁板綍鐢ㄦ埛鏁版嵁 + MainPage.LoginUser = new UserInfo + { + ID = loginResponseData.UserId, + MasterID = loginResponseData.MainUserId, + AccountType = loginResponseData.UserType, + AccountString = account, + Password = password, + LastTime = DateTime.Now, + SIP_Account = loginResponseData.AllVisionRegisterDevUserNameGuid, + }; + MainPage.LoginUser.SaveUserInfo(); + MainPage.Log("鐧诲綍鎴愬姛銆�"); + + /* + * Wait : 鎺ㄩ�佹敞鍐� + */ + } + //鐧诲綍澶辫触 + else + { + Application.RunOnMainThread(() => + { + //鎻愮ず鍘熷洜 + var tip = new Tip() + { + Text = loginResult.ErrorInfo, + CloseTime = 3, + Direction = AMPopTipDirection.None + }; + tip.Show(bodyView); + //if (loginResult.StateCode == HttpRequesResult.LoginFailed_AccountErorr.ToString()) + { + btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; + btnAccountViewBottomLine.Height = Application.GetRealHeight(2); + //} + //else if (loginResult.StateCode == HttpRequesResult.LoginFailed_PasswordErorr.ToString()) + //{ + btnPasswordViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; + btnPasswordViewBottomLine.Height = Application.GetRealHeight(2); + } + }); + } + } + catch (Exception ex) + { + MainPage.Log($"LoginPage : {ex.Message}"); + } + }) + { IsBackground = true }; + return loginThread; + } + + /// <summary> + /// 鍔犺浇娉ㄥ唽鐣岄潰 + /// </summary> + void LoadPage_RegisterPage() + { + btnRegister.MouseUpEventHandler += (sender, e) => { + //鍥炶皟浜嬩欢 + Action<string> callBackAction = (callBackPar_Action) => + { + try + { + etAccount.Text = callBackPar_Action; + } + catch (Exception ex) { + MainPage.Log($"login callBackAction : {ex.Message}"); + } + }; + + var registerPage = new RegisterPage(callBackAction); + registerPage.Show(); + registerPage.ShowDialog(); + }; + } + } +} diff --git a/HDL_ON/UI/UI1-Login/RegisterPage.cs b/HDL_ON/UI/UI1-Login/RegisterPage.cs new file mode 100644 index 0000000..82b2ddd --- /dev/null +++ b/HDL_ON/UI/UI1-Login/RegisterPage.cs @@ -0,0 +1,498 @@ +锘縰sing System; +using HDL_ON.DAL.Server; +using HDL_ON.UI.CSS; +using Shared; + +namespace HDL_ON.UI.UI1Login +{ + public partial class RegisterPage : Dialog + { + #region 鎺т欢鍒楄〃 + /// <summary> + /// 褰撳墠鐣岄潰 + /// </summary> + FrameLayout bodyView; + /// <summary> + /// 閫夋嫨鎵嬫満鐧诲綍鎸夐挳 + /// </summary> + Button btnPhoneLogin; + /// <summary> + /// 閫夋嫨閭鐧诲綍鎸夐挳 + /// </summary> + Button btnEmailLogin; + /// <summary> + /// 璐﹀彿瀛愬尯鍩� + /// </summary> + FrameLayout accountView; + /// <summary> + /// 鍥介檯鍖哄彿鎸夐挳 + /// </summary> + Button btnGlobalRoaming; + /// <summary> + /// 璐﹀彿瀛愬尯鍩熼噷闈㈢殑鍒嗗壊绾� + /// </summary> + Button btnDividingLineVertical_AccountView; + /// <summary> + /// 璐﹀彿鏂囨湰妗� + /// </summary> + EditText etAccount; + /// <summary> + /// 璐﹀彿Icon鎸夐挳 + /// </summary> + Button btnAccountIcon; + /// <summary> + /// 璐﹀彿瀛愬尯鍩熷簳閮ㄦí绾� + /// </summary> + Button btnAccountViewBottomLine; + /// <summary> + /// 瀵嗙爜瀛愬尯鍩� + /// </summary> + FrameLayout passwordView; + /// <summary> + /// 瀵嗙爜Icon鎸夐挳 + /// </summary> + Button btnPasswordIcon; + /// <summary> + /// 瀵嗙爜鏂囨湰妗� + /// </summary> + EditText etPassword; + /// <summary> + /// 瀵嗙爜瀛愬尯鍩熼噷闈㈢殑鍒嗗壊绾�1 + /// </summary> + Button btnDividingLineVertical_PasswordView1; + /// <summary> + /// 瀵嗙爜鏄惁鍙鎸夐挳 + /// </summary> + Button btnVisiblePassword; + /// <summary> + /// 瀵嗙爜瀛愬尯鍩熷簳閮ㄦí绾� + /// </summary> + Button btnPasswordViewBottomLine; + + /// <summary> + /// 纭瀵嗙爜瀛愬尯鍩� + /// </summary> + FrameLayout repeatPasswordView; + /// <summary> + /// 纭瀵嗙爜Icon鎸夐挳 + /// </summary> + Button btnRepeatPasswordIcon; + /// <summary> + /// 纭瀵嗙爜鏂囨湰妗� + /// </summary> + EditText etRepeatPassword; + /// <summary> + /// 纭瀵嗙爜瀛愬尯鍩熼噷闈㈢殑鍒嗗壊绾�1 + /// </summary> + Button btnRepeatDividingLineVertical_PasswordView1; + /// <summary> + /// 纭瀵嗙爜鏄惁鍙鎸夐挳 + /// </summary> + Button btnRepeatVisiblePassword; + /// <summary> + /// 纭瀵嗙爜瀛愬尯鍩熷簳閮ㄦí绾� + /// </summary> + Button btnRepeatPasswordViewBottomLine; + /// <summary> + /// 楠岃瘉鐮佸瓙鍖哄煙 + /// </summary> + FrameLayout verificationCodeView; + /// <summary> + /// 楠岃瘉鐮佸浘鏍� + /// </summary> + Button btnVerificationCodeIcon; + /// <summary> + /// 楠岃瘉鐮佸瓙鍖哄煙鍒嗗壊绾� + /// </summary> + Button btnDividingLineVertical_VerificationCodeView1; + /// <summary> + /// 楠岃瘉鐮佹枃鏈緭鍏ユ + /// </summary> + EditText etVerificationCode; + /// <summary> + /// 鑾峰彇楠岃瘉鐮佹寜閽� + /// </summary> + Button btnGetVerificationCode; + /// <summary> + /// 楠岃瘉鐮佸瓙鍖哄煙搴曢儴鍒嗗壊绾� + /// </summary> + Button btnVerificationCodeViewBottomLine; + /// <summary> + /// 娉ㄥ唽鎸夐挳 + /// </summary> + Button btnRegister; + + #endregion + + #region 灞�閮ㄥ彉閲忓垪琛� + /// <summary> + /// 璐﹀彿绫诲瀷 + /// 0:鎵嬫満 + /// 1:閭 + /// </summary> + int accountType = 0; + /// <summary> + /// 鎵嬫満鍙风爜鏄惁鏈夋晥 + /// </summary> + bool ValidMobileNumber = false; + /// <summary> + /// 瀵嗙爜鏄惁鏈夋晥 + /// </summary> + bool ValidPassword = false; + /// <summary> + /// 鏈嶅姟鍣ㄨ姹傚璞� + /// </summary> + HttpServerRequest pm; + /// <summary> + /// 鍥炶皟浜嬩欢 + /// </summary> + Action<string> callbackAction; + /// <summary> + /// 娉ㄥ唽绫诲瀷 + /// 0:鎵嬫満 + /// 1:閭 + /// </summary> + int registerType; + #endregion + public RegisterPage() + { + bodyView = new FrameLayout() + { + BackgroundColor = CSS_Color.BackgroundColor, + }; + AddChidren(bodyView); + + pm = new HttpServerRequest(); + } + + public RegisterPage(Action<string> action) + { + bodyView = new FrameLayout() + { + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + AddChidren(bodyView); + + pm = new HttpServerRequest(); + callbackAction = action; + } + + public void ShowDialog() + { + new PublicAssmebly().LoadTopView(this, bodyView, Language.StringByID(R.InternationalizationString.Register)); + + #region 娉ㄥ唽鏂瑰紡閫夋嫨 + btnPhoneLogin = new Button() + { + X = Application.GetRealWidth(28), + Y = Application.GetRealHeight(112), + Width = Application.GetRealWidth(120), + Height = Application.GetRealHeight(40), + TextID = R.InternationalizationString.LoginByPhone, + TextColor = CSS_Color.MainColor, + TextAlignment = TextAlignment.CenterLeft, + TextSize = CSS_FontSize.EmphasisFontSize_Secondary, + }; + bodyView.AddChidren(btnPhoneLogin); + + btnEmailLogin = new Button() + { + X = btnPhoneLogin.Right, + Y = Application.GetRealHeight(112), + Width = Application.GetRealWidth(100), + Height = Application.GetRealHeight(40), + TextID = R.InternationalizationString.LoginByEmail, + TextColor = CSS_Color.PromptingColor1, + TextAlignment = TextAlignment.Center, + TextSize = CSS_FontSize.TextFontSize, + }; + bodyView.AddChidren(btnEmailLogin); + #endregion + + #region 璐﹀彿濉啓 + accountView = new FrameLayout() + { + X = Application.GetRealWidth(28), + Y = Application.GetRealHeight(167), + Width = Application.GetRealWidth(319), + Height = Application.GetRealHeight(44), + }; + bodyView.AddChidren(accountView); + + btnGlobalRoaming = new Button() + { + Width = Application.GetRealWidth(57), + X = Application.GetRealWidth(9), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + Text = "+86", + TextSize = CSS_FontSize.TextFontSize, + }; + if (accountType == 0) + { + accountView.AddChidren(btnGlobalRoaming); + } + + //btnDividingLineVertical_AccountView = new Button() + //{ + // X = Application.GetRealWidth(65), + // Gravity = Gravity.CenterVertical, + // Width = 1, + // Height = Application.GetRealHeight(20), + // BackgroundColor = CSS_Color.DividingLineColor, + //}; + //accountView.AddChidren(btnDividingLineVertical_AccountView); + + etAccount = new EditText() + { + X = Application.GetRealWidth(49), + Width = Application.GetRealWidth(319 - 78), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + PlaceholderTextColor = CSS_Color.PromptingColor1, + PlaceholderText = Language.StringByID(R.InternationalizationString.PlsEntryPhoneNumber), + }; + accountView.AddChidren(etAccount); + + btnAccountViewBottomLine = new Button() + { + Y = Application.GetRealHeight(42), + BackgroundColor = CSS_Color.DividingLineColor, + Height = Application.GetRealHeight(1), + }; + accountView.AddChidren(btnAccountViewBottomLine); + + btnAccountIcon = new Button() + { + X = Application.GetRealWidth(9), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(20), + Height = Application.GetMinRealAverage(20), + UnSelectedImagePath = "LoginIcon/AccountIcon.png", + }; + if (accountType == 1) + { + accountView.AddChidren(btnAccountIcon); + } + #endregion + + #region 瀵嗙爜濉啓 + passwordView = new FrameLayout() + { + X = Application.GetRealWidth(28), + Y = Application.GetRealHeight(223), + Width = Application.GetRealWidth(319), + Height = Application.GetRealHeight(44), + }; + bodyView.AddChidren(passwordView); + + btnPasswordIcon = new Button() + { + X = Application.GetRealWidth(9), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(20), + Height = Application.GetMinRealAverage(20), + UnSelectedImagePath = "LoginIcon/PasswordIcon.png", + + }; + passwordView.AddChidren(btnPasswordIcon); + //btnDividingLineVertical_PasswordView1 = new Button() + //{ + // X = Application.GetRealWidth(65), + // Gravity = Gravity.CenterVertical, + // Width = 1, + // Height = Application.GetRealHeight(20), + // BackgroundColor = CSS_Color.DividingLineColor, + //}; + //passwordView.AddChidren(btnDividingLineVertical_PasswordView1); + + etPassword = new EditText() + { + X = Application.GetRealWidth(49), + Width = Application.GetRealWidth(319 - 78), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + PlaceholderTextColor = CSS_Color.PromptingColor1, + PlaceholderText = Language.StringByID(R.InternationalizationString.PlsRegisterPassword), + SecureTextEntry = true, + }; + passwordView.AddChidren(etPassword); + + #region 瀵嗙爜鐧诲綍-鎺т欢鍔犺浇 + btnVisiblePassword = new Button() + { + X = Application.GetRealWidth(295), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(20), + Height = Application.GetMinRealAverage(20), + UnSelectedImagePath = "LoginIcon/HidePasswordIcon.png", + SelectedImagePath = "LoginIcon/ShowPasswordIcon.png", + }; + passwordView.AddChidren(btnVisiblePassword); + + #endregion + btnPasswordViewBottomLine = new Button() + { + Y = Application.GetRealHeight(42), + BackgroundColor = CSS_Color.DividingLineColor, + SelectedBackgroundColor = CSS_Color.MainColor, + Height = Application.GetRealHeight(1), + }; + passwordView.AddChidren(btnPasswordViewBottomLine); + #endregion + + #region 纭瀵嗙爜濉啓 + repeatPasswordView = new FrameLayout() + { + X = Application.GetRealWidth(28), + Y = Application.GetRealHeight(279), + Width = Application.GetRealWidth(319), + Height = Application.GetRealHeight(44), + }; + bodyView.AddChidren(repeatPasswordView); + + btnRepeatPasswordIcon = new Button() + { + X = Application.GetRealWidth(9), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(20), + Height = Application.GetMinRealAverage(20), + UnSelectedImagePath = "LoginIcon/PasswordIcon.png", + + }; + repeatPasswordView.AddChidren(btnRepeatPasswordIcon); + //btnRepeatDividingLineVertical_PasswordView1 = new Button() + //{ + // X = Application.GetRealWidth(65), + // Gravity = Gravity.CenterVertical, + // Width = 1, + // Height = Application.GetRealHeight(20), + // BackgroundColor = CSS_Color.DividingLineColor, + //}; + //repeatPasswordView.AddChidren(btnRepeatDividingLineVertical_PasswordView1); + + etRepeatPassword = new EditText() + { + X = Application.GetRealWidth(49), + Width = Application.GetRealWidth(319 - 78), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + PlaceholderTextColor = CSS_Color.PromptingColor1, + PlaceholderText = Language.StringByID(R.InternationalizationString.PlsRegisterRepeatPassword), + SecureTextEntry = true, + }; + repeatPasswordView.AddChidren(etRepeatPassword); + + #region 瀵嗙爜鐧诲綍-鎺т欢鍔犺浇 + btnRepeatVisiblePassword = new Button() + { + X = Application.GetRealWidth(295), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(20), + Height = Application.GetMinRealAverage(20), + UnSelectedImagePath = "LoginIcon/HidePasswordIcon.png", + SelectedImagePath = "LoginIcon/ShowPasswordIcon.png", + }; + repeatPasswordView.AddChidren(btnRepeatVisiblePassword); + + #endregion + + btnRepeatPasswordViewBottomLine = new Button() + { + Y = Application.GetRealHeight(42), + BackgroundColor = CSS_Color.DividingLineColor, + SelectedBackgroundColor = CSS_Color.MainColor, + Height = Application.GetRealHeight(1), + }; + repeatPasswordView.AddChidren(btnRepeatPasswordViewBottomLine); + + #endregion + + #region 楠岃瘉鐮佸~鍐� + verificationCodeView = new FrameLayout() + { + X = Application.GetRealWidth(28), + Y = Application.GetRealHeight(335), + Width = Application.GetRealWidth(319), + Height = Application.GetRealHeight(44), + }; + bodyView.AddChidren(verificationCodeView); + + btnVerificationCodeIcon = new Button() + { + X = Application.GetRealWidth(9), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(20), + Height = Application.GetMinRealAverage(20), + UnSelectedImagePath = "LoginIcon/VerificationCodeIcon.png", + }; + verificationCodeView.AddChidren(btnVerificationCodeIcon); + + //btnDividingLineVertical_VerificationCodeView1 = new Button() + //{ + // X = Application.GetRealWidth(65), + // Gravity = Gravity.CenterVertical, + // Width = 1, + // Height = Application.GetRealHeight(20), + // BackgroundColor = CSS_Color.DividingLineColor, + //}; + //verificationCodeView.AddChidren(btnDividingLineVertical_VerificationCodeView1); + + etVerificationCode = new EditText() + { + X = Application.GetRealWidth(49), + Width = Application.GetRealWidth(61 + 84), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + PlaceholderTextColor = CSS_Color.PromptingColor1, + PlaceholderText = Language.StringByID(R.InternationalizationString.PlsEntryVerificationCode), + }; + verificationCodeView.AddChidren(etVerificationCode); + + btnGetVerificationCode = new Button() + { + X = Application.GetRealWidth(219), + Width = Application.GetRealWidth(100), + TextID = R.InternationalizationString.GetVerificationCode, + SelectedTextColor = CSS_Color.MainColor, + TextColor = CSS_Color.PromptingColor1, + TextAlignment = TextAlignment.CenterRight, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + }; + verificationCodeView.AddChidren(btnGetVerificationCode); + + btnVerificationCodeViewBottomLine = new Button() + { + Y = Application.GetRealHeight(42), + BackgroundColor = CSS_Color.DividingLineColor, + SelectedBackgroundColor = CSS_Color.MainColor, + Height = Application.GetRealHeight(1), + }; + verificationCodeView.AddChidren(btnVerificationCodeViewBottomLine); + + #endregion + + btnRegister = new Button() + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(421), + Width = Application.GetRealWidth(220), + Height = Application.GetRealHeight(44), + Radius = (uint)Application.GetRealHeight(22), + SelectedBackgroundColor = CSS_Color.MainColor, + BackgroundColor = CSS_Color.PromptingColor1, + TextID = R.InternationalizationString.Register, + TextSize = CSS_FontSize.SubheadingFontSize, + TextColor = CSS_Color.MainBackgroundColor, + TextAlignment = TextAlignment.Center, + }; + bodyView.AddChidren(btnRegister); + + LoadEventList(); + } + } +} \ No newline at end of file diff --git a/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs b/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs new file mode 100644 index 0000000..947b4f2 --- /dev/null +++ b/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs @@ -0,0 +1,387 @@ +锘縰sing System; +using System.Text.RegularExpressions; +using System.Threading; +using HDL_ON.DAL.Server; +using HDL_ON.UI.CSS; +using Shared; + +namespace HDL_ON.UI.UI1Login +{ + public partial class RegisterPage + { + /// <summary> + /// 鍔犺浇浜嬩欢鍒楄〃 + /// </summary> + void LoadEventList() + { + LoadPage_SwitchLoginType(); + LoadEvent_EditTextFcousChange(); + LoadEvent_ChangeTextVisble(); + LoadEvent_GetVerificationCode(); + LoadEvent_Register(); + } + + /// <summary> + /// 鍒囨崲娉ㄥ唽绫诲瀷 + /// </summary> + void LoadPage_SwitchLoginType() + { + //閫夋嫨鎵嬫満娉ㄥ唽 + btnPhoneLogin.MouseUpEventHandler += (sender, e) => + { + #region 鍒囨崲閫変腑鎸夐挳 + btnEmailLogin.TextColor = CSS_Color.PromptingColor1; + btnEmailLogin.TextSize = CSS_FontSize.TextFontSize; + btnPhoneLogin.TextColor = CSS_Color.MainColor; + btnPhoneLogin.TextSize = CSS_FontSize.EmphasisFontSize_Secondary; + etAccount.PlaceholderText = Language.StringByID(R.InternationalizationString.PlsEntryCorrectMobilNeumber); + #endregion + + #region 鍒囨崲娉ㄥ唽鏂瑰紡鍙婂浘鏍� + registerType = 0; + if (btnAccountIcon.Parent != null) + { + btnAccountIcon.RemoveFromParent(); + } + accountView.AddChidren(btnGlobalRoaming); + #endregion + }; + + //閫夋嫨閭娉ㄥ唽 + btnEmailLogin.MouseUpEventHandler += (sender, e) => + { + #region 鍒囨崲閫変腑鎸夐挳 + btnPhoneLogin.TextColor = CSS_Color.PromptingColor1; + btnPhoneLogin.TextSize = CSS_FontSize.TextFontSize; + btnEmailLogin.TextColor = CSS_Color.MainColor; + btnEmailLogin.TextSize = CSS_FontSize.EmphasisFontSize_Secondary; + etAccount.PlaceholderText = Language.StringByID(R.InternationalizationString.PlsEntryEmailAddress); + #endregion + + #region 鍒囨崲娉ㄥ唽绫诲瀷鍙婂浘鏍� + registerType = 1; + if (btnGlobalRoaming.Parent != null) + { + btnGlobalRoaming.RemoveFromParent(); + } + accountView.AddChidren(btnAccountIcon); + #endregion + + }; + } + + + /// <summary> + /// 鍔犺浇鏂囨湰妗嗙劍鐐瑰彉鍖栦簨浠� + /// </summary> + void LoadEvent_EditTextFcousChange() + { + //璐﹀彿鏂囨湰妗嗙劍鐐瑰彉鍖栦簨浠� + etAccount.FoucsChanged += (sender, e) => + { + if (etAccount.Foucs) + { + btnAccountViewBottomLine.BackgroundColor = CSS_Color.MainColor; + btnAccountViewBottomLine.Height = Application.GetRealHeight(2); + } + else + { + //鏍囪鎵嬫満鍙风爜鏃犳晥 + btnGetVerificationCode.IsSelected = false; + btnAccountViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor; + btnAccountViewBottomLine.Height = Application.GetRealHeight(1); + //鎵嬫満娉ㄥ唽-楠岃瘉鎵嬫満鍙风爜鏄惁姝g‘ + if (registerType == 0) + { + Regex reg = new Regex("^\\d+$"); + var mFalg = reg.Match(etAccount.Text.Trim()); + if (!mFalg.Success || (btnGlobalRoaming.Text == "+86" && etAccount.Text.Trim().Length != 11)) + { + btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; + btnAccountViewBottomLine.Height = Application.GetRealHeight(2); + new Tip() + { + CloseTime = 3, + Text = Language.StringByID(R.InternationalizationString.PlsEntryCorrectMobilNeumber), + Direction = AMPopTipDirection.None, + }.Show(bodyView); + } + else + { + //鏍囪鎵嬫満鍙风爜鏈夋晥 + btnGetVerificationCode.IsSelected = true; + //璐﹀彿鏈夋晥銆佸瘑鐮佹湁鏁堛�侀獙璇佺爜杈撳叆浜嗭紝鎵嶈兘鐐瑰嚮娉ㄥ唽 + if (btnGetVerificationCode.IsSelected && ValidPassword && string.IsNullOrEmpty(etVerificationCode.Text.Trim())) + { + btnRegister.IsSelected = true; + } + } + } + else if (registerType == 1) + { + //閭娉ㄥ唽-楠岃瘉閭鏄惁姝g‘ + var reg = new Regex("^\\s*([A-Za-z0-9_-]+(\\.\\w+)*@(\\w+\\.)+\\w{2,5})\\s*$"); + var mFalg = reg.Match(etAccount.Text.Trim()); + if (!mFalg.Success || (btnGlobalRoaming.Text == "+86" && etAccount.Text.Trim().Length != 11)) + { + btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; + btnAccountViewBottomLine.Height = Application.GetRealHeight(2); + new Tip() + { + CloseTime = 3, + Text = Language.StringByID(R.InternationalizationString.PlsEntryCorrectEmailAddress), + Direction = AMPopTipDirection.None, + }.Show(bodyView); + } + else + { + //鏍囪鎵嬫満鍙风爜鏈夋晥 + btnGetVerificationCode.IsSelected = true; + //璐﹀彿鏈夋晥銆佸瘑鐮佹湁鏁堛�侀獙璇佺爜杈撳叆浜嗭紝鎵嶈兘鐐瑰嚮娉ㄥ唽 + if (btnGetVerificationCode.IsSelected && ValidPassword && string.IsNullOrEmpty(etVerificationCode.Text.Trim())) + { + btnRegister.IsSelected = true; + } + } + } + } + }; + + //瀵嗙爜鏂囨湰妗嗙劍鐐瑰彉鍖栦簨浠� + etPassword.FoucsChanged += (sender, e) => { + if (etPassword.Foucs) + { + btnPasswordViewBottomLine.BackgroundColor = CSS_Color.MainColor; + btnPasswordViewBottomLine.Height = Application.GetRealHeight(2); + } + else + { + btnPasswordViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor; + btnPasswordViewBottomLine.Height = Application.GetRealHeight(1); + //鏍¢獙瀵嗙爜鏄惁绗﹀悎瑕佹眰 + if (etPassword.Text.Trim().Length < 6) + { + new Tip() + { + CloseTime = 3, + Direction = AMPopTipDirection.None, + Text = Language.StringByID(R.InternationalizationString.IncorrectRepeatPassword) + }.Show(bodyView); + } + } + }; + + //纭瀵嗙爜鏂囨湰妗嗙劍鐐瑰彉鍖栦簨浠� + etRepeatPassword.FoucsChanged += (sender, e) => { + if (etRepeatPassword.Foucs) + { + btnRepeatPasswordViewBottomLine.BackgroundColor = CSS_Color.MainColor; + btnRepeatPasswordViewBottomLine.Height = Application.GetRealHeight(2); + } + else + { + btnRepeatPasswordViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor; + btnRepeatPasswordViewBottomLine.Height = Application.GetRealHeight(1); + //鏍¢獙涓ゆ杈撳叆鐨勫瘑鐮佹槸鍚︿竴鑷� + if (etPassword.Text.Trim() != etRepeatPassword.Text.Trim()) + { + btnRepeatPasswordViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; + btnRepeatPasswordViewBottomLine.Height = Application.GetRealHeight(2); + new Tip() + { + CloseTime = 3, + Direction = AMPopTipDirection.None, + Text = Language.StringByID(R.InternationalizationString.IncorrectRepeatPassword) + }.Show(bodyView); + } + else + { + ValidPassword = true; + //璐﹀彿鏈夋晥銆佸瘑鐮佹湁鏁堛�侀獙璇佺爜杈撳叆浜嗭紝鎵嶈兘鐐瑰嚮娉ㄥ唽 + if (btnGetVerificationCode.IsSelected && ValidPassword && string.IsNullOrEmpty(etVerificationCode.Text.Trim())) + { + btnRegister.IsSelected = true; + } + } + } + }; + + //楠岃瘉鐮佹枃鏈鐒︾偣鍙樺寲浜嬩欢 + etVerificationCode.FoucsChanged += (sender, e) => { + if (etVerificationCode.Foucs) + { + btnVerificationCodeViewBottomLine.BackgroundColor = CSS_Color.MainColor; + btnVerificationCodeViewBottomLine.Height = Application.GetRealHeight(2); + } + else + { + btnVerificationCodeViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor; + btnVerificationCodeViewBottomLine.Height = Application.GetRealHeight(1); + if (etVerificationCode.Text.Length > 4) + { + //璐﹀彿鏈夋晥銆佸瘑鐮佹湁鏁堛�侀獙璇佺爜杈撳叆浜嗭紝鎵嶈兘鐐瑰嚮娉ㄥ唽 + if (btnGetVerificationCode.IsSelected && ValidPassword && string.IsNullOrEmpty(etVerificationCode.Text.Trim())) + { + btnRegister.IsSelected = true; + } + } + } + }; + } + + /// <summary> + /// 鏇存敼瀵嗙爜鍙鎬� + /// </summary> + void LoadEvent_ChangeTextVisble() + { + //瀵嗙爜鏂囨湰鍙鎬у彉鍖� + btnVisiblePassword.MouseUpEventHandler += (sender, e) => { + btnVisiblePassword.IsSelected = !btnVisiblePassword.IsSelected; + etPassword.SecureTextEntry = !btnVisiblePassword.IsSelected; + }; + //閲嶅瀵嗙爜鏂囨湰鍙鎬у彉鍖� + btnRepeatVisiblePassword.MouseUpEventHandler += (sender, e) => { + btnRepeatVisiblePassword.IsSelected = !btnRepeatVisiblePassword.IsSelected; + etRepeatPassword.SecureTextEntry = !btnRepeatVisiblePassword.IsSelected; + }; + } + + /// <summary> + /// 鑾峰彇楠岃瘉鐮� + /// </summary> + void LoadEvent_GetVerificationCode() + { + btnGetVerificationCode.MouseUpEventHandler += (sender, e) => { + if (btnGetVerificationCode.IsSelected) + { + //鐭俊鍙戦�侀棿闅�60s + btnGetVerificationCode.IsSelected = false; + int time = 60; + new Thread(() => + { + while (time == 0) + { + time--; + Application.RunOnMainThread(() => + { + btnGetVerificationCode.Text = time.ToString() + "s"; + }); + Thread.Sleep(1000); + } + Application.RunOnMainThread(() => + { + //鍥炲鑾峰彇鐭俊鎸夐挳浜嬩欢 + btnGetVerificationCode.IsSelected = true; + }); + }) + { IsBackground = true }.Start(); + //妫�鏌ユ墜鏈烘槸鍚﹀凡缁忚娉ㄥ唽 + var checkPhoneResult = pm.IsExistingAccount(etAccount.Text.Trim()); + //鎵嬫満鏈娉ㄥ唽 + if (checkPhoneResult.StateCode != HttpRequesResult.SUCCESS.ToString()) + { + //鑾峰彇楠岃瘉鐮� + pm.GetPhoneVerificationCode(etAccount.Text.Trim(), MainPage.Company); + } + else + { + //鎻愮ず鎵嬫満鍙风爜宸茬粡娉ㄥ唽 + new Tip() + { + CloseTime = 3, + Direction = AMPopTipDirection.None, + Text = Language.StringByID(R.InternationalizationString.AccountAlreadyExists) + }.Show(bodyView); + } + } + }; + } + + /// <summary> + /// 鍔犺浇娉ㄥ唽鎸夐挳浜嬩欢 + /// </summary> + void LoadEvent_Register() + { + btnRegister.MouseUpEventHandler += (sender, e) => + { + //鎵嬫満娉ㄥ唽 + if (registerType == 0) + { + //鏍¢獙楠岃瘉鐮� + var validateSmsResult = pm.ValidateSmsCode(etAccount.Text.Trim(), etVerificationCode.Text.Trim()); + //楠岃瘉鐮佹牎楠屾垚鍔� + if (validateSmsResult.StateCode == HttpRequesResult.SUCCESS.ToString()) + { + //娉ㄥ唽璐﹀彿 + var registerPhoneResult = pm.RegisterPhone(etAccount.Text.Trim(), etPassword.Text.Trim(), Language.CurrentLanguage); + if (registerPhoneResult.StateCode == HttpRequesResult.SUCCESS.ToString()) + { + //娉ㄥ唽鎴愬姛 + //鎵ц鍥炶皟浜嬩欢 + callbackAction?.Invoke(etAccount.Text.Trim()); + } + else + { + //娉ㄥ唽澶辫触 + new Tip() + { + CloseTime = 3, + Text = registerPhoneResult.ErrorInfo, + Direction = AMPopTipDirection.None, + }.Show(bodyView); + } + } + else + { + //楠岃瘉鐮佹牎楠屽け璐� + new Tip() + { + CloseTime = 3, + Direction = AMPopTipDirection.None, + Text = Language.StringByID(R.InternationalizationString.VerificationCodeWrong) + }.Show(bodyView); + } + } + else if(registerType == 1) + { + //閭娉ㄥ唽 + //鏍¢獙楠岃瘉鐮� + var validateSmsResult = pm.ValidateSmsCode(etAccount.Text.Trim(), etVerificationCode.Text.Trim()); + //楠岃瘉鐮佹牎楠屾垚鍔� + if (validateSmsResult.StateCode == HttpRequesResult.SUCCESS.ToString()) + { + //娉ㄥ唽璐﹀彿 + var registerPhoneResult = pm.RegisterPhone(etAccount.Text.Trim(), etPassword.Text.Trim(), Language.CurrentLanguage); + if (registerPhoneResult.StateCode == HttpRequesResult.SUCCESS.ToString()) + { + //娉ㄥ唽鎴愬姛 + //鎵ц鍥炶皟浜嬩欢 + callbackAction?.Invoke(etAccount.Text.Trim()); + } + else + { + //娉ㄥ唽澶辫触 + new Tip() + { + CloseTime = 3, + Text = registerPhoneResult.ErrorInfo, + Direction = AMPopTipDirection.None, + }.Show(bodyView); + } + } + else + { + //楠岃瘉鐮佹牎楠屽け璐� + new Tip() + { + CloseTime = 3, + Direction = AMPopTipDirection.None, + Text = Language.StringByID(R.InternationalizationString.VerificationCodeWrong) + }.Show(bodyView); + } + } + }; + } + + } +} diff --git a/HDL_ON/UI/UI1-Login/ResetPassword_VerificationCode.cs b/HDL_ON/UI/UI1-Login/ResetPassword_VerificationCode.cs new file mode 100644 index 0000000..314a7ef --- /dev/null +++ b/HDL_ON/UI/UI1-Login/ResetPassword_VerificationCode.cs @@ -0,0 +1,22 @@ +锘縰sing System; +using Shared; + +namespace HDL_ON.UI.UI1Login +{ + public class ResetPassword_VerificationCode : FrameLayout + { + /// <summary> + /// 褰撳墠鐣岄潰 + /// </summary> + FrameLayout bodyView; + public ResetPassword_VerificationCode() + { + bodyView = this; + } + + public void Show() + { + new PublicAssmebly().LoadTopView(bodyView, ""); + } + } +} diff --git a/HDL_ON/UI/UI2-4-PersonalCenter/PersonalCenterPage.cs b/HDL_ON/UI/UI2-4-PersonalCenter/PersonalCenterPage.cs new file mode 100644 index 0000000..38d2c14 --- /dev/null +++ b/HDL_ON/UI/UI2-4-PersonalCenter/PersonalCenterPage.cs @@ -0,0 +1,54 @@ +锘縰sing System; +using Shared; + +namespace HDL_ON.UI.UI24PersonalCenter +{ + public partial class PersonalCenterPage : FrameLayout + { + + #region 鎺т欢鍒楄〃 + /// <summary> + /// 褰撳墠鐣岄潰 + /// </summary> + FrameLayout bodyView; + /// <summary> + /// 椤堕儴鑳屾櫙 + /// </summary> + FrameLayout topbg; + /// <summary> + /// 涓汉淇℃伅鍖哄煙 + /// </summary> + FrameLayout personalInfoView; + #endregion + + public PersonalCenterPage() + { + bodyView = this; + } + public void LoadView() + { + topbg = new FrameLayout() { + Y = Application.GetRealHeight(-10), + Radius = (uint)Application.GetRealHeight(5), + BorderColor = 0x00FFFFFF, + BorderWidth = 0, + BackgroundColor = CSS.CSS_Color.MainColor, + }; + bodyView.AddChidren(topbg); + + personalInfoView = new FrameLayout() { + Gravity = Gravity.CenterVertical, + Y = Application.GetRealHeight(74), + BackgroundColor = CSS.CSS_Color.MainBackgroundColor, + Radius = (uint)Application.GetRealHeight(5), + BorderColor = 0x00FFFFFF, + BorderWidth = 0, + }; + bodyView.AddChidren(personalInfoView); + + + + + } + } +} diff --git "a/asset/logo/1024\302\2671024@2x.png" "b/asset/logo/1024\302\2671024@2x.png" new file mode 100755 index 0000000..e4ceb09 --- /dev/null +++ "b/asset/logo/1024\302\2671024@2x.png" Binary files differ diff --git "a/asset/logo/120\302\267120@2x.png" "b/asset/logo/120\302\267120@2x.png" new file mode 100755 index 0000000..4d03d25 --- /dev/null +++ "b/asset/logo/120\302\267120@2x.png" Binary files differ diff --git "a/asset/logo/120\302\267120@3x.png" "b/asset/logo/120\302\267120@3x.png" new file mode 100755 index 0000000..71dca78 --- /dev/null +++ "b/asset/logo/120\302\267120@3x.png" Binary files differ diff --git "a/asset/logo/180\302\267180@3x.png" "b/asset/logo/180\302\267180@3x.png" new file mode 100755 index 0000000..51ac63f --- /dev/null +++ "b/asset/logo/180\302\267180@3x.png" Binary files differ diff --git "a/asset/logo/20\302\26720.png" "b/asset/logo/20\302\26720.png" new file mode 100755 index 0000000..4c2b0bc --- /dev/null +++ "b/asset/logo/20\302\26720.png" Binary files differ diff --git "a/asset/logo/29\302\26729.png" "b/asset/logo/29\302\26729.png" new file mode 100755 index 0000000..0f95b74 --- /dev/null +++ "b/asset/logo/29\302\26729.png" Binary files differ diff --git "a/asset/logo/40\302\26740@2x.png" "b/asset/logo/40\302\26740@2x.png" new file mode 100755 index 0000000..db9b919 --- /dev/null +++ "b/asset/logo/40\302\26740@2x.png" Binary files differ diff --git "a/asset/logo/512\302\267512.png" "b/asset/logo/512\302\267512.png" new file mode 100755 index 0000000..f88b1b6 --- /dev/null +++ "b/asset/logo/512\302\267512.png" Binary files differ diff --git "a/asset/logo/58\302\26758@2x.png" "b/asset/logo/58\302\26758@2x.png" new file mode 100755 index 0000000..2afe2fd --- /dev/null +++ "b/asset/logo/58\302\26758@2x.png" Binary files differ diff --git "a/asset/logo/60\302\26760@3x.png" "b/asset/logo/60\302\26760@3x.png" new file mode 100755 index 0000000..0db2dd7 --- /dev/null +++ "b/asset/logo/60\302\26760@3x.png" Binary files differ diff --git "a/asset/logo/80\302\26780@2x.png" "b/asset/logo/80\302\26780@2x.png" new file mode 100755 index 0000000..9fb08a5 --- /dev/null +++ "b/asset/logo/80\302\26780@2x.png" Binary files differ diff --git "a/asset/logo/87\302\26787@3x.png" "b/asset/logo/87\302\26787@3x.png" new file mode 100755 index 0000000..5802ceb --- /dev/null +++ "b/asset/logo/87\302\26787@3x.png" Binary files differ -- Gitblit v1.8.0