陈嘉乐
2021-03-16 e1ac4ab0e68024e6289e0b11756962d662749b04
HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -245,7 +245,7 @@
            Utlis.WriteLine($"StartCloudMqtt: 开始");
            await Task.Factory.StartNew(async () => {
            await Task.Factory.StartNew((Func<Task>)(async () => {
                try
                {
                    #region 初始化远程Mqtt
@@ -257,7 +257,7 @@
                    if (RemoteMqttClient.ApplicationMessageReceivedHandler == null)
                    {
                        //处理接收到的数据
                        RemoteMqttClient.UseApplicationMessageReceivedHandler((e) => {
                        RemoteMqttClient.UseApplicationMessageReceivedHandler((Action<MqttApplicationMessageReceivedEventArgs>)((e) => {
                            try
                            {
                                var topic = e.ApplicationMessage.Topic;
@@ -298,7 +298,7 @@
                                {
                                    var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, tuyaEncryptKey);
                                    var revString = Encoding.UTF8.GetString(bytes);
                                    HDL_ON.UI.UI2.PersonalCenter.PirDevice.Method.addcontrondata = revString;
                                    HDL_ON.UI.UI2.PersonalCenter.PirDevice.Method.controldata = revString;
                                    //ReceiveCheckGateway(ss);
                                    //return;
                                }
@@ -307,7 +307,7 @@
                                {
                                    var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, tuyaEncryptKey);
                                    var revString = Encoding.UTF8.GetString(bytes);
                                    HDL_ON.UI.UI2.PersonalCenter.PirDevice.Method.studybtndata = revString;
                                    HDL_ON.UI.UI2.PersonalCenter.PirDevice.Method.buttondata = revString;
                                    //ReceiveCheckGateway(ss);
                                    //return;
                                }
@@ -338,7 +338,7 @@
                                }
                            }
                            catch { }
                        });
                        }));
                    }
                    //(2)DisconnectedHandler
@@ -389,7 +389,7 @@
                    Utlis.WriteLine($"StartCloudMqtt: 结束");
                }
            });
            }));
        }