gxc
2019-11-15 05ce435c3b58e53eeab04c672affdeeab75f3036
ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs
@@ -3317,10 +3317,7 @@
                        DefaultCommunicationTimeout = new TimeSpan(0, 0, 100),//设置超时时间
                    };
                    //远程通讯连接,连接云端服务器 
                    if (RemoteMqttClient != null)
                    {
                        await RemoteMqttClient.ConnectAsync(connectCloudMqttClientOptions);
                    }
                    await RemoteMqttClient.ConnectAsync(connectCloudMqttClientOptions);
                }
                catch (Exception ex)
@@ -3922,6 +3919,54 @@
                    UpdateDeviceInfo(tempDevice, "DeviceStatusReport");
                }
                #endregion
                #region 门锁操作事件通知
                else if (topic == gatewayID + "/" + "DoorLock/DoorLockOperatingEventNotificationCommand")
                {
                    var deviceID = jobject.Value<int>("Device_ID");
                    switch ((DeviceType)(deviceID))
                    {
                        case DeviceType.DoorLock:
                            var doorLock = new DoorLock() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID };
                            var OperatingEventNotificationDatad = Newtonsoft.Json.JsonConvert.DeserializeObject<ZigBee.Device.DoorLock.DoorLockOperatingEventNotificationCommand>(jobject["Data"].ToString());
                            if (OperatingEventNotificationDatad != null)
                            {
                                doorLock.doorLockOperatingEventNotificationCommand = OperatingEventNotificationDatad;
                            }
                            if (gwa.ReportAction != null)
                            {
                                DebugPrintLog("DoorLockProgrammingEventNotificationCommand已经通知");
                                gwa.ReportAction("DoorLockProgrammingEventNotificationCommand", doorLock);
                            }
                            UpdateDeviceStatus(doorLock);
                            UpdateDeviceInfo(doorLock, "DoorLockProgrammingEventNotificationCommand");
                            break;
                    }
                }
                #endregion
                #region 门锁编程事件通知
                else if (topic == gatewayID + "/" + "DoorLock/DoorLockProgrammingEventNotificationCommand")
                {
                    var deviceID = jobject.Value<int>("Device_ID");
                    switch ((DeviceType)(deviceID))
                    {
                        case DeviceType.DoorLock:
                            var doorLock = new DoorLock() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID };
                            var ProgrammingEventNotificationData = Newtonsoft.Json.JsonConvert.DeserializeObject<ZigBee.Device.DoorLock.DoorLockProgrammingEventNotificationCommand>(jobject["Data"].ToString());
                            if (ProgrammingEventNotificationData != null)
                            {
                                doorLock.doorLockProgrammingEventNotificationCommand = ProgrammingEventNotificationData;
                            }
                            if (gwa.ReportAction != null)
                            {
                                DebugPrintLog("DoorLockProgrammingEventNotificationCommand已经通知");
                                gwa.ReportAction("DoorLockProgrammingEventNotificationCommand", doorLock);
                            }
                            UpdateDeviceStatus(doorLock);
                            UpdateDeviceInfo(doorLock, "DoorLockProgrammingEventNotificationCommand");
                            break;
                    }
                }
                #endregion
                #region IAS安防信息上报
                else if (topic == gatewayID + "/" + "IASInfoReport")
                {