| | |
| | | /// <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");
|
| | |
|
| | |
| | | /// <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());
|
| | |
|
| | |
| | | /// <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)
|
| | | {
|
| | |
| | | list.Add(this.dicDeviceEvent[keys]);
|
| | | }
|
| | | //有可能在回调函数中移除了事件,导致报错,所以先收集,再调用
|
| | | Application.RunOnMainThread(() =>
|
| | | foreach (var action in list)
|
| | | {
|
| | | foreach (var action in list)
|
| | | Application.RunOnMainThread(() =>
|
| | | {
|
| | | try
|
| | | {
|
| | |
| | | catch (Exception ex)
|
| | | {
|
| | | //Log出力
|
| | | string msg = "当前激活的界面[" + UserCenterResourse.NowActionFormID + "]";
|
| | | string msg = "推送错误! 当前激活的界面[" + UserCenterResourse.NowActionFormID + "]";
|
| | | HdlLogLogic.Current.WriteLog(ex, msg);
|
| | | }
|
| | | }
|
| | | });
|
| | | });
|
| | | }
|
| | | }
|
| | | }
|
| | |
|