| | |
| | | /// 变更网络时的事件
|
| | | /// </summary>
|
| | | private string changedNetworkTime = string.Empty;
|
| | | /// <summary>
|
| | | /// 当前 wifi 的
|
| | | /// </summary>
|
| | | private string oldSsid = string.Empty;
|
| | |
|
| | | #endregion
|
| | |
|
| | |
| | | tcpClient = new System.Net.Sockets.TcpClient();
|
| | | tcpClient.Connect("192.168.8.1", 5000);
|
| | | networkStream = tcpClient.GetStream();
|
| | | networkStream.ReadTimeout = 1000;
|
| | | //加密数据
|
| | | string sendDataMsg = "hdl1985.";
|
| | | string DefaultdesKey = "hdl1985.";
|
| | |
| | | /// 监听安卓网络变化
|
| | | /// </summary>
|
| | | /// <param name="value">0:没有网络 1:4G 2:wifi</param>
|
| | | private void NetworkStateChanged(int value)
|
| | | public void NetworkStateChanged(int value)
|
| | | {
|
| | | if (Common.Config.Instance.HomeId == string.Empty)
|
| | | {
|
| | | //在登录界面不处理
|
| | | return;
|
| | | }
|
| | | #if iOS
|
| | | var nowSsid = this.SSID;
|
| | | if (this.oldSsid == nowSsid)
|
| | | {
|
| | | //如果当前 wifi 的名字一样,则不处理
|
| | | ZigBee.Common.Application.FindGateWaySocket.Start();
|
| | | return;
|
| | | }
|
| | | this.oldSsid = nowSsid;
|
| | | #endif
|
| | | //没有网络
|
| | | if (value == 0)
|
| | | {
|