From a469a96ee8c38f7d98366dcd633e3a15f92fec65 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期一, 01 三月 2021 17:53:52 +0800 Subject: [PATCH] 2021-3-1-1 --- HDL_ON/DAL/Mqtt/MqttClient.cs | 18 +++++++++++++++++- 1 files changed, 17 insertions(+), 1 deletions(-) diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs index 9cded85..a7dea34 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; @@ -278,6 +286,14 @@ //鏂版尋涓嬬嚎涓婚鏂规 鏀跺埌鎸や笅绾夸富棰� ReceiveNotifySqueezeAsync(mMes); } + //App璁㈤槄绾㈠瀹�/缃戝叧閬ユ帶鍣ㄦ坊鍔犳垚鍔熼�氱煡 + else if (topic == $"/user/${DB_ResidenceData.Instance.CurrentRegion.RegionID}/app/thing/topo/found") + { + var ss = Encoding.UTF8.GetString(e.ApplicationMessage.Payload); + HDL_ON.UI.UI2.PersonalCenter.PirDevice.Method.addcontronsid = ss; + //ReceiveCheckGateway(ss); + //return; + } //A缃戝叧璁惧鐘舵��-鍖呭惈娑傞甫璁惧 else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.RegionID}/app/thing/property/send") { -- Gitblit v1.8.0