wxr
2023-07-26 58d4fc80a710ea6e1d350e913ed09b75953c6e7a
Crabtree/SmartHome/UI/SimpleControl/EquipmentPublicClass.cs
@@ -239,10 +239,23 @@
                                SystemRemote.LinkRemote (gateWay.Remote_UserName, gateWay.Remote_ProjectName, gateWay.Remote_Password, true);
                            } else {
                                CommonPage.IsRemote = false;
                                CommonPage.FindGateway = true;
                                //CommonPage.FindGateway = true;
                                var result = Control.ControlBytesSendHasReturn (Command.ReadDeviceMac, common.SubnetID, common.DeviceID, new byte [] { }, false);
                                CommonPage.FindGateway = false;
                                //var control = new Control ();
                                //control.Send (new Target () {
                                //    IPEndPoint = new System.Net.IPEndPoint (System.Net.IPAddress.Parse (new Net.NetWiFi ().BroadcastIpAddress.ToString ()), 6000),
                                //    Command = Command.ReadGateway,
                                //    SubnetID = common.SubnetID,
                                //    DeviceID = common.DeviceID,
                                //    AddData = new byte [] { (byte)new Random ().Next (255), (byte)new Random ().Next (255) },
                                //}, SendCount.Three, true, true);
                                //var result = control.UsefulBytes;
                                //CommonPage.FindGateway = false;
                                if (result != null) {
                                    //var mac0 = CommonPage.byteToHex16 (result [5]) + "." + CommonPage.byteToHex16 (result [6]) + "." + CommonPage.byteToHex16 (result [7]) + "." + CommonPage.byteToHex16 (result [8]) + "." + CommonPage.byteToHex16 (result [9]) + "." + CommonPage.byteToHex16 (result [10]) + "." + CommonPage.byteToHex16 (result [11]) + "." + CommonPage.byteToHex16 (result [12]);
                                    var mac0 = CommonPage.byteToHex16 (result [0]) + "." + CommonPage.byteToHex16 (result [1]) + "." + CommonPage.byteToHex16 (result [2]) + "." + CommonPage.byteToHex16 (result [3]) + "." + CommonPage.byteToHex16 (result [4]) + "." + CommonPage.byteToHex16 (result [5]) + "." + CommonPage.byteToHex16 (result [6]) + "." + CommonPage.byteToHex16 (result [7]);
                                    if (common.MAC == mac0) {
                                        Application.RunOnMainThread (() => {