From 488efb508eb0648773fe7b68e810e04bcd7ca075 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期五, 11 十二月 2020 15:58:15 +0800
Subject: [PATCH] 20201211

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

diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs
index 321d8b1..3161a9f 100644
--- a/HDL_ON/DAL/Mqtt/MqttClient.cs
+++ b/HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -210,7 +210,7 @@
         /// </summary>
         public static async Task StartCloudMqtt()
         {
-            if (OnAppConfig.Instance.internetStatus == 0)
+            if (MainPage.InternetStatus == 0)
             {
                 return;
             }
@@ -268,7 +268,8 @@
                                 else
                                 {
                                     SetGatewayOnlineResetCheck();
-                                    Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, DB_ResidenceData.residenceData.HomeGateway.aesKey);
+                                    var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, DB_ResidenceData.residenceData.HomeGateway.aesKey);
+                                    
                                     //bus鏁版嵁瑙f瀽
                                     if (DB_ResidenceData.residenceData.GatewayType == 0)
                                     {
@@ -287,7 +288,7 @@
                                     else
                                     {
                                         //A鍗忚鏁版嵁澶勭悊
-                                        var revString = Encoding.UTF8.GetString(e.ApplicationMessage.Payload);
+                                        var revString = Encoding.UTF8.GetString(bytes);
                                         Control.Ins.UpdataFunctionStatus(revString);
                                     }
                                 }
@@ -309,6 +310,7 @@
                     if (RemoteMqttClient.ConnectedHandler == null)
                     {
                         RemoteMqttClient.UseConnectedHandler(async (e) => {
+                            Control.Ins.GatewayOnline = true;
                             IfNeedReadAllDeviceStatus = true;
                             Utlis.WriteLine($"============>Mqtt杩滅▼杩炴帴鎴愬姛");
                             SendPushSignOut();

--
Gitblit v1.8.0