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 | 21 ++++++--------------- 1 files changed, 6 insertions(+), 15 deletions(-) diff --git a/SmartHome/HDL/Operation/Control.cs b/SmartHome/HDL/Operation/Control.cs index 0b0b1b2..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 ()); } @@ -204,6 +191,8 @@ case Command.READ_JOG_OPEN_TIME_ACK: case Command.SET_JOG_CLOSE_TIME_ACK: case Command.READ_JOG_CLOSE_TIME_ACK: + case Command.GetRemoteOnePortInfoACK: + case Command.GetRemoteOnePortListInfoACK: receiveFlag += ""; break; case Command.ControlMusicModel1ACK: @@ -545,6 +534,8 @@ case Command.READ_JOG_OPEN_TIME_CMD: case Command.SET_JOG_CLOSE_TIME_CMD: case Command.READ_JOG_CLOSE_TIME_CMD: + case Command.GetRemoteOnePortInfo: + case Command.GetRemoteOnePortListInfo: this.SendFlag += ""; break; case Command.ControlMusicModel2: -- Gitblit v1.8.0