| | |
| | | if (status == 2) { |
| | | //var result = Control.ControlBytesSendHasReturn (Command.ReadGateway, common.SubnetID, common.DeviceID, new byte [] { (byte)new Random ().Next (255), (byte)new Random ().Next (255) }); |
| | | #region |
| | | //开始本地搜索网关... |
| | | MainPage.AddTip ("Searching local gateway..."); |
| | | |
| | | var control = new Control (); |
| | | control.Send (new Target () { |
| | | IPEndPoint = new System.Net.IPEndPoint (System.Net.IPAddress.Parse (new Net.NetWiFi ().BroadcastIpAddress.ToString ()), 6000), |
| | |
| | | UserMiddle.btnLinkStatus.UnSelectedImagePath = MainPage.WiFiStatus; |
| | | MainPage.Loading.Hide (); |
| | | }); |
| | | //搜索成功,启用本地连接 |
| | | MainPage.AddTip ("Gateway searched successfully, enable local connection."); |
| | | |
| | | Shared.SimpleControl.Phone.UserMiddle.ReadAllDeviceStatus (); |
| | | await SmartHome.MqttCommon.DisConnectRemoteMqttClient (); |
| | | return; |
| | | } else { |
| | | |
| | | } |
| | | } else { |
| | | //搜索失败,启用远程连接 |
| | | MainPage.AddTip ("Gateway not found, enable remote connection."); |
| | | |
| | | } |
| | | } else { |
| | | break; |