From a61775710f8c4466db5bfce58af58f886d58edf3 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期三, 14 十二月 2022 10:04:06 +0800 Subject: [PATCH] 备份 --- SmartHome/HDL/Operation/Control.cs | 17 ++--------------- 1 files changed, 2 insertions(+), 15 deletions(-) diff --git a/SmartHome/HDL/Operation/Control.cs b/SmartHome/HDL/Operation/Control.cs index a7476dc..a2b60c0 100644 --- a/SmartHome/HDL/Operation/Control.cs +++ b/SmartHome/HDL/Operation/Control.cs @@ -22,12 +22,7 @@ /// <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, @@ -36,7 +31,6 @@ DeviceID = deviceID, AddData = gatewayBytes, }, SendCount.Three, true); - CommonPage.FindGateway = false; return control.UsefulBytes; } @@ -46,13 +40,7 @@ /// </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), @@ -61,7 +49,6 @@ DeviceID = deviceID, AddData = gatewayBytes, }, sendCount, false); - CommonPage.FindGateway = false; System.Console.WriteLine (command.ToString () + "::" + CommonPage.EndPoint.ToString ()); } -- Gitblit v1.8.0