wxr
2020-11-24 a5ba89efa83d0a4afd0d25dbeba5989e4944b5b8
HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -14,7 +14,7 @@
namespace HDL_ON.DAL.Mqtt
{
    public static class MqttCommon
    public static class MqttClient
    {
        /// <summary>
        /// 加密通讯KEY
@@ -121,8 +121,6 @@
        {
            if (reset)
            {
                bNeedStartTip = true;
                bNeedConnectTip = true;
                MqttInfoConfig.Current.IfGetMqttInfoSuccess = false;
            }
            await DisConnectRemoteMqttClient(s);
@@ -135,7 +133,7 @@
        public static bool remoteMqttIsConnecting;
        static bool remoteIsConnected;
        static MqttCommon()
        static MqttClient()
        {
            InitMqtt();
        }
@@ -301,7 +299,6 @@
                                    {
                                        packet.Bytes = e.ApplicationMessage.Payload;
                                    }
                                    packet.IsLocal = false;
                                    packet.Manager();
                                }
                            }
@@ -441,12 +438,6 @@
            if (MqttInfoConfig.Current.HomeGatewayInfo != null && MqttInfoConfig.Current.mMqttInfo != null)
            {
                if (bNeedConnectTip)
                {
                    bNeedConnectTip = false;
                    MainPage.LoadingTipShow(Language.StringByID(SimpleControl.R.MyInternationalizationString.GetSuccessfullyStartConnecting));
                }
                try
                {
@@ -687,8 +678,8 @@
            var mqttInfoRequestResult_Obj =new Server.HttpServerRequest().GetMqttRemoteInfo(GetRandomKey());
            if (mqttInfoRequestResult_Obj != null)
            {
                MqttInfoConfig.Current.mMqttInfo = mqttInfoRequestResult_Obj;
                if (UserConfig.Instance.GatewayList != null && UserConfig.Instance.GatewayList.Count > 0)
                MqttInfoConfig.Cur.mMqttInfo = mqttInfoRequestResult_Obj;
            if (UserConfig.Instance.GatewayList != null && UserConfig.Instance.GatewayList.Count > 0)
                {
                    //----第二步找出是否存在匹配当前住宅的mac,存在再进行远程。
                    MqttInfoConfig.Current.HomeGatewayInfo = UserConfig.Instance.GatewayList[0];
@@ -702,18 +693,12 @@
                {
                    Utlis.WriteLine("============>还没绑定网关");
                }
            }
            else
            {
                Utlis.WriteLine("============>MqttInfo null");
            }
        }
    }
}