You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by mehdouch <me...@hotmail.com> on 2011/05/03 10:51:15 UTC

upnp listener

Hi all,

How can I implements a simple upnp listener using felix upnp basedriver ?


thanks

-- 
View this message in context: http://old.nabble.com/upnp-listener-tp31530489p31530489.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: upnp listener

Posted by "Jackson, Bruce" <br...@qualcomm.com>.
Hi Mehdouch

You simply need to create a ServiceTracker that watches for services of
type UPnPDevice, for example:


ServiceTrackerCustomizer stc = new ServiceTrackerCustomizer(){

	public Object addingService(ServiceReference arg0) {
		// when a new device is found, this method will get hit
		// if you're interested in tracking the device, you should get the
service from the
		// reference and return it from this method
		return null;
	}

	public void modifiedService(ServiceReference arg0, Object arg1) {

	}

	public void removedService(ServiceReference arg0, Object arg1) {
		// when a tracked device disappeared, this method will be called
				
	}
			
		};


ServiceTracker tracker = new ServiceTracker(context,
UPnPDevice.class.getName(), stc);
tracker.open();

...

Bruce

On 03/05/2011 09:51, "mehdouch" <me...@hotmail.com> wrote:

>
>Hi all,
>
>How can I implements a simple upnp listener using felix upnp basedriver ?
>
>
>thanks
>
>-- 
>View this message in context:
>http://old.nabble.com/upnp-listener-tp31530489p31530489.html
>Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>For additional commands, e-mail: users-help@felix.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org