| | |
| | | /// </summary> |
| | | public static async Task StartCloudMqtt() |
| | | { |
| | | if (MainPage.InternetStatus == 0) |
| | | //没有网络的状态下尝试一下连接mqtt ,安卓的网络状态变化监听有异常,修改底层麻烦 |
| | | if (MainPage.InternetStatus == 0 && MainPage.LinkHdlMqttCount > 1) |
| | | { |
| | | return; |
| | | } |
| | | MainPage.LinkHdlMqttCount++; |
| | | |
| | | if (!UserInfo.Current.IsLogin) |
| | | { |
| | |
| | | } |
| | | #region 数据更新推送主题 |
| | | //appHomeRefresh:住宅数据刷新通知 |
| | | else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/thing/event/appHomeRefresh/up" |
| | | || topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/thing/event/appDeviceRefresh/up") |
| | | else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/thing/event/appHomeRefresh/up") |
| | | { |
| | | MainPage.Log("住宅数据刷新通知"); |
| | | new HttpServerRequest().GetHomePager(); |
| | |
| | | { |
| | | IfNeedReadAllDeviceStatus = true; |
| | | Control.Ins.GatewayOnline_Cloud = true; |
| | | if(MainPage.InternetStatus == 0) |
| | | { |
| | | MainPage.InternetStatus = 1; |
| | | } |
| | | Utlis.WriteLine($"============>Mqtt远程连接成功"); |
| | | SendPushSignOut(); |
| | | }); |