From 23ca39219c5075d829d14137cb54896a24ae513d Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期五, 04 十二月 2020 13:57:08 +0800
Subject: [PATCH] 20201204

---
 HDL_ON/DAL/Mqtt/MqttClient.cs |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs
index ea06685..591e8a2 100644
--- a/HDL_ON/DAL/Mqtt/MqttClient.cs
+++ b/HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -178,8 +178,14 @@
                         //QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.ExactlyOnce
                     };
 
+                    var topicAlinkStatus = new MqttTopicFilter()
+                    {
+                        Topic = $"/user/{MqttInfoConfig.Current.HomeGatewayInfo.gatewayId}/app/thing/property/#",
+                        QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce
+                    };
+
                     Utlis.WriteLine("寮�濮嬭闃咃紒");
-                    var result = await RemoteMqttClient.SubscribeAsync(new MqttTopicFilter[] { topicFilterBusGateWayToClient, topicFilterPush2 });
+                    var result = await RemoteMqttClient.SubscribeAsync(new MqttTopicFilter[] { topicFilterBusGateWayToClient, topicFilterPush2 , topicAlinkStatus });
                     if (result.Items[0].ResultCode == MQTTnet.Client.Subscribing.MqttClientSubscribeResultCode.GrantedQoS0)
                     {
                         isSubscribeSuccess = true;
@@ -424,8 +430,7 @@
 
                     //url = HttpUtil.GetProxyEMQUrl (url);
                     //#if DEBUG
-                    //                   url = HttpUtil.GetProxyEMQUrl (url);
-
+                    //url = HttpUtil.GetProxyEMQUrl (url);
                     //#endif
                     var clientId = MqttInfoConfig.Current.mMqttInfo.clientId;
                     var username = MqttInfoConfig.Current.mMqttInfo.userName;

--
Gitblit v1.8.0