protected void OnSensorClientCreateEvent(object sender, SensorClientCreateEventArgs e) { if (e.Ready == true) { //m_sensorClient.Subscribe(Constant.NODE_ACTION, OnSubscribeHandler); m_sensorClient.Subscribe(m_netManager.Username + "_action", OnSubscribeHandler); } m_chatManager = new ChatManager(this); m_infJason = new JasonInterface(this); }
public override SensorDataSubscriptionRequest SubscribeSensorDataMomentaryReadout(FieldSubscriptionRule[] Rules) { XmppAccountNode XmppAccountNode = this.XmppAccountNode; SensorClient SensorClient; if (XmppAccountNode != null && (SensorClient = XmppAccountNode.SensorClient) != null) { return(SensorClient.Subscribe(this.RosterItem.LastPresenceFullJid, FieldType.Momentary, Rules, new Duration(false, 0, 0, 0, 0, 0, 1), new Duration(false, 0, 0, 0, 0, 1, 0), false)); } else { return(null); } }
public override SensorDataSubscriptionRequest SubscribeSensorDataMomentaryReadout(FieldSubscriptionRule[] Rules) { XmppConcentrator Concentrator = this.Concentrator; XmppAccountNode XmppAccountNode = Concentrator.XmppAccountNode; SensorClient SensorClient; if (XmppAccountNode != null && (SensorClient = XmppAccountNode.SensorClient) != null) { return(SensorClient.Subscribe(Concentrator.RosterItem.LastPresenceFullJid, new ThingReference[] { new ThingReference(this.nodeInfo.NodeId, this.nodeInfo.SourceId, this.nodeInfo.Partition) }, FieldType.Momentary, Rules, new Duration(false, 0, 0, 0, 0, 0, 1), new Duration(false, 0, 0, 0, 0, 1, 0), false)); } else { return(null); } }
public override SensorDataSubscriptionRequest SubscribeSensorDataMomentaryReadout(FieldSubscriptionRule[] Rules) { if (this.isSensor) { XmppAccountNode XmppAccountNode = this.XmppAccountNode; SensorClient SensorClient; if (XmppAccountNode != null && (SensorClient = XmppAccountNode.SensorClient) != null) { return(SensorClient.Subscribe(this.RosterItem.LastPresenceFullJid, FieldType.Momentary, Rules, Duration.FromSeconds(1), Duration.FromMinutes(1), false)); } else { return(null); } } else { throw new NotSupportedException(); } }
static void sc_SensorClientCreateEvent(object sender, SensorClientCreateEventArgs e) { sc.Subscribe("example", Subscribehandler); }