From 6e580804d74d7a6fb118b6ba381e88aa81f267c7 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期一, 15 三月 2021 15:30:23 +0800 Subject: [PATCH] Merge branch 'temp-wxr' into dev-tzy --- HDL_ON/DAL/Mqtt/MqttClient.cs | 27 +++++++++++++++++++++++++-- 1 files changed, 25 insertions(+), 2 deletions(-) diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs index d6b5871..18941e8 100644 --- a/HDL_ON/DAL/Mqtt/MqttClient.cs +++ b/HDL_ON/DAL/Mqtt/MqttClient.cs @@ -191,9 +191,17 @@ Topic = $"/user/{DB_ResidenceData.Instance.CurrentRegion.RegionID}/app/thing/property/send", QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce }; + //App璁㈤槄绾㈠瀹� / 缃戝叧閬ユ帶鍣ㄦ坊鍔犳垚鍔熼�氱煡 + var pirStatus = new MqttTopicFilter() + { + Topic = $"/user/{DB_ResidenceData.Instance.CurrentRegion.RegionID}/app/thing/topo/found", + QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce + }; Utlis.WriteLine("寮�濮嬭闃咃紒"); - var result = await RemoteMqttClient.SubscribeAsync(new MqttTopicFilter[] { topicFilterPush2, topicAlinkStatus }); + var result = await RemoteMqttClient.SubscribeAsync(new MqttTopicFilter[] { + pirStatus, + topicFilterPush2, topicAlinkStatus }); if (result.Items[0].ResultCode == MQTTnet.Client.Subscribing.MqttClientSubscribeResultCode.GrantedQoS0) { isSubscribeSuccess = true; @@ -272,11 +280,26 @@ } } + //涓�浜涚壒娈婄殑涓婚澶勭悊(涓轰簡鎵ц閫熷害,灏藉彲鑳界殑鍒姞鑰楁椂鐨勬搷浣� true:鎵ц浜嗙壒娈婂鐞� false:娌℃湁鎵ц鐗规畩澶勭悊) + if (Stan.HdlCloudReceiveLogic.Current.CloudOverallMsgReceiveEx(topic, e.ApplicationMessage.Payload, mqttEncryptKey, tuyaEncryptKey) == true) + { + return; + } + if (topic == $"/BusGateWayToClient/{UserInfo.Current.ID}" + PushNotifySqueeze) { var mMes = Encoding.UTF8.GetString(e.ApplicationMessage.Payload); //鏂版尋涓嬬嚎涓婚鏂规 鏀跺埌鎸や笅绾夸富棰� ReceiveNotifySqueezeAsync(mMes); + } + //App璁㈤槄绾㈠瀹�/缃戝叧閬ユ帶鍣ㄦ坊鍔犳垚鍔熼�氱煡 + else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.RegionID}/app/thing/topo/found") + { + var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, tuyaEncryptKey); + var revString = Encoding.UTF8.GetString(bytes); + HDL_ON.UI.UI2.PersonalCenter.PirDevice.Method.addcontronsid = revString; + //ReceiveCheckGateway(ss); + //return; } //A缃戝叧璁惧鐘舵��-鍖呭惈娑傞甫璁惧 else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.RegionID}/app/thing/property/send") @@ -289,7 +312,7 @@ else { //SetGatewayOnlineResetCheck(); - var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, mqttEncryptKey); + //var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, mqttEncryptKey); //bus鏁版嵁瑙f瀽 var packet = new Packet(); -- Gitblit v1.8.0