wxr
2022-12-14 a61775710f8c4466db5bfce58af58f886d58edf3
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 ());
        }