黄学彪
2020-04-14 463cf39019aa54e6c1226be4620766a035a0c490
ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs
@@ -143,12 +143,6 @@
        public List<CommonDevice> DeviceList = new List<CommonDevice>();
        /// <summary>
        /// 所有网关中的设备列表
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public List<CommonDevice> AllGatewayDeviceList = new List<CommonDevice>();
        /// <summary>
        /// 网关中场景列表
        /// 一个场景中包含所有信息,包括场景设备信息
        /// </summary>
@@ -160,28 +154,6 @@
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public List<Scene.GetSceneDeviceListInfo> SceneDeviceList = new List<Scene.GetSceneDeviceListInfo>();
        /// <summary>
        /// 网关中hdl私有按键绑定列表
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public List<HDLbutton> HdlButtonList = new List<HDLbutton>();
        //网关中新的设备列表
        [Newtonsoft.Json.JsonIgnore]
        public List<CommonDevice> ListNewDeviceInfoData = new List<CommonDevice>();
        /// <summary>
        /// 私有按键信息列表
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public System.Collections.Generic.Dictionary<string, HDLbutton> hdlButtonInfoList = new Dictionary<string, HDLbutton>();
        /// <summary>
        /// 传感器信息列表
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public System.Collections.Generic.Dictionary<string, Scene.TaskListInfo> sceneTaskInfoList = new Dictionary<string, Scene.TaskListInfo>();
        #region action variable
        /// <summary>
@@ -3158,14 +3130,14 @@
                            {
                                if (localMqttClient.Options == null)
                                {
                                    var options = new MQTTnet.Client.Options.MqttClientOptionsBuilder().WithClientId(currentGuid.ToString())
                       .WithTcpServer(brokerName, 1883)
                       .WithKeepAlivePeriod(TimeSpan.FromSeconds(20))
                       .WithCleanSession()
                        //.WithCommunicationTimeout(TimeSpan.FromSeconds(10))
                       .WithCredentials("", "")
                       .Build();
                                    await localMqttClient.ConnectAsync(options, CancellationToken.None);
                                    var options = new MQTTnet.Client.Options.MqttClientOptionsBuilder()//MQTT连接参数填充
                                    .WithClientId(currentGuid.ToString())//客户端ID
                                    .WithTcpServer(brokerName, 1883)//TCP服务端  1883  ,即MQTT服务端
                                    .WithCredentials("", "")//"", "")//凭证  帐号 密码
                                    .WithCommunicationTimeout(new TimeSpan(0, 0, 60)) //重连超时时间,默认5s
                                    .WithKeepAlivePeriod(new TimeSpan(0, 0, 15)) //保持连接时间,默认5s,心跳包
                                    .Build();//
                                    await localMqttClient.ConnectAsync(options);
                                }
                                else
                                {