| | |
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.Text;
|
| | | using Newtonsoft.Json.Linq;
|
| | | using ZigBee.Device;
|
| | |
|
| | | namespace Shared.Phone.UserCenter
|
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using Newtonsoft.Json.Linq; |
| | | using ZigBee.Device; |
| | | |
| | | namespace Shared.Phone.UserCenter |
| | | { |
| | | /// <summary>
|
| | | /// 全局接收网关推送的的逻辑(为了执行速度,尽可能的别加耗时的操作)
|
| | | /// </summary>
|
| | | /// <summary> |
| | | /// 全局接收网关推送的的逻辑(为了执行速度,尽可能的别加耗时的操作) |
| | | /// </summary> |
| | | public class HdlGatewayReceiveLogic |
| | | { |
| | | #region ■ 变量声明___________________________
|
| | | #region ■ 变量声明___________________________ |
| | | |
| | | /// <summary>
|
| | | /// 全局接收网关推送的的逻辑
|
| | | /// </summary>
|
| | | /// <summary> |
| | | /// 全局接收网关推送的的逻辑 |
| | | /// </summary> |
| | | private static HdlGatewayReceiveLogic m_Current = null; |
| | | /// <summary>
|
| | | /// 全局接收网关推送的的逻辑
|
| | | /// </summary>
|
| | | /// <summary> |
| | | /// 全局接收网关推送的的逻辑 |
| | | /// </summary> |
| | | public static HdlGatewayReceiveLogic Current |
| | | { |
| | | get |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary>
|
| | | /// 网关接收事件(参数1:主题 参数2:推送消息)
|
| | | /// </summary>
|
| | | /// <summary> |
| | | /// 网关接收事件(参数1:主题 参数2:推送消息) |
| | | /// </summary> |
| | | private Action<string, string> GatewayReceiveEvent = null; |
| | | /// <summary>
|
| | | /// 接收网关的id
|
| | | /// </summary>
|
| | | /// <summary> |
| | | /// 接收网关的id |
| | | /// </summary> |
| | | private string GatewayReceiveId = null; |
| | | /// <summary>
|
| | | /// 设备推送事件集合
|
| | | /// </summary>
|
| | | /// <summary> |
| | | /// 设备推送事件集合 |
| | | /// </summary> |
| | | private Dictionary<string, Action<CommonDevice>> dicDeviceEvent = new Dictionary<string, Action<CommonDevice>>(); |
| | | /// <summary>
|
| | | /// 命令区分
|
| | | /// </summary>
|
| | | /// <summary> |
| | | /// 命令区分 |
| | | /// </summary> |
| | | private Dictionary<string, ReceiveComandDiv> dicCommandDiv = new Dictionary<string, ReceiveComandDiv>(); |
| | | |
| | | #endregion
|
| | | #endregion |
| | | |
| | | #region ■ 全局接收___________________________
|
| | | #region ■ 全局接收___________________________ |
| | | |
| | | /// <summary>
|
| | | /// 全局接收网关推送的的逻辑(为了执行速度,尽可能的别加耗时的操作)
|
| | | /// </summary>
|
| | | /// <param name="gatewayId">网关ID</param>
|
| | | /// <param name="topic">整个主题</param>
|
| | | /// <param name="reportTopic">上报数据的主题</param>
|
| | | /// <param name="msgData">接收的数据</param>
|
| | | /// <summary> |
| | | /// 全局接收网关推送的的逻辑(为了执行速度,尽可能的别加耗时的操作) |
| | | /// </summary> |
| | | /// <param name="gatewayId">网关ID</param> |
| | | /// <param name="topic">整个主题</param> |
| | | /// <param name="reportTopic">上报数据的主题</param> |
| | | /// <param name="msgData">接收的数据</param> |
| | | public void GatewayOverallMsgReceive(string gatewayId, string topic, string reportTopic, string msgData) |
| | | { |
| | | //如果它在登陆界面,则不做任何处理 |
| | | if (Common.Config.Instance.HomeId == string.Empty) |
| | | { |
| | | return; |
| | | } |
| | | if (topic == "AppNoLogin") |
| | | { |
| | | HdlThreadLogic.Current.RunMain(() => |
| | |
| | | { |
| | | if (HdlGatewayLogic.Current.IsGatewayExist(gatewayId) == false) |
| | | { |
| | | //不是自己绑定的网关,则不处理 |
| | | //不是自己绑定的网关,则不处理,但是下面这个东西有点特殊 |
| | | if (gatewayId == this.GatewayReceiveId) |
| | | { |
| | | this.GatewayReceiveEvent?.Invoke(topic, msgData); |
| | | } |
| | | return; |
| | | } |
| | | //设备属性上报 |
| | |
| | | } |
| | | } |
| | | |
| | | #endregion
|
| | | #endregion |
| | | |
| | | #region ■ 设备属性上报_______________________
|
| | | #region ■ 设备属性上报_______________________ |
| | | |
| | | /// <summary>
|
| | | /// 设备属性上报
|
| | | /// </summary>
|
| | | /// <param name="receiveData"></param>
|
| | | /// <summary> |
| | | /// 设备属性上报 |
| | | /// </summary> |
| | | /// <param name="receiveData"></param> |
| | | private void DeviceAttributeReportPush(JObject receiveData) |
| | | { |
| | | if (this.dicDeviceEvent.Count == 0) |
| | |
| | | locadevice.IsOnline = 1; |
| | | locadevice.LastDateTime = DateTime.Now; |
| | | |
| | | #region ■ 开关功能
|
| | | #region ■ 开关功能 |
| | | //晾衣架回路2,3,4,5都是CluterID是6 ,但是功能不是开关 |
| | | if (locadevice.Type == DeviceType.Airer) |
| | | { |
| | |
| | | //已经接收到状态 |
| | | locadevice.HadReadDeviceStatu = true; |
| | | } |
| | | |
| | | if (locadevice is TemperatureSensor) |
| | | { |
| | | //获取设备类型 |
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { locadevice }); |
| | | //空气质量传感器 |
| | | if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor) |
| | | { |
| | | locadevice.DeviceStatusReport = report.DeviceStatusReport; |
| | | ((TemperatureSensor)locadevice).OnOffStatus = report.DeviceStatusReport.AttriBute[0].AttriButeData; |
| | | //已经接收到状态 |
| | | locadevice.HadReadDeviceStatu = true; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | #endregion
|
| | | #endregion |
| | | |
| | | #region ■ 电量推送
|
| | | #region ■ 电量推送 |
| | | //电量推送 |
| | | if (report.DeviceStatusReport.CluterID == 1) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | #endregion
|
| | | #endregion |
| | | |
| | | #region ■ 蜂鸣器推送
|
| | | #region ■ 蜂鸣器推送 |
| | | //蜂鸣器数据 |
| | | else if (report.DeviceStatusReport.CluterID == 1282) |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | #endregion
|
| | | #endregion |
| | | |
| | | #region ■ 窗帘数据
|
| | | #region ■ 窗帘数据 |
| | | //窗帘数据 |
| | | else if (report.DeviceStatusReport.CluterID == 258) |
| | | { |
| | |
| | | locadevice.HadReadDeviceStatu = true; |
| | | } |
| | | } |
| | | #endregion
|
| | | #endregion |
| | | |
| | | #region ■ 空调和新风数据
|
| | | #region ■ 空调和新风数据 |
| | | //空调数据 |
| | | else if (report.DeviceStatusReport.CluterID == 513) |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | #endregion
|
| | | #endregion |
| | | |
| | | #region ■ 亮度数据
|
| | | #region ■ 亮度数据 |
| | | //亮度数据 |
| | | else if (report.DeviceStatusReport.CluterID == 8) |
| | | { |
| | |
| | | //} |
| | | } |
| | | } |
| | | #endregion
|
| | | #endregion |
| | | |
| | | #region ■ 色温数据
|
| | | #region ■ 色温数据 |
| | | //色温数据 |
| | | else if (report.DeviceStatusReport.CluterID == 768) |
| | | { |
| | |
| | | locadevice.HadReadDeviceStatu = true; |
| | | } |
| | | } |
| | | #endregion
|
| | | #endregion |
| | | |
| | | #region ■ 温度数据
|
| | | #region ■ 温度数据 |
| | | //温度数据 |
| | | else if (report.DeviceStatusReport.CluterID == 1026) |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | #endregion
|
| | | #endregion |
| | | |
| | | #region ■ 湿度数据
|
| | | #region ■ 湿度数据 |
| | | //湿度数据 |
| | | else if (report.DeviceStatusReport.CluterID == 1029) |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | #endregion
|
| | | #endregion |
| | | |
| | | #region ■ PM2.5数据
|
| | | #region ■ PM2.5数据 |
| | | //PM2.5数据 |
| | | else if (report.DeviceStatusReport.CluterID == 1066) |
| | | { |
| | |
| | | //PM2.5 |
| | | if (attData.AttributeId == (int)AttriButeId.MeasuredValue) |
| | | { |
| | | |
| | | if (attData.AttriButeDataType == 57) |
| | | { |
| | | ((PMSensor)locadevice).currentPmData = attData.AttriButeData; |
| | | //获取设备类型 |
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { locadevice }); |
| | | //空气质量传感器 |
| | | if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor) |
| | | { |
| | | ((TemperatureSensor)locadevice).currentPmData = attData.AttriButeData; |
| | | } |
| | | else |
| | | { |
| | | ((PMSensor)locadevice).currentPmData = attData.AttriButeData; |
| | | } |
| | | } |
| | | } |
| | | //已经接收到状态 |
| | |
| | | } |
| | | } |
| | | |
| | | #endregion
|
| | | #endregion |
| | | |
| | | #region ■ 设备基础信息
|
| | | #region ■ CO2数据 |
| | | else if (report.DeviceStatusReport.CluterID == 1037) |
| | | { |
| | | foreach (var attData in report.DeviceStatusReport.AttriBute) |
| | | { |
| | | if (attData.AttributeId == (int)AttriButeId.MeasuredValue) |
| | | { |
| | | if (attData.AttriButeDataType == 57) |
| | | { |
| | | //获取设备类型 |
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { locadevice }); |
| | | //空气质量传感器 |
| | | if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor) |
| | | { |
| | | ((TemperatureSensor)locadevice).currentCO2 = attData.AttriButeData; |
| | | } |
| | | } |
| | | } |
| | | //已经接收到状态 |
| | | locadevice.HadReadDeviceStatu = true; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ■ 设备基础信息 |
| | | |
| | | else if (report.DeviceStatusReport.CluterID == 0) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | #endregion
|
| | | #endregion |
| | | } |
| | | else if (deviceEpoint == 200) |
| | | { |
| | | var localOta = Common.LocalDevice.Current.GetOTADevice(deviceAddr); |
| | | if (localOta != null) |
| | | { |
| | | #region ■ 固件版本
|
| | | #region ■ 固件版本 |
| | | //固件版本 |
| | | if (report.DeviceStatusReport.CluterID == (int)Cluster_ID.Ota) |
| | | { |
| | |
| | | } |
| | | localOta.ReSave(); |
| | | } |
| | | #endregion
|
| | | #endregion |
| | | } |
| | | } |
| | | this.DeviceReportPush(report, ReceiveComandDiv.A设备属性上报); |
| | | } |
| | | |
| | | #endregion
|
| | | #endregion |
| | | |
| | | #region ■ 传感器上报_________________________
|
| | | #region ■ 传感器上报_________________________ |
| | | |
| | | /// <summary>
|
| | | /// 传感器设备上报
|
| | | /// </summary>
|
| | | /// <param name="receiveData"></param>
|
| | | /// <summary> |
| | | /// 传感器设备上报 |
| | | /// </summary> |
| | | /// <param name="receiveData"></param> |
| | | private void SensorDeviceReportPush(JObject receiveData) |
| | | { |
| | | var ias = new IASZone() { DeviceAddr = receiveData.Value<string>("DeviceAddr"), DeviceEpoint = receiveData.Value<int>("Epoint") }; |
| | |
| | | this.ShowHadNewMessageAppeal(); |
| | | } |
| | | |
| | | #endregion
|
| | | #endregion |
| | | |
| | | #region ■ 门锁上报___________________________
|
| | | #region ■ 门锁上报___________________________ |
| | | |
| | | /// <summary>
|
| | | /// 门锁上报
|
| | | /// </summary>
|
| | | /// <param name="receiveData"></param>
|
| | | /// <summary> |
| | | /// 门锁上报 |
| | | /// </summary> |
| | | /// <param name="receiveData"></param> |
| | | private void DoorLockDeviceReportPush(JObject receiveData) |
| | | { |
| | | if (UserCenterResourse.UserInfo.AuthorityNo == 1) |
| | |
| | | this.ShowHadNewMessageAppeal(); |
| | | } |
| | | } |
| | | #endregion
|
| | | #endregion |
| | | |
| | | #region ■ 设备在线状态更新反馈_______________
|
| | | #region ■ 设备在线状态更新反馈_______________ |
| | | |
| | | /// <summary>
|
| | | /// 设备在线状态更新反馈
|
| | | /// </summary>
|
| | | /// <param name="receiveData"></param>
|
| | | /// <summary> |
| | | /// 设备在线状态更新反馈 |
| | | /// </summary> |
| | | /// <param name="receiveData"></param> |
| | | private void DeviceOnlineChangePush(JObject receiveData) |
| | | { |
| | | if (this.dicDeviceEvent.Count == 0) |
| | |
| | | this.DeviceReportPush(tempDevice, ReceiveComandDiv.A设备在线上报); |
| | | } |
| | | |
| | | #endregion
|
| | | #endregion |
| | | |
| | | #region ■ 设备控制状态反馈___________________
|
| | | #region ■ 设备控制状态反馈___________________ |
| | | |
| | | /// <summary>
|
| | | /// 设备控制状态反馈
|
| | | /// </summary>
|
| | | /// <param name="receiveData"></param>
|
| | | /// <summary> |
| | | /// 设备控制状态反馈 |
| | | /// </summary> |
| | | /// <param name="receiveData"></param> |
| | | private void DeviceControlResponePush(JObject receiveData) |
| | | { |
| | | if (this.dicDeviceEvent.Count == 0) |
| | |
| | | this.DeviceReportPush(tempDevice, ReceiveComandDiv.A节点控制反馈); |
| | | } |
| | | |
| | | #endregion
|
| | | #endregion |
| | | |
| | | #region ■ 布防_______________________________
|
| | | #region ■ 布防_______________________________ |
| | | |
| | | /// <summary>
|
| | | /// 布防推送
|
| | | /// </summary>
|
| | | /// <param name="receiveData"></param>
|
| | | /// <summary> |
| | | /// 布防推送 |
| | | /// </summary> |
| | | /// <param name="receiveData"></param> |
| | | private void SetSafetyGarrisonPush(JObject receiveData) |
| | | { |
| | | var data = Newtonsoft.Json.JsonConvert.DeserializeObject<Safeguard.EnableModeResponseData>(receiveData["Data"].ToString()); |
| | |
| | | } |
| | | } |
| | | |
| | | #endregion
|
| | | #endregion |
| | | |
| | | #region ■ 撤防_______________________________
|
| | | #region ■ 撤防_______________________________ |
| | | |
| | | /// <summary>
|
| | | /// 撤防推送
|
| | | /// </summary>
|
| | | /// <param name="receiveData"></param>
|
| | | /// <summary> |
| | | /// 撤防推送 |
| | | /// </summary> |
| | | /// <param name="receiveData"></param> |
| | | private void RemoveSafetyGarrisonPush(JObject receiveData) |
| | | { |
| | | var data = Newtonsoft.Json.JsonConvert.DeserializeObject<Safeguard.WithdrawModeResponseData>(receiveData["Data"].ToString()); |
| | |
| | | } |
| | | } |
| | | |
| | | #endregion
|
| | | #endregion |
| | | |
| | | #region ■ 通过外部方式布防撤防_______________
|
| | | #region ■ 通过外部方式布防撤防_______________ |
| | | |
| | | /// <summary>
|
| | | /// 通过外部方式布防撤防
|
| | | /// </summary>
|
| | | /// <param name="receiveData">接收的数据</param>
|
| | | /// <summary> |
| | | /// 通过外部方式布防撤防 |
| | | /// </summary> |
| | | /// <param name="receiveData">接收的数据</param> |
| | | private void SecurityEnOrWithdrawSucceedReport(JObject receiveData) |
| | | { |
| | | var data = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityEnOrWithdrawResult>(receiveData["Data"].ToString()); |
| | |
| | | this.ShowHadNewMessageAppeal(); |
| | | } |
| | | |
| | | /// <summary>
|
| | | /// 通过外部方式布防撤防的接收结果
|
| | | /// </summary>
|
| | | /// <summary> |
| | | /// 通过外部方式布防撤防的接收结果 |
| | | /// </summary> |
| | | private class SecurityEnOrWithdrawResult |
| | | { |
| | | /// <summary>
|
| | | /// 0:布防成功 1:撤防成功
|
| | | /// </summary>
|
| | | /// <summary> |
| | | /// 0:布防成功 1:撤防成功 |
| | | /// </summary> |
| | | public int EnOrWithdraw = -1; |
| | | /// <summary>
|
| | | /// 安防模式id
|
| | | /// </summary>
|
| | | /// <summary> |
| | | /// 安防模式id |
| | | /// </summary> |
| | | public int ModeId = -1; |
| | | /// <summary>
|
| | | /// 外部布撤防方式-> 0:执行逻辑动作 1:按键操作
|
| | | /// </summary>
|
| | | /// <summary> |
| | | /// 外部布撤防方式-> 0:执行逻辑动作 1:按键操作 |
| | | /// </summary> |
| | | public int OperationWay = -1; |
| | | } |
| | | |
| | | #endregion
|
| | | #endregion |
| | | |
| | | #region ■ 逻辑触发上报_______________________
|
| | | #region ■ 逻辑触发上报_______________________ |
| | | |
| | | /// <summary>
|
| | | /// 逻辑触发上报
|
| | | /// </summary>
|
| | | /// <param name="receiveData"></param>
|
| | | /// <summary> |
| | | /// 逻辑触发上报 |
| | | /// </summary> |
| | | /// <param name="receiveData"></param> |
| | | private void LogicExecutePush(JObject receiveData) |
| | | { |
| | | //显示有新消息的特效 |
| | |
| | | } |
| | | } |
| | | } |
| | | #endregion
|
| | | #endregion |
| | | |
| | | #region ■ 场景触发上报_______________________
|
| | | #region ■ 场景触发上报_______________________ |
| | | |
| | | /// <summary>
|
| | | /// 场景触发上报
|
| | | /// </summary>
|
| | | /// <param name="receiveData"></param>
|
| | | /// <summary> |
| | | /// 场景触发上报 |
| | | /// </summary> |
| | | /// <param name="receiveData"></param> |
| | | private void SceneExecPush(JObject receiveData) |
| | | { |
| | | //目前不处理场景上报内容 |
| | |
| | | this.ShowHadNewMessageAppeal(); |
| | | } |
| | | |
| | | #endregion
|
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region ■ 添加设备事件_______________________
|
| | | #region ■ 添加设备事件_______________________ |
| | | |
| | | /// <summary>
|
| | | /// 添加获取设备属性的事件(属性上报的对象:device.DeviceStatusReport)
|
| | | /// </summary>
|
| | | /// <param name="mainKeys">标识事件的主键(可以随便填,主要是针对多个界面一起使用的情况)</param>
|
| | | /// <param name="comand">命令区分</param>
|
| | | /// <param name="action">
|
| | | /// <para>当接收到网关回复之后的回调函数</para>
|
| | | /// <para>设备属性上报的对象:device.DeviceStatusReport</para>
|
| | | /// <para>传感器上报的对象:ias.iASInfo</para>
|
| | | /// <para>设备在线上报的对象:device.IsOnline</para></param>
|
| | | /// <summary> |
| | | /// 添加获取设备属性的事件(属性上报的对象:device.DeviceStatusReport) |
| | | /// </summary> |
| | | /// <param name="mainKeys">标识事件的主键(可以随便填,主要是针对多个界面一起使用的情况)</param> |
| | | /// <param name="comand">命令区分</param> |
| | | /// <param name="action"> |
| | | /// <para>当接收到网关回复之后的回调函数</para> |
| | | /// <para>设备属性上报的对象:device.DeviceStatusReport</para> |
| | | /// <para>传感器上报的对象:ias.iASInfo</para> |
| | | /// <para>设备在线上报的对象:device.IsOnline</para></param> |
| | | public void AddAttributeEvent(string mainKeys, ReceiveComandDiv comand, Action<CommonDevice> action) |
| | | { |
| | | lock (this.dicDeviceEvent) |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary>
|
| | | /// 添加网关接收事件(action只能存在一个,与AddAttributeEvent不共存,AddAttributeEvent优先)
|
| | | /// </summary>
|
| | | /// <param name="i_gatewayId">网关id</param>
|
| | | /// <param name="action">只能存在一个action (参数1:主题 参数2:推送消息)</param>
|
| | | /// <summary> |
| | | /// 添加网关接收事件(action只能存在一个,与AddAttributeEvent不共存,AddAttributeEvent优先) |
| | | /// </summary> |
| | | /// <param name="i_gatewayId">网关id</param> |
| | | /// <param name="action">只能存在一个action (参数1:主题 参数2:推送消息)</param> |
| | | public void AddGatewayReceiveEvent(string i_gatewayId, Action<string, string> action) |
| | | { |
| | | //添加事件 |
| | |
| | | this.GatewayReceiveId = i_gatewayId; |
| | | } |
| | | |
| | | #endregion
|
| | | #endregion |
| | | |
| | | #region ■ 移除设备监听_______________________
|
| | | #region ■ 移除设备监听_______________________ |
| | | |
| | | /// <summary>
|
| | | /// 移除事件
|
| | | /// </summary>
|
| | | /// <param name="mainKeys">标识事件的主键(可以随便填,主要是针对多个界面一起使用的情况)</param>
|
| | | /// <summary> |
| | | /// 移除事件 |
| | | /// </summary> |
| | | /// <param name="mainKeys">标识事件的主键(可以随便填,主要是针对多个界面一起使用的情况)</param> |
| | | public void RemoveEvent(string mainKeys) |
| | | { |
| | | lock (this.dicDeviceEvent) |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary>
|
| | | /// 移除全部的事件
|
| | | /// </summary>
|
| | | /// <summary> |
| | | /// 移除全部的事件 |
| | | /// </summary> |
| | | public void RemoveAllEvent() |
| | | { |
| | | lock (this.dicDeviceEvent) |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary>
|
| | | /// 移除网关接收事件(只能存在一个事件)
|
| | | /// </summary>
|
| | | /// <summary> |
| | | /// 移除网关接收事件(只能存在一个事件) |
| | | /// </summary> |
| | | public void RemoveGatewayReceiveEvent() |
| | | { |
| | | this.GatewayReceiveEvent = null; |
| | | this.GatewayReceiveId = null; |
| | | } |
| | | |
| | | #endregion
|
| | | #endregion |
| | | |
| | | #region ■ 一般方法___________________________
|
| | | #region ■ 一般方法___________________________ |
| | | |
| | | /// <summary>
|
| | | /// 设备上报推送(调用此方法,他会推送到各自的界面)
|
| | | /// </summary>
|
| | | /// <param name="common"></param>
|
| | | /// <param name="comand"></param>
|
| | | /// <summary> |
| | | /// 设备上报推送(调用此方法,他会推送到各自的界面) |
| | | /// </summary> |
| | | /// <param name="common"></param> |
| | | /// <param name="comand"></param> |
| | | public void DeviceReportPush(CommonDevice common, ReceiveComandDiv comand) |
| | | { |
| | | if (this.dicDeviceEvent.Count == 0) |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary>
|
| | | /// 是否存在指定的事件
|
| | | /// </summary>
|
| | | /// <param name="mainkeys"></param>
|
| | | /// <returns></returns>
|
| | | /// <summary> |
| | | /// 是否存在指定的事件 |
| | | /// </summary> |
| | | /// <param name="mainkeys"></param> |
| | | /// <returns></returns> |
| | | public bool IsEsixt(string mainkeys) |
| | | { |
| | | return this.dicCommandDiv.ContainsKey(mainkeys); |
| | | } |
| | | |
| | | /// <summary>
|
| | | /// 显示有新消息的特效
|
| | | /// </summary>
|
| | | /// <summary> |
| | | /// 显示有新消息的特效 |
| | | /// </summary> |
| | | private void ShowHadNewMessageAppeal() |
| | | { |
| | | //有新消息(特效还在时,不需要再处理) |
| | |
| | | } |
| | | } |
| | | |
| | | #endregion
|
| | | #endregion |
| | | } |
| | | |
| | | /// <summary>
|
| | | /// 接收命令区分
|
| | | /// </summary>
|
| | | /// <summary> |
| | | /// 接收命令区分 |
| | | /// </summary> |
| | | public enum ReceiveComandDiv |
| | | { |
| | | /// <summary>
|
| | | /// 设备属性上报
|
| | | /// </summary>
|
| | | /// <summary> |
| | | /// 设备属性上报 |
| | | /// </summary> |
| | | A设备属性上报 = 1, |
| | | /// <summary>
|
| | | /// 传感器上报
|
| | | /// </summary>
|
| | | /// <summary> |
| | | /// 传感器上报 |
| | | /// </summary> |
| | | A传感器上报 = 2, |
| | | /// <summary>
|
| | | /// 设备在线上报
|
| | | /// </summary>
|
| | | /// <summary> |
| | | /// 设备在线上报 |
| | | /// </summary> |
| | | A设备在线上报 = 3, |
| | | /// <summary>
|
| | | /// 当客户端发送控制设备指令,如打开或关闭设备、调节亮度、颜色。如果被控制的节点设备在线,节点设备将反馈
|
| | | /// </summary>
|
| | | /// <summary> |
| | | /// 当客户端发送控制设备指令,如打开或关闭设备、调节亮度、颜色。如果被控制的节点设备在线,节点设备将反馈 |
| | | /// </summary> |
| | | A节点控制反馈 = 4 |
| | | }
|
| | | }
|
| | | } |
| | | } |