| | |
| | | Topic = $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/thing/event/irCodeStudyDone/up", |
| | | QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce |
| | | }; |
| | | |
| | | #region 数据更新推送主题 |
| | | //appHomeRefresh:住宅数据刷新通知 |
| | | var appHomeRefresh = new MqttTopicFilter() |
| | |
| | | Topic = $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/thing/event/appDeviceRefresh/up", |
| | | QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce |
| | | }; |
| | | //网关密钥更新通知 |
| | | var mqttkeyChange = new MqttTopicFilter() |
| | | { |
| | | Topic = $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/custom/mqtt/secret/change", |
| | | QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce |
| | | }; |
| | | |
| | | #endregion |
| | | |
| | | |
| | |
| | | var result = await RemoteMqttClient.SubscribeAsync(new MqttTopicFilter[] { |
| | | pirStatus,pirStudy, |
| | | appDeviceRefresh,appHomeRefresh,appRoomRefresh, |
| | | topicFilterPush2, topicAlinkStatus }); |
| | | topicFilterPush2, topicAlinkStatus ,mqttkeyChange}); |
| | | if (result.Items[0].ResultCode == MQTTnet.Client.Subscribing.MqttClientSubscribeResultCode.GrantedQoS0) |
| | | { |
| | | isSubscribeSuccess = true; |
| | |
| | | MainPage.Log($"读取云端设备数据失败:Code:{deviceResult.Code}; Msg:{deviceResult.message}"); |
| | | } |
| | | } |
| | | //网关密钥变化 |
| | | else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/custom/mqtt/secret/change") |
| | | { |
| | | var pm = new HttpServerRequest(); |
| | | pm.GetHomeGatewayList(); |
| | | MainPage.Log($"网关密钥变更"); |
| | | MainPage.Log($"旧密钥:{mqttEncryptKey}"); |
| | | mqttEncryptKey = MqttInfoConfig.Current.HomeGatewayInfo.aesKey; |
| | | MainPage.Log($"新密钥:{mqttEncryptKey}"); |
| | | } |
| | | |
| | | #endregion |
| | | //A网关设备状态-包含涂鸦设备 |
| | | else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/thing/property/send") |
| | |
| | | { |
| | | if (mMes == PushSignStr) return;//是自己的登录推送不处理//或者当前不是远程链接状态 |
| | | //测试账号,不挤下线 |
| | | switch (UserInfo.Current.AccountString) |
| | | switch (UserInfo.Current.userMobileInfo) |
| | | { |
| | | case "13415629083": |
| | | case "18316120654": |