| | |
| | | if (RemoteMqttClient.ApplicationMessageReceivedHandler == null) |
| | | { |
| | | RemoteMqttClient.UseApplicationMessageReceivedHandler((e) => |
| | | { |
| | | if (!RemoteMqttClient.IsConnected || !IsRemote) |
| | | { |
| | | if (e.ApplicationMessage.Topic != "/ZigbeeGateWayToClient/" + Config.Instance.ConnEmqClientId + "/Push/NotifySqueeze")
|
| | | {
|
| | | return;
|
| | | } |
| | | }
|
| | | //如果当前使用的是内网模式
|
| | | if (IsRemote == false)
|
| | | {
|
| | | //这里是特殊的主题
|
| | | if (e.ApplicationMessage.Topic == "/ZigbeeGateWayToClient/" + Config.Instance.ConnEmqClientId + "/Push/NotifySqueeze"//踢人下线
|
| | | || e.ApplicationMessage.Topic == "/ZigbeeGateWayToClient/" + Config.Instance.Guid + "/Push/Deleted"//分享删除
|
| | | || e.ApplicationMessage.Topic == "/ZigbeeGateWayToClient/" + Config.Instance.Guid + "/Push/DeletedShareData"
|
| | | || e.ApplicationMessage.Topic == "/ZigbeeGateWayToClient/" + Config.Instance.Home.Id + "_" + Config.Instance.Guid + "/PrimaryUserDelYou")//子账号被删除
|
| | | {
|
| | | if (e.ApplicationMessage.Topic == "/ZigbeeGateWayToClient/" + Config.Instance.ConnEmqClientId + "/Push/NotifySqueeze"//踢人下线
|
| | | || e.ApplicationMessage.Topic == "/ZigbeeGateWayToClient/" + Config.Instance.Guid + "/Push/Deleted"//分享删除
|
| | | || e.ApplicationMessage.Topic == "/ZigbeeGateWayToClient/" + Config.Instance.Guid + "/Push/DeletedShareData")
|
| | | {
|
| | | mqttRemoteClient_MqttMsgPublishReceived(e);
|
| | | }
|
| | | mqttRemoteClient_MqttMsgPublishReceived(e);
|
| | | return;
|
| | | }
|
| | | if (!RemoteMqttClient.IsConnected || !IsRemote)
|
| | | {
|
| | | return;
|
| | | } |
| | | mqttRemoteClient_MqttMsgPublishReceived(e); |
| | |
| | | await RemoteMqttClient.SubscribeAsync("/ZigbeeGateWayToClient/" + myGuid + "/Push/Deleted");
|
| | | //订阅一个分享数据已经变更的主题
|
| | | await RemoteMqttClient.SubscribeAsync("/ZigbeeGateWayToClient/" + myGuid + "/Push/DeletedShareData");
|
| | | //订阅一个子账号被删除的主题
|
| | | await RemoteMqttClient.SubscribeAsync("/ZigbeeGateWayToClient/" + Config.Instance.Home.Id + "_" + myGuid + "/PrimaryUserDelYou");
|
| | | }
|
| | | //订阅一个挤下线的主题
|
| | | await RemoteMqttClient.SubscribeAsync("/ZigbeeGateWayToClient/" + Config.Instance.ConnEmqClientId + "/Push/NotifySqueeze");
|