xm
2020-05-18 490696fba6c1f1318e088c439ee81d536126581b
ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs
old mode 100755 new mode 100644
@@ -2758,8 +2758,8 @@
           .WithTcpServer(domain, int.Parse(port))
           .WithCredentials(connEmqUserName, connEmqPwd)
           .WithKeepAlivePeriod(TimeSpan.FromSeconds(20))
           .WithCleanSession()
           //.WithCommunicationTimeout(TimeSpan.FromSeconds(10))
           .WithCleanSession()
           //.WithCommunicationTimeout(TimeSpan.FromSeconds(10))
           .Build();
                                await DisConnectRemoteMqttClient("StartRemoteMqtt");
                                await RemoteMqttClient.ConnectAsync(options, CancellationToken.None);
@@ -3184,9 +3184,23 @@
                {
                    jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
                }
                #region 设备状态上报【奇怪,为什么放在原来的位置会不执行这块代码》???】
                if (topic == gatewayID + "/" + "DeviceStatusReport" + "/" + addr + "/" + epoint + "/" + cluID + "/" + attrId)
                {
                    var deviceID = jobject.Value<int>("Device_ID");
                    var deviceAddr = jobject.Value<string>("DeviceAddr");
                    var tempEpoint = jobject.Value<int>("Epoint");
                    var dataId = jobject.Value<int>("Data_ID");
                    var tempDevice = new CommonDevice { DeviceID = deviceID, DeviceAddr = deviceAddr, DeviceEpoint = tempEpoint };
                    tempDevice.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.DeviceStatusReportData>(jobject["Data"].ToString());
                    UpdateDeviceInfo(tempDevice, "DeviceStatusReport");
                }
                #endregion
                #region 远程,主网关上报通知
                if (IsRemote)
                else if (IsRemote)
                {
                    if (topic == gatewayID + "/" + "BeMainGw_Report")
                    {
@@ -3208,27 +3222,12 @@
                        }
                    }
                }
                #endregion
                #region 设备在线状态更新反馈
                //2020.05.11 删除
                #endregion
                #region 设备状态上报
                else if (topic == gatewayID + "/" + "DeviceStatusReport" + "/" + addr + "/" + epoint + "/" + cluID + "/" + attrId)
                {
                    var deviceID = jobject.Value<int>("Device_ID");
                    var deviceAddr = jobject.Value<string>("DeviceAddr");
                    var tempEpoint = jobject.Value<int>("Epoint");
                    var dataId = jobject.Value<int>("Data_ID");
                    var tempDevice = new CommonDevice { DeviceID = deviceID, DeviceAddr = deviceAddr, DeviceEpoint = tempEpoint };
                    tempDevice.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.DeviceStatusReportData>(jobject["Data"].ToString());
                    UpdateDeviceInfo(tempDevice, "DeviceStatusReport");
                }
                #endregion
                #region 门锁操作事件通知
                else if (topic == gatewayID + "/" + "DoorLock/DoorLockOperatingEventNotificationCommand")
@@ -3511,13 +3510,13 @@
        public static void DebugPrintLog(string msg, bool flage = true)
        {
#if DEBUG
            if (flage == true)
            {
                if (msg.Contains("DeviceStatusReport") == false)
                {
                    System.Console.WriteLine(msg + "  " + System.DateTime.Now.ToLongTimeString() + " " + System.DateTime.Now.Millisecond);
                }
            }
            //if (flage == true)
            //{
            //if (msg.Contains("DeviceStatusReport") == false)
            //{
            System.Console.WriteLine(msg + "  " + System.DateTime.Now.ToLongTimeString() + " " + System.DateTime.Now.Millisecond);
            // }
            // }
#endif
        }