Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
        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);
            }
        }
Beispiel #4
0
        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();
            }
        }
Beispiel #5
0
 static void sc_SensorClientCreateEvent(object sender, SensorClientCreateEventArgs e)
 {
     sc.Subscribe("example", Subscribehandler);
 }