| | |
| | | { |
| | | return; |
| | | } |
| | | if(DB_ResidenceData.Instance.CurrentRegion == null || DB_ResidenceData.Instance.CurrentRegion.RegionID == null) |
| | | if (DB_ResidenceData.Instance.CurrentRegion == null || DB_ResidenceData.Instance.CurrentRegion.RegionID == null) |
| | | { |
| | | return; |
| | | } |
| | |
| | | try |
| | | { |
| | | var topic = e.ApplicationMessage.Topic; |
| | | MainPage.Log($"收到mqtt主题:{topic}"); |
| | | //MainPage.Log($"收到mqtt主题:{topic}"); |
| | | //一端口主题处理 |
| | | if (DB_ResidenceData.Instance.GatewayType == 0 && !DB_ResidenceData.Instance.CheckWhetherGatewayIdIsNull()) |
| | | { |
| | |
| | | { |
| | | var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, tuyaEncryptKey); |
| | | var revString = Encoding.UTF8.GetString(bytes); |
| | | UI.UI2.PersonalCenter.PirDevice.Method.controldata = revString; |
| | | UI.UI2.PersonalCenter.PirDevice.Method.buttondata = revString; |
| | | } |
| | | #region 数据更新推送主题 |
| | | //appHomeRefresh:住宅数据刷新通知 |
| | | else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.RegionID}/app/thing/event/appHomeRefresh/up") { |
| | | else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.RegionID}/app/thing/event/appHomeRefresh/up") |
| | | { |
| | | MainPage.Log("住宅数据刷新通知"); |
| | | new HttpServerRequest().GetHomePager(); |
| | | } |
| | | //appRoomRefresh:房间数据刷新通知 |
| | | else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.RegionID}/app/thing/event/appRoomRefresh/up"){ |
| | | else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.RegionID}/app/thing/event/appRoomRefresh/up") |
| | | { |
| | | MainPage.Log("房间数据刷新通知"); |
| | | var roomResult = new HttpServerRequest().GetRoomList(); |
| | | if (roomResult.Code == StateCode.SUCCESS) |
| | |
| | | } |
| | | } |
| | | //appDeviceRefresh:设备数据刷新通知 |
| | | else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.RegionID}/app/thing/event/appDeviceRefresh/up") { |
| | | else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.RegionID}/app/thing/event/appDeviceRefresh/up") |
| | | { |
| | | MainPage.Log("设备数据刷新通知"); |
| | | var deviceResult = new HttpServerRequest().GetDeviceList(); |
| | | if (deviceResult.Code == StateCode.SUCCESS) |
| | |
| | | { |
| | | var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, tuyaEncryptKey); |
| | | var revString = Encoding.UTF8.GetString(bytes); |
| | | Control.Ins.UpdataFunctionStatus(revString, null,true); |
| | | Control.Ins.UpdataFunctionStatus(revString, null, true); |
| | | } |
| | | //一端口数据解析 |
| | | else |
| | |
| | | MqttInfoConfig.Current.Save(); |
| | | |
| | | |
| | | |
| | | |
| | | mqttEncryptKey = MqttInfoConfig.Current.HomeGatewayInfo.aesKey; |
| | | //解密密钥规则:已现有的住宅ID为基准,从右边一一获取值,最后如果不够16位,则往右补零 |
| | | string aesKey = string.Empty; |
| | |
| | | /// </summary> |
| | | static void ReceiveNotifySqueezeAsync(string mMes) |
| | | { |
| | | if (mMes == PushSignStr ) return;//是自己的登录推送不处理//或者当前不是远程链接状态 |
| | | if (mMes == PushSignStr) return;//是自己的登录推送不处理//或者当前不是远程链接状态 |
| | | //测试账号,不挤下线 |
| | | switch (UserInfo.Current.AccountString) |
| | | { |
| | |
| | | |
| | | |
| | | } |
| | | } |
| | | } |