| | |
| | | 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") |
| | | { |