HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2019-12-17 5986f63b75bd81c6cef262c670e9251c038cbf5d
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs
@@ -165,6 +165,11 @@
        /// <param name="receiveData"></param>
        private void DeviceAttributeReportPush(JObject receiveData)
        {
            if (this.dicDeviceEvent.Count == 0)
            {
                //没有添加监听
                return;
            }
            var deviceAddr = receiveData.Value<string>("DeviceAddr");
            var deviceEpoint = receiveData.Value<int>("Epoint");
@@ -227,6 +232,11 @@
        /// <param name="receiveData"></param>
        private void DeviceOnlineChangePush (JObject receiveData)
        {
            if (this.dicDeviceEvent.Count == 0)
            {
                //没有添加监听
                return;
            }
            var tempDevice = new CommonDevice() { DeviceAddr = receiveData.Value<string>("DeviceAddr"), DeviceEpoint = receiveData.Value<int>("Epoint") };
            tempDevice.IsOnline = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(receiveData["Data"]["IsOnline"].ToString());
            
@@ -470,14 +480,13 @@
        /// <param name="comand"></param>
        private void DeviceReportPush(CommonDevice common, ReceiveComandDiv comand)
        {
            if (this.dicDeviceEvent.Count == 0)
            {
                //没有添加监听
                return;
            }
            lock (this.dicDeviceEvent)
            {
                if (this.dicDeviceEvent.Count == 0)
                {
                    //没有添加监听
                    return;
                }
                var list = new List<Action<CommonDevice>>();
                foreach (string keys in this.dicDeviceEvent.Keys)
                {
@@ -490,9 +499,9 @@
                    list.Add(this.dicDeviceEvent[keys]);
                }
                //有可能在回调函数中移除了事件,导致报错,所以先收集,再调用
                Application.RunOnMainThread(() =>
                foreach (var action in list)
                {
                    foreach (var action in list)
                    Application.RunOnMainThread(() =>
                    {
                        try
                        {
@@ -501,11 +510,11 @@
                        catch (Exception ex)
                        {
                            //Log出力
                            string msg = "当前激活的界面[" + UserCenterResourse.NowActionFormID + "]";
                            string msg = "推送错误! 当前激活的界面[" + UserCenterResourse.NowActionFormID + "]";
                            HdlLogLogic.Current.WriteLog(ex, msg);
                        }
                    }
                });
                    });
                }
            }
        }